MIDI Import: implement missing SMFSource::update_length

Provides intended behavior: imported midi region length should be rounded to the nearest beat

ToDo: add options to round to Bar/Beat/None ?
This commit is contained in:
Ben Loftis 2021-11-14 14:25:31 -06:00
parent f6adf9c897
commit 3f69e8e329
2 changed files with 8 additions and 0 deletions

View File

@ -56,6 +56,8 @@ public:
void append_event_beats (const Lock& lock, const Evoral::Event<Temporal::Beats>& ev);
void append_event_samples (const Lock& lock, const Evoral::Event<samplepos_t>& ev, samplepos_t source_start);
void update_length (timecnt_t const & cnt);
void mark_streaming_midi_write_started (const Lock& lock, NoteMode mode);
void mark_streaming_write_completed (const Lock& lock);
void mark_midi_streaming_write_completed (const Lock& lock,

View File

@ -394,6 +394,12 @@ SMFSource::write_unlocked (const Lock& lock,
return cnt;
}
void
SMFSource::update_length (timecnt_t const & cnt)
{
_length = cnt;
}
/** Append an event with a timestamp in beats */
void
SMFSource::append_event_beats (const Glib::Threads::Mutex::Lock& lock,