diff options
author | Hans Baier <hansfbaier@googlemail.com> | 2009-01-28 04:55:31 +0000 |
---|---|---|
committer | Hans Baier <hansfbaier@googlemail.com> | 2009-01-28 04:55:31 +0000 |
commit | 3705a2d6307cf443acbf8419b0e0f560591f2016 (patch) | |
tree | 0702629940e808aa553d1d344ac49dac2d7ca9c2 /libs/ardour/smf_source.cc | |
parent | 6c538ab719c49262da159e9568bb1f8fb30e1518 (diff) |
* MIDI control lanes: Set Interpolationtype according to Parameter
git-svn-id: svn://localhost/ardour2/branches/3.0@4452 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/smf_source.cc')
-rw-r--r-- | libs/ardour/smf_source.cc | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index 9caf005833..cc521336e3 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -241,8 +241,9 @@ SMFSource::write_unlocked (MidiRingBuffer& src, nframes_t cnt) append_event_unlocked(Frames, ev); - if (_model) + if (_model) { _model->append(ev); + } } SMF::flush(); @@ -601,14 +602,18 @@ SMFSource::set_source_name (string newname, bool destructive) void SMFSource::load_model(bool lock, bool force_reload) { - if (_writing) + if (_writing) { return; + } + - if (lock) + if (lock) { Glib::Mutex::Lock lm (_lock); + } - if (_model && !force_reload && !_model->empty()) + if (_model && !force_reload && !_model->empty()) { return; + } if (! _model) { _model = boost::shared_ptr<MidiModel>(new MidiModel(this)); @@ -648,10 +653,18 @@ SMFSource::load_model(bool lock, bool force_reload) _model->append(ev); } - if (ev.size() > scratch_size) + if (ev.size() > scratch_size) { scratch_size = ev.size(); - else + } else { ev.size() = scratch_size; + } + } + + // set interpolation style to defaults, can be changed by the GUI later + Evoral::ControlSet::Controls controls = _model->controls(); + for (Evoral::ControlSet::Controls::iterator c = controls.begin(); c != controls.end(); ++c) { + (*c).second->list()->set_interpolation( + EventTypeMap::instance().interpolation_of((*c).first)); } _model->end_write(false); |