From 384c418ae0181f413ae85b06d11b244352ee74a6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 21 Dec 2010 00:04:58 +0000 Subject: Set new (recorded) MIDI source length to length of entire capture (instead of length from start to last actual recorded event). Precisely set length_beats of newly captured MIDI regions to source length in beats (no conversion). git-svn-id: svn://localhost/ardour2/branches/3.0@8317 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/midi_diskstream.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libs/ardour/midi_diskstream.cc') diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index 7227c8ba2e..c3f85438db 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -968,6 +968,12 @@ MidiDiskstream::transport_stopped_wallclock (struct tm& /*when*/, time_t /*twhen _write_source->mark_streaming_write_completed (); + /* set length in beats to entire capture length */ + + BeatsFramesConverter converter (_session.tempo_map(), capture_info.front()->start); + const double total_capture_beats = converter.from(total_capture); + _write_source->set_length_beats(total_capture_beats); + /* make it not a stub anymore */ _write_source->unstubify (); -- cgit v1.2.3