13
0

add action and menu item to control use of skip playback

This commit is contained in:
Paul Davis 2014-09-17 12:28:36 -04:00
parent cfc658de04
commit e9ab53402c
3 changed files with 28 additions and 0 deletions

View File

@ -62,6 +62,7 @@
<menuitem action='Record'/>
<menuitem action='ToggleRollMaybe'/>
<menuitem action='ToggleRollForgetCapture'/>
<menuitem action='toggle-skip-playback'/>
<menu action="SetLoopMenu">
<menuitem action='set-loop-from-edit-range'/>
<menuitem action='set-loop-from-region'/>

View File

@ -1310,6 +1310,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void jump_forward_to_mark ();
void jump_backward_to_mark ();
void cursor_align (bool playhead_to_edit);
void toggle_skip_playback ();
void remove_last_capture ();
void select_all_selectables_using_time_selection ();

View File

@ -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));
@ -745,6 +747,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)
{
@ -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);
}
}
}
}