summaryrefslogtreecommitdiff
path: root/libs/ardour/playlist.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-05-25 00:20:33 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-05-25 00:20:33 +0000
commitbf574116346fdc3804d37c0e7ee424608d7ee38e (patch)
tree4c11b038cb9149352cb77bf68dedf45f4435d947 /libs/ardour/playlist.cc
parentedfc4e8563549630c2e15465f949c209c3eacf4f (diff)
add back combine/uncombine debugging; fix uncombine op to get original region lengths right, i think
git-svn-id: svn://localhost/ardour2/branches/3.0@9579 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/playlist.cc')
-rw-r--r--libs/ardour/playlist.cc29
1 files changed, 27 insertions, 2 deletions
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc
index 57b919f8ae..38a231b2d1 100644
--- a/libs/ardour/playlist.cc
+++ b/libs/ardour/playlist.cc
@@ -3266,9 +3266,9 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
the length of the region.
*/
- adjusted_start = target->start();
- adjusted_end = target->start() + target->length();
+ cerr << "Compound region: bounds within nested playlist = " << adjusted_start << " .. " << adjusted_end << endl;
+
// (2) get all the original regions
const RegionList& rl (pl->region_list().rlist());
@@ -3291,6 +3291,19 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
if (i == rl.begin()) {
move_offset = (target->position() - original->position()) - target->start();
+
+
+ cerr << "Move offset is " << target->position() << " - " << original->position()
+ << " - " << target->start() << " = " << move_offset
+ << endl;
+
+ adjusted_start = original->position() + target->start();
+ adjusted_end = adjusted_start + target->length();
+
+ cerr << "adjusted range = " << adjusted_start << " based on "
+ << original->position() << " + " << target->start() << " .. "
+ << adjusted_end << " from " << target->length()
+ << endl;
}
/* check to see how the original region (in the
@@ -3298,6 +3311,12 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
* with the new state of the compound region.
*/
+ cerr << "Original " << original->name()
+ << " overlaptype = " << enum_2_string (original->coverage (adjusted_start, adjusted_end))
+ << " target range: " << adjusted_start << " .. " << adjusted_end
+ << " orig range: " << original->position() << " .. " << original->last_frame ()
+ << endl;
+
original->clear_changes ();
modified_region = false;
@@ -3306,6 +3325,7 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
/* original region does not cover any part
of the current state of the compound region
*/
+ cerr << "Not present - skip\n";
continue;
case OverlapInternal:
@@ -3314,12 +3334,14 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
*/
original->trim_to (adjusted_start, adjusted_end - adjusted_start, this);
modified_region = true;
+ cerr << "trim to\n";
break;
case OverlapExternal:
/* overlap fully covers original, so leave it
as is
*/
+ cerr << "leave as is\n";
break;
case OverlapEnd:
@@ -3328,6 +3350,7 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
*/
original->trim_front (adjusted_start, this);
modified_region = true;
+ cerr << "trim front\n";
break;
case OverlapStart:
@@ -3336,12 +3359,14 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
*/
original->trim_end (adjusted_end, this);
modified_region = true;
+ cerr << "trim end\n";
break;
}
if (move_offset) {
/* fix the position to match any movement of the compound region.
*/
+ cerr << "Moving region to new position based on " << original->position() << " + " << move_offset << endl;
original->set_position (original->position() + move_offset, this);
modified_region = true;
}