From a08012214fea09567b78086b5ca076c3369dcb16 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 18 Oct 2019 10:26:30 -0600 Subject: [PATCH] add a new "contents" pseudo-property to Region The type of this property doesn't matter - it only exists so that we can signal a change to the (MIDI) contents of a Region via PropertyChanged --- libs/ardour/ardour/region.h | 2 ++ libs/ardour/region.cc | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index a408f5429a..a695d9e5ed 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -72,6 +72,7 @@ namespace Properties { LIBARDOUR_API extern PBD::PropertyDescriptor position_lock_style; LIBARDOUR_API extern PBD::PropertyDescriptor layering_index; LIBARDOUR_API extern PBD::PropertyDescriptor tags; + LIBARDOUR_API extern PBD::PropertyDescriptor contents; // type doesn't matter here }; class Playlist; @@ -468,6 +469,7 @@ private: PBD::EnumProperty _position_lock_style; PBD::Property _layering_index; PBD::Property _tags; + PBD::Property _contents; // type is irrelevant samplecnt_t _last_length; samplepos_t _last_position; diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 94083bd73a..635b87fb0f 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -81,6 +81,7 @@ namespace ARDOUR { PBD::PropertyDescriptor position_lock_style; PBD::PropertyDescriptor layering_index; PBD::PropertyDescriptor tags; + PBD::PropertyDescriptor contents; } } @@ -143,6 +144,8 @@ Region::make_property_quarks () DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for layering_index = %1\n", Properties::layering_index.property_id)); Properties::tags.property_id = g_quark_from_static_string (X_("tags")); DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for tags = %1\n", Properties::tags.property_id)); + Properties::contents.property_id = g_quark_from_static_string (X_("contents")); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for contents = %1\n", Properties::contents.property_id)); } void @@ -176,6 +179,7 @@ Region::register_properties () add_property (_position_lock_style); add_property (_layering_index); add_property (_tags); + add_property (_contents); } #define REGION_DEFAULT_STATE(s,l) \ @@ -209,7 +213,8 @@ Region::register_properties () , _shift (Properties::shift, 1.0) \ , _position_lock_style (Properties::position_lock_style, _type == DataType::AUDIO ? AudioTime : MusicTime) \ , _layering_index (Properties::layering_index, 0) \ - , _tags (Properties::tags, "") + , _tags (Properties::tags, "") \ + , _contents (Properties::contents, false) #define REGION_COPY_STATE(other) \ _sync_marked (Properties::sync_marked, other->_sync_marked) \ @@ -244,7 +249,8 @@ Region::register_properties () , _shift (Properties::shift, other->_shift) \ , _position_lock_style (Properties::position_lock_style, other->_position_lock_style) \ , _layering_index (Properties::layering_index, other->_layering_index) \ - , _tags (Properties::tags, other->_tags) + , _tags (Properties::tags, other->_tags) \ + , _contents (Properties::contents, other->_contents) /* derived-from-derived constructor (no sources in constructor) */ Region::Region (Session& s, samplepos_t start, samplecnt_t length, const string& name, DataType type)