diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-09-17 12:28:36 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-09-17 12:28:36 -0400 |
commit | e9ab53402c9263b21303388bc203b50b50876455 (patch) | |
tree | de3ee9b74f078bda2e14561f04d9c38be4dacbb3 /gtk2_ardour/editor_actions.cc | |
parent | cfc658de0412555980bf6c8b9624f5d9c806ae04 (diff) |
add action and menu item to control use of skip playback
Diffstat (limited to 'gtk2_ardour/editor_actions.cc')
-rw-r--r-- | gtk2_ardour/editor_actions.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 01777f46a6..b598d606c5 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -295,6 +295,8 @@ Editor::register_actions () reg_sens (editor_actions, "playhead-to-edit", _("Playhead to Active Mark"), sigc::bind (sigc::mem_fun(*this, &Editor::cursor_align), true)); reg_sens (editor_actions, "edit-to-playhead", _("Active Mark to Playhead"), sigc::bind (sigc::mem_fun(*this, &Editor::cursor_align), false)); + toggle_reg_sens (editor_actions, "toggle-skip-playback", _("Use Skip Ranges"), sigc::mem_fun(*this, &Editor::toggle_skip_playback)); + reg_sens (editor_actions, "set-loop-from-edit-range", _("Set Loop from Edit Range"), sigc::bind (sigc::mem_fun(*this, &Editor::set_loop_from_edit_range), false)); reg_sens (editor_actions, "set-punch-from-edit-range", _("Set Punch from Edit Range"), sigc::mem_fun(*this, &Editor::set_punch_from_edit_range)); @@ -746,6 +748,20 @@ Editor::load_bindings () } void +Editor::toggle_skip_playback () +{ + Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), "toggle-skip-playback"); + + if (act) { + Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act); + bool s = Config->get_skip_playback (); + if (tact->get_active() != s) { + Config->set_skip_playback (tact->get_active()); + } + } +} + +void Editor::toggle_ruler_visibility (RulerType rt) { const char* action = 0; @@ -1721,6 +1737,16 @@ Editor::parameter_changed (std::string p) } else { Gtkmm2ext::disable_tooltips (); } + } else if (p == "skip-playback") { + Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-skip-playback")); + + if (act) { + bool s = Config->get_skip_playback (); + Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act); + if (tact->get_active () != s) { + tact->set_active (s); + } + } } } |