summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_model.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-02-15 17:30:42 +0000
committerDavid Robillard <d@drobilla.net>2009-02-15 17:30:42 +0000
commitecaf107ed3dd2bb3443a92fc3dd9cf566d3439e3 (patch)
tree2d858fb36efa6c4a6ca26c85d7b09cf6fb6b2ed0 /libs/ardour/midi_model.cc
parent425966a69611d531f1d4d6c947d76708c8c7962e (diff)
The Big Change: Store time in MidiModel as tempo time, not frame time.
The time stamp of an event is now always tempo, from file to model and back again. Frame time is only relevant at playback or recording time, in the audio thread (MidiModel and MidiBuffer). I think perhaps we don't need to change the actual time from double (which is convenient for math), it is the time base conversion that caused problems. Using a correct equality comparison (i.e. not == which is not correct for floating point) should probably make the undo issues go away, in 99.99% of cases anyway. There's almost certainly some regressions in here somewhere, but they do not seem to be time related. The bugs I'm hitting in testing are old ones that seem unrelated now, so it's checkpoint time. This sets us up for fancy things like tempo map import and tempo/meter changes halfway through MIDI regions, but for now it's still assumed that the tempo at the start of the region is valid for the duration of the entire region. git-svn-id: svn://localhost/ardour2/branches/3.0@4582 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_model.cc')
-rw-r--r--libs/ardour/midi_model.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc
index 4e755d8717..6573bcfd68 100644
--- a/libs/ardour/midi_model.cc
+++ b/libs/ardour/midi_model.cc
@@ -295,9 +295,11 @@ MidiModel::write_to(boost::shared_ptr<MidiSource> source)
const bool old_percussive = percussive();
set_percussive(false);
+
+ source->drop_model();
for (Evoral::Sequence<TimeType>::const_iterator i = begin(); i != end(); ++i) {
- source->append_event_unlocked(Frames, *i);
+ source->append_event_unlocked_beats(*i);
}
set_percussive(old_percussive);