Fix split of midi regions after tempo / meter changes.
authorCarl Hetherington <carl@carlh.net>
Mon, 20 Dec 2010 18:47:18 +0000 (18:47 +0000)
committerCarl Hetherington <carl@carlh.net>
Mon, 20 Dec 2010 18:47:18 +0000 (18:47 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8308 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/midi_region.cc
libs/ardour/playlist.cc

index 02d9f7d3984c2a396818a488e2d0c0272eeab632..d8373bac8672e1c6d35dcdc93e2d8718bffa82e7 100644 (file)
@@ -141,10 +141,8 @@ MidiRegion::set_length_internal (framecnt_t len)
 void
 MidiRegion::update_length_beats ()
 {
-        cerr << name() << " Updating length beats, currently = " << _length_beats << " w/length = " << _length << endl;
-       BeatsFramesConverter converter (_session.tempo_map(), _position);
+       BeatsFramesConverter converter (_session.tempo_map(), _position - _start);
         _length_beats = converter.from (_length);
-        cerr << "\tnew value: " << _length_beats << endl;
 }
 
 void
index 971ed8b2e836173a56b0c8d91d24aa23c1e15e6d..7e393a7718d373f70f2e96b4b459ed1beec742dc 100644 (file)
@@ -1397,7 +1397,8 @@ Playlist::_split_region (boost::shared_ptr<Region> region, framepos_t playlist_p
 
        {
                PropertyList plist;
-               
+
+               plist.add (Properties::position, region->position ());
                plist.add (Properties::length, before);
                plist.add (Properties::name, before_name);
                plist.add (Properties::left_of_split, true);
@@ -1413,7 +1414,8 @@ Playlist::_split_region (boost::shared_ptr<Region> region, framepos_t playlist_p
 
        {
                PropertyList plist;
-               
+
+               plist.add (Properties::position, region->position() + before);
                plist.add (Properties::length, after);
                plist.add (Properties::name, after_name);
                plist.add (Properties::right_of_split, true);