diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-11-13 02:19:04 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-11-13 02:19:04 +0000 |
commit | 3fa84d0caa2fb74471619cff2e44f5db3f0a12c6 (patch) | |
tree | 55159b5ad4afd54b86601ee7b922186a9517f54d /gtk2_ardour/editor_ops.cc | |
parent | cf55921aea8adec135535419febb8bbd0803f008 (diff) |
add alt-i as a binding in both the editor and mixer windows to toggle the state of MIDI input on the selected track(s); in the mixer this will also operate on the strip under the mouse. fixes #4838
git-svn-id: svn://localhost/ardour2/branches/3.0@13475 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 0aac921afd..ac402981a8 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -6828,3 +6828,26 @@ Editor::uncombine_regions () commit_reversible_command (); } +void +Editor::toggle_midi_input_active (bool flip_others) +{ + bool onoff; + boost::shared_ptr<RouteList> rl (new RouteList); + + for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) { + RouteTimeAxisView *rtav = dynamic_cast<RouteTimeAxisView *>(*i); + + if (!rtav) { + continue; + } + + boost::shared_ptr<MidiTrack> mt = rtav->midi_track(); + + if (mt) { + rl->push_back (rtav->route()); + onoff = !mt->input_active(); + } + } + + _session->set_exclusive_input_active (rl, onoff, flip_others); +} |