nframes_t convert_to_frames_at (nframes_t position, AnyTime const &);
- static PBD::Signal0<void> StartTimeChanged;
- static PBD::Signal0<void> EndTimeChanged;
+ static PBD::Signal1<void, framepos_t> StartTimeChanged;
+ static PBD::Signal1<void, framepos_t> EndTimeChanged;
static PBD::Signal0<void> TimecodeOffsetChanged;
std::vector<SyncSource> get_available_sync_options() const;
mutable gint _suspend_timecode_transmission;
void update_locations_after_tempo_map_change (Locations::LocationList &);
+
+ void start_time_changed (framepos_t);
+ void end_time_changed (framepos_t);
};
} // namespace ARDOUR
}
if (s != _start) {
+
+ framepos_t const old = _start;
+
_start = s;
if (allow_bbt_recompute) {
recompute_bbt_from_frames ();
}
start_changed (this); /* EMIT SIGNAL */
if (is_session_range ()) {
- Session::StartTimeChanged (); /* EMIT SIGNAL */
+ Session::StartTimeChanged (old); /* EMIT SIGNAL */
AudioFileSource::set_header_position_offset (s);
}
}
}
if (e != _end) {
+ framepos_t const old = _end;
+
_end = e;
if (allow_bbt_recompute) {
recompute_bbt_from_frames ();
end_changed(this); /* EMIT SIGNAL */
if (is_session_range()) {
- Session::EndTimeChanged (); /* EMIT SIGNAL */
+ Session::EndTimeChanged (old); /* EMIT SIGNAL */
}
}
if (make_current) {
current_changed (current_location); /* EMIT SIGNAL */
}
+
+ if (loc->is_session_range()) {
+ Session::StartTimeChanged (0);
+ Session::EndTimeChanged (1);
+ }
}
void
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;
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;
}
}
+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);
+ }
+}