use session stripable selection API
[ardour.git] / libs / surfaces / generic_midi / midifunction.cc
index e2fb3176057aad48936ba522c9e7580dcb25633b..4d2b19fdfd9d563194fe6ddd52d010af110d2eaf 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");
@@ -160,7 +167,7 @@ MIDIFunction::execute ()
                if (!_argument.empty()) {
                        uint32_t rid;
                        sscanf (_argument.c_str(), "%d", &rid);
-                       _ui->SetRouteSelection (rid);
+                       _ui->toggle_selection (rid, ARDOUR::PresentationInfo::Flag (ARDOUR::PresentationInfo::Route|ARDOUR::PresentationInfo::VCA));
                        DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("Function: SetRouteSelection = %1\n", rid));
                }
                break;