diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index e482dc1e81..6be0875db4 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -500,6 +500,8 @@ public: int wipe (); + timepos_t current_end () const; + timepos_t current_start () const; samplepos_t current_end_sample () const; samplepos_t current_start_sample () const; /** "actual" sample rate of session, set by current audioengine rate, pullup/down etc. */ @@ -1139,8 +1141,8 @@ public: /* temporary hacks to allow selection to be pushed from GUI into backend. Whenever we move the selection object into libardour, these will go away. */ - void set_range_selection (samplepos_t start, samplepos_t end); - void set_object_selection (samplepos_t start, samplepos_t end); + void set_range_selection (Temporal::timepos_t const & start, Temporal::timepos_t const & end); + void set_object_selection (Temporal::timepos_t const & start, Temporal::timepos_t const & end); void clear_range_selection (); void clear_object_selection (); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index a79dbd66f1..91e18f9f70 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -6511,6 +6511,18 @@ Session::current_end_sample () const return _session_range_location ? _session_range_location->end().samples() : 0; } +timepos_t +Session::current_start () const +{ + return _session_range_location ? _session_range_location->start() : timepos_t::max (Temporal::AudioTime); +} + +timepos_t +Session::current_end () const +{ + return _session_range_location ? _session_range_location->end() : timepos_t::max (Temporal::AudioTime); +} + void Session::step_edit_status_change (bool yn) { @@ -7097,15 +7109,15 @@ Session::reconnect_ltc_output () } void -Session::set_range_selection (samplepos_t start, samplepos_t end) +Session::set_range_selection (timepos_t const & start, timepos_t const & end) { - _range_selection = Temporal::Range (timepos_t (start), timepos_t (end)); + _range_selection = Temporal::Range (start, end); } void -Session::set_object_selection (samplepos_t start, samplepos_t end) +Session::set_object_selection (timepos_t const & start, timepos_t const & end) { - _object_selection = Temporal::Range (timepos_t (start), timepos_t (end)); + _object_selection = Temporal::Range (start, end); } void