summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_audio_import.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-05-17 23:07:46 +0000
committerCarl Hetherington <carl@carlh.net>2011-05-17 23:07:46 +0000
commit84aeb92d15f5d5ea3a38265f2ba64c56fcc282ff (patch)
tree44708a185e40699ad45779f37c9dd047e1bfaee8 /gtk2_ardour/editor_audio_import.cc
parentba51f635f718d85bde83c1f27cd210b8e44d9623 (diff)
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
Diffstat (limited to 'gtk2_ardour/editor_audio_import.cc')
-rw-r--r--gtk2_ardour/editor_audio_import.cc8
1 files changed, 6 insertions, 2 deletions
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<string> 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);