diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-05-11 21:30:36 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-05-11 21:30:36 +0000 |
commit | a98fa4bc61e26cd94aeb6720325633c4e6618155 (patch) | |
tree | 21e55518ce42e5ffe3e974b32e10192525627b82 /libs/evoral | |
parent | 4d780bdcd0009943ec292dfd2177e60804d91245 (diff) |
switch to 5 new fade curves, taken from mixbus2 branch. make xfade context menus functional even though the images are not accurate
git-svn-id: svn://localhost/ardour2/branches/3.0@12253 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral')
-rw-r--r-- | libs/evoral/evoral/ControlList.hpp | 1 | ||||
-rw-r--r-- | libs/evoral/src/ControlList.cpp | 33 |
2 files changed, 19 insertions, 15 deletions
diff --git a/libs/evoral/evoral/ControlList.hpp b/libs/evoral/evoral/ControlList.hpp index 30b9fca430..c54c231ca7 100644 --- a/libs/evoral/evoral/ControlList.hpp +++ b/libs/evoral/evoral/ControlList.hpp @@ -95,6 +95,7 @@ public: ControlList& operator= (const ControlList&); bool operator== (const ControlList&); + void copy_events (const ControlList&); virtual void freeze(); virtual void thaw (); diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp index 9c38f67b29..9a820294ef 100644 --- a/libs/evoral/src/ControlList.cpp +++ b/libs/evoral/src/ControlList.cpp @@ -80,9 +80,7 @@ ControlList::ControlList (const ControlList& other) _search_cache.first = _events.end(); _sort_pending = false; - for (const_iterator i = other._events.begin(); i != other._events.end(); ++i) { - _events.push_back (new ControlEvent (**i)); - } + copy_events (other); mark_dirty (); } @@ -106,9 +104,7 @@ ControlList::ControlList (const ControlList& other, double start, double end) boost::shared_ptr<ControlList> section = const_cast<ControlList*>(&other)->copy (start, end); if (!section->empty()) { - for (iterator i = section->begin(); i != section->end(); ++i) { - _events.push_back (new ControlEvent ((*i)->when, (*i)->value)); - } + copy_events (*(section.get())); } mark_dirty (); @@ -147,24 +143,31 @@ ControlList::operator= (const ControlList& other) { if (this != &other) { - _events.clear (); - - for (const_iterator i = other._events.begin(); i != other._events.end(); ++i) { - _events.push_back (new ControlEvent (**i)); - } - _min_yval = other._min_yval; _max_yval = other._max_yval; _default_value = other._default_value; - - mark_dirty (); - maybe_signal_changed (); + + copy_events (other); } return *this; } void +ControlList::copy_events (const ControlList& other) +{ + { + Glib::Mutex::Lock lm (_lock); + _events.clear (); + for (const_iterator i = other.begin(); i != other.end(); ++i) { + _events.push_back (new ControlEvent ((*i)->when, (*i)->value)); + } + mark_dirty (); + } + maybe_signal_changed (); +} + +void ControlList::create_curve() { _curve = new Curve(*this); |