summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-09-16 02:58:22 +0000
committerDavid Robillard <d@drobilla.net>2006-09-16 02:58:22 +0000
commit5cbce5b762263e8bd67d439c2e02d5f407a0e541 (patch)
treed3cd625c86c3ef76d7fce64fe7527e5d4d16a5ef
parentdc9484d1449d04923849316a3ac7c74c4c49ec23 (diff)
Fix for the persistent rec-region problem.
git-svn-id: svn://localhost/ardour2/trunk@916 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/audio_streamview.cc16
-rw-r--r--gtk2_ardour/streamview.cc3
-rw-r--r--gtk2_ardour/streamview.h2
3 files changed, 13 insertions, 8 deletions
diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc
index fcf2289570..9a6f1f25a2 100644
--- a/gtk2_ardour/audio_streamview.cc
+++ b/gtk2_ardour/audio_streamview.cc
@@ -217,9 +217,7 @@ AudioStreamView::playlist_modified ()
StreamView::playlist_modified();
- /* if the playlist is modified, make sure xfades are on top and all the regionviews are stacked
- correctly.
- */
+ /* make sure xfades are on top and all the regionviews are stacked correctly. */
for (list<CrossfadeView *>::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
(*i)->get_canvas_group()->raise_to_top();
@@ -423,8 +421,8 @@ AudioStreamView::setup_rec_box ()
(RegionFactory::create (sources, start, 1 , "", 0, (Region::Flag)(Region::DefaultFlags | Region::DoNotSaveState), false)));
region->set_position (_trackview.session().transport_frame(), this);
rec_regions.push_back (region);
- /* catch it if it goes away */
- region->GoingAway.connect (bind (mem_fun (*this, &AudioStreamView::remove_rec_region), region));
+
+ // rec regions are destroyed in setup_rec_box
/* we add the region later */
}
@@ -506,6 +504,9 @@ AudioStreamView::setup_rec_box ()
/* remove temp regions */
+ for (list<boost::shared_ptr<ARDOUR::Region> >::iterator i = rec_regions.begin(); i != rec_regions.end(); ++i) {
+ (*i)->drop_references();
+ }
rec_regions.clear();
// cerr << "\tclear " << rec_rects.size() << " rec rects\n";
@@ -569,9 +570,10 @@ AudioStreamView::update_rec_regions ()
continue;
}
- // FIXME
boost::shared_ptr<AudioRegion> region = boost::dynamic_pointer_cast<AudioRegion>(*iter);
- assert(region);
+ if (!region) {
+ continue;
+ }
jack_nframes_t origlen = region->length();
diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc
index 555112e081..46ac213f7a 100644
--- a/gtk2_ardour/streamview.cc
+++ b/gtk2_ardour/streamview.cc
@@ -177,6 +177,8 @@ StreamView::remove_region_view (boost::shared_ptr<Region> r)
}
}
+#if 0
+(unused)
void
StreamView::remove_rec_region (boost::shared_ptr<Region> r)
{
@@ -194,6 +196,7 @@ StreamView::remove_rec_region (boost::shared_ptr<Region> r)
}
}
}
+#endif
void
StreamView::undisplay_diskstream ()
diff --git a/gtk2_ardour/streamview.h b/gtk2_ardour/streamview.h
index 64a1ef74c1..b83c082b08 100644
--- a/gtk2_ardour/streamview.h
+++ b/gtk2_ardour/streamview.h
@@ -109,7 +109,7 @@ protected:
virtual void add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves) = 0;
virtual void remove_region_view (boost::shared_ptr<ARDOUR::Region> );
- void remove_rec_region (boost::shared_ptr<ARDOUR::Region>);
+ //void remove_rec_region (boost::shared_ptr<ARDOUR::Region>); (unused)
void display_diskstream (boost::shared_ptr<ARDOUR::Diskstream>);
virtual void undisplay_diskstream ();