summaryrefslogtreecommitdiff
path: root/muse2/muse/instruments
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2011-05-19 07:43:06 +0000
committerTim E. Real <termtech@rogers.com>2011-05-19 07:43:06 +0000
commit0f3ed66e83d6639452a5aa219b9a6bf2bfd54897 (patch)
tree950c324e7301f657cba543d8ccbb268ca40e418f /muse2/muse/instruments
parent0792c2ec66dacfff10899cbe171cb661871617f1 (diff)
Popup menus now auto-scroll if too large to fit on desktop.
Midi track info patch popup now stays open for auditioning patches. Editor 'ctrl' controller popups: Split instrument/other (+ common controls!) + show ctrl numbers.
Diffstat (limited to 'muse2/muse/instruments')
-rw-r--r--muse2/muse/instruments/minstrument.cpp9
-rw-r--r--muse2/muse/instruments/minstrument.h6
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&);