13
0

playlist IS-A TimeDomainProvider

It has Session as its initial time domain parent
This commit is contained in:
Paul Davis 2023-07-21 09:57:38 -06:00
parent e9585ad530
commit c293876518
2 changed files with 13 additions and 16 deletions

View File

@ -88,7 +88,7 @@ private:
Playlist& _playlist;
};
class LIBARDOUR_API Playlist : public SessionObject, public std::enable_shared_from_this<Playlist>
class LIBARDOUR_API Playlist : public SessionObject, public Temporal::TimeDomainProvider, public std::enable_shared_from_this<Playlist>
{
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:

View File

@ -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<const Playlist> 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<const Playlist> other, string namestr, bool
Playlist::Playlist (std::shared_ptr<const Playlist> 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 ();
}