diff options
author | Tim E. Real <termtech@rogers.com> | 2013-02-02 07:37:31 +0000 |
---|---|---|
committer | Tim E. Real <termtech@rogers.com> | 2013-02-02 07:37:31 +0000 |
commit | f118ed0cfca8ab717b87e1f00459199acba80bb9 (patch) | |
tree | 7a5a46771dcea1a978182d0da0134e6a5d049745 /muse2/muse/song.cpp | |
parent | 5d8ab88bd418da3a4047b38707b5a49f32e912ba (diff) |
Solved: "Old style" Drums: Track channel/port re-enabled, drum list columns default to them.
Required some icon and colour changes. See ChangeLog.
Fixed Old Style Drum lockup: Certain item channel overrides caused infinite loop in Audio::processMidi().
Diffstat (limited to 'muse2/muse/song.cpp')
-rw-r--r-- | muse2/muse/song.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp index 3349686b..1ef45cd1 100644 --- a/muse2/muse/song.cpp +++ b/muse2/muse/song.cpp @@ -93,6 +93,7 @@ Song::Song(const char* name) bounceTrack = NULL; bounceOutput = NULL; showSongInfo=true; + clearDrumMap(); // One-time only early init clear(false); } @@ -669,8 +670,13 @@ void Song::remapPortDrumCtrlEvents(int mapidx, int newnote, int newchan, int new if(note == mapidx) { int tick = ev.tick() + part->tick(); + // Default to track port if -1 and track channel if -1. int ch = MusEGlobal::drumMap[note].channel; + if(ch == -1) + ch = mt->outChannel(); int port = MusEGlobal::drumMap[note].port; + if(port == -1) + port = mt->outPort(); MidiPort* mp = &MusEGlobal::midiPorts[port]; cntrl = (cntrl & ~0xff) | MusEGlobal::drumMap[note].anote; @@ -738,8 +744,11 @@ void Song::changeAllPortDrumCtrlEvents(bool add, bool drumonly) if(trackmp->drumController(cntrl)) { int note = cntrl & 0x7f; - ch = MusEGlobal::drumMap[note].channel; - mp = &MusEGlobal::midiPorts[MusEGlobal::drumMap[note].port]; + // Default to track port if -1 and track channel if -1. + if(MusEGlobal::drumMap[note].channel != -1) + ch = MusEGlobal::drumMap[note].channel; + if(MusEGlobal::drumMap[note].port != -1) + mp = &MusEGlobal::midiPorts[MusEGlobal::drumMap[note].port]; cntrl = (cntrl & ~0xff) | MusEGlobal::drumMap[note].anote; } else @@ -2663,8 +2672,11 @@ int Song::execMidiAutomationCtlPopup(MidiTrack* track, MidiPart* part, const QPo // Change the controller event's index into the drum map to an instrument note. int note = ctlnum & 0x7f; dctl &= ~0xff; - channel = MusEGlobal::drumMap[note].channel; - mp = &MusEGlobal::midiPorts[MusEGlobal::drumMap[note].port]; + // Default to track port if -1 and track channel if -1. + if(MusEGlobal::drumMap[note].channel != -1) + channel = MusEGlobal::drumMap[note].channel; + if(MusEGlobal::drumMap[note].port != -1) + mp = &MusEGlobal::midiPorts[MusEGlobal::drumMap[note].port]; dctl |= MusEGlobal::drumMap[note].anote; } |