Fix for the persistent rec-region problem.
authorDavid Robillard <d@drobilla.net>
Sat, 16 Sep 2006 02:58:22 +0000 (02:58 +0000)
committerDavid Robillard <d@drobilla.net>
Sat, 16 Sep 2006 02:58:22 +0000 (02:58 +0000)
git-svn-id: svn://localhost/ardour2/trunk@916 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/audio_streamview.cc
gtk2_ardour/streamview.cc
gtk2_ardour/streamview.h

index fcf2289570d9c9e0fc78b7a7555c31b80a4fd654..9a6f1f25a2335a2733f5c42ee9020865103ea23d 100644 (file)
@@ -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();
 
index 555112e0816666950722d29bee7f70d3083e0b96..46ac213f7a6b238d286046ba1993a96de23fe809 100644 (file)
@@ -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 ()
index 64a1ef74c1be0d8b2ab8673c99e9462d819acc5c..b83c082b08338ca77c693ef2db6f1c99f5e99f35 100644 (file)
@@ -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 ();