From ddb362fe170ce7c86c2e7504196b6b2959c374d7 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Thu, 14 Jan 2016 16:37:47 -0600 Subject: Generic MIDI: add ToggleRecEnable action, and change all maps to use that instead of separate rec-enable, rec-disable, which didnt work --- libs/surfaces/generic_midi/midicontrollable.cc | 2 +- libs/surfaces/generic_midi/midifunction.cc | 7 +++++++ libs/surfaces/generic_midi/midifunction.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'libs/surfaces/generic_midi') diff --git a/libs/surfaces/generic_midi/midicontrollable.cc b/libs/surfaces/generic_midi/midicontrollable.cc index 8945463e97..b036a9d30f 100644 --- a/libs/surfaces/generic_midi/midicontrollable.cc +++ b/libs/surfaces/generic_midi/midicontrollable.cc @@ -374,7 +374,7 @@ MIDIControllable::midi_sense_controller (Parser &, EventTwoBytes *msg) } } else { - if (msg->value > 64.0f) { + if ( msg->value > 0x40 ) { controllable->set_value (1, Controllable::NoGroup); DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("Midi CC %1 value 1 %2\n", (int) msg->controller_number, current_uri())); } else { diff --git a/libs/surfaces/generic_midi/midifunction.cc b/libs/surfaces/generic_midi/midifunction.cc index e9e875b702..1f3535f22c 100644 --- a/libs/surfaces/generic_midi/midifunction.cc +++ b/libs/surfaces/generic_midi/midifunction.cc @@ -58,6 +58,8 @@ MIDIFunction::setup (GenericMidiControlProtocol& ui, const std::string& invokabl _function = TransportEnd; } else if (strcasecmp (_invokable_name.c_str(), "loop-toggle") == 0) { _function = TransportLoopToggle; + } else if (strcasecmp (_invokable_name.c_str(), "toggle-rec-enable") == 0) { + _function = TransportRecordToggle; } else if (strcasecmp (_invokable_name.c_str(), "rec-enable") == 0) { _function = TransportRecordEnable; } else if (strcasecmp (_invokable_name.c_str(), "rec-disable") == 0) { @@ -146,6 +148,11 @@ MIDIFunction::execute () DEBUG_TRACE (DEBUG::GenericMidi, "Function: loop_toggle\n"); break; + case TransportRecordToggle: + _ui->rec_enable_toggle (); + DEBUG_TRACE (DEBUG::GenericMidi, "Function: toggle_record_enable\n"); + break; + case TransportRecordEnable: _ui->set_record_enable (true); DEBUG_TRACE (DEBUG::GenericMidi, "Function: set_record_enable = true\n"); diff --git a/libs/surfaces/generic_midi/midifunction.h b/libs/surfaces/generic_midi/midifunction.h index 948775c843..12340174d4 100644 --- a/libs/surfaces/generic_midi/midifunction.h +++ b/libs/surfaces/generic_midi/midifunction.h @@ -50,6 +50,7 @@ class MIDIFunction : public MIDIInvokable TransportStart, TransportEnd, TransportLoopToggle, + TransportRecordToggle, TransportRecordEnable, TransportRecordDisable, /* 1 argument functions: RID */ -- cgit v1.2.3