summaryrefslogtreecommitdiff
path: root/muse2/muse/instruments/minstrument.cpp
diff options
context:
space:
mode:
authorterminator356 <termtech@rogers.com>2014-01-07 02:00:22 -0500
committerterminator356 <termtech@rogers.com>2014-01-07 02:00:22 -0500
commit7a6952bbdbcf8bd6573543d1c28e6fa75d50d4e4 (patch)
treecc4f8980591848591ba05389cf1791d8c611d4d1 /muse2/muse/instruments/minstrument.cpp
parent42ecd9fd47fe44c999bfd7f4f051179806735b0a (diff)
Instrument can now be changed from trackinfo panel. Tweaks, cleanups.
Midi instrument can now be changed from midi track info panel. Some minor code tweaks, code cleanup in mtrackinfo.cpp, confmport.cpp.
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
//---------------------------------------------------------