Make exact beat calculation of tempi a bit less cumbersome. Move tempi on an audio...
[ardour.git] / libs / surfaces / generic_midi / midifunction.cc
index e2fb3176057aad48936ba522c9e7580dcb25633b..4b5faa7018667745748232f3b13eaf6c3a3df959 100644 (file)
@@ -1,6 +1,6 @@
 /*
     Copyright (C) 2009 Paul Davis
+
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
@@ -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");
@@ -158,9 +165,14 @@ MIDIFunction::execute ()
 
        case Select:
                if (!_argument.empty()) {
+                       /* this uses only the numerical orderpart of a
+                          PresentionInfo, because it only sets the lower 32
+                          bits of a 64 bit value. This will be interpreted
+                          as a request to select only Routes.
+                       */
                        uint32_t rid;
                        sscanf (_argument.c_str(), "%d", &rid);
-                       _ui->SetRouteSelection (rid);
+                       _ui->SetStripableSelection (rid);
                        DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("Function: SetRouteSelection = %1\n", rid));
                }
                break;