summaryrefslogtreecommitdiff
path: root/libs/ardour/session.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r--libs/ardour/session.cc37
1 files changed, 35 insertions, 2 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 8a3eb6a6c6..54fb4c20bd 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -119,8 +119,8 @@ PBD::Signal2<int,nframes_t,nframes_t> Session::AskAboutSampleRateMismatch;
PBD::Signal0<void> Session::SendFeedback;
PBD::Signal0<void> Session::TimecodeOffsetChanged;
-PBD::Signal0<void> Session::StartTimeChanged;
-PBD::Signal0<void> Session::EndTimeChanged;
+PBD::Signal1<void, framepos_t> Session::StartTimeChanged;
+PBD::Signal1<void, framepos_t> Session::EndTimeChanged;
PBD::Signal0<void> Session::AutoBindingOn;
PBD::Signal0<void> Session::AutoBindingOff;
PBD::Signal2<void,std::string, std::string> Session::Exported;
@@ -203,6 +203,9 @@ Session::Session (AudioEngine &eng,
DirtyChanged (); /* EMIT SIGNAL */
}
+ StartTimeChanged.connect_same_thread (*this, boost::bind (&Session::start_time_changed, this, _1));
+ EndTimeChanged.connect_same_thread (*this, boost::bind (&Session::end_time_changed, this, _1));
+
_is_new = false;
}
@@ -4028,3 +4031,33 @@ Session::step_edit_status_change (bool yn)
}
+void
+Session::start_time_changed (framepos_t old)
+{
+ /* Update the auto loop range to match the session range
+ (unless the auto loop range has been changed by the user)
+ */
+
+ Location* s = _locations->session_range_location ();
+ Location* l = _locations->auto_loop_location ();
+
+ if (l->start() == old) {
+ l->set_start (s->start(), true);
+ }
+}
+
+void
+Session::end_time_changed (framepos_t old)
+{
+ /* Update the auto loop range to match the session range
+ (unless the auto loop range has been changed by the user)
+ */
+
+ Location* s = _locations->session_range_location ();
+ Location* l = _locations->auto_loop_location ();
+
+ if (l->end() == old) {
+ cout << "set end to " << s->end() << "\n";
+ l->set_end (s->end(), true);
+ }
+}