diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index a54454a112..4e1e5cc536 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -88,7 +88,7 @@ private: Playlist& _playlist; }; -class LIBARDOUR_API Playlist : public SessionObject, public std::enable_shared_from_this +class LIBARDOUR_API Playlist : public SessionObject, public Temporal::TimeDomainProvider, public std::enable_shared_from_this { public: static void make_property_quarks (); @@ -113,8 +113,6 @@ public: bool set_name (const std::string& str); void set_region_ownership (); - Temporal::TimeDomain time_domain() const; - /*playlist group IDs (pgroup_id) is a group identifier that is implicitly * or explicitly assigned to playlists so they can be associated with each other. * @@ -302,6 +300,7 @@ public: void set_capture_insertion_in_progress (bool yn); + void time_domain_changed (); void globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to); protected: diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 938b8bd984..b251f1c5a5 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -143,6 +143,7 @@ RegionListProperty::get_content_from_xml (XMLNode const& node) const Playlist::Playlist (Session& sess, string nom, DataType type, bool hide) : SessionObject (sess, nom) + , Temporal::TimeDomainProvider ((type == DataType::AUDIO ? Temporal::AudioTime : Temporal::BeatTime), sess) , regions (*this) , _type (type) { @@ -154,6 +155,7 @@ Playlist::Playlist (Session& sess, string nom, DataType type, bool hide) Playlist::Playlist (Session& sess, const XMLNode& node, DataType type, bool hide) : SessionObject (sess, "unnamed playlist") + , Temporal::TimeDomainProvider ((type == DataType::AUDIO ? Temporal::AudioTime : Temporal::BeatTime), sess) , regions (*this) , _type (type) { @@ -171,6 +173,7 @@ Playlist::Playlist (Session& sess, const XMLNode& node, DataType type, bool hide Playlist::Playlist (std::shared_ptr other, string namestr, bool hide) : SessionObject (other->_session, namestr) + , Temporal::TimeDomainProvider ((other->_type == DataType::AUDIO ? Temporal::AudioTime : Temporal::BeatTime), other->_session) , regions (*this) , _type (other->_type) , _orig_track_id (other->_orig_track_id) @@ -204,6 +207,7 @@ Playlist::Playlist (std::shared_ptr other, string namestr, bool Playlist::Playlist (std::shared_ptr other, timepos_t const & start, timepos_t const & cnt, string str, bool hide) : SessionObject(other->_session, str) + , Temporal::TimeDomainProvider ((other->_type == DataType::AUDIO ? Temporal::AudioTime : Temporal::BeatTime), other->_session) , regions (*this) , _type (other->_type) , _orig_track_id (other->_orig_track_id) @@ -3500,19 +3504,6 @@ Playlist::rdiff_and_add_command (Session* session) session->add_command (new StatefulDiffCommand (shared_from_this ())); } -Temporal::TimeDomain -Playlist::time_domain() const -{ - switch (_type) { - case DataType::AUDIO: - return Temporal::AudioTime; - default: - break; - } - - return Temporal::BeatTime; -} - void Playlist::globally_change_time_domain (Temporal::TimeDomain from, Temporal::TimeDomain to) { @@ -3521,3 +3512,10 @@ Playlist::globally_change_time_domain (Temporal::TimeDomain from, Temporal::Time region->globally_change_time_domain (from, to); } } + +void +Playlist::time_domain_changed () +{ + TimeDomainProvider::time_domain_changed (); +} +