13
0

add transition_to_{roll,reverse}

git-svn-id: svn://localhost/ardour2/trunk@1376 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2007-01-23 22:29:45 +00:00
parent 3cfa32d6c2
commit e35621772e
6 changed files with 47 additions and 0 deletions

View File

@ -257,6 +257,8 @@
; (gtk_accel_path "<Actions>/Main/Snapshot" "")
; (gtk_accel_path "<Actions>/Transport/ToggleVideoSync" "")
(gtk_accel_path "<Actions>/Transport/ToggleRoll" "space")
(gtk_accel_path "<Actions>/Transport/TransitionToRoll" "<Ctrl>uparrow")
(gtk_accel_path "<Actions>/Transport/TransitionToReverse" "<Ctrl>downarrow")
; (gtk_accel_path "<Actions>/RegionList/SortBySourceFilesystem" "")
(gtk_accel_path "<Actions>/Common/ToggleColorManager" "<Alt>c")
; (gtk_accel_path "<Actions>/Common/About" "")

View File

@ -47,6 +47,9 @@
<separator/>
<menuitem action='Record'/>
<separator/>
<menuitem action='TransitionToRoll'/>
<menuitem action='TransitionToReverse'/>
<separator/>
<menuitem action='jump-forward-to-mark'/>
<menuitem action='jump-backward-to-mark'/>
<menuitem action='add-location-from-playhead'/>

View File

@ -233,6 +233,22 @@ ARDOUR_UI::install_actions ()
ActionManager::register_action (transport_actions, X_("ToggleRollForgetCapture"), _("Stop + Forget Capture"), bind (mem_fun(*editor, &PublicEditor::toggle_playback), true));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
/* these two behave as follows:
- if transport speed != 1.0 or != -1.0, change speed to 1.0 or -1.0 (respectively)
- otherwise do nothing
*/
ActionManager::register_action (transport_actions, X_("TransitionToRoll"), _("Transition To Roll"), bind (mem_fun (*editor, &PublicEditor::transition_to_rolling), true));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::register_action (transport_actions, X_("TransitionToReverse"), _("Transition To Reverse"), bind (mem_fun (*editor, &PublicEditor::transition_to_rolling), false));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("Loop"), _("Play Loop Range"), mem_fun(*this, &ARDOUR_UI::toggle_session_auto_loop));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);

View File

@ -171,6 +171,7 @@ class Editor : public PublicEditor
void separate_region_from_selection ();
void separate_regions_using_location (ARDOUR::Location&);
void toggle_playback (bool with_abort);
void transition_to_rolling (bool forward);
/* undo related */

View File

@ -1911,6 +1911,30 @@ Editor::edit_envelope ()
/* PLAYBACK */
void
Editor::transition_to_rolling (bool fwd)
{
if (!session) {
return;
}
switch (Config->get_slave_source()) {
case None:
case JACK:
break;
default:
/* transport controlled by the master */
return;
}
if (session->is_auditioning()) {
session->cancel_audition ();
return;
}
session->request_transport_speed (fwd ? 1.0f : -1.0f);
}
void
Editor::toggle_playback (bool with_abort)
{

View File

@ -86,6 +86,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
virtual void new_region_from_selection () = 0;
virtual void separate_region_from_selection () = 0;
virtual void toggle_playback (bool with_abort) = 0;
virtual void transition_to_rolling (bool fwd) = 0;
virtual nframes_t unit_to_frame (double unit) = 0;
virtual double frame_to_unit (nframes_t frame) = 0;
virtual double frame_to_unit (double frame) = 0;