From 84aeb92d15f5d5ea3a38265f2ba64c56fcc282ff Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 17 May 2011 23:07:46 +0000 Subject: Re-fix problems when zero-length MIDI regions are created by an import. Set those regions to have the length of one beat, rather than 1 frame, so that the length doesn't get rounded back down to 0 by frames/beats conversions (bug #4000). git-svn-id: svn://localhost/ardour2/branches/3.0@9549 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_audio_import.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc index 4a7c8c5654..902e3fe6e6 100644 --- a/gtk2_ardour/editor_audio_import.cc +++ b/gtk2_ardour/editor_audio_import.cc @@ -760,10 +760,14 @@ Editor::add_sources (vector paths, SourceList& sources, framepos_t& pos, PropertyList plist; - /* Fudge region length to ensure it is non-zero */ + /* Fudge region length to ensure it is non-zero; make it 1 beat at 120bpm + for want of a better idea. It can't be too small, otherwise if this + is a MIDI region the conversion from frames -> beats -> frames will + round it back down to 0 again. + */ framecnt_t len = (*x)->length (pos); if (len == 0) { - len = 1; + len = (60 / 120) * _session->frame_rate (); } plist.add (ARDOUR::Properties::start, 0); -- cgit v1.2.3