summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2014-07-03 12:25:35 -0500
committerBen Loftis <ben@harrisonconsoles.com>2014-07-03 12:56:33 -0500
commit043b76569d2420edda4e8a6781b530a281f3be7a (patch)
tree5337234d9ce0a595316c018618bdc82f9b92f957
parent53a5f5d8ca8da56c8e72b01eceadc47a9eb1783a (diff)
fix the naming and behavior of always-play-range to match the button, which is follow-edits. when you select a range, the playhead should jump to the start of the range and begin to play the selection. BUT (unlike previous implementation) if the user wants to relocate the playhead, then that should be allowed. The user should always remain in charge of the playhead location. NOTE: your previous config setting will be invalidated. You must re-save a session to overwrite with the new config variable
-rw-r--r--gtk2_ardour/ardour_ui.cc8
-rw-r--r--gtk2_ardour/ardour_ui.h2
-rw-r--r--gtk2_ardour/ardour_ui2.cc4
-rw-r--r--gtk2_ardour/ardour_ui_ed.cc2
-rw-r--r--gtk2_ardour/ardour_ui_options.cc2
-rw-r--r--gtk2_ardour/editor_drag.cc2
-rw-r--r--gtk2_ardour/editor_mouse.cc2
-rw-r--r--gtk2_ardour/editor_ops.cc4
-rw-r--r--gtk2_ardour/editor_selection.cc2
-rw-r--r--libs/ardour/ardour/rc_configuration_vars.h2
-rw-r--r--libs/ardour/ardour/session.h1
-rw-r--r--libs/ardour/session_transport.cc7
12 files changed, 23 insertions, 15 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index cde9d0d9ee..a11c4d556c 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -1909,7 +1909,7 @@ ARDOUR_UI::transport_roll ()
}
}
- } else if (_session->get_play_range () && !Config->get_always_play_range()) {
+ } else if (_session->get_play_range () ) {
/* stop playing a range if we currently are */
_session->request_play_range (0, true);
}
@@ -1976,10 +1976,10 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode)
if (rolling) {
_session->request_stop (with_abort, true);
} else {
- if ( Config->get_always_play_range() ) {
+ if ( Config->get_follow_edits() && ( editor->get_selection().time.front().start == _session->transport_frame() ) ) { //if playhead is exactly at the start of a range, we can assume it was placed there by follow_edits
_session->request_play_range (&editor->get_selection().time, true);
+ _session->set_requested_return_frame( editor->get_selection().time.front().start ); //force an auto-return here
}
-
_session->request_transport_speed (1.0f);
}
}
@@ -2153,7 +2153,7 @@ ARDOUR_UI::map_transport_state ()
auto_loop_button.set_active (false);
}
- if (Config->get_always_play_range()) {
+ if (Config->get_follow_edits()) {
/* light up both roll and play-selection if they are joined */
roll_button.set_active (true);
play_selection_button.set_active (true);
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 1c637a436d..701be1dfc2 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -424,7 +424,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
boost::shared_ptr<TransportControllable> play_selection_controllable;
boost::shared_ptr<TransportControllable> rec_controllable;
- void toggle_always_play_range ();
+ void toggle_follow_edits ();
void set_transport_controllable_state (const XMLNode&);
XMLNode& get_transport_controllable_state ();
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index f78d096000..53efcbb48b 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -657,7 +657,7 @@ ARDOUR_UI::click_button_clicked (GdkEventButton* ev)
}
void
-ARDOUR_UI::toggle_always_play_range ()
+ARDOUR_UI::toggle_follow_edits ()
{
RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
assert (act);
@@ -665,7 +665,7 @@ ARDOUR_UI::toggle_always_play_range ()
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
assert (tact);
- Config->set_always_play_range (tact->get_active ());
+ Config->set_follow_edits (tact->get_active ());
}
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc
index 6c69f42793..2c3e7fc569 100644
--- a/gtk2_ardour/ardour_ui_ed.cc
+++ b/gtk2_ardour/ardour_ui_ed.cc
@@ -344,7 +344,7 @@ ARDOUR_UI::install_actions ()
act = ActionManager::register_toggle_action (transport_actions, X_("ToggleAutoReturn"), _("Auto Return"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_auto_return));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
- act = ActionManager::register_toggle_action (transport_actions, X_("ToggleFollowEdits"), _("Follow Edits"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_always_play_range));
+ act = ActionManager::register_toggle_action (transport_actions, X_("ToggleFollowEdits"), _("Follow Edits"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_follow_edits));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc
index 365810df75..79f44a5116 100644
--- a/gtk2_ardour/ardour_ui_options.cc
+++ b/gtk2_ardour/ardour_ui_options.cc
@@ -328,7 +328,7 @@ ARDOUR_UI::parameter_changed (std::string p)
} else if (p == "always-play-range") {
- ActionManager::map_some_state ("Transport", "ToggleFollowEdits", &RCConfiguration::get_always_play_range);
+ ActionManager::map_some_state ("Transport", "ToggleFollowEdits", &RCConfiguration::get_follow_edits);
} else if (p == "send-mtc") {
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 6fec1f77f7..0cc6ad45f9 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -4349,7 +4349,7 @@ SelectionDrag::finished (GdkEvent* event, bool movement_occurred)
if ( s->get_play_range() && s->transport_rolling() ) {
s->request_play_range (&_editor->selection->time, true);
} else {
- if (Config->get_always_play_range() && !s->transport_rolling()) {
+ if (Config->get_follow_edits() && !s->transport_rolling()) {
s->request_locate (_editor->get_selection().time.start());
}
}
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 75c4fb57cf..62cf89e35c 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -1293,7 +1293,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
}
//not rolling, range mode click + join_play_range : locate the PH here
- if ( !_drags->active () && !_session->transport_rolling() && ( effective_mouse_mode() == MouseRange ) && Config->get_always_play_range() ) {
+ if ( !_drags->active () && !_session->transport_rolling() && ( effective_mouse_mode() == MouseRange ) && Config->get_follow_edits() ) {
framepos_t where = canvas_event_sample (event);
snap_to(where);
_session->request_locate (where, false);
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index b7a246d589..3c89ddc448 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -2213,7 +2213,7 @@ Editor::get_preroll ()
void
Editor::maybe_locate_with_edit_preroll ( framepos_t location )
{
- if ( _session->transport_rolling() || !Config->get_always_play_range() )
+ if ( _session->transport_rolling() || !Config->get_follow_edits() )
return;
location -= get_preroll();
@@ -5535,7 +5535,7 @@ Editor::set_playhead_cursor ()
}
}
- if ( Config->get_always_play_range() )
+ if ( Config->get_follow_edits() )
cancel_time_selection();
}
diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc
index 203df9f322..229d658a5a 100644
--- a/gtk2_ardour/editor_selection.cc
+++ b/gtk2_ardour/editor_selection.cc
@@ -1014,7 +1014,7 @@ Editor::time_selection_changed ()
ActionManager::set_sensitive (ActionManager::time_selection_sensitive_actions, true);
}
- if (_session && Config->get_always_play_range() && !_session->transport_rolling() && !selection->time.empty()) {
+ if (_session && Config->get_follow_edits() && !_session->transport_rolling() && !selection->time.empty()) {
_session->request_locate (selection->time.start());
}
}
diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h
index c0c76d3826..85c5a35ab5 100644
--- a/libs/ardour/ardour/rc_configuration_vars.h
+++ b/libs/ardour/ardour/rc_configuration_vars.h
@@ -148,7 +148,7 @@ CONFIG_VARIABLE (bool, secondary_clock_delta_edit_cursor, "secondary-clock-delta
CONFIG_VARIABLE (bool, show_track_meters, "show-track-meters", true)
CONFIG_VARIABLE (bool, locate_while_waiting_for_sync, "locate-while-waiting-for-sync", false)
CONFIG_VARIABLE (bool, disable_disarm_during_roll, "disable-disarm-during-roll", false)
-CONFIG_VARIABLE (bool, always_play_range, "always-play-range", false)
+CONFIG_VARIABLE (bool, follow_edits, "follow-edits", false)
CONFIG_VARIABLE (bool, super_rapid_clock_update, "super-rapid-clock-update", false)
/* metering */
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index de2dc6189e..f9affaa78d 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -502,6 +502,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
framepos_t transport_frame () const {return _transport_frame; }
framepos_t audible_frame () const;
framepos_t requested_return_frame() const { return _requested_return_frame; }
+ void set_requested_return_frame(framepos_t return_to);
enum PullupFormat {
pullup_Plus4Plus1,
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 19f86eb2b3..2cd8de49bf 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -1635,6 +1635,13 @@ Session::request_bounded_roll (framepos_t start, framepos_t end)
lar.push_back (ar);
request_play_range (&lar, true);
}
+
+void
+Session::set_requested_return_frame (framepos_t return_to)
+{
+ _requested_return_frame = return_to;
+}
+
void
Session::request_roll_at_and_return (framepos_t start, framepos_t return_to)
{