diff options
author | Carl Hetherington <carl@carlh.net> | 2010-07-12 00:41:45 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-07-12 00:41:45 +0000 |
commit | d1b4599725abda6b8697151fd4a1bd3740ad2f2a (patch) | |
tree | a6c7035d9316f8a1c1fef9aa079a76a210b643a5 /libs/evoral/evoral | |
parent | 6f5ee7c4293c43486d48bac00fdcdba90dabb17d (diff) |
Mark Sequence as edited when one of its parent ControlSet's ControlLists is changed.
git-svn-id: svn://localhost/ardour2/branches/3.0@7404 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral/evoral')
-rw-r--r-- | libs/evoral/evoral/Control.hpp | 8 | ||||
-rw-r--r-- | libs/evoral/evoral/ControlList.hpp | 6 | ||||
-rw-r--r-- | libs/evoral/evoral/ControlSet.hpp | 6 | ||||
-rw-r--r-- | libs/evoral/evoral/Sequence.hpp | 6 |
4 files changed, 22 insertions, 4 deletions
diff --git a/libs/evoral/evoral/Control.hpp b/libs/evoral/evoral/Control.hpp index d79ef25b5a..210ee7c322 100644 --- a/libs/evoral/evoral/Control.hpp +++ b/libs/evoral/evoral/Control.hpp @@ -22,6 +22,7 @@ #include <set> #include <map> #include <boost/shared_ptr.hpp> +#include "pbd/signals.h" #include "evoral/types.hpp" #include "evoral/Parameter.hpp" @@ -55,10 +56,17 @@ public: inline const Parameter& parameter() const { return _parameter; } + /** Emitted when the our ControlList is marked dirty */ + PBD::Signal0<void> ListMarkedDirty; + protected: Parameter _parameter; boost::shared_ptr<ControlList> _list; float _user_value; + PBD::ScopedConnection _list_marked_dirty_connection; + +private: + void list_marked_dirty (); }; } // namespace Evoral diff --git a/libs/evoral/evoral/ControlList.hpp b/libs/evoral/evoral/ControlList.hpp index d68b6a3e5f..5f842775ee 100644 --- a/libs/evoral/evoral/ControlList.hpp +++ b/libs/evoral/evoral/ControlList.hpp @@ -24,6 +24,7 @@ #include <boost/pool/pool.hpp> #include <boost/pool/pool_alloc.hpp> #include <glibmm/thread.h> +#include "pbd/signals.h" #include "evoral/types.hpp" #include "evoral/Parameter.hpp" @@ -224,7 +225,7 @@ public: Curve& curve() { assert(_curve); return *_curve; } const Curve& curve() const { assert(_curve); return *_curve; } - virtual void mark_dirty () const; + void mark_dirty () const; enum InterpolationStyle { Discrete, @@ -235,6 +236,9 @@ public: InterpolationStyle interpolation() const { return _interpolation; } void set_interpolation(InterpolationStyle style) { _interpolation = style; } + /** Emitted when mark_dirty() is called on this object */ + mutable PBD::Signal0<void> Dirty; + protected: /** Called by unlocked_eval() to handle cases of 3 or more control points. */ diff --git a/libs/evoral/evoral/ControlSet.hpp b/libs/evoral/evoral/ControlSet.hpp index f0c6bd0807..b775bb3b4b 100644 --- a/libs/evoral/evoral/ControlSet.hpp +++ b/libs/evoral/evoral/ControlSet.hpp @@ -24,6 +24,7 @@ #include <boost/shared_ptr.hpp> #include <boost/utility.hpp> #include <glibmm/thread.h> +#include "pbd/signals.h" #include "evoral/types.hpp" #include "evoral/Parameter.hpp" @@ -67,8 +68,13 @@ public: Glib::Mutex& control_lock() const { return _control_lock; } protected: + virtual void control_list_marked_dirty () {} + mutable Glib::Mutex _control_lock; Controls _controls; + +private: + PBD::ScopedConnectionList _control_connections; }; diff --git a/libs/evoral/evoral/Sequence.hpp b/libs/evoral/evoral/Sequence.hpp index 1ad456b302..3cddeb38ca 100644 --- a/libs/evoral/evoral/Sequence.hpp +++ b/libs/evoral/evoral/Sequence.hpp @@ -79,6 +79,7 @@ protected: }; public: + typedef typename boost::shared_ptr<Evoral::Note<Time> > NotePtr; typedef typename boost::shared_ptr<const Evoral::Note<Time> > constNotePtr; @@ -274,6 +275,8 @@ private: void get_notes_by_pitch (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const; void get_notes_by_velocity (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const; + void control_list_marked_dirty (); + const TypeMap& _type_map; Notes _notes; // notes indexed by time @@ -283,9 +286,6 @@ private: typedef std::multiset<NotePtr, EarlierNoteComparator> WriteNotes; WriteNotes _write_notes[16]; - typedef std::vector< boost::shared_ptr<const ControlList> > ControlLists; - ControlLists _dirty_controls; - const const_iterator _end_iter; bool _percussive; |