diff options
author | Florian Jung <flo@windfisch.org> | 2011-06-03 14:24:08 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-06-03 14:24:08 +0000 |
commit | db164b62e3892bd17d1a2eabca76bde3b67072df (patch) | |
tree | ab71ac4b4f05ab94c008d75ef7052bef5af6cc74 /muse2/muse/instruments | |
parent | def4fdb391f5207ebbe61881416f39f3d896cc5d (diff) | |
parent | 9187899632c14d64b3fae6477b7f941240f912a6 (diff) |
merged with trunk and adapted new functions
Diffstat (limited to 'muse2/muse/instruments')
-rw-r--r-- | muse2/muse/instruments/minstrument.cpp | 9 | ||||
-rw-r--r-- | muse2/muse/instruments/minstrument.h | 6 |
2 files changed, 10 insertions, 5 deletions
diff --git a/muse2/muse/instruments/minstrument.cpp b/muse2/muse/instruments/minstrument.cpp index 4fde7bf3..10cb3ec2 100644 --- a/muse2/muse/instruments/minstrument.cpp +++ b/muse2/muse/instruments/minstrument.cpp @@ -11,7 +11,7 @@ #include <QAction> #include <QDir> #include <QFileInfo> -#include <QMenu> +//#include <QMenu> #include <QMessageBox> #include "minstrument.h" @@ -25,6 +25,7 @@ #include "mpevent.h" #include "midictrl.h" #include "gconfig.h" +#include "popupmenu.h" MidiInstrumentList midiInstruments; MidiInstrument* genericMidiInstrument; @@ -881,7 +882,7 @@ QString MidiInstrument::getPatchName(int channel, int prog, MType mode, bool dru // populatePatchPopup //--------------------------------------------------------- -void MidiInstrument::populatePatchPopup(QMenu* menu, int chan, MType songType, bool drum) +void MidiInstrument::populatePatchPopup(PopupMenu* menu, int chan, MType songType, bool drum) { menu->clear(); int mask = 0; @@ -905,7 +906,9 @@ void MidiInstrument::populatePatchPopup(QMenu* menu, int chan, MType songType, b if (pg.size() > 1) { for (ciPatchGroup i = pg.begin(); i != pg.end(); ++i) { PatchGroup* pgp = *i; - QMenu* pm = menu->addMenu(pgp->name); + //QMenu* pm = menu->addMenu(pgp->name); + PopupMenu* pm = new PopupMenu(pgp->name, menu, menu->stayOpen()); // Use the parent stayOpen here. + menu->addMenu(pm); pm->setFont(config.fonts[0]); const PatchList& pl = pgp->patches; for (ciPatch ipl = pl.begin(); ipl != pl.end(); ++ipl) { diff --git a/muse2/muse/instruments/minstrument.h b/muse2/muse/instruments/minstrument.h index a8fb1168..15942537 100644 --- a/muse2/muse/instruments/minstrument.h +++ b/muse2/muse/instruments/minstrument.h @@ -14,7 +14,8 @@ #include <vector> class MidiPort; -class QMenu; +//class QMenu; +class PopupMenu; class MidiPlayEvent; class Xml; class EventList; @@ -118,7 +119,8 @@ class MidiInstrument { virtual void reset(int, MType); virtual QString getPatchName(int,int,MType,bool); - virtual void populatePatchPopup(QMenu*, int, MType, bool); + //virtual void populatePatchPopup(QMenu*, int, MType, bool); + virtual void populatePatchPopup(PopupMenu*, int, MType, bool); void read(Xml&); void write(int level, Xml&); |