=== modified file 'mixxx/src/controllers/midi/midicontroller.cpp' --- mixxx/src/controllers/midi/midicontroller.cpp 2013-05-16 00:14:12 +0000 +++ mixxx/src/controllers/midi/midicontroller.cpp 2013-09-26 07:22:24 +0000 @@ -50,6 +50,13 @@ // TODO(XXX): throw a hissy fit. } +bool MidiController::isClockSignal(MidiKey &mappingKey) { + if ((mappingKey.key & MIDI_SYS_RT_MSG_MASK) == MIDI_SYS_RT_MSG_MASK) { + return true; + } + return false; +} + bool MidiController::matchPreset(const PresetInfo& preset) { // Product info mapping not implemented for MIDI devices yet Q_UNUSED(preset); @@ -255,6 +262,12 @@ target.first = control; target.second = options; + // Ignore all standard MIDI System Real-Time Messages because they + // are continuously sent and prevent mapping of the pressed key. + if (isClockSignal(mappingKey)) { + return; + } + // TODO: store these in a temporary hash to be applied on learning // success, or thrown away on cancel. m_preset.mappings.insert(mappingKey.key,target); === modified file 'mixxx/src/controllers/midi/midicontroller.h' --- mixxx/src/controllers/midi/midicontroller.h 2013-02-09 05:21:42 +0000 +++ mixxx/src/controllers/midi/midicontroller.h 2013-09-26 07:22:49 +0000 @@ -20,6 +20,9 @@ #include "controllers/midi/midioutputhandler.h" #include "controllers/softtakeover.h" +#define MIDI_SYS_RT_MSG_MASK 0xF8 +// from MIDI Message Table http://www.midi.org/techspecs/midimessages.php + class MidiController : public Controller { Q_OBJECT public: @@ -43,6 +46,8 @@ virtual void visit(const MidiControllerPreset* preset); virtual void visit(const HidControllerPreset* preset); + bool isClockSignal(MidiKey &mappingKey); + virtual bool isMappable() const { return m_preset.isMappable(); }