summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2020-04-16 12:07:53 -0600
committerPaul Davis <paul@linuxaudiosystems.com>2020-04-16 17:48:12 -0600
commit0bea4f2374f4ef284091c23f329312ae66aa667b (patch)
tree0d7d81cc435a8bf01cbe180cb80f02e06189874e
parentba424352a288b84b432980b32cdc07b60a89bc67 (diff)
fix up action names for MIDI editing
-rw-r--r--gtk2_ardour/editor_actions.cc77
1 files changed, 77 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc
index 35837ca64a..6a43c42c17 100644
--- a/gtk2_ardour/editor_actions.cc
+++ b/gtk2_ardour/editor_actions.cc
@@ -59,6 +59,7 @@
#include "editor_group_tabs.h"
#include "editor_routes.h"
#include "editor_regions.h"
+#include "midi_region_view.h"
using namespace Gtk;
using namespace Glib;
@@ -700,7 +701,71 @@ Editor::register_actions ()
/* MIDI stuff */
reg_sens (editor_actions, "quantize", _("Quantize"), sigc::mem_fun (*this, &Editor::quantize_region));
+}
+void
+Editor::register_midi_actions (Bindings* midi_bindings)
+{
+ _midi_actions = ActionManager::create_action_group (midi_bindings, X_("Notes"));
+
+ /* two versions to allow same action for Delete and Backspace */
+
+ ActionManager::register_action (_midi_actions, X_("delete"), _("Delete Selection"), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::delete_selection));
+ ActionManager::register_action (_midi_actions, X_("alt-delete"), _("Delete Selection"), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::delete_selection));
+
+ ActionManager::register_action (_midi_actions, X_("clear-selection"), _("Clear Note Selection"), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::clear_note_selection));
+ ActionManager::register_action (_midi_actions, X_("move-starts-earlier-fine"), _("Move Note Start Earlier (fine)"), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::move_note_starts_earlier_fine));
+ ActionManager::register_action (_midi_actions, X_("move-starts-earlier"), _("Move Note Start Earlier"), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::move_note_starts_earlier));
+ ActionManager::register_action (_midi_actions, X_("move-ends-later-fine"), _("Move Note Ends Later (fine)"), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::move_note_ends_later_fine));
+ ActionManager::register_action (_midi_actions, X_("move-ends-later"), _("Move Note Ends Later"), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::move_note_ends_later));
+
+ /* Alt versions allow bindings for both Tab and ISO_Left_Tab, if desired */
+
+ ActionManager::register_action (_midi_actions, X_("select-next"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::select_next_note));
+ ActionManager::register_action (_midi_actions, X_("alt-select-next"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::select_next_note));
+ ActionManager::register_action (_midi_actions, X_("select-previous"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::select_previous_note));
+ ActionManager::register_action (_midi_actions, X_("alt-select-previous"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::select_previous_note));
+ ActionManager::register_action (_midi_actions, X_("add-select-next"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::add_select_next_note));
+ ActionManager::register_action (_midi_actions, X_("alt-add-select-next"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::add_select_next_note));
+ ActionManager::register_action (_midi_actions, X_("add-select-previous"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::add_select_previous_note));
+ ActionManager::register_action (_midi_actions, X_("alt-select-previous"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::add_select_previous_note));
+
+ ActionManager::register_action (_midi_actions, X_("increase-velocity"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::increase_note_velocity));
+ ActionManager::register_action (_midi_actions, X_("increase-velocity-fine"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::increase_note_velocity_fine));
+ ActionManager::register_action (_midi_actions, X_("increase-_velocity-smush"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::increase_note_velocity_smush));
+ ActionManager::register_action (_midi_actions, X_("increase-_velocity-together"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::increase_note_velocity_together));
+ ActionManager::register_action (_midi_actions, X_("increase-_velocity-fine-smush"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::increase_note_velocity_fine_smush));
+ ActionManager::register_action (_midi_actions, X_("increase-_velocity-fine-together"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::increase_note_velocity_fine_together));
+ ActionManager::register_action (_midi_actions, X_("increase-_velocity-smush-together"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::increase_note_velocity_smush_together));
+ ActionManager::register_action (_midi_actions, X_("increase-_velocity-fine-smush-together"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::increase_note_velocity_fine_smush_together));
+ ActionManager::register_action (_midi_actions, X_("decrease-velocity"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::decrease_note_velocity));
+ ActionManager::register_action (_midi_actions, X_("decrease-velocity-fine"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::decrease_note_velocity_fine));
+ ActionManager::register_action (_midi_actions, X_("decrease-velocity-smush"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::decrease_note_velocity_smush));
+ ActionManager::register_action (_midi_actions, X_("decrease-velocity-together"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::decrease_note_velocity_together));
+ ActionManager::register_action (_midi_actions, X_("decrease-velocity-fine-smush"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::decrease_note_velocity_fine_smush));
+ ActionManager::register_action (_midi_actions, X_("decrease-velocity-fine-together"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::decrease_note_velocity_fine_together));
+ ActionManager::register_action (_midi_actions, X_("decrease-velocity-smush-together"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::decrease_note_velocity_smush_together));
+ ActionManager::register_action (_midi_actions, X_("decrease-velocity_fine-smush-together"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::decrease_note_velocity_fine_smush_together));
+
+ ActionManager::register_action (_midi_actions, X_("transpose-up-octave"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::transpose_up_octave));
+ ActionManager::register_action (_midi_actions, X_("transpose-up-octave-allow-collapse"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::transpose_up_octave_smush));
+ ActionManager::register_action (_midi_actions, X_("transpose-up-tone"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::transpose_up_tone));
+ ActionManager::register_action (_midi_actions, X_("transpose-up-octave-allow-collapse"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::transpose_up_octave_smush));
+
+ ActionManager::register_action (_midi_actions, X_("transpose-down-octave"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::transpose_down_octave));
+ ActionManager::register_action (_midi_actions, X_("transpose-down-octave-allow-collapse"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::transpose_down_octave_smush));
+ ActionManager::register_action (_midi_actions, X_("transpose-down-tone"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::transpose_down_tone));
+ ActionManager::register_action (_midi_actions, X_("transpose-down-octave-allow-collapse"), _(""), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::transpose_down_octave_smush));
+
+ ActionManager::register_action (_midi_actions, X_("nudge-notes-later"), _("Nudge Notes Later"), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::nudge_notes_later));
+ ActionManager::register_action (_midi_actions, X_("nudge-notes-later-fine"), _("Nudge Notes Later (fine)"), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::nudge_notes_later_fine));
+ ActionManager::register_action (_midi_actions, X_("nudge-notes-earlier"), _("Nudge Notes Earlier"), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::nudge_notes_earlier));
+ ActionManager::register_action (_midi_actions, X_("nudge-notes-earlier-fine"), _("Nudge Notes Earlier (fine)"), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::nudge_notes_earlier_fine));
+
+ ActionManager::register_action (_midi_actions, X_("edit-note-channels"), _("Edit Note Channels"), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::channel_edit));
+ ActionManager::register_action (_midi_actions, X_("edit-note-velocities"), _("Edit Note Velocities"), sigc::bind (sigc::mem_fun (*this, &Editor::midi_action), &MidiRegionView::velocity_edit));
+
+ ActionManager::set_sensitive (_midi_actions, false);
}
static void _lua_print (std::string s) {
@@ -762,6 +827,18 @@ Editor::load_bindings ()
{
bindings = Bindings::get_bindings (X_("Editor"));
global_hpacker.set_data ("ardour-bindings", bindings);
+
+ /* This set of bindings may expand in the future to include things
+ * other than MIDI editing, but for now this is all we've got as far as
+ * bindings that need to be distinct from the Editors (because some of
+ * the keys may overlap.
+ */
+
+ Bindings* midi_bindings = Bindings::get_bindings (X_("MIDI"));
+
+ register_midi_actions (midi_bindings);
+
+ _track_canvas_viewport->canvas()->set_data ("ardour-bindings", midi_bindings);
}
void