diff options
author | nick_m <mainsbridge@gmail.com> | 2016-08-31 03:17:26 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-08-31 23:12:11 +1000 |
commit | 21054f6d8db2c69271bebb99c5a2800d38ae8afd (patch) | |
tree | b4e1ae79cfcfb72657ffe0634a31ce2c78ec74d3 /libs/ardour/smf_source.cc | |
parent | 2c7a5815ee18d2854597e6b198ecfd3673386f78 (diff) |
Add length_pulse to MidiSource, usr quarter-notes in midi_read().
- MidiSource _length_beats is in quarter notes.
Here we duplicate length_beats for backwards compatibility
Diffstat (limited to 'libs/ardour/smf_source.cc')
-rw-r--r-- | libs/ardour/smf_source.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index 2aae26d847..dac78cd020 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -434,6 +434,8 @@ SMFSource::append_event_beats (const Glib::Threads::Mutex::Lock& lock, } _length_beats = max(_length_beats, time); + /* midi is in quarter note format as distinct from ardour beat */ + _length_pulse = _length_beats.to_double() / 4.0; const Evoral::Beats delta_time_beats = time - _last_ev_time_beats; const uint32_t delta_time_ticks = delta_time_beats.to_ticks(ppqn()); @@ -483,6 +485,8 @@ SMFSource::append_event_frames (const Glib::Threads::Mutex::Lock& lock, } _length_beats = max(_length_beats, ev_time_beats); + /* midi is in quarter note format as distinct from ardour beat */ + _length_pulse = _length_beats.to_double() / 4.0; const Evoral::Beats last_time_beats = converter.from (_last_ev_time_frames); const Evoral::Beats delta_time_beats = ev_time_beats - last_time_beats; @@ -695,6 +699,8 @@ SMFSource::load_model (const Glib::Threads::Mutex::Lock& lock, bool force_reload size = scratch_size; _length_beats = max(_length_beats, event_time); + /* midi is in quarter note format as distinct from ardour beat */ + _length_pulse = _length_beats.to_double() / 4.0; } /* event ID's must immediately precede the event they are for */ |