diff options
author | Florian Jung <flo@windfisch.org> | 2012-03-16 14:34:56 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2012-03-16 14:34:56 +0000 |
commit | 8f7ed6ab503f7f1befae937bdc33e6907f3a1868 (patch) | |
tree | 3c193b15ec70c1cb0230ab6a0683dc99b5a3185d /muse2/muse/helper.cpp | |
parent | e232be5476afe17a3abc717f757e667832d9daa6 (diff) |
custom columns now send their changes to the device if appropriate
Diffstat (limited to 'muse2/muse/helper.cpp')
-rw-r--r-- | muse2/muse/helper.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/muse2/muse/helper.cpp b/muse2/muse/helper.cpp index 89b0b641..c5f9eca1 100644 --- a/muse2/muse/helper.cpp +++ b/muse2/muse/helper.cpp @@ -38,6 +38,7 @@ #include "globaldefs.h" #include "audio.h" #include "audiodev.h" +#include "midi.h" #include "midiseq.h" #include <QMenu> @@ -352,6 +353,23 @@ void read_new_style_drummap(Xml& xml, const char* tagname, } } +void record_controller_change_and_maybe_send(unsigned tick, int ctrl_num, int val, MidiTrack* mt) +{ + MusECore::Event a(MusECore::Controller); + a.setTick(tick); + a.setA(ctrl_num); + a.setB(val); + MusEGlobal::song->recordEvent(mt, a); + + if (MusEGlobal::song->cpos() < mt->getControllerValueLifetime(tick, ctrl_num)) + { + // this CC has an immediate effect? so send it out to the device. + MusECore::MidiPlayEvent ev(0, mt->outPort(), mt->outChannel(), MusECore::ME_CONTROLLER, ctrl_num, val); + MusEGlobal::audio->msgPlayMidiEvent(&ev); + } +} + + } // namespace MusECore namespace MusEGui { |