The Big Change: Store time in MidiModel as tempo time, not frame time.
authorDavid Robillard <d@drobilla.net>
Sun, 15 Feb 2009 17:30:42 +0000 (17:30 +0000)
committerDavid Robillard <d@drobilla.net>
Sun, 15 Feb 2009 17:30:42 +0000 (17:30 +0000)
commitecaf107ed3dd2bb3443a92fc3dd9cf566d3439e3
tree2d858fb36efa6c4a6ca26c85d7b09cf6fb6b2ed0
parent425966a69611d531f1d4d6c947d76708c8c7962e
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
14 files changed:
gtk2_ardour/canvas-note-event.cc
gtk2_ardour/canvas-program-change.cc
gtk2_ardour/editor_rulers.cc
gtk2_ardour/midi_region_view.cc
gtk2_ardour/midi_region_view.h
libs/ardour/ardour/midi_source.h
libs/ardour/ardour/smf_source.h
libs/ardour/ardour/types.h
libs/ardour/audiofilesource.cc
libs/ardour/import.cc
libs/ardour/meter.cc
libs/ardour/midi_model.cc
libs/ardour/midi_source.cc
libs/ardour/smf_source.cc