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"
35 #include "ardour_ui.h"
40 using namespace Editing
;
44 //------------------------------------------------------------------------------
45 /** Initialize const static memeber data */
47 Pango::FontDescription
* TimeAxisViewItem::NAME_FONT
= 0;
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 int TimeAxisViewItem::NAME_HEIGHT
;
53 double TimeAxisViewItem::NAME_Y_OFFSET
;
54 double TimeAxisViewItem::NAME_HIGHLIGHT_SIZE
;
55 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
, bool recording
,
74 : trackview (tv
), _height(1.0), _recregion(recording
)
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
);
94 NAME_Y_OFFSET
= (height
/ 2) + 8;
95 NAME_HIGHLIGHT_SIZE
= height
+ 6;
96 NAME_HIGHLIGHT_THRESH
= NAME_HIGHLIGHT_SIZE
* 2;
98 have_name_font
= true;
101 group
= new ArdourCanvas::Group (parent
);
103 init (it_name
, spu
, base_color
, start
, duration
, vis
);
107 TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem
& other
)
108 : trackview (other
.trackview
)
109 , _height (other
._height
)
115 UINT_TO_RGBA (other
.fill_color
, &r
, &g
, &b
, &a
);
116 c
.set_rgb_p (r
/255.0, g
/255.0, b
/255.0);
118 /* share the other's parent, but still create a new group */
120 Gnome::Canvas::Group
* parent
= other
.group
->property_parent();
122 group
= new ArdourCanvas::Group (*parent
);
124 init (other
.item_name
, other
.samples_per_unit
, c
, other
.frame_position
, other
.item_duration
, other
.visibility
);
128 TimeAxisViewItem::init (const string
& it_name
, double spu
, Gdk::Color
& base_color
, nframes_t start
, nframes_t duration
, Visibility vis
)
130 item_name
= it_name
;
131 samples_per_unit
= spu
;
132 should_show_selection
= true;
133 frame_position
= start
;
134 item_duration
= duration
;
135 name_connected
= false;
137 position_locked
= false ;
138 max_item_duration
= ARDOUR::max_frames
;
139 min_item_duration
= 0 ;
140 show_vestigial
= true;
143 name_pixbuf_width
= 0;
147 warning
<< "Time Axis Item Duration == 0" << endl
;
150 vestigial_frame
= new ArdourCanvas::SimpleRect (*group
);
151 vestigial_frame
->property_x1() = (double) 0.0;
152 vestigial_frame
->property_y1() = (double) 1.0;
153 vestigial_frame
->property_x2() = (double) 2.0;
154 vestigial_frame
->property_y2() = (double) trackview
.current_height();
155 vestigial_frame
->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_VestigialFrame
.get();
156 vestigial_frame
->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_VestigialFrame
.get();
157 vestigial_frame
->hide ();
159 if (visibility
& ShowFrame
) {
160 frame
= new ArdourCanvas::SimpleRect (*group
);
161 frame
->property_x1() = (double) 0.0;
162 frame
->property_y1() = (double) 1.0;
163 frame
->property_x2() = (double) trackview
.editor
.frame_to_pixel(duration
);
164 frame
->property_y2() = (double) trackview
.current_height();
165 frame
->property_outline_color_rgba() = ARDOUR_UI::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
.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE
);
199 name_highlight
->property_y2() = (double) (trackview
.current_height() - 1);
201 name_highlight
->set_data ("timeaxisviewitem", this);
207 /* create our grab handles used for trimming/duration etc */
209 if (visibility
& ShowHandles
) {
210 frame_handle_start
= new ArdourCanvas::SimpleRect (*group
);
211 frame_handle_start
->property_x1() = (double) 0.0;
212 frame_handle_start
->property_x2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH
;
213 frame_handle_start
->property_y1() = (double) 1.0;
214 frame_handle_start
->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH
+1;
215 frame_handle_start
->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle
.get();
217 frame_handle_end
= new ArdourCanvas::SimpleRect (*group
);
218 frame_handle_end
->property_x1() = (double) (trackview
.editor
.frame_to_pixel(get_duration())) - (TimeAxisViewItem::GRAB_HANDLE_LENGTH
);
219 frame_handle_end
->property_x2() = (double) trackview
.editor
.frame_to_pixel(get_duration());
220 frame_handle_end
->property_y1() = (double) 1;
221 frame_handle_end
->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH
+ 1;
222 frame_handle_end
->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle
.get();
225 frame_handle_start
= 0;
226 frame_handle_end
= 0;
229 if (visibility
& ShowNameText
) {
230 name_pixbuf
= new ArdourCanvas::Pixbuf(*group
);
231 name_pixbuf
->property_x() = NAME_X_OFFSET
;
232 name_pixbuf
->property_y() = trackview
.current_height() - 1.0 - NAME_Y_OFFSET
;
238 set_color (base_color
) ;
240 set_duration (item_duration
, this) ;
241 set_position (start
, this) ;
243 ColorsChanged
.connect (mem_fun (*this, &TimeAxisViewItem::color_handler
));
249 TimeAxisViewItem::~TimeAxisViewItem()
255 //---------------------------------------------------------------------------------------//
256 // Position and duration Accessors/Mutators
259 * Set the position of this item upon the timeline to the specified value
261 * @param pos the new position
262 * @param src the identity of the object that initiated the change
263 * @return true if the position change was a success, false otherwise
266 TimeAxisViewItem::set_position(nframes_t pos
, void* src
, double* delta
)
268 if (position_locked
) {
272 frame_position
= pos
;
274 /* This sucks. The GnomeCanvas version I am using
275 doesn't correctly implement gnome_canvas_group_set_arg(),
276 so that simply setting the "x" arg of the group
277 fails to move the group. Instead, we have to
278 use gnome_canvas_item_move(), which does the right
279 thing. I see that in GNOME CVS, the current (Sept 2001)
280 version of GNOME Canvas rectifies this issue cleanly.
283 double old_unit_pos
;
284 double new_unit_pos
= pos
/ samples_per_unit
;
286 old_unit_pos
= group
->property_x();
288 if (new_unit_pos
!= old_unit_pos
) {
289 group
->move (new_unit_pos
- old_unit_pos
, 0.0);
293 (*delta
) = new_unit_pos
- old_unit_pos
;
296 PositionChanged (frame_position
, src
) ; /* EMIT_SIGNAL */
302 * Return the position of this item upon the timeline
304 * @return the position of this item
307 TimeAxisViewItem::get_position() const
309 return frame_position
;
313 * Sets the duration of this item
315 * @param dur the new duration of this item
316 * @param src the identity of the object that initiated the change
317 * @return true if the duration change was succesful, false otherwise
320 TimeAxisViewItem::set_duration (nframes_t dur
, void* src
)
322 if ((dur
> max_item_duration
) || (dur
< min_item_duration
)) {
323 warning
<< string_compose (_("new duration %1 frames is out of bounds for %2"), get_item_name(), dur
)
334 reset_width_dependent_items (trackview
.editor
.frame_to_pixel (dur
));
336 DurationChanged (dur
, src
) ; /* EMIT_SIGNAL */
341 * Returns the duration of this item
345 TimeAxisViewItem::get_duration() const
347 return (item_duration
);
351 * Sets the maximum duration that this item make have.
353 * @param dur the new maximum duration
354 * @param src the identity of the object that initiated the change
357 TimeAxisViewItem::set_max_duration(nframes_t dur
, void* src
)
359 max_item_duration
= dur
;
360 MaxDurationChanged(max_item_duration
, src
) ; /* EMIT_SIGNAL */
364 * Returns the maxmimum duration that this item may be set to
366 * @return the maximum duration that this item may be set to
369 TimeAxisViewItem::get_max_duration() const
371 return (max_item_duration
) ;
375 * Sets the minimu duration that this item may be set to
377 * @param the minimum duration that this item may be set to
378 * @param src the identity of the object that initiated the change
381 TimeAxisViewItem::set_min_duration(nframes_t dur
, void* src
)
383 min_item_duration
= dur
;
384 MinDurationChanged(max_item_duration
, src
) ; /* EMIT_SIGNAL */
388 * Returns the minimum duration that this item mey be set to
390 * @return the nimum duration that this item mey be set to
393 TimeAxisViewItem::get_min_duration() const
395 return(min_item_duration
) ;
399 * Sets whether the position of this Item is locked to its current position
400 * Locked items cannot be moved until the item is unlocked again.
402 * @param yn set to true to lock this item to its current position
403 * @param src the identity of the object that initiated the change
406 TimeAxisViewItem::set_position_locked(bool yn
, void* src
)
408 position_locked
= yn
;
409 set_trim_handle_colors() ;
410 PositionLockChanged (position_locked
, src
); /* EMIT_SIGNAL */
414 * Returns whether this item is locked to its current position
416 * @return true if this item is locked to its current posotion
420 TimeAxisViewItem::get_position_locked() const
422 return (position_locked
);
426 * Sets whether the Maximum Duration constraint is active and should be enforced
428 * @param active set true to enforce the max duration constraint
429 * @param src the identity of the object that initiated the change
432 TimeAxisViewItem::set_max_duration_active(bool active
, void* src
)
434 max_duration_active
= active
;
438 * Returns whether the Maximum Duration constraint is active and should be enforced
440 * @return true if the maximum duration constraint is active, false otherwise
443 TimeAxisViewItem::get_max_duration_active() const
445 return(max_duration_active
) ;
449 * Sets whether the Minimum Duration constraint is active and should be enforced
451 * @param active set true to enforce the min duration constraint
452 * @param src the identity of the object that initiated the change
455 TimeAxisViewItem::set_min_duration_active(bool active
, void* src
)
457 min_duration_active
= active
;
461 * Returns whether the Maximum Duration constraint is active and should be enforced
463 * @return true if the maximum duration constraint is active, false otherwise
466 TimeAxisViewItem::get_min_duration_active() const
468 return(min_duration_active
) ;
471 //---------------------------------------------------------------------------------------//
472 // Name/Id Accessors/Mutators
475 * Set the name/Id of this item.
477 * @param new_name the new name of this item
478 * @param src the identity of the object that initiated the change
481 TimeAxisViewItem::set_item_name(std::string new_name
, void* src
)
483 if (new_name
!= item_name
) {
484 std::string temp_name
= item_name
;
485 item_name
= new_name
;
486 NameChanged (item_name
, temp_name
, src
) ; /* EMIT_SIGNAL */
491 * Returns the name/id of this item
493 * @return the name/id of this item
496 TimeAxisViewItem::get_item_name() const
501 //---------------------------------------------------------------------------------------//
505 * Set to true to indicate that this item is currently selected
507 * @param yn true if this item is currently selected
508 * @param src the identity of the object that initiated the change
511 TimeAxisViewItem::set_selected(bool yn
)
513 if (_selected
!= yn
) {
514 Selectable::set_selected (yn
);
520 TimeAxisViewItem::set_should_show_selection (bool yn
)
522 if (should_show_selection
!= yn
) {
523 should_show_selection
= yn
;
528 //---------------------------------------------------------------------------------------//
529 // Parent Componenet Methods
532 * Returns the TimeAxisView that this item is upon
534 * @return the timeAxisView that this item is placed upon
537 TimeAxisViewItem::get_time_axis_view()
541 //---------------------------------------------------------------------------------------//
545 * Sets the displayed item text
546 * This item is the visual text name displayed on the canvas item, this can be different to the name of the item
548 * @param new_name the new name text to display
551 TimeAxisViewItem::set_name_text(const ustring
& new_name
)
559 last_item_width
= trackview
.editor
.frame_to_pixel(item_duration
);
560 name_pixbuf_width
= pixel_width (new_name
, *NAME_FONT
) + 2;
561 name_pixbuf
->property_pixbuf() = pixbuf_from_ustring(new_name
, NAME_FONT
,
562 ARDOUR_UI::config()->canvasvar_TimeAxisViewItemName
.get(),
563 name_pixbuf_width
, NAME_HEIGHT
);
567 TimeAxisViewItem::color_handler ()
569 set_name_text (_name
);
573 * Set the height of this item
575 * @param h the new height
578 TimeAxisViewItem::set_height (double height
)
582 if (name_highlight
) {
583 if (height
< NAME_HIGHLIGHT_THRESH
) {
584 name_highlight
->hide();
586 name_highlight
->show();
589 if (height
> NAME_HIGHLIGHT_SIZE
) {
590 name_highlight
->property_y1() = (double) height
+1 - NAME_HIGHLIGHT_SIZE
;
591 name_highlight
->property_y2() = (double) height
;
593 /* it gets hidden now anyway */
594 //name_highlight->property_y1() = (double) 1.0;
595 //name_highlight->property_y2() = (double) height;
600 if (height
< NAME_HIGHLIGHT_THRESH
) {
603 name_pixbuf
->property_y() = height
+1 - NAME_Y_OFFSET
;
609 frame
->property_y2() = height
+1;
612 vestigial_frame
->property_y2() = height
+1;
619 TimeAxisViewItem::set_color(Gdk::Color
& base_color
)
621 compute_colors (base_color
);
629 TimeAxisViewItem::get_canvas_frame()
638 TimeAxisViewItem::get_canvas_group()
647 TimeAxisViewItem::get_name_highlight()
649 return (name_highlight
) ;
655 ArdourCanvas::Pixbuf
*
656 TimeAxisViewItem::get_name_pixbuf()
658 return (name_pixbuf
) ;
662 * Calculates some contrasting color for displaying various parts of this item, based upon the base color
664 * @param color the base color of the item
667 TimeAxisViewItem::compute_colors(Gdk::Color
& base_color
)
669 unsigned char radius
;
672 unsigned char r
,g
,b
;
674 /* FILL: this is simple */
675 r
= base_color
.get_red()/256 ;
676 g
= base_color
.get_green()/256 ;
677 b
= base_color
.get_blue()/256 ;
678 fill_color
= RGBA_TO_UINT(r
,g
,b
,255) ;
681 if the overall saturation is strong, make the minor colors light.
682 if its weak, make them dark.
684 we do this by moving an equal distance to the other side of the
685 central circle in the color wheel from where we started.
688 radius
= (unsigned char) rint (floor (sqrt (static_cast<double>(r
*r
+ g
*g
+ b
+b
))/3.0f
)) ;
689 minor_shift
= 125 - radius
;
691 /* LABEL: rotate around color wheel by 120 degrees anti-clockwise */
693 r
= base_color
.get_red()/256;
694 g
= base_color
.get_green()/256;
695 b
= base_color
.get_blue()/256;
701 /* red sector => green */
706 /* green sector => blue */
714 /* blue sector => red */
719 /* green sector => blue */
728 label_color
= RGBA_TO_UINT(r
,g
,b
,255);
729 r
= (base_color
.get_red()/256) + 127 ;
730 g
= (base_color
.get_green()/256) + 127 ;
731 b
= (base_color
.get_blue()/256) + 127 ;
733 label_color
= RGBA_TO_UINT(r
,g
,b
,255);
735 /* XXX can we do better than this ? */
736 /* We're trying ;) */
739 //frame_color_r = 192;
740 //frame_color_g = 192;
741 //frame_color_b = 194;
743 //selected_frame_color_r = 182;
744 //selected_frame_color_g = 145;
745 //selected_frame_color_b = 168;
747 //handle_color_r = 25 ;
748 //handle_color_g = 0 ;
749 //handle_color_b = 255 ;
750 //lock_handle_color_r = 235 ;
751 //lock_handle_color_g = 16;
752 //lock_handle_color_b = 16;
756 * Convenience method to set the various canvas item colors
759 TimeAxisViewItem::set_colors()
763 if (name_highlight
) {
764 name_highlight
->property_fill_color_rgba() = fill_color
;
765 name_highlight
->property_outline_color_rgba() = fill_color
;
767 set_trim_handle_colors() ;
771 * Sets the frame color depending on whether this item is selected
774 TimeAxisViewItem::set_frame_color()
779 if (_selected
&& should_show_selection
) {
780 UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_SelectedFrameBase
.get(), &r
, &g
, &b
, &a
);
781 frame
->property_fill_color_rgba() = RGBA_TO_UINT(r
, g
, b
, fill_opacity
? fill_opacity
: a
);// Lets still use the theme's opacity value if Opaque is not set
784 UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_RecordingRect
.get(), &r
, &g
, &b
, &a
);
785 frame
->property_fill_color_rgba() = RGBA_TO_UINT(r
, g
, b
, a
);
787 UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_FrameBase
.get(), &r
, &g
, &b
, &a
);
788 frame
->property_fill_color_rgba() = RGBA_TO_UINT(r
, g
, b
, fill_opacity
? fill_opacity
: a
);
795 * Sets the colors of the start and end trim handle depending on object state
799 TimeAxisViewItem::set_trim_handle_colors()
801 if (frame_handle_start
) {
802 if (position_locked
) {
803 frame_handle_start
->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TrimHandleLocked
.get();
804 frame_handle_end
->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TrimHandleLocked
.get();
806 frame_handle_start
->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TrimHandle
.get();
807 frame_handle_end
->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TrimHandle
.get();
813 TimeAxisViewItem::get_samples_per_unit()
815 return(samples_per_unit
) ;
819 TimeAxisViewItem::set_samples_per_unit (double spu
)
821 samples_per_unit
= spu
;
822 set_position (this->get_position(), this);
823 reset_width_dependent_items ((double)get_duration() / samples_per_unit
);
827 TimeAxisViewItem::reset_width_dependent_items (double pixel_width
)
829 if (pixel_width
< 2.0) {
831 if (show_vestigial
) {
832 vestigial_frame
->show();
835 if (name_highlight
) {
836 name_highlight
->hide();
847 if (frame_handle_start
) {
848 frame_handle_start
->hide();
849 frame_handle_end
->hide();
853 vestigial_frame
->hide();
855 if (name_highlight
) {
857 if (_height
< NAME_HIGHLIGHT_THRESH
) {
858 name_highlight
->hide();
860 name_highlight
->show();
863 if (visibility
& FullWidthNameHighlight
) {
864 name_highlight
->property_x2() = pixel_width
;
866 name_highlight
->property_x2() = pixel_width
- 1.0;
872 if (_height
< NAME_HIGHLIGHT_THRESH
) {
875 reset_name_width (pixel_width
);
881 frame
->property_x2() = pixel_width
;
884 if (frame_handle_start
) {
885 if (pixel_width
< (2*TimeAxisViewItem::GRAB_HANDLE_LENGTH
)) {
886 frame_handle_start
->hide();
887 frame_handle_end
->hide();
889 frame_handle_start
->show();
890 frame_handle_end
->property_x1() = pixel_width
- (TimeAxisViewItem::GRAB_HANDLE_LENGTH
);
891 frame_handle_end
->property_x2() = pixel_width
;
892 frame_handle_end
->show();
899 TimeAxisViewItem::reset_name_width (double pix_width
)
903 bool pixbuf_holds_full_name
;
909 it_width
= trackview
.editor
.frame_to_pixel(item_duration
);
910 pb_width
= name_pixbuf_width
;
912 pixbuf_holds_full_name
= last_item_width
> pb_width
+ NAME_X_OFFSET
;
913 last_item_width
= it_width
;
915 if (pixbuf_holds_full_name
&& (it_width
>= pb_width
+ NAME_X_OFFSET
)) {
917 we've previously had the full name length showing
918 and its still showing.
923 if (pb_width
> it_width
- NAME_X_OFFSET
) {
924 pb_width
= it_width
- NAME_X_OFFSET
;
927 if (pb_width
<= 0 || it_width
<= NAME_X_OFFSET
) {
934 name_pixbuf
->property_pixbuf() = pixbuf_from_ustring(item_name
, NAME_FONT
,
935 ARDOUR_UI::config()->canvasvar_TimeAxisViewItemName
.get(),
936 pb_width
, NAME_HEIGHT
);
940 //---------------------------------------------------------------------------------------//
941 // Handle time axis removal
944 * Handles the Removal of this time axis item
945 * This _needs_ to be called to alert others of the removal properly, ie where the source
946 * of the removal came from.
948 * XXX Although im not too happy about this method of doing things, I cant think of a cleaner method
949 * just now to capture the source of the removal
951 * @param src the identity of the object that initiated the change
954 TimeAxisViewItem::remove_this_item(void* src
)
957 defer to idle loop, otherwise we'll delete this object
958 while we're still inside this function ...
960 Glib::signal_idle().connect(bind (sigc::ptr_fun (&TimeAxisViewItem::idle_remove_this_item
), this, src
));
964 * Callback used to remove this time axis item during the gtk idle loop
965 * This is used to avoid deleting the obejct while inside the remove_this_item
968 * @param item the TimeAxisViewItem to remove
969 * @param src the identity of the object that initiated the change
972 TimeAxisViewItem::idle_remove_this_item(TimeAxisViewItem
* item
, void* src
)
974 item
->ItemRemoved (item
->get_item_name(), src
) ; /* EMIT_SIGNAL */