mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 00:56:33 +01:00
Tweak behavior of Play-With-Preroll action
This commit is contained in:
parent
628c99d555
commit
3e214eb4ea
2 changed files with 16 additions and 7 deletions
|
|
@ -391,7 +391,7 @@ ARDOUR_UI::install_actions ()
|
||||||
act = global_actions.register_action (transport_actions, X_("PlaySelection"), _("Play Selection"), sigc::mem_fun(*this, &ARDOUR_UI::transport_play_selection));
|
act = global_actions.register_action (transport_actions, X_("PlaySelection"), _("Play Selection"), sigc::mem_fun(*this, &ARDOUR_UI::transport_play_selection));
|
||||||
ActionManager::session_sensitive_actions.push_back (act);
|
ActionManager::session_sensitive_actions.push_back (act);
|
||||||
ActionManager::transport_sensitive_actions.push_back (act);
|
ActionManager::transport_sensitive_actions.push_back (act);
|
||||||
act = global_actions.register_action (transport_actions, X_("PlayPreroll"), _("Play Selection w/Preroll"), sigc::mem_fun(*this, &ARDOUR_UI::transport_play_preroll));
|
act = global_actions.register_action (transport_actions, X_("PlayPreroll"), _("Play w/Preroll"), sigc::mem_fun(*this, &ARDOUR_UI::transport_play_preroll));
|
||||||
ActionManager::session_sensitive_actions.push_back (act);
|
ActionManager::session_sensitive_actions.push_back (act);
|
||||||
ActionManager::transport_sensitive_actions.push_back (act);
|
ActionManager::transport_sensitive_actions.push_back (act);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2626,12 +2626,11 @@ Editor::maybe_locate_with_edit_preroll ( framepos_t location )
|
||||||
void
|
void
|
||||||
Editor::play_with_preroll ()
|
Editor::play_with_preroll ()
|
||||||
{
|
{
|
||||||
{
|
framepos_t preroll = get_preroll();
|
||||||
framepos_t preroll = get_preroll();
|
framepos_t start, end;
|
||||||
|
if ( UIConfiguration::instance().get_follow_edits() && get_selection_extents ( start, end) ) {
|
||||||
|
|
||||||
framepos_t start, end;
|
framepos_t ret = start;
|
||||||
if (!get_selection_extents ( start, end))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (start > preroll)
|
if (start > preroll)
|
||||||
start = start - preroll;
|
start = start - preroll;
|
||||||
|
|
@ -2643,6 +2642,16 @@ Editor::play_with_preroll ()
|
||||||
lar.push_back (ar);
|
lar.push_back (ar);
|
||||||
|
|
||||||
_session->request_play_range (&lar, true);
|
_session->request_play_range (&lar, true);
|
||||||
|
_session->set_requested_return_frame( ret ); //force auto-return to return to range start, without the preroll
|
||||||
|
} else {
|
||||||
|
framepos_t ph = playhead_cursor->current_frame ();
|
||||||
|
framepos_t start;
|
||||||
|
if (ph > preroll)
|
||||||
|
start = ph - preroll;
|
||||||
|
else
|
||||||
|
start = 0;
|
||||||
|
_session->request_locate ( start, true);
|
||||||
|
_session->set_requested_return_frame( ph ); //force auto-return to return to playhead location, without the preroll
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue