Generic MIDI: add ToggleRecEnable action, and change all maps to use that instead...
authorBen Loftis <ben@harrisonconsoles.com>
Thu, 14 Jan 2016 22:37:47 +0000 (16:37 -0600)
committerBen Loftis <ben@harrisonconsoles.com>
Thu, 14 Jan 2016 22:37:54 +0000 (16:37 -0600)
13 files changed:
libs/surfaces/generic_midi/midicontrollable.cc
libs/surfaces/generic_midi/midifunction.cc
libs/surfaces/generic_midi/midifunction.h
midi_maps/Korg_nanoKONTROL.map
midi_maps/Korg_nanoKONTROL2.map
midi_maps/Korg_nanoKONTROL2_With_Master.map
midi_maps/M-Audio_Axiom25.map
midi_maps/M-Audio_Axiom61.map
midi_maps/Novation Impulse 49.map
midi_maps/Novation_Impulse61.map
midi_maps/Roland_SI-24.map
midi_maps/m-audio_oxygen8v2.map
midi_maps/midikb_wiimote.map

index 8945463e979fc989fe1a478699034669ae7ae64f..b036a9d30f81e9f72491686be4276052852b6bed 100644 (file)
@@ -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 {
index e9e875b7027cf5edbf6e959c1e91934d3dfe3805..1f3535f22c213bd33ffb9a5ec2ee1c1eb83054e0 100644 (file)
@@ -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");
index 948775c843e09f60e8e0c131e556d8eab8777e56..12340174d40f1ef649aac36209a21fb1ca1fb420 100644 (file)
@@ -50,6 +50,7 @@ class MIDIFunction : public MIDIInvokable
                TransportStart,
                TransportEnd,
                TransportLoopToggle,
+               TransportRecordToggle,
                TransportRecordEnable,
                TransportRecordDisable,
                /* 1 argument functions: RID */
index 05308a1b0f770ae5ecef36c5dbd1e0ef58d5ce10..f0af7fc5818b7550c0805c1da3dc095c489ad326 100644 (file)
@@ -5,7 +5,7 @@
   <DeviceInfo bank-size="9" motorized="no" threshold="15"/>
 
 <!-- Transport Controls -->
-  <Binding msg="B0 2c 7f" function="rec-enable"/>
+  <Binding msg="B0 2c 7f" function="toggle-rec-enable"/>
   <Binding msg="B0 2d 7f" function="transport-roll"/>
   <Binding msg="B0 2e 7f" function="transport-stop"/>
   <Binding msg="B0 2f 7f" function="transport-start"/>
index 7f85945e90363cf4227b380fe1b7fe665cf8dcf2..f1c11566b09f75df49aa6d0c9baffb5f2d587f50 100644 (file)
 
   <DeviceInfo bank-size="8"/>
        
-  <Binding msg="B0 2d 7f" function="rec-enable"/>
-  <Binding msg="B0 2d 00" function="rec-disable"/>
   <Binding channel="1" ctl="41" function="transport-roll"/>
   <Binding channel="1" ctl="42" function="transport-stop"/>
   <Binding channel="1" ctl="43" function="transport-start"/>
   <Binding channel="1" ctl="44" function="transport-end"/>
+  <Binding channel="1" ctl="44" function="transport-end"/>
+  <Binding channel="1" ctl="45" function="toggle-rec-enable"/>
   <Binding channel="1" ctl="46" function="loop-toggle"/>
   <Binding msg="B0 3c 7f" action="Editor/add-location-from-playhead"/>
   <Binding msg="B0 3d 7f" action="Editor/jump-backward-to-mark"/>
index adf8ee72cd91375e34aff85c79ec42965868a7fb..1217ca9b25a8a02268ece568d682d48d4d36bf6a 100644 (file)
 
   <DeviceInfo bank-size="7"/>
        
-  <Binding msg="B0 2d 7f" function="rec-enable"/>
-  <Binding msg="B0 2d 00" function="rec-disable"/>
   <Binding channel="1" ctl="41" function="transport-roll"/>
   <Binding channel="1" ctl="42" function="transport-stop"/>
   <Binding channel="1" ctl="43" function="transport-start"/>
   <Binding channel="1" ctl="44" function="transport-end"/>
+  <Binding channel="1" ctl="45" function="toggle-rec-enable"/>
   <Binding channel="1" ctl="46" function="loop-toggle"/>
   <Binding msg="B0 3c 7f" action="Editor/add-location-from-playhead"/>
   <Binding msg="B0 3d 7f" action="Editor/jump-backward-to-mark"/>
index 2c7bbe4f76fc47c425ab2a062bfdcb19f9d085e9..001f7b1a0056888a7e23ff0d3ab287b7d129e423 100644 (file)
@@ -9,8 +9,7 @@
   <Binding channel="1" ctl="22" function="transport-end"/>
   <Binding channel="1" ctl="23" function="transport-stop"/>
   <Binding channel="1" ctl="24" function="transport-roll"/>
-  <Binding channel="1" ctl="25" function="rec-enable"/>
-  <Binding channel="1" ctl="25" function="rec-disable"/>
+  <Binding channel="1" ctl="25" function="toggle-rec-enable"/>
 
 <!--  Potentiometers:                                                       -->
 <!--  I decided to map the 8 pots as track fader controls. They have a      -->
index 734a8d6cb9006ae38caee2de1b7756cb572be5d8..7945870d55128055135373dc667b1a598144fa3f 100644 (file)
@@ -47,8 +47,7 @@
   <Binding channel="1" ctl="23" function="transport-stop"/>
   <Binding channel="1" ctl="24" function="transport-roll"/>
   <Binding channel="1" ctl="20" function="loop-toggle"/>
-  <Binding channel="1" ctl="25" function="rec-enable"/>
-  <Binding channel="1" ctl="25" function="rec-disable"/>
+  <Binding channel="1" ctl="25" function="toggle-rec-enable"/>
 
 
 </ArdourMIDIBindings>
index a6a10f3a6ac86249e9693eec7d0c30bb86d05e71..234991e41b69b40c7cfd928c9888e7a2463f5cd4 100644 (file)
@@ -10,8 +10,7 @@
   <Binding channel="1" ctl="114" function="transport-stop"/>\r
   <Binding channel="1" ctl="115" function="transport-roll"/>\r
   <Binding channel="1" ctl="116" function="loop-toggle"/>\r
-  <Binding channel="1" ctl="117" function="rec-enable"/>\r
-  <Binding channel="1" ctl="117" function="rec-disable"/>\r
+  <Binding channel="1" ctl="117" function="toggle-rec-enable"/>\r
 \r
 <!-- Gain controls. Faders are mapped to faders. -->\r
 \r
@@ -41,4 +40,4 @@
 <!-- Status buttons are mapped to mute toggles. -->\r
 <!-- Apparently Solo toggle only works when Automap is used. Sad but true. -->\r
 \r
-</ArdourMIDIBindings>
\ No newline at end of file
+</ArdourMIDIBindings>\r
index 516167d0716ba6ddc0ffe264c8b31fd99009aa75..78e0d4c54812d2da0c82572583c1095cad342c59 100644 (file)
@@ -11,8 +11,7 @@
   <Binding channel="1" ctl="114" function="transport-stop"/>
   <Binding channel="1" ctl="115" function="transport-roll"/>
   <Binding channel="1" ctl="116" function="loop-toggle"/>
-  <Binding channel="1" ctl="117" function="rec-enable"/>
-  <Binding channel="1" ctl="117" function="rec-disable"/>
+  <Binding channel="1" ctl="117" function="toggle-rec-enable"/>
 
 <!-- Gain controls. Faders are mapped to faders. -->
 
index db783eba96705ec5400963c2f13eef65e61a0223..40aa03a4869d27dc7882ac2ed9b3b2d94d36df20 100644 (file)
        <Binding channel="1" note="86" function="transport-start"/>     <!-- FF -->
        <Binding channel="1" note="87" function="transport-end"/>               <!-- STOP -->
        <Binding channel="1" note="88" function="transport-roll"/>      <!-- PLAY -->
-       <Binding channel="1" note="89" function="rec-enable"/>          <!-- REC -->
+       <Binding channel="1" note="89" function="toggle-rec-enable"/>           <!-- REC -->
 
 </ArdourMIDIBindings>
 
index b1b8afc35ec0c291693358cf8950e6c5fc1afdd8..549276b42645831cbd328cabd5640d053caa821f 100644 (file)
@@ -6,8 +6,7 @@
   <Binding channel="1" ctl="22" function="transport-end"/>
   <Binding channel="1" ctl="23" function="transport-stop"/>
   <Binding channel="1" ctl="24" function="transport-roll"/>
-  <Binding channel="1" ctl="25" function="rec-enable"/>
-  <Binding channel="1" ctl="25" function="rec-disable"/>
+  <Binding channel="1" ctl="25" function="toggle-rec-enable"/>
 
   <Binding channel="1" ctl="91" uri="/route/gain B1"/>
   <Binding channel="1" ctl="93" uri="/route/gain B2"/>
index 61b3fd0fc9c2581c6774043647b7ad68b5dfe06e..8c0c3b866e68a4874155414a1d3c5c144ac4b213 100644 (file)
@@ -43,7 +43,7 @@
 <!-- one -->
 <Binding channel="1" note="40" action="Editor/track-record-enable-toggle"/>
 <!-- Two -->
-<Binding channel="1" note="41" function="rec-enable"/>
+<Binding channel="1" note="41" function="toggle-rec-enable"/>