X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fsurfaces%2Fgeneric_midi%2Fmidifunction.cc;h=70e9337861e5d4b0601cbd1a14794e920eeeb570;hb=0786ff15a005f6b56a93a5a9a3b486dde4cae725;hp=3d407b4c76c4345bf8680c172cea428b64ebd95f;hpb=77c09fc8248160ab60e2e229710d07934fe08894;p=ardour.git diff --git a/libs/surfaces/generic_midi/midifunction.cc b/libs/surfaces/generic_midi/midifunction.cc index 3d407b4c76..70e9337861 100644 --- a/libs/surfaces/generic_midi/midifunction.cc +++ b/libs/surfaces/generic_midi/midifunction.cc @@ -35,10 +35,12 @@ MIDIFunction::~MIDIFunction () } int -MIDIFunction::init (GenericMidiControlProtocol& ui, const std::string& invokable_name, MIDI::byte* msg_data, size_t data_sz) +MIDIFunction::setup (GenericMidiControlProtocol& ui, const std::string& invokable_name, const std::string& arg, MIDI::byte* msg_data, size_t data_sz) { MIDIInvokable::init (ui, invokable_name, msg_data, data_sz); + _argument = arg; + if (strcasecmp (_invokable_name.c_str(), "transport-stop") == 0) { _function = TransportStop; } else if (strcasecmp (_invokable_name.c_str(), "transport-roll") == 0) { @@ -59,6 +61,26 @@ MIDIFunction::init (GenericMidiControlProtocol& ui, const std::string& invokable _function = NextBank; } else if (strcasecmp (_invokable_name.c_str(), "prev-bank") == 0) { _function = PrevBank; + } else if (strcasecmp (_invokable_name.c_str(), "set-bank") == 0) { + if (_argument.empty()) { + return -1; + } + _function = SetBank; + } else if (strcasecmp (_invokable_name.c_str(), "select") == 0) { + if (_argument.empty()) { + return -1; + } + _function = Select; + } else if (strcasecmp (_invokable_name.c_str(), "track-set-solo") == 0) { + if (_argument.empty()) { + return -1; + } + _function = TrackSetSolo; + } else if (strcasecmp (_invokable_name.c_str(), "track-set-mute") == 0) { + if (_argument.empty()) { + return -1; + } + _function = TrackSetMute; } else { return -1; } @@ -78,6 +100,14 @@ MIDIFunction::execute () _ui->prev_bank(); break; + case SetBank: + if (!_argument.empty()) { + uint32_t bank; + sscanf (_argument.c_str(), "%d", &bank); + _ui->set_current_bank (bank); + } + break; + case TransportStop: _ui->transport_stop (); break; @@ -109,6 +139,26 @@ MIDIFunction::execute () case TransportRecordDisable: _ui->set_record_enable (false); break; + + case Select: + if (!_argument.empty()) { + uint32_t rid; + sscanf (_argument.c_str(), "%d", &rid); + _ui->SetRouteSelection (rid); + } + break; + case TrackSetMute: + break; + case TrackSetSolo: + break; + case TrackSetSoloIsolate: + break; + case TrackSetGain: + break; + case TrackSetRecordEnable: + break; + default: + break; } } @@ -120,7 +170,7 @@ MIDIFunction::get_state () } int -MIDIFunction::set_state (const XMLNode& node, int version) +MIDIFunction::set_state (const XMLNode& /*node*/, int /*version*/) { return 0; }