diff options
author | Carl Hetherington <carl@carlh.net> | 2010-07-14 00:58:15 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-07-14 00:58:15 +0000 |
commit | 593b421180290f46f39efcb21ed8192b624bbc73 (patch) | |
tree | f8a81aad5fae8683818103b192d3c53a26110728 /libs/evoral/evoral | |
parent | b75977920e7cb02ae31bca0379dd3aa4d82f9cbc (diff) |
A few fixes to interpolation of MIDI controller data. Don't interpolate
when writing these data back to a source, otherwise surprising new
interpolated points appear in MIDI automation. Similarly don't interpolate
when reading the model during MIDI stretch. Fix handling of interpolation state;
controllers that have been set by the user to use a different interpolation style
are noted in the <Source> tag of the session file and this state is sprayed around
to MidiModel and the GUI as necessary.
git-svn-id: svn://localhost/ardour2/branches/3.0@7409 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral/evoral')
-rw-r--r-- | libs/evoral/evoral/ControlList.hpp | 6 | ||||
-rw-r--r-- | libs/evoral/evoral/ControlSet.hpp | 5 | ||||
-rw-r--r-- | libs/evoral/evoral/Sequence.hpp | 7 |
3 files changed, 12 insertions, 6 deletions
diff --git a/libs/evoral/evoral/ControlList.hpp b/libs/evoral/evoral/ControlList.hpp index 5f842775ee..d207c76925 100644 --- a/libs/evoral/evoral/ControlList.hpp +++ b/libs/evoral/evoral/ControlList.hpp @@ -218,6 +218,7 @@ public: bool rt_safe_earliest_event (double start, double end, double& x, double& y, bool start_inclusive=false) const; bool rt_safe_earliest_event_unlocked (double start, double end, double& x, double& y, bool start_inclusive=false) const; + bool rt_safe_earliest_event_discrete_unlocked (double start, double end, double& x, double& y, bool inclusive) const; void create_curve(); void destroy_curve(); @@ -234,10 +235,12 @@ public: }; InterpolationStyle interpolation() const { return _interpolation; } - void set_interpolation(InterpolationStyle style) { _interpolation = style; } + void set_interpolation (InterpolationStyle); /** Emitted when mark_dirty() is called on this object */ mutable PBD::Signal0<void> Dirty; + /** Emitted when our interpolation style changes */ + PBD::Signal1<void, InterpolationStyle> InterpolationChanged; protected: @@ -246,7 +249,6 @@ protected: void build_search_cache_if_necessary(double start, double end) const; - bool rt_safe_earliest_event_discrete_unlocked (double start, double end, double& x, double& y, bool inclusive) const; bool rt_safe_earliest_event_linear_unlocked (double start, double end, double& x, double& y, bool inclusive) const; boost::shared_ptr<ControlList> cut_copy_clear (double, double, int op); diff --git a/libs/evoral/evoral/ControlSet.hpp b/libs/evoral/evoral/ControlSet.hpp index b775bb3b4b..95de58dead 100644 --- a/libs/evoral/evoral/ControlSet.hpp +++ b/libs/evoral/evoral/ControlSet.hpp @@ -27,11 +27,11 @@ #include "pbd/signals.h" #include "evoral/types.hpp" #include "evoral/Parameter.hpp" +#include "evoral/ControlList.hpp" namespace Evoral { class Control; -class ControlList; class ControlEvent; class ControlSet : public boost::noncopyable { @@ -69,12 +69,15 @@ public: protected: virtual void control_list_marked_dirty () {} + virtual void control_list_interpolation_changed (Parameter, ControlList::InterpolationStyle) {} mutable Glib::Mutex _control_lock; Controls _controls; private: + PBD::ScopedConnectionList _control_connections; + PBD::ScopedConnectionList _list_connections; }; diff --git a/libs/evoral/evoral/Sequence.hpp b/libs/evoral/evoral/Sequence.hpp index 3cddeb38ca..24a3c44625 100644 --- a/libs/evoral/evoral/Sequence.hpp +++ b/libs/evoral/evoral/Sequence.hpp @@ -185,7 +185,7 @@ public: class const_iterator { public: const_iterator(); - const_iterator(const Sequence<Time>& seq, Time t, std::set<Evoral::Parameter> const &); + const_iterator(const Sequence<Time>& seq, Time t, bool, std::set<Evoral::Parameter> const &); ~const_iterator(); inline bool valid() const { return !_is_end && _event; } @@ -220,10 +220,11 @@ public: typename SysExes::const_iterator _sysex_iter; ControlIterators _control_iters; ControlIterators::iterator _control_iter; + bool _force_discrete; }; - const_iterator begin (Time t=0, std::set<Evoral::Parameter> const & f = std::set<Evoral::Parameter> ()) const { - return const_iterator (*this, t, f); + const_iterator begin (Time t = 0, bool force_discrete = false, std::set<Evoral::Parameter> const & f = std::set<Evoral::Parameter> ()) const { + return const_iterator (*this, t, force_discrete, f); } const const_iterator& end() const { return _end_iter; } |