summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_actions.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-02-01 20:11:57 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-02-01 20:11:57 +0000
commit2d015c06104186af6711f6040a82448723971481 (patch)
tree07f334d17d543b924c7ae78bbdbb090ece8a8d5c /gtk2_ardour/editor_actions.cc
parente39e6196c69adb51cab9283aac08777edf4698de (diff)
MIDI event list editor improvements, mostly to do with nagivation, but also edits are now applied across all selected notes. getting close to calling this done for 3.0
git-svn-id: svn://localhost/ardour2/branches/3.0@11418 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_actions.cc')
-rw-r--r--gtk2_ardour/editor_actions.cc28
1 files changed, 27 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc
index 37dbf30ab7..d071377899 100644
--- a/gtk2_ardour/editor_actions.cc
+++ b/gtk2_ardour/editor_actions.cc
@@ -111,6 +111,7 @@ Editor::register_actions ()
ActionManager::register_action (editor_actions, X_("MarkerMenu"), _("Markers"));
ActionManager::register_action (editor_actions, X_("MeterFalloff"), _("Meter falloff"));
ActionManager::register_action (editor_actions, X_("MeterHold"), _("Meter hold"));
+ ActionManager::register_action (editor_actions, X_("MIDI"), _("MIDI Options"));
ActionManager::register_action (editor_actions, X_("MiscOptions"), _("Misc Options"));
ActionManager::register_action (editor_actions, X_("Monitoring"), _("Monitoring"));
ActionManager::register_action (editor_actions, X_("MoveActiveMarkMenu"), _("Active Mark"));
@@ -238,7 +239,6 @@ Editor::register_actions ()
reg_sens (editor_actions, "playhead-forward-to-grid", _("Forward to Grid"), sigc::mem_fun(*this, &Editor::playhead_forward_to_grid));
reg_sens (editor_actions, "playhead-backward-to-grid", _("Backward to Grid"), sigc::mem_fun(*this, &Editor::playhead_backward_to_grid));
-
reg_sens (editor_actions, "temporal-zoom-out", _("Zoom Out"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_step), true));
reg_sens (editor_actions, "temporal-zoom-in", _("Zoom In"), sigc::bind (sigc::mem_fun(*this, &Editor::temporal_zoom_step), false));
reg_sens (editor_actions, "zoom-to-session", _("Zoom to Session"), sigc::mem_fun(*this, &Editor::temporal_zoom_session));
@@ -390,6 +390,8 @@ Editor::register_actions ()
sigc::mem_fun(*this, &Editor::set_track_height), HeightSmall));
ActionManager::track_selection_sensitive_actions.push_back (act);
+ toggle_reg_sens (editor_actions, "sound-midi-notes", _("Sound Selected MIDI Notes"), sigc::mem_fun (*this, &Editor::toggle_sound_midi_notes));
+
Glib::RefPtr<ActionGroup> zoom_actions = ActionGroup::create (X_("Zoom"));
RadioAction::Group zoom_group;
@@ -1114,6 +1116,20 @@ Editor::zoom_focus_action (ZoomFocus focus)
}
void
+Editor::toggle_sound_midi_notes ()
+{
+ Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("sound-midi-notes"));
+
+ if (act) {
+ bool s = Config->get_sound_midi_notes();
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+ if (tact->get_active () != s) {
+ Config->set_sound_midi_notes (tact->get_active());
+ }
+ }
+}
+
+void
Editor::zoom_focus_chosen (ZoomFocus focus)
{
/* this is driven by a toggle on a radio group, and so is invoked twice,
@@ -1192,6 +1208,16 @@ Editor::parameter_changed (std::string p)
update_just_timecode ();
} else if (p == "show-zoom-tools") {
_zoom_tearoff->set_visible (Config->get_show_zoom_tools(), true);
+ } else if (p == "sound-midi-notes") {
+ Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("sound-midi-notes"));
+
+ if (act) {
+ bool s = Config->get_sound_midi_notes();
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+ if (tact->get_active () != s) {
+ tact->set_active (s);
+ }
+ }
}
}