summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/midi_source.h
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-07-14 00:58:15 +0000
committerCarl Hetherington <carl@carlh.net>2010-07-14 00:58:15 +0000
commit593b421180290f46f39efcb21ed8192b624bbc73 (patch)
treef8a81aad5fae8683818103b192d3c53a26110728 /libs/ardour/ardour/midi_source.h
parentb75977920e7cb02ae31bca0379dd3aa4d82f9cbc (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/ardour/ardour/midi_source.h')
-rw-r--r--libs/ardour/ardour/midi_source.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/ardour/ardour/midi_source.h b/libs/ardour/ardour/midi_source.h
index 0d0b744a95..8d20f9c7b6 100644
--- a/libs/ardour/ardour/midi_source.h
+++ b/libs/ardour/ardour/midi_source.h
@@ -117,8 +117,15 @@ class MidiSource : virtual public Source
void set_model (boost::shared_ptr<MidiModel>);
void drop_model();
+ Evoral::ControlList::InterpolationStyle interpolation_of (Evoral::Parameter) const;
+ void set_interpolation_of (Evoral::Parameter, Evoral::ControlList::InterpolationStyle);
+ void copy_interpolation_from (boost::shared_ptr<MidiSource>);
+ void copy_interpolation_from (MidiSource *);
+
/** Emitted when a different MidiModel is set */
PBD::Signal0<void> ModelChanged;
+ /** Emitted when a parameter's interpolation style is changed */
+ PBD::Signal2<void, Evoral::Parameter, Evoral::ControlList::InterpolationStyle> InterpolationChanged;
protected:
virtual void flush_midi() = 0;
@@ -146,6 +153,12 @@ class MidiSource : virtual public Source
mutable double _length_beats;
mutable sframes_t _last_read_end;
sframes_t _last_write_end;
+
+ /** Map of interpolation styles to use for Parameters; if they are not in this map,
+ * the correct interpolation style can be obtained from EventTypeMap::interpolation_of ()
+ */
+ typedef std::map<Evoral::Parameter, Evoral::ControlList::InterpolationStyle> InterpolationStyleMap;
+ InterpolationStyleMap _interpolation_style;
};
}