2 Copyright (C) 2003 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <pbd/error.h>
21 #include <pbd/stacktrace.h>
23 #include <ardour/types.h>
24 #include <ardour/ardour.h>
26 #include <gtkmm2ext/utils.h>
28 #include "public_editor.h"
29 #include "time_axis_view_item.h"
30 #include "time_axis_view.h"
31 #include "simplerect.h"
33 #include "canvas_impl.h"
34 #include "rgb_macros.h"
39 using namespace Editing;
42 using namespace ARDOUR;
44 //------------------------------------------------------------------------------
45 /** Initialize const static memeber data */
47 Pango::FontDescription TimeAxisViewItem::NAME_FONT;
48 bool TimeAxisViewItem::have_name_font = false;
49 const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
50 const double TimeAxisViewItem::GRAB_HANDLE_LENGTH = 6 ;
52 double TimeAxisViewItem::NAME_Y_OFFSET;
53 double TimeAxisViewItem::NAME_HIGHLIGHT_SIZE;
54 double TimeAxisViewItem::NAME_HIGHLIGHT_THRESH;
57 //---------------------------------------------------------------------------------------//
58 // Constructor / Desctructor
61 * Constructs a new TimeAxisViewItem.
63 * @param it_name the unique name/Id of this item
64 * @param parant the parent canvas group
65 * @param tv the TimeAxisView we are going to be added to
66 * @param spu samples per unit
68 * @param start the start point of this item
69 * @param duration the duration of this item
71 TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color,
72 nframes_t start, nframes_t duration,
76 if (!have_name_font) {
78 /* first constructed item sets up font info */
80 NAME_FONT = get_font_for_style (N_("TimeAxisViewItemName"));
86 Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout (X_("Hg")); /* ascender + descender */
90 layout->set_font_description (NAME_FONT);
91 Gtkmm2ext::get_ink_pixel_size (layout, width, height);
93 NAME_Y_OFFSET = height + 6;
94 NAME_HIGHLIGHT_SIZE = height + 6;
95 NAME_HIGHLIGHT_THRESH = NAME_HIGHLIGHT_SIZE * 2;
97 have_name_font = true;
100 group = new ArdourCanvas::Group (parent);
102 init (it_name, spu, base_color, start, duration, vis);
106 TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
107 : trackview (other.trackview)
113 UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a);
114 c.set_rgb_p (r/255.0, g/255.0, b/255.0);
116 /* share the other's parent, but still create a new group */
118 Gnome::Canvas::Group* parent = other.group->property_parent();
120 group = new ArdourCanvas::Group (*parent);
122 init (other.item_name, other.samples_per_unit, c, other.frame_position, other.item_duration, other.visibility);
127 TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_color, nframes_t start, nframes_t duration, Visibility vis)
129 item_name = it_name ;
130 name_text_width = ::pixel_width (it_name, NAME_FONT);
131 last_name_text_width = 0;
132 samples_per_unit = spu ;
133 should_show_selection = true;
134 frame_position = start ;
135 item_duration = duration ;
136 name_connected = false;
137 // why? fill_opacity = 60;
138 position_locked = false ;
139 max_item_duration = ARDOUR::max_frames;
140 min_item_duration = 0 ;
141 show_vestigial = true;
146 warning << "Time Axis Item Duration == 0" << endl ;
149 vestigial_frame = new ArdourCanvas::SimpleRect (*group);
150 vestigial_frame->property_x1() = (double) 0.0;
151 vestigial_frame->property_y1() = (double) 1.0;
152 vestigial_frame->property_x2() = 2.0;
153 vestigial_frame->property_y2() = (double) trackview.height;
154 vestigial_frame->property_outline_color_rgba() = Config->canvasvar_VestigialFrame.get();
155 vestigial_frame->property_fill_color_rgba() = Config->canvasvar_VestigialFrame.get();
156 vestigial_frame->hide ();
158 if (visibility & ShowFrame) {
159 frame = new ArdourCanvas::SimpleRect (*group);
160 frame->property_x1() = (double) 0.0;
161 frame->property_y1() = (double) 1.0;
162 frame->property_x2() = (double) trackview.editor.frame_to_pixel(duration);
163 frame->property_y2() = (double) trackview.height;
164 frame->property_outline_color_rgba() = Config->canvasvar_TimeAxisFrame.get();
165 frame->property_fill_color_rgba() = Config->canvasvar_TimeAxisFrame.get();
167 /* by default draw all 4 edges */
169 uint32_t outline_what = 0x1|0x2|0x4|0x8;
171 if (visibility & HideFrameLeft) {
172 outline_what &= ~(0x1);
175 if (visibility & HideFrameRight) {
176 outline_what &= ~(0x2);
179 if (visibility & HideFrameTB) {
180 outline_what &= ~(0x4 | 0x8);
183 frame->property_outline_what() = outline_what;
189 if (visibility & ShowNameHighlight) {
190 name_highlight = new ArdourCanvas::SimpleRect (*group);
191 if (visibility & FullWidthNameHighlight) {
192 name_highlight->property_x1() = (double) 0.0;
193 name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration));
195 name_highlight->property_x1() = (double) 1.0;
196 name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration)) - 1;
198 name_highlight->property_y1() = (double) (trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE);
199 name_highlight->property_y2() = (double) (trackview.height - 1);
200 name_highlight->property_outline_color_rgba() = Config->canvasvar_NameHighlightFill.get();
201 name_highlight->property_fill_color_rgba() = Config->canvasvar_NameHighlightOutline.get();
203 name_highlight->set_data ("timeaxisviewitem", this);
209 if (visibility & ShowNameText) {
210 name_text = new ArdourCanvas::Text (*group);
211 name_text->property_x() = (double) TimeAxisViewItem::NAME_X_OFFSET;
212 /* trackview.height is the bottom of the trackview. subtract 1 to get back to the bottom of the highlight,
213 then NAME_Y_OFFSET to position the text in the vertical center of the highlight
215 name_text->property_y() = (double) trackview.height - 1.0 - TimeAxisViewItem::NAME_Y_OFFSET;
216 name_text->property_font_desc() = NAME_FONT;
217 name_text->property_anchor() = Gtk::ANCHOR_NW;
219 name_text->set_data ("timeaxisviewitem", this);
225 /* create our grab handles used for trimming/duration etc */
227 if (visibility & ShowHandles) {
228 frame_handle_start = new ArdourCanvas::SimpleRect (*group);
229 frame_handle_start->property_x1() = (double) 0.0;
230 frame_handle_start->property_x2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH;
231 frame_handle_start->property_y1() = (double) 1.0;
232 frame_handle_start->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH+1;
233 frame_handle_start->property_outline_color_rgba() = Config->canvasvar_FrameHandle.get();
234 frame_handle_start->property_fill_color_rgba() = Config->canvasvar_FrameHandle.get();
236 frame_handle_end = new ArdourCanvas::SimpleRect (*group);
237 frame_handle_end->property_x1() = (double) (trackview.editor.frame_to_pixel(get_duration())) - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
238 frame_handle_end->property_x2() = (double) trackview.editor.frame_to_pixel(get_duration());
239 frame_handle_end->property_y1() = (double) 1;
240 frame_handle_end->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH + 1;
241 frame_handle_end->property_outline_color_rgba() = Config->canvasvar_FrameHandle.get();
242 frame_handle_end->property_fill_color_rgba() = Config->canvasvar_FrameHandle.get();
245 frame_handle_start = 0;
246 frame_handle_end = 0;
249 set_color (base_color) ;
251 set_duration (item_duration, this) ;
252 set_position (start, this) ;
258 TimeAxisViewItem::~TimeAxisViewItem()
264 //---------------------------------------------------------------------------------------//
265 // Position and duration Accessors/Mutators
268 * Set the position of this item upon the timeline to the specified value
270 * @param pos the new position
271 * @param src the identity of the object that initiated the change
272 * @return true if the position change was a success, false otherwise
275 TimeAxisViewItem::set_position(nframes_t pos, void* src, double* delta)
277 if (position_locked) {
281 frame_position = pos;
283 /* This sucks. The GnomeCanvas version I am using
284 doesn't correctly implement gnome_canvas_group_set_arg(),
285 so that simply setting the "x" arg of the group
286 fails to move the group. Instead, we have to
287 use gnome_canvas_item_move(), which does the right
288 thing. I see that in GNOME CVS, the current (Sept 2001)
289 version of GNOME Canvas rectifies this issue cleanly.
292 double old_unit_pos ;
293 double new_unit_pos = pos / samples_per_unit ;
295 old_unit_pos = group->property_x();
297 if (new_unit_pos != old_unit_pos) {
298 group->move (new_unit_pos - old_unit_pos, 0.0);
302 (*delta) = new_unit_pos - old_unit_pos;
305 PositionChanged (frame_position, src) ; /* EMIT_SIGNAL */
311 * Return the position of this item upon the timeline
313 * @return the position of this item
316 TimeAxisViewItem::get_position() const
318 return frame_position;
322 * Sets the duration of this item
324 * @param dur the new duration of this item
325 * @param src the identity of the object that initiated the change
326 * @return true if the duration change was succesful, false otherwise
329 TimeAxisViewItem::set_duration (nframes_t dur, void* src)
331 if ((dur > max_item_duration) || (dur < min_item_duration)) {
332 warning << string_compose (_("new duration %1 frames is out of bounds for %2"), get_item_name(), dur)
343 reset_width_dependent_items (trackview.editor.frame_to_pixel (dur));
345 DurationChanged (dur, src) ; /* EMIT_SIGNAL */
350 * Returns the duration of this item
354 TimeAxisViewItem::get_duration() const
356 return (item_duration);
360 * Sets the maximum duration that this item make have.
362 * @param dur the new maximum duration
363 * @param src the identity of the object that initiated the change
366 TimeAxisViewItem::set_max_duration(nframes_t dur, void* src)
368 max_item_duration = dur ;
369 MaxDurationChanged(max_item_duration, src) ; /* EMIT_SIGNAL */
373 * Returns the maxmimum duration that this item may be set to
375 * @return the maximum duration that this item may be set to
378 TimeAxisViewItem::get_max_duration() const
380 return (max_item_duration) ;
384 * Sets the minimu duration that this item may be set to
386 * @param the minimum duration that this item may be set to
387 * @param src the identity of the object that initiated the change
390 TimeAxisViewItem::set_min_duration(nframes_t dur, void* src)
392 min_item_duration = dur ;
393 MinDurationChanged(max_item_duration, src) ; /* EMIT_SIGNAL */
397 * Returns the minimum duration that this item mey be set to
399 * @return the nimum duration that this item mey be set to
402 TimeAxisViewItem::get_min_duration() const
404 return(min_item_duration) ;
408 * Sets whether the position of this Item is locked to its current position
409 * Locked items cannot be moved until the item is unlocked again.
411 * @param yn set to true to lock this item to its current position
412 * @param src the identity of the object that initiated the change
415 TimeAxisViewItem::set_position_locked(bool yn, void* src)
417 position_locked = yn ;
418 set_trim_handle_colors() ;
419 PositionLockChanged (position_locked, src); /* EMIT_SIGNAL */
423 * Returns whether this item is locked to its current position
425 * @return true if this item is locked to its current posotion
429 TimeAxisViewItem::get_position_locked() const
431 return (position_locked);
435 * Sets whether the Maximum Duration constraint is active and should be enforced
437 * @param active set true to enforce the max duration constraint
438 * @param src the identity of the object that initiated the change
441 TimeAxisViewItem::set_max_duration_active(bool active, void* src)
443 max_duration_active = active ;
447 * Returns whether the Maximum Duration constraint is active and should be enforced
449 * @return true if the maximum duration constraint is active, false otherwise
452 TimeAxisViewItem::get_max_duration_active() const
454 return(max_duration_active) ;
458 * Sets whether the Minimum Duration constraint is active and should be enforced
460 * @param active set true to enforce the min duration constraint
461 * @param src the identity of the object that initiated the change
464 TimeAxisViewItem::set_min_duration_active(bool active, void* src)
466 min_duration_active = active ;
470 * Returns whether the Maximum Duration constraint is active and should be enforced
472 * @return true if the maximum duration constraint is active, false otherwise
475 TimeAxisViewItem::get_min_duration_active() const
477 return(min_duration_active) ;
480 //---------------------------------------------------------------------------------------//
481 // Name/Id Accessors/Mutators
484 * Set the name/Id of this item.
486 * @param new_name the new name of this item
487 * @param src the identity of the object that initiated the change
490 TimeAxisViewItem::set_item_name(std::string new_name, void* src)
492 if (new_name != item_name) {
493 std::string temp_name = item_name ;
494 item_name = new_name ;
495 name_text_width = ::pixel_width (new_name, NAME_FONT);
496 NameChanged (item_name, temp_name, src) ; /* EMIT_SIGNAL */
501 * Returns the name/id of this item
503 * @return the name/id of this item
506 TimeAxisViewItem::get_item_name() const
511 //---------------------------------------------------------------------------------------//
515 * Set to true to indicate that this item is currently selected
517 * @param yn true if this item is currently selected
518 * @param src the identity of the object that initiated the change
521 TimeAxisViewItem::set_selected(bool yn)
523 if (_selected != yn) {
524 Selectable::set_selected (yn);
530 TimeAxisViewItem::set_should_show_selection (bool yn)
532 if (should_show_selection != yn) {
533 should_show_selection = yn;
538 //---------------------------------------------------------------------------------------//
539 // Parent Componenet Methods
542 * Returns the TimeAxisView that this item is upon
544 * @return the timeAxisView that this item is placed upon
547 TimeAxisViewItem::get_time_axis_view()
551 //---------------------------------------------------------------------------------------//
555 * Sets the displayed item text
556 * This item is the visual text name displayed on the canvas item, this can be different to the name of the item
558 * @param new_name the new name text to display
561 TimeAxisViewItem::set_name_text(const ustring& new_name)
564 name_text->property_text() = new_name;
565 name_text_width = pixel_width (new_name, NAME_FONT);
566 name_text_size_cache.clear ();
571 * Set the y position and height of this item.
573 * @param y the new y position
574 * @param h the new height
577 TimeAxisViewItem::set_y_position_and_height (double y, double h)
579 if (name_highlight) {
580 if (h < NAME_HIGHLIGHT_THRESH) {
581 name_highlight->hide();
586 name_highlight->show();
592 if (h > NAME_HIGHLIGHT_SIZE) {
593 name_highlight->property_y1() = (double) y + h + 1 - NAME_HIGHLIGHT_SIZE;
594 name_highlight->property_y2() = (double) y + h;
597 /* it gets hidden now anyway */
598 name_highlight->property_y1() = (double) y;
599 name_highlight->property_y2() = (double) y + h;
604 name_text->property_y() = y + h + 1 - NAME_Y_OFFSET;
605 if (h < NAME_HIGHLIGHT_THRESH) {
606 name_text->property_fill_color_rgba() = fill_color;
609 name_text->property_fill_color_rgba() = label_color;
614 frame->property_y1() = y;
615 frame->property_y2() = y + h + 1;
618 vestigial_frame->property_y1() = y;
619 vestigial_frame->property_y2() = y + h + 1;
626 TimeAxisViewItem::set_color(Gdk::Color& base_color)
628 compute_colors (base_color);
636 TimeAxisViewItem::get_canvas_frame()
645 TimeAxisViewItem::get_canvas_group()
654 TimeAxisViewItem::get_name_highlight()
656 return (name_highlight) ;
663 TimeAxisViewItem::get_name_text()
669 * Calculates some contrasting color for displaying various parts of this item, based upon the base color
671 * @param color the base color of the item
674 TimeAxisViewItem::compute_colors(Gdk::Color& base_color)
676 unsigned char radius ;
679 unsigned char r,g,b ;
681 /* FILL: this is simple */
682 r = base_color.get_red()/256 ;
683 g = base_color.get_green()/256 ;
684 b = base_color.get_blue()/256 ;
685 fill_color = RGBA_TO_UINT(r,g,b,255) ;
688 if the overall saturation is strong, make the minor colors light.
689 if its weak, make them dark.
691 we do this by moving an equal distance to the other side of the
692 central circle in the color wheel from where we started.
695 radius = (unsigned char) rint (floor (sqrt (static_cast<double>(r*r + g*g + b+b))/3.0f)) ;
696 minor_shift = 125 - radius ;
698 /* LABEL: rotate around color wheel by 120 degrees anti-clockwise */
700 r = base_color.get_red()/256;
701 g = base_color.get_green()/256;
702 b = base_color.get_blue()/256;
708 /* red sector => green */
713 /* green sector => blue */
721 /* blue sector => red */
726 /* green sector => blue */
735 label_color = RGBA_TO_UINT(r,g,b,255);
736 r = (base_color.get_red()/256) + 127 ;
737 g = (base_color.get_green()/256) + 127 ;
738 b = (base_color.get_blue()/256) + 127 ;
740 label_color = RGBA_TO_UINT(r,g,b,255);
742 /* XXX can we do better than this ? */
743 /* We're trying ;) */
746 //frame_color_r = 192;
747 //frame_color_g = 192;
748 //frame_color_b = 194;
750 //selected_frame_color_r = 182;
751 //selected_frame_color_g = 145;
752 //selected_frame_color_b = 168;
754 //handle_color_r = 25 ;
755 //handle_color_g = 0 ;
756 //handle_color_b = 255 ;
757 //lock_handle_color_r = 235 ;
758 //lock_handle_color_g = 16;
759 //lock_handle_color_b = 16;
763 * Convenience method to set the various canvas item colors
766 TimeAxisViewItem::set_colors()
770 double height = NAME_HIGHLIGHT_THRESH;
773 height = frame->property_y2();
776 if (height < NAME_HIGHLIGHT_THRESH) {
777 name_text->property_fill_color_rgba() = fill_color;
780 name_text->property_fill_color_rgba() = label_color;
784 if (name_highlight) {
785 name_highlight->property_fill_color_rgba() = fill_color;
786 name_highlight->property_outline_color_rgba() = fill_color;
788 set_trim_handle_colors() ;
792 * Sets the frame color depending on whether this item is selected
795 TimeAxisViewItem::set_frame_color()
800 if (_selected && should_show_selection) {
801 UINT_TO_RGBA(Config->canvasvar_SelectedFrameBase.get(), &r, &g, &b, &a);
802 frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, a);
804 UINT_TO_RGBA(Config->canvasvar_FrameBase.get(), &r, &g, &b, &a);
805 frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, a);
811 * Sets the colors of the start and end trim handle depending on object state
815 TimeAxisViewItem::set_trim_handle_colors()
817 if (frame_handle_start) {
818 if (position_locked) {
819 frame_handle_start->property_fill_color_rgba() = Config->canvasvar_TrimHandleLocked.get();
820 frame_handle_end->property_fill_color_rgba() = Config->canvasvar_TrimHandleLocked.get();
822 frame_handle_start->property_fill_color_rgba() = Config->canvasvar_TrimHandle.get();
823 frame_handle_end->property_fill_color_rgba() = Config->canvasvar_TrimHandle.get();
829 TimeAxisViewItem::get_samples_per_unit()
831 return(samples_per_unit) ;
835 TimeAxisViewItem::set_samples_per_unit (double spu)
837 samples_per_unit = spu ;
838 set_position (this->get_position(), this);
839 reset_width_dependent_items ((double)get_duration() / samples_per_unit);
843 TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
845 if (pixel_width < GRAB_HANDLE_LENGTH * 2) {
847 if (frame_handle_start) {
848 frame_handle_start->hide();
849 frame_handle_end->hide();
852 } if (pixel_width < 2.0) {
854 if (show_vestigial) {
855 vestigial_frame->show();
858 if (name_highlight) {
859 name_highlight->hide();
869 if (frame_handle_start) {
870 frame_handle_start->hide();
871 frame_handle_end->hide();
875 vestigial_frame->hide();
877 if (name_highlight) {
879 double height = name_highlight->property_y2 ();
881 if (height < NAME_HIGHLIGHT_THRESH) {
882 name_highlight->hide();
887 name_highlight->show();
888 if (name_text && !get_item_name().empty()) {
890 reset_name_width (pixel_width);
894 if (visibility & FullWidthNameHighlight) {
895 name_highlight->property_x2() = pixel_width;
897 name_highlight->property_x2() = pixel_width - 1.0;
904 frame->property_x2() = pixel_width;
907 if (frame_handle_start) {
908 if (pixel_width < (2*TimeAxisViewItem::GRAB_HANDLE_LENGTH)) {
909 frame_handle_start->hide();
910 frame_handle_end->hide();
912 frame_handle_start->show();
913 frame_handle_end->property_x1() = pixel_width - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
914 frame_handle_end->show();
915 frame_handle_end->property_x2() = pixel_width;
921 TimeAxisViewItem::reset_name_width (double pixel_width)
923 if (name_text == 0) {
927 int limit = (int) floor (pixel_width - NAME_X_OFFSET);
928 bool shrinking = (last_name_text_width > pixel_width);
931 ustring::size_type n;
933 if ((last_name_text_width && // we did this once
934 shrinking && // we're getting smaller
935 (name_text_width <= limit) && // fits the new size
936 (name_text_width <= last_name_text_width - NAME_X_OFFSET))) { // fit into the old size too
937 last_name_text_width = pixel_width;
941 /* now check the cache of existing truncations */
944 Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout ("");
946 for (n = item_name.length(); n > 0; --n) {
948 map<ustring::size_type,int>::iterator i;
950 if ((i = name_text_size_cache.find (n)) != name_text_size_cache.end()) {
952 /* we know the length of this substring already */
954 if ((actual_width = (*i).second) < limit) {
956 /* it fits, use it */
958 ustr = item_name.substr (0, n);
964 /* we don't know the length of this substring already, so compute
965 it and put it into the cache.
968 layout->set_text (item_name.substr (0, n));
971 Gtkmm2ext::get_ink_pixel_size (layout, width, height);
973 name_text_size_cache[n] = width;
975 if ((actual_width = width) < limit) {
976 ustr = item_name.substr (0, n);
983 name_text->property_text() = "";
984 last_name_text_width = pixel_width;
988 /* don't use name for event handling if it leaves no room
989 for trimming to work.
992 if (pixel_width - actual_width < (NAME_X_OFFSET * 2.0)) {
993 if (name_connected) {
994 name_connected = false;
997 if (!name_connected) {
998 name_connected = true;
1002 name_text->property_text() = ustr;
1003 name_text_width = actual_width;
1005 last_name_text_width = pixel_width;
1010 //---------------------------------------------------------------------------------------//
1011 // Handle time axis removal
1014 * Handles the Removal of this time axis item
1015 * This _needs_ to be called to alert others of the removal properly, ie where the source
1016 * of the removal came from.
1018 * XXX Although im not too happy about this method of doing things, I cant think of a cleaner method
1019 * just now to capture the source of the removal
1021 * @param src the identity of the object that initiated the change
1024 TimeAxisViewItem::remove_this_item(void* src)
1027 defer to idle loop, otherwise we'll delete this object
1028 while we're still inside this function ...
1030 Glib::signal_idle().connect(bind (sigc::ptr_fun (&TimeAxisViewItem::idle_remove_this_item), this, src));
1034 * Callback used to remove this time axis item during the gtk idle loop
1035 * This is used to avoid deleting the obejct while inside the remove_this_item
1038 * @param item the TimeAxisViewItem to remove
1039 * @param src the identity of the object that initiated the change
1042 TimeAxisViewItem::idle_remove_this_item(TimeAxisViewItem* item, void* src)
1044 item->ItemRemoved (item->get_item_name(), src) ; /* EMIT_SIGNAL */