diff --git a/libs/ardour/ardour/slice.h b/libs/ardour/ardour/slice.h index 8c6163df0d..d5b05e41f4 100644 --- a/libs/ardour/ardour/slice.h +++ b/libs/ardour/ardour/slice.h @@ -18,7 +18,7 @@ namespace Properties { LIBARDOUR_API extern PBD::PropertyDescriptor length; } -class LIBARDOUR_API Slice +class LIBARDOUR_API Slice : virtual public PBD::Stateful { public: Slice (Temporal::timepos_t const &, Temporal::timecnt_t const &); @@ -33,10 +33,6 @@ class LIBARDOUR_API Slice timepos_t end() const; timepos_t nt_last() const { return end().decrement(); } - virtual void set_start (timepos_t const & s) { _start = s; } - virtual void set_position (timepos_t const & p); - virtual void set_length (timecnt_t const &); - /* these two are valid ONLY during a StateChanged signal handler */ timepos_t last_position () const { return _last_length.position(); } @@ -116,6 +112,9 @@ class LIBARDOUR_API Slice virtual void set_length_internal (timecnt_t const &); virtual void set_start_internal (timepos_t const &); virtual void set_position_internal (timepos_t const &); + + private: + void register_properties (); }; } /* namespace */ diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 5efc2c15d0..248e0b7e39 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -200,13 +200,6 @@ Region::register_properties () { _xml_node_name = X_("Region"); - /* anything derived from Slice must remember to add these properties to - * Stateful's list, since Slice does not do this itself. - */ - - add_property (_start); - add_property (_length); - add_property (_muted); add_property (_opaque); add_property (_locked); diff --git a/libs/ardour/slice.cc b/libs/ardour/slice.cc index 7bafebbfdd..55d5a6d20f 100644 --- a/libs/ardour/slice.cc +++ b/libs/ardour/slice.cc @@ -8,6 +8,7 @@ Slice::Slice (timepos_t const & s, timecnt_t const & l) , _length (Properties::length, l) , _last_length (l) { + register_properties (); } Slice::Slice (Slice const & other) @@ -18,17 +19,10 @@ Slice::Slice (Slice const & other) } void -Slice::set_position (timepos_t const & pos) +Slice::register_properties () { - _length = timecnt_t (_length.val().distance(), pos); - _last_length = _length; -} - -void -Slice::set_length (timecnt_t const & len) -{ - _last_length = _length; - _length = timecnt_t (len.distance(), _length.val().position()); + add_property (_start); + add_property (_length); } timepos_t