1 //=========================================================
2 //  MusE
3 //  Linux Music Editor
4 //    $Id: musewidgetsplug.cpp,v 1.9.2.9 2009/12/01 03:52:40 terminator356 Exp $
5 //  (C) Copyright 2001-2003 Werner Schweer (ws@seh.de)
6 //
7 //  This program is free software; you can redistribute it and/or
8 //  modify it under the terms of the GNU General Public License
9 //  as published by the Free Software Foundation; version 2 of
10 //  the License, or (at your option) any later version.
11 //
12 //  This program is distributed in the hope that it will be useful,
13 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 //  GNU General Public License for more details.
16 //
17 //  You should have received a copy of the GNU General Public License
18 //  along with this program; if not, write to the Free Software
19 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 //
21 //=========================================================
22 
23 // this file makes some of the MusE widgets available
24 // to QT-Designer
25 
26 // #include <qwidgetplugin.h>
27 #include <QtCore/QtPlugin>                             // p4.0.2
28 #include <QtDesigner/QDesignerCustomWidgetInterface>   //
29 #include <QPixmap>
30 #include <QStringList>
31 
32 #include "poslabel.h"
33 #include "pitchedit.h"
34 #include "pitchlabel.h"
35 #include "sig.h"
36 #include "tempo.h"
37 #include "tempolabel.h"
38 #include "sigedit.h"
39 #include "slider.h"
40 #include "doublelabel.h"
41 #include "checkbox.h"
42 #include "combobox.h"
43 #include "gconfig.h"
44 
45 int sampleRate = 44100;   // some dummy values to get things compiled/linked
46 int division   = 384;
47 int MusEGlobal::mtcType    = 0;
48 bool hIsB      = false;
49 
50 static const char* vall[] = {
51       "c","c#","d","d#","e","f","f#","g","g#","a","a#","h"
52       };
53 static const char* valu[] = {
54       "C","C#","D","D#","E","F","F#","G","G#","A","A#","H"
55       };
56 
57 MusEGlobal::GlobalConfigValues config = {
58       QStringList(),              // pluginLadspaPathList
59       QStringList(),              // pluginDssiPathList
60       QStringList(),              // pluginVstPathList
61       QStringList(),              // pluginLinuxVstPathList
62       QStringList(),              // pluginLv2PathList
63       170,                        // globalAlphaBlend
64       {
65         QColor(0xff, 0xff, 0xff),   // palette
66         QColor(0xff, 0xff, 0xff),
67         QColor(0xff, 0xff, 0xff),
68         QColor(0xff, 0xff, 0xff),
69         QColor(0xff, 0xff, 0xff),
70         QColor(0xff, 0xff, 0xff),
71         QColor(0xff, 0xff, 0xff),
72         QColor(0xff, 0xff, 0xff),
73         QColor(0xff, 0xff, 0xff),
74         QColor(0xff, 0xff, 0xff),
75         QColor(0xff, 0xff, 0xff),
76         QColor(0xff, 0xff, 0xff),
77         QColor(0xff, 0xff, 0xff),
78         QColor(0xff, 0xff, 0xff),
79         QColor(0xff, 0xff, 0xff),
80         QColor(0xff, 0xff, 0xff)
81         },
82       {
83         QColor(255,  232,  140),   // part colors
84         QColor(0xff, 0x00, 0x00),
85         QColor(0x00, 0xff, 0x00),
86         QColor(0x00, 0x00, 0xff),
87         QColor(0xff, 0xff, 0x00),
88         QColor(0x00, 0xff, 0xff),
89         QColor(0xff, 0x00, 0xff),
90         QColor(0x9f, 0xc7, 0xef),
91         QColor(0x00, 0xff, 0x7f),
92         QColor(0x7f, 0x00, 0x00),
93         QColor(0x00, 0x7f, 0x00),
94         QColor(0x00, 0x00, 0x7f),
95         QColor(0x7f, 0x7f, 0x3f),
96         QColor(0x00, 0x7f, 0x7f),
97         QColor(0x7f, 0x00, 0x7f),
98         QColor(0x00, 0x7f, 0xff),
99         QColor(0x00, 0x3f, 0x3f)
100       },
101       {
102         QString("Default"),   // Default part color names
103         QString("Refrain"),
104         QString("Bridge"),
105         QString("Intro"),
106         QString("Coda"),
107         QString("Chorus"),
108         QString("Solo"),
109         QString("Brass"),
110         QString("Percussion"),
111         QString("Drums"),
112         QString("Guitar"),
113         QString("Bass"),
114         QString("Flute"),
115         QString("Strings"),
116         QString("Keyboard"),
117         QString("Piano"),
118         QString("Saxophone")
119       },
120       QColor(0, 0, 255),      // transportHandleColor;
121       QColor(255, 0, 0),      // bigTimeForegroundColor;
122       QColor(0, 0, 0),        // bigTimeBackgroundColor;
123       QColor(200, 200, 200),  // waveEditBackgroundColor;
124       {
125         QFont(QString("arial"), 10, QFont::Normal),
126         QFont(QString("arial"), 7,  QFont::Normal),    // Mixer strips and midi track info panel
127         QFont(QString("arial"), 10, QFont::Normal),
128         QFont(QString("arial"), 10, QFont::Bold),
129         QFont(QString("arial"), 8,  QFont::Normal),    // Small numbers: Timescale and markers, part name overlay
130         QFont(QString("arial"), 8,  QFont::Bold),      // Small bold numbers such as marker text
131         QFont(QString("arial"), 8,  QFont::Bold, true)  // Mixer strip labels. Looks and fits better with bold + italic than bold alone,
132                                                         //  at the price of only few more pixels than Normal mode.
133         },
134       QColor(0xff, 0xff, 0xff),     // trackBg;
135       QColor(0x80, 0xff, 0x80),     // selected track Bg;
136       QColor(0x00, 0x00, 0x00),     // selected track Fg;
137       Qt::gray,                     // trackSectionDividerColor;
138 
139       QColor(0, 160, 255),          // midiTrackLabelBg;   // Med blue
140       QColor(150, 177, 189),        // drumTrackLabelBg;   // Pale pastel blue
141       QColor(116, 232, 242),        // newDrumTrackLabelBg; // Light blue
142       Qt::magenta,                  // waveTrackLabelBg;
143       Qt::green,                    // outputTrackLabelBg;
144       Qt::red,                      // inputTrackLabelBg;
145       Qt::yellow,                   // groupTrackLabelBg;
146       QColor(142, 157, 6),          // auxTrackLabelBg;    // Med olive
147       QColor(255, 130, 0),          // synthTrackLabelBg;  // Med orange
148 
149       QColor(220, 220, 220),     // midiTrackBg;
150       QColor(220, 220, 220),     // drumTrackBg;
151       QColor(220, 220, 220),     // newDrumTrackBg;
152       QColor(220, 220, 220),     // waveTrackBg;
153       QColor(189, 220, 193),     // outputTrackBg;
154       QColor(189, 220, 193),     // inputTrackBg;
155       QColor(220, 220, 220),     // groupTrackBg;
156       QColor(220, 220, 220),     // auxTrackBg;
157       QColor(220, 220, 220),     // synthTrackBg;
158 
159       QColor(98, 124, 168),      // part canvas bg
160       QColor(255, 170, 0),       // ctrlGraphFg;    Medium orange
161       QColor(0, 0, 0),           // mixerBg;
162 
163       QColor(0xe0, 0xe0, 0xe0),     // Ruler background
164       QColor(0, 0, 0),              // Ruler text
165       QColor(255, 255, 255),        // Midi editor canvas
166       QColor(255, 255, 255),        // midiControllerViewBg
167       QColor(255, 255, 255),        // drumListBg
168       QColor(255, 255, 255),        // rulerCurrent
169       Qt::gray,                     // midiCanvasBeatColor
170       Qt::black,                    // midiCanvasBarColor
171       Qt::lightGray,                // waveNonselectedPart
172       Qt::darkGray,                 // wavePeakColor
173       Qt::black,                    // waveRmsColor
174       Qt::lightGray,                // wavePeakColorSelected
175       Qt::white,                    // waveRmsColorSelected
176 
177       Qt::darkGray,                 // partWaveColorPeak
178       QColor(20,20,20),             // partWaveColorRms
179       QColor(54,54,54),             // partMidiDarkEventColor
180       QColor(200,200,200),          // partMidiLightEventColor
181 
182       QColor(0,181,241  ),          // sliderBarDefaultColor
183       QColor(228,203,36 ),          // sliderDefaultColor
184       QColor(78,172,35  ),          // panSliderColor
185       QColor(209,86,86  ),          // gainSliderColor
186       QColor(190,190,39 ),          // auxSliderColor
187       QColor(154,135,124),          // audioVolumeSliderColor
188       QColor(153,156,124),          // midiVolumeSliderColor
189       QColor(37,121,255 ),          // audioControllerSliderDefaultColor
190       QColor(220,77,255 ),          // audioPropertySliderDefaultColor
191       QColor(37,121,255 ),          // midiControllerSliderDefaultColor
192       QColor(220,77,255 ),          // midiPropertySliderDefaultColor
193       QColor(100,255,255),          // midiPatchReadoutColor
194       QColor(0,221,255  ),          // audioMeterPrimaryColor
195       QColor(0,221,255  ),          // midiMeterPrimaryColor
196       QColor(208,145,49 ),          // rackItemBackgroundColor
197 
198       MusEGlobal::WaveOutLine,      // waveDrawing
199 
200       false,                        // fixFrozenMDISubWindows Turn on a fix for frozen MDIs in Breeze/Oxygen themes.
201 
202       // maxAliasedPointSize At what point size to switch from aliased text to non-aliased text.
203       // Zero means always use anti-aliasing. For certain widgets that use it. May be more later.
204       8,
205 
206       false,                        // enableAlsaMidiDriver Whether to enable the ALSA midi driver
207       384,                          // division;
208       1024,                         // rtcTicks
209       0,                            // curMidiSyncInPort The currently selected midi sync input port.
210       true,                         // midiSendInit Send instrument initialization sequences
211       true,                         // warnInitPending Warn instrument initialization sequences pending
212       false,                        // midiSendCtlDefaults Send instrument controller defaults at position 0 if none in song
213       false,                        // midiSendNullParameters Send null parameters after each (N)RPN event
214       false,                        // midiOptimizeControllers Don't send redundant H/L parameters or H/L values
215       true,                         // warnIfBadTiming Warn if timer res not good
216       false,                        // velocityPerNote Whether to show per-note or all velocities
217       -60,                          // int minMeter;
218       -60.0,                        // double minSlider;
219       false,                        // use Jack freewheel
220       20,                           // int guiRefresh;
221       QString(""),                  // userInstrumentsDir  // Obsolete. Must keep for compatibility.
222       //QString(""),                // helpBrowser  // Obsolete
223       true,                         // extendedMidi
224       384,                          // division for smf export
225       QString(""),                  // copyright string for smf export
226       1,                            // smf export file format
227       false,                        // midi export file 2 byte timesigs instead of 4
228       true,                         // optimize midi export file note offs
229       true,                         // expRunningStatus; Save space by using running status
230       true,                         // Split imported tracks into multiple parts.
231 // Obsolete. There is only 'New' drum tracks now.
232 //       true,                         // importMidiNewStyleDrum
233       true,                         // importDevNameMetas Import Prefer Device Name metas over port number metas if both exist.
234       true,                         // importInstrNameMetas Import Prefer Instrument Name metas over Mode sysexes if both exist.
235       MusEGlobal::PORT_NUM_META | MusEGlobal::DEVICE_NAME_META, // exportPortsDevices. Or'd ExportPortsDevices_t flags. Export port number metas and/or device name metas.
236       true,                         // exportPortDeviceSMF0 Export a port and/or device meta even for SMF0.
237       MusEGlobal::MODE_SYSEX | MusEGlobal::INSTRUMENT_NAME_META, // exportModeInstr. Or'd ExportModeInstr_t flags. Export mode sysexes and/or instrument name metas.
238       QString("GM"),                // importMidiDefaultInstr Default to this instrument not Generic, if no match found
239       true,                         // exportDrumMapOverrides Apply Port, Channel, and ANote drum map overrides to export
240       true,                         // exportChannelOverridesToNewTrack Drum map Channel overrides go to a separate track
241       1,                            // startMode
242       QString(""),                  // start song path
243       false,                        // startSongLoadConfig
244       384,                          // gui division
245       QRect(0, 0, 400, 300),        // GeometryMain;
246       QRect(0, 0, 200, 100),        // GeometryTransport;
247       QRect(0, 0, 600, 200),        // GeometryBigTime;
248       {
249          QString("Mixer A"),
250          QStringList(),
251          QRect(0, 0, 300, 500),        // Mixer1
252          true, true, true, true,
253          true, true, true, true, true,
254          MusEGlobal::MixerConfig::STRIPS_TRADITIONAL_VIEW,
255          QList<bool>()
256          },
257       {
258          QString("Mixer B"),
259          QStringList(),
260          QRect(200, 200, 300, 500),    // Mixer2
261          true, true, true, true,
262          true, true, true, true, true,
263          MusEGlobal::MixerConfig::STRIPS_TRADITIONAL_VIEW,
264          QList<bool>()
265       },
266       true,                         // TransportVisible;
267       false,                        // BigTimeVisible;
268       false,                        // mixer1Visible;
269       false,                        // mixer2Visible;
270       false,                        // markerVisible;
271       true,                         // arrangerVisible;
272       true,                         // showSplashScreen
273       1,                            // canvasShowPartType 1 - names, 2 events
274       5,                            // canvasShowPartEvent
275       true,                         // canvasShowGrid;
276       false,                        // canvasShowGridHorizontalAlways
277       false,                        // canvasShowGridBeatsAlways
278       QString(""),                  // canvasBgPixmap;
279       QStringList(),                // canvasCustomBgList
280       QString(""),                  // default styleSheetFile - For built-in set to ":/style.qss"
281       QString(""),                  // style
282       QString("sweep"),             // externalWavEditor
283       false,                        // useOldStyleStopShortCut
284       false,                        // moveArmedCheckBox
285       true,                         // useDenormalBias
286       false,                        // useOutputLimiter
287       true,                         // showDidYouKnow
288       false,                        // vstInPlace  Enable VST in-place processing
289       44100,                        // Dummy audio preferred sample rate
290       512,                          // Dummy audio buffer size
291       QString("./"),                // projectBaseFolder
292       true,                         // projectStoreInFolder
293       true,                         // useProjectSaveDialog
294       256,                          // minControlProcessPeriod
295       false,                        // popupsDefaultStayOpen
296       false,                        // leftMouseButtonCanDecrease
297       false,                        // rangeMarkerWithoutMMB
298       MusECore::DONT_REC_MUTED_OR_HIDDEN,
299       true,                         // addHiddenTracks
300       true,                         // unhideTracks
301 // Obsolete. There is only 'New' drum tracks now.
302 //       MusEGlobal::PREFER_NEW,       // drumTrackPreference
303       true,                         // smartFocus
304       20,                           // trackHeight
305       true,                         // borderlessMouse
306       false,                        // autoSave
307       false,                        // scrollableSubMenus
308       true,                         // liveWaveUpdate
309       true,                         // warnOnFileVersions Warn if file version different than current
310       MusEGlobal::CONF_LV2_UI_USE_FIRST, //lv2UiBehavior
311       true,                         // preferKnobsVsSliders Whether to prefer the use of knobs over sliders, esp in mixer.
312       true,                         // showControlValues Whether to show the value along with label in small controls, esp in mixer.
313       true,                        // monitorOnRecord  Whether to automatically monitor on record arm.
314       QString("klick1.wav"),        // measSample
315       QString("klick2.wav"),        // beatSample
316       QString("klick3.wav"),        // accent1Sample
317       QString("klick4.wav"),        // accent2Sample
318       MusEGlobal::RoutePreferCanonicalName,  // preferredRouteNameOrAlias
319       true,                         // routerExpandVertically
320       2                             // routerGroupingChannels
321       };
322 
323 //---------------------------------------------------------
324 //   pitch2string
325 //---------------------------------------------------------
326 
pitch2string(int v)327 QString pitch2string(int v)
328       {
329       if (v < 0 || v > 127)
330             return QString("----");
331       int octave = (v / 12) - 2;
332       QString o = QString::number(octave);
333       int i = v % 12;
334       QString s(octave < 0 ? valu[i] : vall[i]);
335       if (hIsB) {
336             if (s == "h")
337                   s = "b";
338             else if (s == "H")
339                   s = "B";
340             }
341       return s + o;
342       }
343 
344 
345 /* XPM */
346 static const char* slider_pixmap[]={
347 "22 22 50 1",
348 ". c None",
349 "f c #004005",
350 "g c #004007",
351 "h c #004107",
352 "m c #004108",
353 "j c #00430a",
354 "E c #00501f",
355 "s c #005021",
356 "e c #014006",
357 "l c #024006",
358 "F c #095e34",
359 "D c #0b572a",
360 "k c #0b582b",
361 "n c #0f5328",
362 "u c #12562d",
363 "o c #155a35",
364 "p c #165c38",
365 "q c #165c39",
366 "i c #17501a",
367 "I c #175522",
368 "r c #18603f",
369 "N c #18795e",
370 "t c #187a60",
371 "R c #1e5a29",
372 "y c #22633d",
373 "O c #307755",
374 "B c #408262",
375 "v c #439191",
376 "G c #468667",
377 "d c #4c7a51",
378 "H c #4d8a6c",
379 "J c #569174",
380 "C c #599276",
381 "P c #5e967a",
382 "A c #63b1c2",
383 "V c #659477",
384 "Q c #659b80",
385 "S c #6da087",
386 "w c #70b2bc",
387 "x c #72b5c0",
388 "z c #74b7c3",
389 "K c #79a891",
390 "a c #7ea48a",
391 "T c #8cb4a0",
392 "L c #a3c3b3",
393 "M c #b7d8d1",
394 "U c #bedcd5",
395 "c c #c3d2c3",
396 "b c #f1f5f1",
397 "# c #ffffff",
398 "......................",
399 "......................",
400 "......................",
401 "......................",
402 "......................",
403 "......###a............",
404 "......#bcad...........",
405 "......#bcad...........",
406 "......#bcad...........",
407 "..efgh#bcaihhhhhhhjk..",
408 ".lmnop#bcaippppppqrst.",
409 ".huvwx#bcayxxxxxxzABC.",
410 ".DEFGH#bcaIHHHHHHJKLM.",
411 "..NOPQ#bcaRQQQQQQSTU..",
412 "......#bcad...........",
413 "......#bcad...........",
414 "......#bcad...........",
415 "......VVVVd...........",
416 ".......dddd...........",
417 "......................",
418 "......................",
419 "......................"};
420 static const char *posedit_pixmap[] = {
421           "22 22 8 1",
422           "  c Gray100",
423           ". c Gray97",
424           "X c #4f504f",
425           "o c #00007f",
426           "O c Gray0",
427           "+ c none",
428           "@ c Gray0",
429           "# c Gray0",
430           "++++++++++++++++++++++",
431           "++++++++++++++++++++++",
432           "++++++++++++++++++++++",
433           "++++++++++++++++++++++",
434           "+OOOOOOOOOOOOOOOOOOOO+",
435           "OOXXXXXXXXXXXXXXXXXXOO",
436           "OXX.          OO OO  O",
437           "OX.      oo     O    O",
438           "OX.      oo     O   .O",
439           "OX  ooo  oooo   O    O",
440           "OX    oo oo oo  O    O",
441           "OX  oooo oo oo  O    O",
442           "OX oo oo oo oo  O    O",
443           "OX oo oo oo oo  O    O",
444           "OX  oooo oooo   O    O",
445           "OX            OO OO  O",
446           "OO..................OO",
447           "+OOOOOOOOOOOOOOOOOOOO+",
448           "++++++++++++++++++++++",
449           "++++++++++++++++++++++",
450           "++++++++++++++++++++++",
451           "++++++++++++++++++++++"
452       };
453 
454 static const char *pitchedit_pixmap[] = {
455           "22 22 8 1",
456           "  c Gray100",
457           ". c Gray97",
458           "X c #4f504f",
459           "o c #00007f",
460           "O c Gray0",
461           "+ c none",
462           "@ c Gray0",
463           "# c Gray0",
464           "++++++++++++++++++++++",
465           "++++++++++++++++++++++",
466           "++++++++++++++++++++++",
467           "++++++++++++++++++++++",
468           "+OOOOOOOOOOOOOOOOOOOO+",
469           "OOXXXXXXXXXXXXXXXXXXOO",
470           "OXX.          OO OO  O",
471           "OX.      o      O    O",
472           "OX.      oo     O   .O",
473           "OX       o o    O    O",
474           "OX       o      O    O",
475           "OX     o o      O    O",
476           "OX    oooo      O    O",
477           "OX     o        O    O",
478           "OX              O    O",
479           "OX            OO OO  O",
480           "OO..................OO",
481           "+OOOOOOOOOOOOOOOOOOOO+",
482           "++++++++++++++++++++++",
483           "++++++++++++++++++++++",
484           "++++++++++++++++++++++",
485           "++++++++++++++++++++++"
486       };
487 
488 //---------------------------------------------------------
489 //   MusEPlugin
490 //---------------------------------------------------------
491 
492 class MusEPlugin : public QWidgetPlugin {
493    public:
MusEPlugin()494       MusEPlugin() {}
~MusEPlugin()495       ~MusEPlugin() {}
496       QStringList keys() const;
497       QWidget* create(const QString& key, QWidget* parent=0,
498          const char* name = 0);
499       QString group(const QString& key) const;
500       QIcon iconSet(const QString& key) const;
501       QString includeFile(const QString& key) const;
502       QString toolTip(const QString& key) const;
503       QString whatsThis(const QString& key) const;
504       bool isContainer(const QString& key) const;
505       };
506 
507 //---------------------------------------------------------
508 //   keys
509 //---------------------------------------------------------
510 
keys() const511 QStringList MusEPlugin::keys() const
512       {
513       QStringList list;
514       list << QString("PosEdit")
515            << QString("PitchEdit")
516            << QString("PosLabel")
517            << QString("PitchLabel")
518            << QString("TempoLabel")
519            << QString("TempoEdit")
520            << QString("SigEdit")
521            << QString("Slider")
522            << QString("DoubleLabel")
523            << QString("CheckBox")
524            << QString("ComboBox")
525       ;
526       return list;
527       }
528 
529 //---------------------------------------------------------
530 //   create
531 //---------------------------------------------------------
532 
create(const QString & key,QWidget * parent,const char * name)533 QWidget* MusEPlugin::create(const QString& key, QWidget* parent,
534    const char* name)
535       {
536       if (key == QString("PosEdit"))
537             return new PosEdit(parent, name);
538       else if (key == QString("PitchEdit"))
539             return new PitchEdit(parent, name);
540       else if (key == QString("PitchLabel"))
541             return new PitchLabel(parent, name);
542       else if (key == QString("PosLabel"))
543             return new PosLabel(parent, name);
544       else if (key == QString("TempoLabel"))
545             return new TempoLabel(parent, name);
546       else if (key == QString("TempoEdit"))
547             return new TempoEdit(parent, name);
548       else if (key == QString("SigEdit"))
549             return new SigEdit(parent, name);
550       else if (key == QString("Slider"))
551             return new Slider(parent, name);
552       else if (key == QString("DoubleLabel"))
553             return new DoubleLabel(parent, name);
554       else if (key == QString("CheckBox"))
555             return new CheckBox(parent, -1, name);
556       else if (key == QString("ComboBox"))
557             return new ComboBox(parent, name);
558       return 0;
559       }
560 
561 //---------------------------------------------------------
562 //   group
563 //---------------------------------------------------------
564 
group(const QString &) const565 QString MusEPlugin::group(const QString& /*key*/) const
566       {
567       return QString("MusE");
568       }
569 
570 //---------------------------------------------------------
571 //   iconSet
572 //---------------------------------------------------------
573 
iconSet(const QString & key) const574 QIcon MusEPlugin::iconSet(const QString& key) const
575       {
576       if (key == "PosEdit" || key == "PosLabel")
577             return QIcon(QPixmap(posedit_pixmap));
578       else if (key == "PitchEdit" || key == "PitchLabel")
579             return QIcon(QPixmap(pitchedit_pixmap));
580       else if (key == "TempoEdit" || key == "TempoLabel")
581             return QIcon(QPixmap(pitchedit_pixmap));
582       else if (key == "SigEdit")
583             return QIcon(QPixmap(pitchedit_pixmap));
584       else if (key == QString("Slider"))
585             return QIcon(QPixmap(slider_pixmap));
586 //      else if (key == QString("CheckBox"))
587 //            return QIconSet(QPixmap(slider_pixmap));
588 //      else if (key == QString("ComboBox"))
589 //            return QIconSet(QPixmap(slider_pixmap));
590       return QIcon();
591       }
592 
593 //---------------------------------------------------------
594 //   includeFile
595 //---------------------------------------------------------
596 
includeFile(const QString & key) const597 QString MusEPlugin::includeFile(const QString& key) const
598       {
599       if (key == QString("PosEdit"))
600             return QString("posedit.h");
601       else if (key == QString("PitchEdit"))
602             return QString("pitchedit.h");
603       else if (key == QString("PitchLabel"))
604             return QString("pitchlabel.h");
605       else if (key == QString("PosLabel"))
606             return QString("poslabel.h");
607       else if (key == QString("TempoLabel"))
608             return QString("tempolabel.h");
609       else if (key == QString("TempoEdit"))
610             return QString("tempolabel.h");
611       else if (key == QString("SigEdit"))
612             return QString("sigedit.h");
613       else if (key == QString("Slider"))
614             return QString("slider.h");
615       else if (key == QString("DoubleLabel"))
616             return QString("dentry.h");
617       else if (key == QString("CheckBox"))
618             return QString("checkbox.h");
619       else if (key == QString("ComboBox"))
620             return QString("combobox.h");
621       return QString::null;
622       }
623 
624 //---------------------------------------------------------
625 //   toolTip
626 //---------------------------------------------------------
627 
toolTip(const QString & key) const628 QString MusEPlugin::toolTip (const QString& key) const
629       {
630       if (key == QString("PosEdit"))
631             return QString("midi time position editor");
632       else if (key == QString("PitchEdit"))
633             return QString("midi pitch spinbox");
634       else if (key == QString("PitchLabel"))
635             return QString("midi pitch label");
636       else if (key == QString("PosLabel"))
637             return QString("midi time position label");
638       else if (key == QString("TempoLabel"))
639             return QString("midi tempo label");
640       else if (key == QString("TempoEdit"))
641             return QString("midi tempo spinbox");
642       else if (key == QString("SigEdit"))
643             return QString("midi signature spinbox");
644       else if (key == QString("Slider"))
645             return QString("slider for double values");
646       else if (key == QString("DoubleLabel"))
647             return QString("entry/label for double values");
648       else if (key == QString("CheckBox"))
649             return QString("checkbox with id");
650       else if (key == QString("ComboBox"))
651             return QString("combobox with id");
652       return QString::null;
653       }
654 
655 //---------------------------------------------------------
656 //   whatsThis
657 //---------------------------------------------------------
658 
whatsThis(const QString & key) const659 QString MusEPlugin::whatsThis (const QString& key) const
660       {
661       if (key == QString("PosEdit"))
662             return QString("midi time position editor");
663       else if (key == QString("PitchEdit"))
664             return QString("midi pitch spinbox");
665       else if (key == QString("PitchLabel"))
666             return QString("midi pitch label");
667       else if (key == QString("PosLabel"))
668             return QString("midi time position label");
669       else if (key == QString("TempoLabel"))
670             return QString("midi tempo label");
671       else if (key == QString("TempoEdit"))
672             return QString("midi tempo spinbox");
673       else if (key == QString("SigEdit"))
674             return QString("midi signature spinbox");
675       else if (key == QString("Slider"))
676             return QString("slider for double values");
677       else if (key == QString("DoubleLabel"))
678             return QString("entry/label for double values");
679       else if (key == QString("CheckBox"))
680             return QString("checkbox with id");
681       else if (key == QString("ComboBox"))
682             return QString("combobox with id");
683       return QString::null;
684       }
685 
686 //---------------------------------------------------------
687 //   isContainer
688 //---------------------------------------------------------
689 
isContainer(const QString &) const690 bool MusEPlugin::isContainer (const QString& /*key*/) const
691       {
692       return false;
693       }
694 
695 Q_EXPORT_PLUGIN(MusEPlugin)
696 
697