Fix MIDI fork using a modified version of a patch from warrenfalk. Fixes #3595.
authorCarl Hetherington <carl@carlh.net>
Sun, 12 Dec 2010 00:41:47 +0000 (00:41 +0000)
committerCarl Hetherington <carl@carlh.net>
Sun, 12 Dec 2010 00:41:47 +0000 (00:41 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8252 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/midi_region.cc

index 26d43ba2a95519e7caeafc5acc10e25d32d9b23f..ddf582553b23e0bed56798c1a05da60127d74cf5 100644 (file)
@@ -99,8 +99,8 @@ boost::shared_ptr<MidiRegion>
 MidiRegion::clone ()
 {
         BeatsFramesConverter bfc (_session.tempo_map(), _position);
-        double bbegin = bfc.from (_position);
-        double bend = bfc.from (last_frame() + 1);
+       Evoral::MusicalTime const bbegin = bfc.from (_start);
+       Evoral::MusicalTime const bend = bfc.from (_start + _length);
 
         boost::shared_ptr<MidiSource> ms = midi_source(0)->clone (bbegin, bend);
 
@@ -108,7 +108,7 @@ MidiRegion::clone ()
 
         plist.add (Properties::name, ms->name());
         plist.add (Properties::whole_file, true);
-        plist.add (Properties::start, 0);
+        plist.add (Properties::start, _start);
         plist.add (Properties::length, _length);
         plist.add (Properties::layer, 0);