X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fimageframe_time_axis.cc;h=b680dbda3a9f37d1de5bb76e3fc4c3df138173df;hb=cb8bc87a542e35794a12e76a23594e63b3bad521;hp=47b56dff64b9f7410e0f7efe7df7a73d90563552;hpb=64dc5427e4f5339a16a018692dd94f476c53cae9;p=ardour.git diff --git a/gtk2_ardour/imageframe_time_axis.cc b/gtk2_ardour/imageframe_time_axis.cc index 47b56dff64..b680dbda3a 100644 --- a/gtk2_ardour/imageframe_time_axis.cc +++ b/gtk2_ardour/imageframe_time_axis.cc @@ -47,7 +47,6 @@ using namespace ARDOUR; using namespace PBD; -using namespace sigc; using namespace Gtk; /** @@ -58,7 +57,7 @@ using namespace Gtk; * @param sess the current session * @param canvas the parent canvas item */ -ImageFrameTimeAxis::ImageFrameTimeAxis(const string & track_id, PublicEditor& ed, ARDOUR::Session& sess, ArdourCanvas::Canvas& canvas) +ImageFrameTimeAxis::ImageFrameTimeAxis(const string & track_id, PublicEditor& ed, ARDOUR::Session* sess, ArdourCanvas::Canvas& canvas) : AxisView(sess), VisualTimeAxis(track_id, ed, sess, canvas) { @@ -82,6 +81,8 @@ ImageFrameTimeAxis::ImageFrameTimeAxis(const string & track_id, PublicEditor& ed // set the initial height of this time axis set_height(hNormal) ; + + TimeAxisView::CatchDeletion.connect (*this, ui_bind (&ImageFrameTimeAxis::remove_time_axis_view, this, _1), gui_context()); } /** @@ -90,7 +91,7 @@ ImageFrameTimeAxis::ImageFrameTimeAxis(const string & track_id, PublicEditor& ed */ ImageFrameTimeAxis::~ImageFrameTimeAxis () { - GoingAway() ; /* EMIT_SIGNAL */ + CatchDeletion (this); // Destroy all the marker views we may have associaited with this TimeAxis for(MarkerTimeAxisList::iterator iter = marker_time_axis_list.begin(); iter != marker_time_axis_list.end(); ++iter) @@ -323,8 +324,6 @@ ImageFrameTimeAxis::add_marker_time_axis(MarkerTimeAxis* marker_track, void* src else { marker_time_axis_list.push_back(marker_track) ; - marker_track->GoingAway.connect(sigc::bind(sigc::mem_fun(*this, &ImageFrameTimeAxis::remove_time_axis_view), marker_track, (void*)this)); - MarkerTimeAxisAdded(marker_track, src) ; /* EMIT_SIGNAL */ ret = true ; } @@ -391,17 +390,20 @@ ImageFrameTimeAxis::remove_named_marker_time_axis(const string & track_id, void* * @param src the identity of the object that initiated the change */ void -ImageFrameTimeAxis::remove_time_axis_view(MarkerTimeAxis* mta, void* src) +ImageFrameTimeAxis::remove_time_axis_view (TimeAxisView* tav) { - ENSURE_GUI_THREAD (*this, &ImageFrameTimeAxis::remove_time_axis_view, mta, src) + MarkerTimeAxisView* mtav = dynamic_cast (tav); + + if (!mtav) { + return; + } MarkerTimeAxisList::iterator i; - if((i = find (marker_time_axis_list.begin(), marker_time_axis_list.end(), mta)) != marker_time_axis_list.end()) - { + + if ((i = find (marker_time_axis_list.begin(), marker_time_axis_list.end(), mta)) != marker_time_axis_list.end()) { // note that we dont delete the object itself, we just remove it from our list marker_time_axis_list.erase(i) ; - - MarkerTimeAxisRemoved(mta->name(), src) ; /* EMIT_SIGNAL */ + MarkerTimeAxisRemoved (mta->name(), src) ; /* EMIT_SIGNAL */ } }