// 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());
}
/**
*/
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)
else
{
marker_time_axis_list.push_back(marker_track) ;
- scoped_connect (marker_track->GoingAway, boost::bind (&ImageFrameTimeAxis::remove_time_axis_view, this, marker_track, (void*)this));
-
MarkerTimeAxisAdded(marker_track, src) ; /* EMIT_SIGNAL */
ret = true ;
}
* @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<MarkerTimeAxisView*> (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 */
}
}