1
//=========================================================
4
// $Id: poseditplug.cpp,v 1.1 2002/01/30 14:54:03 muse Exp $
5
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
6
//=========================================================
8
#include <qwidgetplugin.h>
11
#include "pitchedit.h"
12
#include "pitchlabel.h"
16
int sampleRate = 44100;
21
static const char *posedit_pixmap[] = {
31
"++++++++++++++++++++++",
32
"++++++++++++++++++++++",
33
"++++++++++++++++++++++",
34
"++++++++++++++++++++++",
35
"+OOOOOOOOOOOOOOOOOOOO+",
36
"OOXXXXXXXXXXXXXXXXXXOO",
47
"OO..................OO",
48
"+OOOOOOOOOOOOOOOOOOOO+",
49
"++++++++++++++++++++++",
50
"++++++++++++++++++++++",
51
"++++++++++++++++++++++",
52
"++++++++++++++++++++++"
55
static const char *pitchedit_pixmap[] = {
65
"++++++++++++++++++++++",
66
"++++++++++++++++++++++",
67
"++++++++++++++++++++++",
68
"++++++++++++++++++++++",
69
"+OOOOOOOOOOOOOOOOOOOO+",
70
"OOXXXXXXXXXXXXXXXXXXOO",
81
"OO..................OO",
82
"+OOOOOOOOOOOOOOOOOOOO+",
83
"++++++++++++++++++++++",
84
"++++++++++++++++++++++",
85
"++++++++++++++++++++++",
86
"++++++++++++++++++++++"
89
class PosEditPlugin : public QWidgetPlugin {
92
virtual ~PosEditPlugin() {}
93
virtual QStringList keys() const;
94
virtual QWidget* create(const QString& key, QWidget* parent=0,
95
const char* name = 0);
96
virtual QString group(const QString& key) const;
97
virtual QIconSet iconSet(const QString& key) const;
98
virtual QString includeFile(const QString& key) const;
99
virtual QString toolTip(const QString& key) const;
100
virtual QString whatsThis(const QString& key) const;
101
virtual bool isContainer(const QString& key) const;
104
QStringList PosEditPlugin::keys() const
107
list << "PosEdit" << "PitchEdit"
108
<< "PosLabel" << "PitchLabel";
112
QWidget* PosEditPlugin::create(const QString& key, QWidget* parent=0,
113
const char* name = 0)
115
if (key == "PosEdit")
116
return new PosEdit(parent, name);
117
else if (key == "PitchEdit")
118
return new PitchEdit(parent, name);
119
else if (key == "PitchLabel")
120
return new PitchLabel(parent, name);
121
else if (key == "PosLabel")
122
return new PosLabel(parent, name);
126
QString PosEditPlugin::group (const QString& /*key*/) const
128
return QString("MusE");
131
QIconSet PosEditPlugin::iconSet (const QString& key) const
133
if (key == "PosEdit" || key == "PosLabel")
134
return QIconSet(QPixmap(posedit_pixmap));
135
else if (key == "PitchEdit" || key == "PitchLabel")
136
return QIconSet(QPixmap(pitchedit_pixmap));
140
QString PosEditPlugin::includeFile (const QString& key) const
142
if (key == "PosEdit")
144
else if (key == "PitchEdit")
145
return "pitchedit.h";
146
else if (key == "PitchLabel")
147
return "pitchlabel.h";
148
else if (key == "PosLabel")
150
return QString::null;
153
QString PosEditPlugin::toolTip (const QString& key) const
155
if (key == "PosEdit")
156
return QString("midi time position editor");
157
else if (key == "PitchEdit")
158
return QString("midi pitch spinbox");
159
else if (key == "PitchLabel")
160
return QString("midi pitch label");
161
else if (key == "PosLabel")
162
return QString("midi time position label");
163
return QString::null;
166
QString PosEditPlugin::whatsThis (const QString& key) const
168
if (key == "PosEdit")
169
return QString("midi time position editor");
170
else if (key == "PitchEdit")
171
return QString("midi pitch spinbox");
172
else if (key == "PitchLabel")
173
return QString("midi pitch label");
174
else if (key == "PosLabel")
175
return QString("midi time position label");
176
return QString::null;
179
bool PosEditPlugin::isContainer (const QString& /*key*/) const
184
Q_EXPORT_PLUGIN(PosEditPlugin)