diff options
author | David Robillard <d@drobilla.net> | 2009-02-15 17:30:42 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-02-15 17:30:42 +0000 |
commit | ecaf107ed3dd2bb3443a92fc3dd9cf566d3439e3 (patch) | |
tree | 2d858fb36efa6c4a6ca26c85d7b09cf6fb6b2ed0 /libs/ardour/import.cc | |
parent | 425966a69611d531f1d4d6c947d76708c8c7962e (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/import.cc')
-rw-r--r-- | libs/ardour/import.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc index 1b6d604d8f..824cdb43f7 100644 --- a/libs/ardour/import.cc +++ b/libs/ardour/import.cc @@ -320,8 +320,8 @@ write_midi_data_to_new_files (Evoral::SMF* source, Session::import_status& statu try { for (unsigned i = 1; i <= source->num_tracks(); ++i) { - boost::shared_ptr<SMFSource> smfs = boost::dynamic_pointer_cast<SMFSource>(newfiles[i-1]); + smfs->drop_model(); source->seek_to_track(i); @@ -346,11 +346,10 @@ write_midi_data_to_new_files (Evoral::SMF* source, Session::import_status& statu continue; } - smfs->append_event_unlocked(Beats, Evoral::Event<double>( - 0, - (double)t / (double)source->ppqn(), - size, - buf)); + smfs->append_event_unlocked_beats(Evoral::Event<double>(0, + (double)t / (double)source->ppqn(), + size, + buf)); if (status.progress < 0.99) status.progress += 0.01; |