2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2003 Paul Davis
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
#include <gtkmm.h>
|
|
|
|
#include <gtkmm2ext/gtk_ui.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include "imageframe_time_axis_group.h"
|
|
|
|
#include "imageframe_time_axis_view.h"
|
|
|
|
#include "imageframe_view.h"
|
|
|
|
#include "imageframe_time_axis.h"
|
|
|
|
#include "canvas-simplerect.h"
|
|
|
|
#include "region_selection.h"
|
|
|
|
#include "public_editor.h"
|
|
|
|
#include "gui_thread.h"
|
|
|
|
|
|
|
|
#include "i18n.h"
|
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
using namespace ARDOUR;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-22 15:21:43 -05:00
|
|
|
PBD::Signal1<void,ImageFrameTimeAxisGroup*> ImageFrameTimeAxisGroup::CatchDeletion;
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Constructor / Desctructor
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Constructs a new ImageFrameTimeAxisGroup.
|
|
|
|
*
|
|
|
|
* @param iftav the parent ImageFrameTimeAxis of this view helper
|
|
|
|
* @param group_id the unique name/id of this group
|
|
|
|
*/
|
2005-12-22 07:23:54 -05:00
|
|
|
ImageFrameTimeAxisGroup::ImageFrameTimeAxisGroup(ImageFrameTimeAxisView& iftav, const string & group_id)
|
2005-09-25 14:42:24 -04:00
|
|
|
: _view_helper(iftav), _group_id(group_id)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
selected_imageframe_item = 0;
|
|
|
|
is_selected = false;
|
|
|
|
|
2012-04-25 08:58:19 -04:00
|
|
|
ImageFrameView::CatchDeletion.connect (*this, boost::bind (&ImageFrameTimeAxisGroup::remove_imageframe_item, this, _1), gui_context());
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor
|
|
|
|
* Responsible for destroying any Items that may have been added to this group
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
ImageFrameTimeAxisGroup::~ImageFrameTimeAxisGroup()
|
|
|
|
{
|
|
|
|
// Destroy all the ImageFramViews that we have
|
|
|
|
for(ImageFrameViewList::iterator iter = imageframe_views.begin(); iter != imageframe_views.end(); ++iter)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
ImageFrameView* ifv = *iter;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
ImageFrameViewList::iterator next = iter;
|
|
|
|
next++;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
imageframe_views.erase(iter);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
delete ifv;
|
|
|
|
ifv = 0;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
iter = next;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
CatchDeletion; /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Name/Id Accessors/Mutators
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Set the name/Id of this group.
|
|
|
|
*
|
|
|
|
* @param new_name the new name of this group
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
|
|
|
void
|
2005-12-22 07:23:54 -05:00
|
|
|
ImageFrameTimeAxisGroup::set_group_name(const string & new_name, void* src)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
if(_group_id != new_name)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
std::string temp_name = _group_id;
|
|
|
|
_group_id = new_name;
|
|
|
|
NameChanged(_group_id, temp_name, src); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the id of this group
|
|
|
|
* The group id must be unique upon a time axis
|
|
|
|
*
|
|
|
|
* @return the id of this group
|
|
|
|
*/
|
|
|
|
std::string
|
|
|
|
ImageFrameTimeAxisGroup::get_group_name() const
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
return(_group_id);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// ui methods & data
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the height of the time axis view and the item upon it
|
|
|
|
*
|
|
|
|
* @param height the new height
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
ImageFrameTimeAxisGroup::set_item_heights(gdouble h)
|
|
|
|
{
|
|
|
|
/* limit the values to something sane-ish */
|
|
|
|
if (h < 10.0 || h > 1000.0)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
return(-1);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// set the heights of all the imaeg frame views within the group
|
|
|
|
for(ImageFrameViewList::const_iterator citer = imageframe_views.begin(); citer != imageframe_views.end(); ++citer)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
(*citer)->set_height(h);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
return(0);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the current samples per unit.
|
|
|
|
* this method tells each item upon the time axis of the change
|
2009-10-14 12:10:01 -04:00
|
|
|
*
|
2005-09-25 14:42:24 -04:00
|
|
|
* @param spu the new samples per canvas unit value
|
|
|
|
*/
|
2009-10-14 12:10:01 -04:00
|
|
|
int
|
2005-09-25 14:42:24 -04:00
|
|
|
ImageFrameTimeAxisGroup::set_item_samples_per_units(gdouble spp)
|
|
|
|
{
|
|
|
|
if(spp < 1.0)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
return(-1);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
for(ImageFrameViewList::const_iterator citer = imageframe_views.begin(); citer != imageframe_views.end(); ++citer)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
(*citer)->set_samples_per_unit(spp);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
return(0);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the color of the items contained uopn this view helper
|
|
|
|
*
|
|
|
|
* @param color the new base color
|
|
|
|
*/
|
|
|
|
void
|
2005-10-06 00:59:20 -04:00
|
|
|
ImageFrameTimeAxisGroup::apply_item_color(Gdk::Color& color)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
region_color = color;
|
2005-09-25 14:42:24 -04:00
|
|
|
for(ImageFrameViewList::const_iterator citer = imageframe_views.begin(); citer != imageframe_views.end(); citer++)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
(*citer)->set_color (region_color);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// child ImageFrameView methods
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds an ImageFrameView to the list of items upon this time axis view helper
|
|
|
|
* the new ImageFrameView is returned
|
|
|
|
*
|
|
|
|
* @param item_id the unique id of the new item
|
|
|
|
* @param image_id the id/name of the image data we are usin
|
|
|
|
* @param start the position the new item should be placed upon the time line
|
|
|
|
* @param duration the duration the new item should be placed upon the timeline
|
|
|
|
* @param rgb_data the rgb data of the image
|
|
|
|
* @param width the original image width of the rgb_data (not the size to display)
|
|
|
|
* @param height the irigianl height of the rgb_data
|
|
|
|
* @param num_channels the number of channles within the rgb_data
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
|
|
|
ImageFrameView*
|
2010-12-03 17:26:29 -05:00
|
|
|
ImageFrameTimeAxisGroup::add_imageframe_item(const string & frame_id, framepos_t start, framecnt_t duration, unsigned char* rgb_data, uint32_t width, uint32_t height, uint32_t num_channels, void* src)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
ImageFrameView* ifv = 0;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
//check that there is not already an imageframe with that id
|
|
|
|
if(get_named_imageframe_item(frame_id) == 0)
|
|
|
|
{
|
|
|
|
ifv = new ImageFrameView(frame_id,
|
2005-11-23 12:21:12 -05:00
|
|
|
_view_helper.canvas_item()->property_parent(),
|
2005-09-25 14:42:24 -04:00
|
|
|
&(_view_helper.trackview()),
|
|
|
|
this,
|
|
|
|
_view_helper.trackview().editor.get_current_zoom(),
|
|
|
|
region_color,
|
|
|
|
start,
|
|
|
|
duration,
|
|
|
|
rgb_data,
|
|
|
|
width,
|
|
|
|
height,
|
2009-12-25 16:06:52 -05:00
|
|
|
num_channels);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
imageframe_views.push_front(ifv);
|
|
|
|
ImageFrameAdded(ifv, src); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
return(ifv);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the named ImageFrameView or 0 if the named view does not exist on this view helper
|
|
|
|
*
|
|
|
|
* @param item_id the unique id of the item to search for
|
|
|
|
* @return the named ImageFrameView, or 0 if it is not held upon this view
|
|
|
|
*/
|
|
|
|
ImageFrameView*
|
2005-12-22 07:23:54 -05:00
|
|
|
ImageFrameTimeAxisGroup::get_named_imageframe_item(const string & frame_id)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
ImageFrameView* ifv = 0;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
for (ImageFrameViewList::const_iterator i = imageframe_views.begin(); i != imageframe_views.end(); ++i)
|
|
|
|
{
|
|
|
|
if (((ImageFrameView*)*i)->get_item_name() == frame_id)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
ifv = ((ImageFrameView*)*i);
|
|
|
|
break;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
2009-12-25 16:06:52 -05:00
|
|
|
return(ifv);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Removes the currently selected ImageFrameView
|
|
|
|
*
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @todo need to remoev this, the selected item within group is no longer
|
|
|
|
* used in favour of a time axis selected item
|
|
|
|
* @see add_imageframe_view
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
ImageFrameTimeAxisGroup::remove_selected_imageframe_item(void* src)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
std::string frame_id;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
if(selected_imageframe_item)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
ImageFrameViewList::iterator i;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
if((i = find(imageframe_views.begin(), imageframe_views.end(), selected_imageframe_item)) != imageframe_views.end())
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
imageframe_views.erase(i);
|
|
|
|
frame_id = selected_imageframe_item->get_item_name();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
// note that we delete the item here
|
2009-12-25 16:06:52 -05:00
|
|
|
delete(selected_imageframe_item);
|
|
|
|
selected_imageframe_item = 0;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
std::string track_id = _view_helper.trackview().name();
|
|
|
|
ImageFrameRemoved(track_id, _group_id, frame_id, src); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
//cerr << "No Selected ImageFrame" << endl;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
/**
|
|
|
|
* Removes and returns the named ImageFrameView from the list of ImageFrameViews held by this view helper
|
|
|
|
*
|
|
|
|
* @param item_id the ImageFrameView unique id to remove
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
* @see add_imageframe_view
|
|
|
|
*/
|
|
|
|
ImageFrameView*
|
2005-12-22 07:23:54 -05:00
|
|
|
ImageFrameTimeAxisGroup::remove_named_imageframe_item(const string & frame_id, void* src)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
ImageFrameView* removed = 0;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
for(ImageFrameViewList::iterator iter = imageframe_views.begin(); iter != imageframe_views.end(); ++iter)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
ImageFrameView* tempItem = *iter;
|
2005-09-25 14:42:24 -04:00
|
|
|
if(tempItem->get_item_name() == frame_id)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
removed = tempItem;
|
|
|
|
imageframe_views.erase(iter);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
if (removed == selected_imageframe_item)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
selected_imageframe_item = 0;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
std::string track_id = _view_helper.trackview().name();
|
|
|
|
ImageFrameRemoved(track_id, _group_id, frame_id, src); /* EMIT_SIGNAL */
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
// break from the for loop
|
2009-12-25 16:06:52 -05:00
|
|
|
break;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-12-25 16:06:52 -05:00
|
|
|
iter++;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
return(removed);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes ifv from the list of ImageFrameViews upon this TimeAxis.
|
|
|
|
* if ifv is not upon this TimeAxis, this method takes no action
|
|
|
|
*
|
|
|
|
* @param ifv the ImageFrameView to remove
|
|
|
|
*/
|
|
|
|
void
|
2009-12-25 16:06:52 -05:00
|
|
|
ImageFrameTimeAxisGroup::remove_imageframe_item (ImageFrameView* ifv)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2009-12-11 18:29:48 -05:00
|
|
|
ENSURE_GUI_THREAD (*this, &ImageFrameTimeAxisGroup::remove_imageframe_item, ifv, src)
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
ImageFrameViewList::iterator i;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
if((i = find (imageframe_views.begin(), imageframe_views.end(), ifv)) != imageframe_views.end()) {
|
|
|
|
imageframe_views.erase(i);
|
|
|
|
|
|
|
|
std::string frame_id = ifv->get_item_name();
|
|
|
|
std::string track_id = _view_helper.trackview().name();
|
|
|
|
ImageFrameRemoved(track_id, _group_id, frame_id, src); /* EMIT_SIGNAL */
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Selected group methods
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the currently selected item upon this time axis
|
|
|
|
*
|
|
|
|
* @param ifv the item to set selected
|
|
|
|
*/
|
|
|
|
//void
|
|
|
|
//ImageFrameTimeAxisGroup::set_selected_imageframe_item(ImageFrameView* ifv)
|
|
|
|
//{
|
|
|
|
// if(selected_imageframe_item)
|
|
|
|
// {
|
2009-12-25 16:06:52 -05:00
|
|
|
// selected_imageframe_item->set_selected(false, this);
|
2005-09-25 14:42:24 -04:00
|
|
|
// }
|
2009-10-14 12:10:01 -04:00
|
|
|
//
|
2009-12-25 16:06:52 -05:00
|
|
|
// selected_imageframe_item = ifv;
|
2009-10-14 12:10:01 -04:00
|
|
|
//
|
2005-09-25 14:42:24 -04:00
|
|
|
// if(!ifv->get_selected())
|
|
|
|
// {
|
2009-12-25 16:06:52 -05:00
|
|
|
// selected_imageframe_item->set_selected(true, this);
|
2005-09-25 14:42:24 -04:00
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the currently selected item upon this time axis to the named item
|
|
|
|
*
|
|
|
|
* @param item_id the name/id of the item to set selected
|
|
|
|
*/
|
|
|
|
//void
|
|
|
|
//ImageFrameTimeAxisGroup::set_selected_imageframe_item(std::string frame_id)
|
|
|
|
//{
|
2009-12-25 16:06:52 -05:00
|
|
|
// selected_imageframe_item = get_named_imageframe_item(frame_id);
|
2005-09-25 14:42:24 -04:00
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the currently selected item upon this time axis
|
|
|
|
*
|
|
|
|
* @return the currently selected item pon this time axis
|
|
|
|
*/
|
|
|
|
// ImageFrameView*
|
|
|
|
// ImageFrameTimeAxisGroup::get_selected_imageframe_item()
|
|
|
|
// {
|
2009-12-25 16:06:52 -05:00
|
|
|
// return(selected_imageframe_item);
|
2005-09-25 14:42:24 -04:00
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this grou pis currently selected
|
|
|
|
*
|
|
|
|
* @returns true if this group is currently selected
|
|
|
|
*/
|
|
|
|
bool
|
|
|
|
ImageFrameTimeAxisGroup::get_selected() const
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
return(is_selected);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets he selected state of this group
|
|
|
|
*
|
|
|
|
* @param yn set true if this group is selected, false otherwise
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
ImageFrameTimeAxisGroup::set_selected(bool yn)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
is_selected = yn;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------//
|
|
|
|
// Handle time axis removal
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles the Removal of this VisualTimeAxis
|
|
|
|
* This _needs_ to be called to alert others of the removal properly, ie where the source
|
|
|
|
* of the removal came from.
|
|
|
|
*
|
|
|
|
* XXX Although im not too happy about this method of doing things, I cant think of a cleaner method
|
|
|
|
* just now to capture the source of the removal
|
|
|
|
*
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
ImageFrameTimeAxisGroup::remove_this_group(void* src)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
defer to idle loop, otherwise we'll delete this object
|
|
|
|
while we're still inside this function ...
|
|
|
|
*/
|
2009-12-11 18:29:48 -05:00
|
|
|
Glib::signal_idle().connect(sigc::bind(ptr_fun(&ImageFrameTimeAxisGroup::idle_remove_this_group), this, src));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback used to remove this group during the gtk idle loop
|
|
|
|
* This is used to avoid deleting the obejct while inside the remove_this_group
|
|
|
|
* method
|
|
|
|
*
|
|
|
|
* @param group the ImageFrameTimeAxisGroup to remove
|
|
|
|
* @param src the identity of the object that initiated the change
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
ImageFrameTimeAxisGroup::idle_remove_this_group(ImageFrameTimeAxisGroup* group, void* src)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
delete group;
|
|
|
|
group = 0;
|
|
|
|
group->GroupRemoved(group->get_group_name(), src); /* EMIT_SIGNAL */
|
|
|
|
return(false);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|