summaryrefslogtreecommitdiff
path: root/gtk2_ardour/selection.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-12-25 21:06:52 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-12-25 21:06:52 +0000
commitb6f4cdaea27fbf49f924b2684d4c638089314067 (patch)
tree4328e93333d13eccadc18455ba32a7293d3cbd73 /gtk2_ardour/selection.cc
parentf53cbaede885cd52b8fee59890e33575a4fc11fa (diff)
rationalize destruction pathway (some more); tidy-ify some ImageFrame code
git-svn-id: svn://localhost/ardour2/branches/3.0@6398 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/selection.cc')
-rw-r--r--gtk2_ardour/selection.cc30
1 files changed, 16 insertions, 14 deletions
diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc
index b2cb88a008..065100a2d8 100644
--- a/gtk2_ardour/selection.cc
+++ b/gtk2_ardour/selection.cc
@@ -46,6 +46,22 @@ struct AudioRangeComparator {
}
};
+Selection::Selection (const PublicEditor* e)
+ : tracks (e)
+ , editor (e)
+ , next_time_id (0)
+{
+ clear ();
+
+ /* we have disambiguate which remove() for the compiler */
+
+ void (Selection::*track_remove)(TimeAxisView*) = &Selection::remove;
+ TimeAxisView::CatchDeletion.connect (*this, ui_bind (track_remove, this, _1), gui_context());
+
+ void (Selection::*marker_remove)(Marker*) = &Selection::remove;
+ Marker::CatchDeletion.connect (*this, ui_bind (marker_remove, this, _1), gui_context());
+}
+
#if 0
Selection&
Selection::operator= (const Selection& other)
@@ -209,8 +225,6 @@ Selection::toggle (TimeAxisView* track)
TrackSelection::iterator i;
if ((i = find (tracks.begin(), tracks.end(), track)) == tracks.end()) {
- void (Selection::*pmf)(TimeAxisView*) = &Selection::remove;
- track->CatchDeletion.connect (*this, boost::bind (pmf, this, track), gui_context());
tracks.push_back (track);
} else {
tracks.erase (i);
@@ -337,11 +351,6 @@ Selection::add (const TrackViewList& track_list)
{
TrackViewList added = tracks.add (track_list);
- for (list<TimeAxisView*>::const_iterator i = added.begin(); i != added.end(); ++i) {
- void (Selection::*pmf)(TimeAxisView*) = &Selection::remove;
- (*i)->CatchDeletion.connect (*this, boost::bind (pmf, this, (*i)), gui_context());
- }
-
if (!added.empty()) {
TracksChanged ();
}
@@ -945,13 +954,6 @@ void
Selection::add (Marker* m)
{
if (find (markers.begin(), markers.end(), m) == markers.end()) {
-
- /* disambiguate which remove() for the compiler */
-
- void (Selection::*pmf)(Marker*) = &Selection::remove;
-
- m->CatchDeletion.connect (*this, boost::bind (pmf, this, _1), gui_context());
-
markers.push_back (m);
MarkersChanged();
}