summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_ops.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-02-15 20:46:39 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-02-15 20:46:39 +0000
commit7c4d5a2a0709a85ceaf57439a8921d61f60f4e99 (patch)
tree8b91b19afbb4deaf9d7719890fa95b33aafe97ce /gtk2_ardour/editor_ops.cc
parent0c71b89a15ffde9e64601ced0ba201484eaf15dd (diff)
fixed uninitialized variable that made ardour scrub at the wrong times
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3064 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r--gtk2_ardour/editor_ops.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index b49594a2eb..7959ae1308 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -5286,17 +5286,14 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList
pl->freeze ();
pl->remove_region (ar);
- vector<boost::shared_ptr<Region> > new_regions;
- cerr << "about to split using " << positions.size() << " positions" << endl;
-
while (x != positions.end()) {
/* file start = original start + how far we from the initial position ?
*/
nframes64_t file_start = ar->start() + (pos - ar->position());
-
+
/* length = next position - current position
*/
@@ -5313,27 +5310,32 @@ Editor::split_region_at_points (boost::shared_ptr<Region> r, AnalysisFeatureList
string new_name;
if (session->region_name (new_name, ar->name())) {
- continue;
+ break;
}
/* do NOT announce new regions 1 by one, just wait till they are all done */
boost::shared_ptr<Region> r = RegionFactory::create (ar->get_sources(), file_start, len, new_name, 0, Region::DefaultFlags, false);
pl->add_region (r, pos);
- new_regions.push_back (r);
-
- cerr << "done at " << pos << endl;
pos += len;
++x;
if (*x > ar->last_frame()) {
+
+ /* add final fragment */
+
+ file_start = ar->start() + (pos - ar->position());
+ len = ar->last_frame() - pos;
+
+ boost::shared_ptr<Region> r = RegionFactory::create (ar->get_sources(), file_start, len, new_name, 0, Region::DefaultFlags);
+ pl->add_region (r, pos);
+
break;
}
}
pl->thaw ();
- session->add_regions (new_regions);
XMLNode& after (pl->get_state());