summaryrefslogtreecommitdiff
path: root/muse2/muse/instruments/minstrument.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/muse/instruments/minstrument.cpp')
-rw-r--r--muse2/muse/instruments/minstrument.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/muse2/muse/instruments/minstrument.cpp b/muse2/muse/instruments/minstrument.cpp
index c119f0bc..ecfc2da4 100644
--- a/muse2/muse/instruments/minstrument.cpp
+++ b/muse2/muse/instruments/minstrument.cpp
@@ -472,13 +472,13 @@ MType MidiInstrument::midiType() const
void MidiInstrument::reset(int portNo)
{
MusECore::MidiPort* port = &MusEGlobal::midiPorts[portNo];
- if(port->device() == 0) // p4.0.15
+ if(port->device() == 0)
return;
MusECore::MidiPlayEvent ev;
ev.setType(0x90);
ev.setPort(portNo);
- ev.setTime(0); // p4.0.15
+ ev.setTime(0);
for (int chan = 0; chan < MIDI_CHANNELS; ++chan)
{
@@ -692,7 +692,7 @@ void SysEx::write(int level, Xml& xml)
void MidiInstrument::readMidiState(Xml& xml)
{
- // p4.0.27 A kludge to support old midistates by wrapping them in the proper header.
+ // A kludge to support old midistates by wrapping them in the proper header.
_tmpMidiStateVersion = 1; // Assume old (unmarked) first version 1.
for (;;)
{
@@ -918,7 +918,6 @@ void MidiInstrument::read(Xml& xml)
else if (tag == "Controller") {
MidiController* mc = new MidiController();
mc->read(xml);
- // Added by Tim. Copied from muse 2.
//
// HACK: make predefined "Program" controller overloadable
//
@@ -1041,6 +1040,25 @@ void MidiInstrument::write(int level, Xml& xml)
//---------------------------------------------------------
+// populateInstrPopup (static)
+//---------------------------------------------------------
+
+void MidiInstrument::populateInstrPopup(MusEGui::PopupMenu* menu, MidiInstrument* /*current*/, bool show_synths)
+ {
+ menu->clear();
+ for (MusECore::iMidiInstrument i = MusECore::midiInstruments.begin(); i
+ != MusECore::midiInstruments.end(); ++i)
+ {
+ // Do not list synths. Although it is possible to assign a synth
+ // as an instrument to a non-synth device, we should not allow this.
+ // (One reason is that the 'show gui' column is then enabled, which
+ // makes no sense for a non-synth device).
+ if(show_synths || !(*i)->isSynti())
+ menu->addAction((*i)->iname());
+ }
+ }
+
+//---------------------------------------------------------
// populatePatchPopup
//---------------------------------------------------------