diff options
author | Tim E. Real <termtech@rogers.com> | 2012-10-28 01:34:16 +0000 |
---|---|---|
committer | Tim E. Real <termtech@rogers.com> | 2012-10-28 01:34:16 +0000 |
commit | b45ce65ca39817a0678f2172410b71433f79f736 (patch) | |
tree | 4a193aaa1ba899f17e298826ae4b44a15a763b7a /muse2/muse/conf.cpp | |
parent | b1776f093d4b87ad2635990f429f4503157f6288 (diff) |
Improved: Eliminated copious unrequired "controller" sections from songs and templates.
Eliminated ALL "controller" and "midiport" sections from built-in templates.
For template "synth.med", changed synth ports to 198 and 199.
Improved: Templates, use your chosen default output port/channel from the midi ports setup dialog.
Diffstat (limited to 'muse2/muse/conf.cpp')
-rw-r--r-- | muse2/muse/conf.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp index 54a02265..ea2390c3 100644 --- a/muse2/muse/conf.cpp +++ b/muse2/muse/conf.cpp @@ -1167,18 +1167,31 @@ static void writeSeqConfiguration(int level, Xml& xml, bool writePortInfo) for (int k = 0; k < MIDI_CHANNELS; ++k) { int min = k << 24; int max = min + 0x100000; - xml.tag(level++, "channel idx=\"%d\"", k); + bool found = false; iMidiCtrlValList s = vll->lower_bound(min); iMidiCtrlValList e = vll->lower_bound(max); if (s != e) { for (iMidiCtrlValList i = s; i != e; ++i) { + int ctl = i->second->num(); + if(mport->drumController(ctl)) // Including internals like polyaftertouch + ctl |= 0xff; + // Don't bother saving these empty controllers since they are already always added! + if(defaultManagedMidiController.find(ctl) != defaultManagedMidiController.end() + && i->second->hwVal() == CTRL_VAL_UNKNOWN) + continue; + if(!found) + { + xml.tag(level++, "channel idx=\"%d\"", k); + found = true; + } xml.tag(level++, "controller id=\"%d\"", i->second->num()); if (i->second->hwVal() != CTRL_VAL_UNKNOWN) xml.intTag(level, "val", i->second->hwVal()); xml.etag(level--, "controller"); } } - xml.etag(level--, "channel"); + if(found) + xml.etag(level--, "channel"); } xml.etag(level--, "midiport"); } |