diff options
author | Carl Hetherington <carl@carlh.net> | 2009-07-09 17:58:13 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-07-09 17:58:13 +0000 |
commit | 402cc384ced6cb152c8abe4294009fe0de0a6dea (patch) | |
tree | f01db6b412cb8e2d3c69fa123fd615c229ee47d3 /gtk2_ardour/selection.cc | |
parent | cc351b97a986fca48a6b3b631a292bf24efc5e41 (diff) |
Back out big shared_ptr change. Moving to a branch. Apologies all.
git-svn-id: svn://localhost/ardour2/branches/3.0@5343 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/selection.cc')
-rw-r--r-- | gtk2_ardour/selection.cc | 65 |
1 files changed, 27 insertions, 38 deletions
diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index c957e4a244..2eafcf220c 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -112,7 +112,7 @@ Selection::clear_tracks () void Selection::clear_time () { - time.track.reset (); + time.track = 0; time.group = 0; time.clear(); @@ -170,22 +170,21 @@ Selection::toggle (boost::shared_ptr<Playlist> pl) } void -Selection::toggle (const list<TimeAxisViewPtr>& track_list) +Selection::toggle (const list<TimeAxisView*>& track_list) { - for (list<TimeAxisViewPtr>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) { + for (list<TimeAxisView*>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) { toggle ( (*i) ); } } void -Selection::toggle (TimeAxisViewPtr track) +Selection::toggle (TimeAxisView* track) { TrackSelection::iterator i; if ((i = find (tracks.begin(), tracks.end(), track)) == tracks.end()) { - void (Selection::*pmf)(boost::weak_ptr<TimeAxisView>) = &Selection::remove; - boost::weak_ptr<TimeAxisView> w (track); - track->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), w)); + void (Selection::*pmf)(TimeAxisView*) = &Selection::remove; + track->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), track)); tracks.push_back (track); } else { tracks.erase (i); @@ -269,14 +268,13 @@ Selection::add (const list<boost::shared_ptr<Playlist> >& pllist) } void -Selection::add (const list<TimeAxisViewPtr>& track_list) +Selection::add (const list<TimeAxisView*>& track_list) { - list<TimeAxisViewPtr> added = tracks.add (track_list); + list<TimeAxisView*> added = tracks.add (track_list); - for (list<TimeAxisViewPtr>::const_iterator i = added.begin(); i != added.end(); ++i) { - void (Selection::*pmf)(boost::weak_ptr<TimeAxisView>) = &Selection::remove; - boost::weak_ptr<TimeAxisView> w (*i); - (*i)->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), w)); + for (list<TimeAxisView*>::const_iterator i = added.begin(); i != added.end(); ++i) { + void (Selection::*pmf)(TimeAxisView*) = &Selection::remove; + (*i)->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), (*i))); } if (!added.empty()) { @@ -285,10 +283,10 @@ Selection::add (const list<TimeAxisViewPtr>& track_list) } void -Selection::add (TimeAxisViewPtr track) +Selection::add (TimeAxisView* track) { if (find (tracks.begin(), tracks.end(), track) == tracks.end()) { - void (Selection::*pmf)(TimeAxisViewPtr) = &Selection::remove; + void (Selection::*pmf)(TimeAxisView*) = &Selection::remove; track->GoingAway.connect (sigc::bind (mem_fun (*this, pmf), track)); tracks.push_back (track); TracksChanged(); @@ -307,7 +305,7 @@ Selection::add (vector<RegionView*>& v) if (find (regions.begin(), regions.end(), (*i)) == regions.end()) { changed = regions.add ((*i)); if (Config->get_link_region_and_track_selection() && changed) { - add ((*i)->get_trackview()); + add (&(*i)->get_trackview()); } } } @@ -329,7 +327,7 @@ Selection::add (const RegionSelection& rs) if (find (regions.begin(), regions.end(), (*i)) == regions.end()) { changed = regions.add ((*i)); if (Config->get_link_region_and_track_selection() && changed) { - add ((*i)->get_trackview()); + add (&(*i)->get_trackview()); } } } @@ -345,7 +343,7 @@ Selection::add (RegionView* r) if (find (regions.begin(), regions.end(), r) == regions.end()) { regions.add (r); if (Config->get_link_region_and_track_selection()) { - add (r->get_trackview()); + add (&r->get_trackview()); } RegionsChanged (); } @@ -404,9 +402,9 @@ Selection::add (boost::shared_ptr<Evoral::ControlList> cl) } void -Selection::remove (TimeAxisViewPtr track) +Selection::remove (TimeAxisView* track) { - list<TimeAxisViewPtr>::iterator i; + list<TimeAxisView*>::iterator i; if ((i = find (tracks.begin(), tracks.end(), track)) != tracks.end()) { tracks.erase (i); TracksChanged(); @@ -414,22 +412,13 @@ Selection::remove (TimeAxisViewPtr track) } void -Selection::remove (boost::weak_ptr<TimeAxisView> w) -{ - boost::shared_ptr<TimeAxisView> t = w.lock (); - if (t) { - remove (t); - } -} - -void -Selection::remove (const list<TimeAxisViewPtr>& track_list) +Selection::remove (const list<TimeAxisView*>& track_list) { bool changed = false; - for (list<TimeAxisViewPtr>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) { + for (list<TimeAxisView*>::const_iterator i = track_list.begin(); i != track_list.end(); ++i) { - list<TimeAxisViewPtr>::iterator x; + list<TimeAxisView*>::iterator x; if ((x = find (tracks.begin(), tracks.end(), (*i))) != tracks.end()) { tracks.erase (x); @@ -480,7 +469,7 @@ Selection::remove (RegionView* r) } if (Config->get_link_region_and_track_selection() && !regions.involves (r->get_trackview())) { - remove (r->get_trackview()); + remove (&r->get_trackview()); } } @@ -518,14 +507,14 @@ Selection::remove (boost::shared_ptr<ARDOUR::AutomationList> ac) } void -Selection::set (TimeAxisViewPtr track) +Selection::set (TimeAxisView* track) { clear_tracks (); add (track); } void -Selection::set (const list<TimeAxisViewPtr>& track_list) +Selection::set (const list<TimeAxisView*>& track_list) { clear_tracks (); add (track_list); @@ -576,7 +565,7 @@ Selection::set (vector<RegionView*>& v) } long -Selection::set (TimeAxisViewPtr track, nframes_t start, nframes_t end) +Selection::set (TimeAxisView* track, nframes_t start, nframes_t end) { if ((start == 0 && end == 0) || end < start) { return 0; @@ -598,7 +587,7 @@ Selection::set (TimeAxisViewPtr track, nframes_t start, nframes_t end) time.track = track; time.group = track->route_group(); } else { - time.track.reset (); + time.track = 0; time.group = 0; } @@ -623,7 +612,7 @@ Selection::selected (Marker* m) } bool -Selection::selected (TimeAxisViewPtr tv) +Selection::selected (TimeAxisView* tv) { return find (tracks.begin(), tracks.end(), tv) != tracks.end(); } |