diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-02-19 18:09:08 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-02-19 18:09:08 +0000 |
commit | fa701b8c065251d242342b86a54d91826d2290a0 (patch) | |
tree | 106865e709c61a1d3af045a26a757b22ba423c3e /libs/ardour/ardour | |
parent | 728bedf9b917287ea76b98860dec04e72472230c (diff) |
change PropertyChange from a bitfield into a real object, with all the many widespread changes that causes
git-svn-id: svn://localhost/ardour2/branches/3.0@6701 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/ardour.h | 9 | ||||
-rw-r--r-- | libs/ardour/ardour/audioplaylist.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/audioregion.h | 24 | ||||
-rw-r--r-- | libs/ardour/ardour/crossfade.h | 15 | ||||
-rw-r--r-- | libs/ardour/ardour/diskstream.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/internal_send.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/location.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/midi_model.h | 10 | ||||
-rw-r--r-- | libs/ardour/ardour/midi_playlist.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/midi_region.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/playlist.h | 8 | ||||
-rw-r--r-- | libs/ardour/ardour/region.h | 24 | ||||
-rw-r--r-- | libs/ardour/ardour/route_group.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/session_object.h | 8 | ||||
-rw-r--r-- | libs/ardour/ardour/tempo.h | 2 |
16 files changed, 49 insertions, 73 deletions
diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h index f608db5b7e..2b1f7bbb04 100644 --- a/libs/ardour/ardour/ardour.h +++ b/libs/ardour/ardour/ardour.h @@ -53,6 +53,9 @@ namespace ARDOUR { void init_post_engine (); int cleanup (); bool no_auto_connect (); + void make_property_quarks (); + + extern PBD::PropertyChange bounds_change; std::string get_ardour_revision (); extern const char* const ardour_config_info; @@ -65,12 +68,6 @@ namespace ARDOUR { return (microseconds_t) jack_get_time(); } - extern PBD::PropertyChange StartChanged; - extern PBD::PropertyChange LengthChanged; - extern PBD::PropertyChange PositionChanged; - extern PBD::PropertyChange NameChanged; - extern PBD::PropertyChange BoundsChanged; - static const double SHUTTLE_FRACT_SPEED1=0.48412291827; /* derived from A1,A2 */ void setup_fpu (); diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h index b5df4cfabb..b53f3c1f73 100644 --- a/libs/ardour/ardour/audioplaylist.h +++ b/libs/ardour/ardour/audioplaylist.h @@ -79,8 +79,8 @@ class AudioPlaylist : public ARDOUR::Playlist XMLNode& state (bool full_state); void dump () const; - bool region_changed (PBD::PropertyChange, boost::shared_ptr<Region>); - void crossfade_changed (PBD::PropertyChange); + bool region_changed (const PBD::PropertyChange&, boost::shared_ptr<Region>); + void crossfade_changed (const PBD::PropertyChange&); void add_crossfade (boost::shared_ptr<Crossfade>); void source_offset_changed (boost::shared_ptr<AudioRegion> region); diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h index 711c8030bd..ec9a64002f 100644 --- a/libs/ardour/ardour/audioregion.h +++ b/libs/ardour/ardour/audioregion.h @@ -44,6 +44,17 @@ namespace Properties { extern PBD::PropertyDescriptor<bool> fade_in_active; extern PBD::PropertyDescriptor<bool> fade_out_active; extern PBD::PropertyDescriptor<float> scale_amplitude; + extern PBD::PropertyDescriptor<float> scale_amplitude; + + /* the envelope and fades are not scalar items and so + currently (2010/02) are not stored using Property. + However, these descriptors enable us to notify + about changes to them via PropertyChange. + */ + + extern PBD::PropertyDescriptor<bool> envelope; + extern PBD::PropertyDescriptor<bool> fade_in; + extern PBD::PropertyDescriptor<bool> fade_out; } class Route; @@ -58,14 +69,6 @@ class AudioRegion : public Region public: static void make_property_quarks (); - static PBD::PropertyChange FadeInChanged; - static PBD::PropertyChange FadeOutChanged; - static PBD::PropertyChange FadeInActiveChanged; - static PBD::PropertyChange FadeOutActiveChanged; - static PBD::PropertyChange EnvelopeActiveChanged; - static PBD::PropertyChange ScaleAmplitudeChanged; - static PBD::PropertyChange EnvelopeChanged; - ~AudioRegion(); void copy_settings (boost::shared_ptr<const AudioRegion>); @@ -185,8 +188,7 @@ class AudioRegion : public Region AudioRegion (const SourceList &); AudioRegion (boost::shared_ptr<const AudioRegion>, frameoffset_t offset = 0, bool offset_relative = true); AudioRegion (boost::shared_ptr<const AudioRegion>, const SourceList&); - AudioRegion (boost::shared_ptr<AudioSource>, const XMLNode&); - AudioRegion (SourceList &, const XMLNode&); + AudioRegion (SourceList &); private: PBD::Property<bool> _envelope_active; @@ -197,7 +199,7 @@ class AudioRegion : public Region PBD::Property<gain_t> _scale_amplitude; void register_properties (); - PBD::PropertyChange set_property (const PBD::PropertyBase& prop); + bool set_property (const PBD::PropertyBase& prop); void post_set (); void init (); diff --git a/libs/ardour/ardour/crossfade.h b/libs/ardour/ardour/crossfade.h index 15b9b3d2a7..7b5ac28379 100644 --- a/libs/ardour/ardour/crossfade.h +++ b/libs/ardour/ardour/crossfade.h @@ -34,6 +34,11 @@ #include "evoral/Curve.hpp" namespace ARDOUR { + namespace Properties { + /* "active" is defined elsewhere but we use it with crossfade also */ + extern PBD::PropertyDescriptor<bool> active; + extern PBD::PropertyDescriptor<bool> follow_overlap; + } class AudioRegion; class Playlist; @@ -71,6 +76,8 @@ class Crossfade : public ARDOUR::AudioRegion Crossfade (const Playlist&, XMLNode&); virtual ~Crossfade(); + static void make_property_quarks (); + bool operator== (const ARDOUR::Crossfade&); XMLNode& get_state (void); @@ -106,7 +113,6 @@ class Crossfade : public ARDOUR::AudioRegion framecnt_t overlap_length() const; PBD::Signal1<void,boost::shared_ptr<Region> > Invalidated; - PBD::Signal1<void,PBD::PropertyChange> StateChanged; bool covers (framecnt_t frame) const { return _position <= frame && frame < _position + _length; @@ -136,9 +142,6 @@ class Crossfade : public ARDOUR::AudioRegion static framecnt_t short_xfade_length() { return _short_xfade_length; } static void set_short_xfade_length (framecnt_t n); - static PBD::PropertyChange ActiveChanged; - static PBD::PropertyChange FollowOverlapChanged; - private: friend struct CrossfadeComparePtr; friend class AudioPlaylist; @@ -147,11 +150,11 @@ class Crossfade : public ARDOUR::AudioRegion boost::shared_ptr<ARDOUR::AudioRegion> _in; boost::shared_ptr<ARDOUR::AudioRegion> _out; - bool _active; + PBD::Property<bool> _active; + PBD::Property<bool> _follow_overlap; bool _in_update; OverlapType overlap_type; AnchorPoint _anchor_point; - bool _follow_overlap; bool _fixed; int32_t layer_relation; diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h index 90bcf4067a..48a9c2776b 100644 --- a/libs/ardour/ardour/diskstream.h +++ b/libs/ardour/ardour/diskstream.h @@ -206,7 +206,7 @@ class Diskstream : public SessionObject /* XXX fix this redundancy ... */ - virtual void playlist_changed (PBD::PropertyChange); + virtual void playlist_changed (const PBD::PropertyChange&); virtual void playlist_deleted (boost::weak_ptr<Playlist>); virtual void playlist_ranges_moved (std::list< Evoral::RangeMove<framepos_t> > const &); diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h index 2171462ab7..243106fb54 100644 --- a/libs/ardour/ardour/internal_send.h +++ b/libs/ardour/ardour/internal_send.h @@ -56,7 +56,7 @@ class InternalSend : public Send PBD::ScopedConnection connect_c; void send_to_going_away (); - void send_to_name_changed (); + void send_to_property_changed (const PBD::PropertyChange&); int connect_when_legal (); int set_our_state (XMLNode const &, int); }; diff --git a/libs/ardour/ardour/location.h b/libs/ardour/ardour/location.h index d93ffeec4a..938177b102 100644 --- a/libs/ardour/ardour/location.h +++ b/libs/ardour/ardour/location.h @@ -179,7 +179,7 @@ class Locations : public PBD::StatefulDestructible PBD::Signal0<void> changed; PBD::Signal1<void,Location*> added; PBD::Signal1<void,Location*> removed; - PBD::Signal1<void,PBD::PropertyChange> StateChanged; + PBD::Signal1<void,const PBD::PropertyChange&> StateChanged; template<class T> void apply (T& obj, void (T::*method)(LocationList&)) { Glib::Mutex::Lock lm (lock); diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h index 77f5798898..fcd285f98c 100644 --- a/libs/ardour/ardour/midi_model.h +++ b/libs/ardour/ardour/midi_model.h @@ -90,7 +90,7 @@ public: }; - /** PropertyChange note properties. + /** Change note properties. * More efficient than DeltaCommand and has the important property that * it leaves the objects in the MidiModel (Notes) the same, thus * enabling selection and other state to persist across command @@ -126,7 +126,7 @@ public: boost::shared_ptr<MidiModel> _model; const std::string _name; - struct NotePropertyChange { + struct NoteChange { DiffCommand::Property property; boost::shared_ptr< Evoral::Note<TimeType> > note; union { @@ -139,11 +139,11 @@ public: }; }; - typedef std::list<NotePropertyChange> ChangeList; + typedef std::list<NoteChange> ChangeList; ChangeList _changes; - XMLNode &marshal_change(const NotePropertyChange&); - NotePropertyChange unmarshal_change(XMLNode *xml_note); + XMLNode &marshal_change(const NoteChange&); + NoteChange unmarshal_change(XMLNode *xml_note); }; MidiModel::DeltaCommand* new_delta_command(const std::string name="midi edit"); diff --git a/libs/ardour/ardour/midi_playlist.h b/libs/ardour/ardour/midi_playlist.h index 46aea9f0b4..ccadb39e92 100644 --- a/libs/ardour/ardour/midi_playlist.h +++ b/libs/ardour/ardour/midi_playlist.h @@ -74,7 +74,7 @@ protected: private: void dump () const; - bool region_changed (PBD::PropertyChange, boost::shared_ptr<Region>); + bool region_changed (const PBD::PropertyChange&, boost::shared_ptr<Region>); NoteMode _note_mode; diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h index d892e5837f..671e4fca43 100644 --- a/libs/ardour/ardour/midi_region.h +++ b/libs/ardour/ardour/midi_region.h @@ -96,11 +96,8 @@ class MidiRegion : public Region private: friend class RegionFactory; - MidiRegion (boost::shared_ptr<MidiSource>); MidiRegion (const SourceList&); MidiRegion (boost::shared_ptr<const MidiRegion>, frameoffset_t offset = 0, bool offset_relative = true); - MidiRegion (boost::shared_ptr<MidiSource>, const XMLNode&); - MidiRegion (const SourceList &, const XMLNode&); private: framecnt_t _read_at (const SourceList&, Evoral::EventSink<nframes_t>& dst, diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 9cd02dec1e..7213c99397 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -249,15 +249,15 @@ class Playlist : public SessionObject void notify_length_changed (); void notify_layering_changed (); void notify_contents_changed (); - void notify_state_changed (PBD::PropertyChange); + void notify_state_changed (const PBD::PropertyChange&); void notify_region_moved (boost::shared_ptr<Region>); void mark_session_dirty(); - void region_changed_proxy (PBD::PropertyChange, boost::weak_ptr<Region>); - virtual bool region_changed (PBD::PropertyChange, boost::shared_ptr<Region>); + void region_changed_proxy (const PBD::PropertyChange&, boost::weak_ptr<Region>); + virtual bool region_changed (const PBD::PropertyChange&, boost::shared_ptr<Region>); - void region_bounds_changed (PBD::PropertyChange, boost::shared_ptr<Region>); + void region_bounds_changed (const PBD::PropertyChange&, boost::shared_ptr<Region>); void region_deleted (boost::shared_ptr<Region>); void sort_regions (); diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 60ccf66984..fb827e308d 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -89,16 +89,7 @@ class Region MusicTime }; - static PBD::PropertyChange FadeChanged; - static PBD::PropertyChange SyncOffsetChanged; - static PBD::PropertyChange MuteChanged; - static PBD::PropertyChange OpacityChanged; - static PBD::PropertyChange LockChanged; - static PBD::PropertyChange LayerChanged; - static PBD::PropertyChange HiddenChanged; - - PBD::Signal1<void,PBD::PropertyChange> StateChanged; - static PBD::Signal1<void,boost::shared_ptr<ARDOUR::Region> > RegionPropertyChanged; + static PBD::Signal2<void,boost::shared_ptr<ARDOUR::Region>, const PBD::PropertyChange&> RegionPropertyChanged; void unlock_property_changes () { _no_property_changes = false; } void block_property_changes () { _no_property_changes = true; } @@ -281,8 +272,6 @@ class Region protected: friend class RegionFactory; - /** Construct a region from a single source */ - Region (boost::shared_ptr<Source> src); /** Construct a region from multiple sources*/ Region (const SourceList& srcs); /** Construct a region from another region, at an offset within that region */ @@ -292,16 +281,11 @@ class Region /** normal Region copy constructor */ Region (boost::shared_ptr<const Region>); - /** Construct a region from 1 source and XML state */ - Region (boost::shared_ptr<Source> src, const XMLNode&); - /** Construct a region from multiple sources and XML state */ - Region (const SourceList& srcs, const XMLNode&); - /** Constructor for derived types only */ Region (Session& s, framepos_t start, framecnt_t length, const std::string& name, DataType); protected: - void send_change (PBD::PropertyChange); + void send_change (const PBD::PropertyChange&); void trim_to_internal (framepos_t position, framecnt_t length, void *src); virtual void set_position_internal (framepos_t pos, bool allow_bbt_recompute); @@ -351,7 +335,7 @@ class Region AnalysisFeatureList _transients; bool _valid_transients; mutable uint64_t _read_data_count; ///< modified in read() - PBD::PropertyChange _pending_changed; + PBD::PropertyChange _pending_changed; uint64_t _last_layer_op; ///< timestamp Glib::Mutex _lock; SourceList _sources; @@ -365,7 +349,7 @@ class Region virtual int _set_state (const XMLNode&, int version, PBD::PropertyChange& what_changed, bool send_signal); - PBD::PropertyChange set_property (const PBD::PropertyBase&); + bool set_property (const PBD::PropertyBase&); void register_properties (); private: diff --git a/libs/ardour/ardour/route_group.h b/libs/ardour/ardour/route_group.h index 820295b54a..f3109a707d 100644 --- a/libs/ardour/ardour/route_group.h +++ b/libs/ardour/ardour/route_group.h @@ -131,9 +131,6 @@ class RouteGroup : public SessionObject PBD::Signal0<void> changed; PBD::Signal1<void,void*> FlagsChanged; - static PBD::PropertyChange FlagsChange; - static PBD::PropertyChange PropertiesChange; - XMLNode& get_state (); int set_state (const XMLNode&, int version); diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 154c5d0078..9294d56fcc 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1210,7 +1210,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void xrun_recovery (); TempoMap *_tempo_map; - void tempo_map_changed (PBD::PropertyChange); + void tempo_map_changed (const PBD::PropertyChange&); /* edit/mix groups */ @@ -1257,7 +1257,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi RegionList regions; void add_region (boost::shared_ptr<Region>); - void region_changed (PBD::PropertyChange, boost::weak_ptr<Region>); + void region_changed (const PBD::PropertyChange&, boost::weak_ptr<Region>); void remove_region (boost::weak_ptr<Region>); int load_regions (const XMLNode& node); diff --git a/libs/ardour/ardour/session_object.h b/libs/ardour/ardour/session_object.h index 1f81cf6fd2..d18a1f9d41 100644 --- a/libs/ardour/ardour/session_object.h +++ b/libs/ardour/ardour/session_object.h @@ -48,7 +48,7 @@ class SessionObject : public SessionHandleRef, public PBD::StatefulDestructible SessionObject (Session& session, const std::string& name) : SessionHandleRef (session) - , _name (Properties::name, PBD::PropertyChange (0), name) + , _name (Properties::name, name) { add_property (_name); } @@ -56,18 +56,16 @@ class SessionObject : public SessionHandleRef, public PBD::StatefulDestructible Session& session() const { return _session; } std::string name() const { return _name; } - PBD::PropertyChange set_property (const PBD::PropertyBase& prop); + bool set_property (const PBD::PropertyBase& prop); virtual bool set_name (const std::string& str) { if (_name != str) { _name = str; - NameChanged(); + PropertyChanged (PBD::PropertyChange (Properties::name)); } return true; } - PBD::Signal0<void> NameChanged; - protected: PBD::Property<std::string> _name; }; diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h index 5c2d3d6918..596444173f 100644 --- a/libs/ardour/ardour/tempo.h +++ b/libs/ardour/ardour/tempo.h @@ -258,8 +258,6 @@ class TempoMap : public PBD::StatefulDestructible nframes_t frame_rate () const { return _frame_rate; } - PBD::Signal1<void,PBD::PropertyChange> StateChanged; - private: static Tempo _default_tempo; static Meter _default_meter; |