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.
22 #include "pbd/error.h"
23 #include "pbd/stacktrace.h"
25 #include "ardour/types.h"
26 #include "ardour/ardour.h"
28 #include "gtkmm2ext/utils.h"
29 #include "gtkmm2ext/gui_thread.h"
31 #include "canvas/group.h"
32 #include "canvas/rectangle.h"
33 #include "canvas/debug.h"
34 #include "canvas/text.h"
35 #include "canvas/utils.h"
37 #include "ardour_ui.h"
39 * ardour_ui.h was moved up in the include list
40 * due to a conflicting definition of 'Rect' between
41 * Apple's MacTypes.h file and GTK
44 #include "public_editor.h"
45 #include "time_axis_view_item.h"
46 #include "time_axis_view.h"
48 #include "rgb_macros.h"
53 using namespace Editing;
56 using namespace ARDOUR;
57 using namespace Gtkmm2ext;
59 Pango::FontDescription TimeAxisViewItem::NAME_FONT;
60 const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
61 const double TimeAxisViewItem::GRAB_HANDLE_TOP = 6;
62 const double TimeAxisViewItem::GRAB_HANDLE_WIDTH = 5;
64 int TimeAxisViewItem::NAME_HEIGHT;
65 double TimeAxisViewItem::NAME_Y_OFFSET;
66 double TimeAxisViewItem::NAME_HIGHLIGHT_SIZE;
67 double TimeAxisViewItem::NAME_HIGHLIGHT_THRESH;
70 TimeAxisViewItem::set_constant_heights ()
72 NAME_FONT = get_font_for_style (X_("TimeAxisViewItemName"));
78 Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout (X_("Hg")); /* ascender + descender */
82 layout->set_font_description (NAME_FONT);
83 Gtkmm2ext::get_ink_pixel_size (layout, width, height);
86 NAME_Y_OFFSET = height + 5; // XXX this offset is magic
87 NAME_HIGHLIGHT_SIZE = height + 2;
88 NAME_HIGHLIGHT_THRESH = NAME_HIGHLIGHT_SIZE * 3;
92 * Construct a new TimeAxisViewItem.
94 * @param it_name the unique name of this item
95 * @param parent the parent canvas group
96 * @param tv the TimeAxisView we are going to be added to
97 * @param spu samples per unit
99 * @param start the start point of this item
100 * @param duration the duration of this item
101 * @param recording true if this is a recording region view
102 * @param automation true if this is an automation region view
104 TimeAxisViewItem::TimeAxisViewItem(
105 const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color,
106 framepos_t start, framecnt_t duration, bool recording, bool automation, Visibility vis
109 , item_name (it_name)
111 , _recregion (recording)
112 , _automation (automation)
116 init (&parent, spu, base_color, start, duration, vis, true, true);
119 TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
122 , PBD::ScopedConnectionList()
123 , trackview (other.trackview)
124 , item_name (other.item_name)
126 , _recregion (other._recregion)
127 , _automation (other._automation)
128 , _dragging (other._dragging)
135 UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a);
136 c.set_rgb_p (r/255.0, g/255.0, b/255.0);
138 /* share the other's parent, but still create a new group */
140 ArdourCanvas::Group* parent = other.group->parent();
142 _selected = other._selected;
144 init (parent, other.samples_per_pixel, c, other.frame_position,
145 other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name);
149 TimeAxisViewItem::init (ArdourCanvas::Group* parent, double fpp, Gdk::Color const & base_color,
150 framepos_t start, framepos_t duration, Visibility vis,
151 bool wide, bool high)
153 group = new ArdourCanvas::Group (parent);
154 CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
155 group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
157 samples_per_pixel = fpp;
158 frame_position = start;
159 item_duration = duration;
160 name_connected = false;
162 position_locked = false;
163 max_item_duration = ARDOUR::max_framepos;
164 min_item_duration = 0;
165 show_vestigial = true;
170 wide_enough_for_name = wide;
171 high_enough_for_name = high;
175 warning << "Time Axis Item Duration == 0" << endl;
178 vestigial_frame = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, 1.0, 2.0, trackview.current_height()));
179 CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name()));
180 vestigial_frame->hide ();
181 vestigial_frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_VestigialFrame());
182 vestigial_frame->set_fill_color (ARDOUR_UI::config()->get_canvasvar_VestigialFrame());
184 if (visibility & ShowFrame) {
185 frame = new ArdourCanvas::Rectangle (group,
186 ArdourCanvas::Rect (0.0, 1.0,
187 trackview.editor().sample_to_pixel(duration),
188 trackview.current_height()));
190 CANVAS_DEBUG_NAME (frame, string_compose ("frame for %1", get_item_name()));
193 frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_RecordingRect());
195 frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame());
203 if (visibility & ShowNameHighlight) {
205 if (visibility & FullWidthNameHighlight) {
206 name_highlight = new ArdourCanvas::Rectangle (group,
207 ArdourCanvas::Rect (0.0, trackview.editor().sample_to_pixel(item_duration),
208 trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE,
209 trackview.current_height()));
210 CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name()));
212 name_highlight = new ArdourCanvas::Rectangle (group,
213 ArdourCanvas::Rect (1.0, trackview.editor().sample_to_pixel(item_duration) - 1,
214 trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE,
215 trackview.current_height()));
216 CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name()));
219 name_highlight->set_data ("timeaxisviewitem", this);
220 name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
221 /* we should really use a canvas color property here */
222 name_highlight->set_outline_color (RGBA_TO_UINT (0,0,0,255));
228 if (visibility & ShowNameText) {
229 name_text = new ArdourCanvas::Text (group);
230 CANVAS_DEBUG_NAME (name_text, string_compose ("name text for %1", get_item_name()));
231 name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, trackview.current_height() - NAME_Y_OFFSET));
232 name_text->set_font_description (NAME_FONT);
238 /* create our grab handles used for trimming/duration etc */
239 if (!_recregion && !_automation) {
240 double top = TimeAxisViewItem::GRAB_HANDLE_TOP;
241 double width = TimeAxisViewItem::GRAB_HANDLE_WIDTH;
243 frame_handle_start = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height()));
244 CANVAS_DEBUG_NAME (frame_handle_start, "TAVI frame handle start");
245 frame_handle_start->set_outline (false);
246 frame_handle_start->set_fill (false);
247 frame_handle_start->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::frame_handle_crossing), frame_handle_start));
249 frame_handle_end = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height()));
250 CANVAS_DEBUG_NAME (frame_handle_end, "TAVI frame handle end");
251 frame_handle_end->set_outline (false);
252 frame_handle_end->set_fill (false);
253 frame_handle_end->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::frame_handle_crossing), frame_handle_end));
255 frame_handle_start = frame_handle_end = 0;
258 set_color (base_color);
260 set_duration (item_duration, this);
261 set_position (start, this);
263 Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&TimeAxisViewItem::parameter_changed, this, _1), gui_context ());
264 ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun (*this, &TimeAxisViewItem::parameter_changed));
267 TimeAxisViewItem::~TimeAxisViewItem()
273 TimeAxisViewItem::canvas_group_event (GdkEvent* /*ev*/)
279 TimeAxisViewItem::hide_rect ()
281 rect_visible = false;
284 if (name_highlight) {
285 name_highlight->set_outline_what (ArdourCanvas::Rectangle::What (0));
286 name_highlight->set_fill_color (UINT_RGBA_CHANGE_A (fill_color, 64));
291 TimeAxisViewItem::show_rect ()
296 if (name_highlight) {
297 name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
298 name_highlight->set_fill_color (fill_color);
303 * Set the position of this item on the timeline.
305 * @param pos the new position
306 * @param src the identity of the object that initiated the change
307 * @return true on success
311 TimeAxisViewItem::set_position(framepos_t pos, void* src, double* delta)
313 if (position_locked) {
317 frame_position = pos;
319 /* This sucks. The GnomeCanvas version I am using
320 doesn't correctly implement gnome_canvas_group_set_arg(),
321 so that simply setting the "x" arg of the group
322 fails to move the group. Instead, we have to
323 use gnome_canvas_item_move(), which does the right
324 thing. I see that in GNOME CVS, the current (Sept 2001)
325 version of GNOME Canvas rectifies this issue cleanly.
329 double new_unit_pos = pos / samples_per_pixel;
331 old_unit_pos = group->position().x;
333 if (new_unit_pos != old_unit_pos) {
334 group->set_x_position (new_unit_pos);
338 (*delta) = new_unit_pos - old_unit_pos;
341 PositionChanged (frame_position, src); /* EMIT_SIGNAL */
346 /** @return position of this item on the timeline */
348 TimeAxisViewItem::get_position() const
350 return frame_position;
354 * Set the duration of this item.
356 * @param dur the new duration of this item
357 * @param src the identity of the object that initiated the change
358 * @return true on success
362 TimeAxisViewItem::set_duration (framecnt_t dur, void* src)
364 if ((dur > max_item_duration) || (dur < min_item_duration)) {
365 warning << string_compose (
366 P_("new duration %1 frame is out of bounds for %2", "new duration of %1 frames is out of bounds for %2", dur),
367 get_item_name(), dur)
378 reset_width_dependent_items (trackview.editor().sample_to_pixel (dur));
380 DurationChanged (dur, src); /* EMIT_SIGNAL */
384 /** @return duration of this item */
386 TimeAxisViewItem::get_duration() const
388 return item_duration;
392 * Set the maximum duration that this item can have.
394 * @param dur the new maximum duration
395 * @param src the identity of the object that initiated the change
398 TimeAxisViewItem::set_max_duration(framecnt_t dur, void* src)
400 max_item_duration = dur;
401 MaxDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
404 /** @return the maximum duration that this item may have */
406 TimeAxisViewItem::get_max_duration() const
408 return max_item_duration;
412 * Set the minimum duration that this item may have.
414 * @param the minimum duration that this item may be set to
415 * @param src the identity of the object that initiated the change
418 TimeAxisViewItem::set_min_duration(framecnt_t dur, void* src)
420 min_item_duration = dur;
421 MinDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
424 /** @return the minimum duration that this item mey have */
426 TimeAxisViewItem::get_min_duration() const
428 return min_item_duration;
432 * Set whether this item is locked to its current position.
433 * Locked items cannot be moved until the item is unlocked again.
435 * @param yn true to lock this item to its current position
436 * @param src the identity of the object that initiated the change
439 TimeAxisViewItem::set_position_locked(bool yn, void* src)
441 position_locked = yn;
442 set_trim_handle_colors();
443 PositionLockChanged (position_locked, src); /* EMIT_SIGNAL */
446 /** @return true if this item is locked to its current position */
448 TimeAxisViewItem::get_position_locked() const
450 return position_locked;
454 * Set whether the maximum duration constraint is active.
456 * @param active set true to enforce the max duration constraint
457 * @param src the identity of the object that initiated the change
460 TimeAxisViewItem::set_max_duration_active (bool active, void* /*src*/)
462 max_duration_active = active;
465 /** @return true if the maximum duration constraint is active */
467 TimeAxisViewItem::get_max_duration_active() const
469 return max_duration_active;
473 * Set whether the minimum duration constraint is active.
475 * @param active set true to enforce the min duration constraint
476 * @param src the identity of the object that initiated the change
480 TimeAxisViewItem::set_min_duration_active (bool active, void* /*src*/)
482 min_duration_active = active;
485 /** @return true if the maximum duration constraint is active */
487 TimeAxisViewItem::get_min_duration_active() const
489 return min_duration_active;
493 * Set the name of this item.
495 * @param new_name the new name of this item
496 * @param src the identity of the object that initiated the change
500 TimeAxisViewItem::set_item_name(std::string new_name, void* src)
502 if (new_name != item_name) {
503 std::string temp_name = item_name;
504 item_name = new_name;
505 NameChanged (item_name, temp_name, src); /* EMIT_SIGNAL */
509 /** @return the name of this item */
511 TimeAxisViewItem::get_item_name() const
517 * Set selection status.
519 * @param yn true if this item is currently selected
522 TimeAxisViewItem::set_selected(bool yn)
524 if (_selected != yn) {
525 Selectable::set_selected (yn);
530 /** @return the TimeAxisView that this item is on */
532 TimeAxisViewItem::get_time_axis_view () const
538 * Set the displayed item text.
539 * This item is the visual text name displayed on the canvas item, this can be different to the name of the item.
541 * @param new_name the new name text to display
545 TimeAxisViewItem::set_name_text(const string& new_name)
551 name_text_width = pixel_width (new_name, NAME_FONT) + 2;
552 name_text->set (new_name);
557 * Set the height of this item.
559 * @param h new height
562 TimeAxisViewItem::set_height (double height)
566 manage_name_highlight ();
568 if (visibility & ShowNameText) {
569 name_text->set_y_position (height + 1 - NAME_Y_OFFSET);
573 frame->set_y1 (height - 1);
574 if (frame_handle_start) {
575 frame_handle_start->set_y1 (height - 1);
576 frame_handle_end->set_y1 (height - 1);
580 vestigial_frame->set_y1 (height - 1);
586 TimeAxisViewItem::manage_name_highlight ()
588 if (_height < NAME_HIGHLIGHT_THRESH) {
589 high_enough_for_name = false;
591 high_enough_for_name = true;
595 wide_enough_for_name = false;
597 wide_enough_for_name = true;
600 if (name_highlight && wide_enough_for_name && high_enough_for_name) {
602 name_highlight->show();
604 name_highlight->set_y0 ((double) _height - 1 - NAME_HIGHLIGHT_SIZE);
605 name_highlight->set_y1 ((double) _height - 1);
607 /* x0 is always zero */
608 name_highlight->set_x1 (_width);
611 name_highlight->hide();
618 TimeAxisViewItem::set_color (Gdk::Color const & base_color)
620 compute_colors (base_color);
625 TimeAxisViewItem::get_canvas_frame()
631 TimeAxisViewItem::get_canvas_group()
637 TimeAxisViewItem::get_name_highlight()
639 return name_highlight;
643 * Calculate some contrasting color for displaying various parts of this item, based upon the base color.
645 * @param color the base color of the item
648 TimeAxisViewItem::compute_colors (Gdk::Color const & base_color)
650 unsigned char radius;
655 /* FILL: this is simple */
656 r = base_color.get_red()/256;
657 g = base_color.get_green()/256;
658 b = base_color.get_blue()/256;
659 fill_color = RGBA_TO_UINT(r,g,b,160);
662 if the overall saturation is strong, make the minor colors light.
663 if its weak, make them dark.
665 we do this by moving an equal distance to the other side of the
666 central circle in the color wheel from where we started.
669 radius = (unsigned char) rint (floor (sqrt (static_cast<double>(r*r + g*g + b+b))/3.0f));
670 minor_shift = 125 - radius;
672 /* LABEL: rotate around color wheel by 120 degrees anti-clockwise */
674 r = base_color.get_red()/256;
675 g = base_color.get_green()/256;
676 b = base_color.get_blue()/256;
682 /* red sector => green */
687 /* green sector => blue */
695 /* blue sector => red */
700 /* green sector => blue */
709 label_color = RGBA_TO_UINT(r,g,b,255);
710 r = (base_color.get_red()/256) + 127;
711 g = (base_color.get_green()/256) + 127;
712 b = (base_color.get_blue()/256) + 127;
714 label_color = RGBA_TO_UINT(r,g,b,255);
716 /* XXX can we do better than this ? */
720 //frame_color_r = 192;
721 //frame_color_g = 192;
722 //frame_color_b = 194;
724 //selected_frame_color_r = 182;
725 //selected_frame_color_g = 145;
726 //selected_frame_color_b = 168;
728 //handle_color_r = 25;
729 //handle_color_g = 0;
730 //handle_color_b = 255;
731 //lock_handle_color_r = 235;
732 //lock_handle_color_g = 16;
733 //lock_handle_color_b = 16;
737 * Convenience method to set the various canvas item colors
740 TimeAxisViewItem::set_colors()
744 if (name_highlight) {
745 name_highlight->set_fill_color (fill_color);
751 const double black_r = 0.0;
752 const double black_g = 0.0;
753 const double black_b = 0.0;
755 const double white_r = 1.0;
756 const double white_g = 1.0;
757 const double white_b = 1.0;
759 ArdourCanvas::color_to_rgba (fill_color, r, g, b, a);
761 /* Use W3C contrast guideline calculation */
763 double white_contrast = (max (r, white_r) - min (r, white_r)) +
764 (max (g, white_g) - min (g, white_g)) +
765 (max (b, white_b) - min (b, white_b));
767 double black_contrast = (max (r, black_r) - min (r, black_r)) +
768 (max (g, black_g) - min (g, black_g)) +
769 (max (b, black_b) - min (b, black_b));
771 if (white_contrast > black_contrast) {
773 name_text->set_color (ArdourCanvas::rgba_to_color (1.0, 1.0, 1.0, 1.0));
776 name_text->set_color (ArdourCanvas::rgba_to_color (0.0, 0.0, 0.0, 1.0));
782 ArdourCanvas::color_to_hsv (fill_color, h, s, v);
785 /* fill is black, set text to white */
786 name_text->set_color (ArdourCanvas::rgba_to_color (1.0, 1.0, 1.0, 1.0));
787 } else if (v == 1.0) {
788 /* fill is white, set text to black */
789 name_text->set_color (ArdourCanvas::rgba_to_color (0.0, 0.0, 0.0, 1.0));
792 h = fabs (fmod ((h - 180), 360.0)); /* complementary color */
793 s = 1.0; /* fully saturate */
794 v = 0.9; /* increase lightness/brightness/value */
796 name_text->set_color (ArdourCanvas::hsv_to_color (h, s, v, 1.0));
802 set_trim_handle_colors();
806 TimeAxisViewItem::get_fill_color () const
812 f = ARDOUR_UI::config()->get_canvasvar_SelectedFrameBase();
817 f = ARDOUR_UI::config()->get_canvasvar_RecordingRect();
820 if (high_enough_for_name && !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
821 f = ARDOUR_UI::config()->get_canvasvar_FrameBase();
832 * Sets the frame color depending on whether this item is selected
835 TimeAxisViewItem::set_frame_color()
843 f = get_fill_color ();
846 f = UINT_RGBA_CHANGE_A (f, fill_opacity);
850 f = UINT_RGBA_CHANGE_A (f, 0);
853 frame->set_fill_color (f);
854 set_frame_gradient ();
858 f = ARDOUR_UI::config()->get_canvasvar_SelectedTimeAxisFrame();
860 f = ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame();
864 f = UINT_RGBA_CHANGE_A (f, 64);
867 frame->set_outline_color (f);
872 TimeAxisViewItem::set_frame_gradient ()
874 if (ARDOUR_UI::config()->get_timeline_item_gradient_depth() == 0.0) {
875 frame->set_gradient (ArdourCanvas::Fill::StopList (), 0);
879 ArdourCanvas::Fill::StopList stops;
882 ArdourCanvas::Color f (get_fill_color());
884 /* need to get alpha value */
885 ArdourCanvas::color_to_rgba (f, r, g, b, a);
887 stops.push_back (std::make_pair (0.0, f));
889 /* now a darker version */
891 ArdourCanvas::color_to_hsv (f, h, s, v);
893 v = min (1.0, v * (1.0 - ARDOUR_UI::config()->get_timeline_item_gradient_depth()));
895 ArdourCanvas::Color darker = ArdourCanvas::hsv_to_color (h, s, v, a);
896 stops.push_back (std::make_pair (1.0, darker));
898 frame->set_gradient (stops, true);
902 * Set the colors of the start and end trim handle depending on object state
905 TimeAxisViewItem::set_trim_handle_colors()
907 if (frame_handle_start) {
908 if (position_locked) {
909 frame_handle_start->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandleLocked());
910 frame_handle_end->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandleLocked());
912 frame_handle_start->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandle());
913 frame_handle_end->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandle());
919 TimeAxisViewItem::frame_handle_crossing (GdkEvent* ev, ArdourCanvas::Rectangle* item)
922 case GDK_LEAVE_NOTIFY:
923 item->set_fill (false);
925 case GDK_ENTER_NOTIFY:
926 item->set_fill (true);
934 /** @return the frames per pixel */
936 TimeAxisViewItem::get_samples_per_pixel () const
938 return samples_per_pixel;
941 /** Set the frames per pixel of this item.
942 * This item is used to determine the relative visual size and position of this item
943 * based upon its duration and start value.
945 * @param fpp the new frames per pixel
948 TimeAxisViewItem::set_samples_per_pixel (double fpp)
950 samples_per_pixel = fpp;
951 set_position (this->get_position(), this);
952 reset_width_dependent_items ((double) get_duration() / samples_per_pixel);
956 TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
958 _width = pixel_width;
960 manage_name_highlight ();
962 if (pixel_width < 2.0) {
964 if (show_vestigial) {
965 vestigial_frame->show();
972 if (frame_handle_start) {
973 frame_handle_start->hide();
974 frame_handle_end->hide();
978 vestigial_frame->hide();
982 frame->set_x1 (pixel_width);
985 if (frame_handle_start) {
986 if (pixel_width < (3 * TimeAxisViewItem::GRAB_HANDLE_WIDTH)) {
988 * there's less than GRAB_HANDLE_WIDTH of the region between
989 * the right-hand end of frame_handle_start and the left-hand
990 * end of frame_handle_end, so disable the handles
993 frame_handle_start->hide();
994 frame_handle_end->hide();
996 frame_handle_start->show();
997 frame_handle_end->set_x0 (pixel_width - (TimeAxisViewItem::GRAB_HANDLE_WIDTH));
998 frame_handle_end->set_x1 (pixel_width);
999 frame_handle_end->show();
1006 TimeAxisViewItem::manage_name_text ()
1008 int visible_name_width;
1014 if (!wide_enough_for_name || !high_enough_for_name) {
1019 if (name_text->text().empty()) {
1023 visible_name_width = name_text_width;
1025 if (visible_name_width > _width - NAME_X_OFFSET) {
1026 visible_name_width = _width - NAME_X_OFFSET;
1029 if (visible_name_width < 1) {
1032 name_text->clamp_width (visible_name_width);
1038 * Callback used to remove this time axis item during the gtk idle loop.
1039 * This is used to avoid deleting the obejct while inside the remove_this_item
1042 * @param item the TimeAxisViewItem to remove.
1043 * @param src the identity of the object that initiated the change.
1046 TimeAxisViewItem::idle_remove_this_item(TimeAxisViewItem* item, void* src)
1048 item->ItemRemoved (item->get_item_name(), src); /* EMIT_SIGNAL */
1055 TimeAxisViewItem::set_y (double y)
1057 group->set_y_position (y);
1061 TimeAxisViewItem::parameter_changed (string p)
1063 if (p == "color-regions-using-track-color") {
1065 } else if (p == "timeline-item-gradient-depth") {
1066 set_frame_gradient ();