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);
85 std::cerr << "item name font " << NAME_FONT.get_family() << ' ' << NAME_FONT.get_size() << ' ' << NAME_FONT.get_style() << " width x height = " << width << " x " << height << std::endl;
88 NAME_Y_OFFSET = height + 5; // XXX this offset is magic
89 NAME_HIGHLIGHT_SIZE = height + 2;
90 NAME_HIGHLIGHT_THRESH = NAME_HIGHLIGHT_SIZE * 3;
94 * Construct a new TimeAxisViewItem.
96 * @param it_name the unique name of this item
97 * @param parent the parent canvas group
98 * @param tv the TimeAxisView we are going to be added to
99 * @param spu samples per unit
101 * @param start the start point of this item
102 * @param duration the duration of this item
103 * @param recording true if this is a recording region view
104 * @param automation true if this is an automation region view
106 TimeAxisViewItem::TimeAxisViewItem(
107 const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color,
108 framepos_t start, framecnt_t duration, bool recording, bool automation, Visibility vis
111 , item_name (it_name)
113 , _recregion (recording)
114 , _automation (automation)
118 init (&parent, spu, base_color, start, duration, vis, true, true);
121 TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
124 , PBD::ScopedConnectionList()
125 , trackview (other.trackview)
126 , item_name (other.item_name)
128 , _recregion (other._recregion)
129 , _automation (other._automation)
130 , _dragging (other._dragging)
137 UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a);
138 c.set_rgb_p (r/255.0, g/255.0, b/255.0);
140 /* share the other's parent, but still create a new group */
142 ArdourCanvas::Group* parent = other.group->parent();
144 _selected = other._selected;
146 init (parent, other.samples_per_pixel, c, other.frame_position,
147 other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name);
151 TimeAxisViewItem::init (ArdourCanvas::Group* parent, double fpp, Gdk::Color const & base_color,
152 framepos_t start, framepos_t duration, Visibility vis,
153 bool wide, bool high)
155 group = new ArdourCanvas::Group (parent);
156 CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
157 group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
159 samples_per_pixel = fpp;
160 frame_position = start;
161 item_duration = duration;
162 name_connected = false;
164 position_locked = false;
165 max_item_duration = ARDOUR::max_framepos;
166 min_item_duration = 0;
167 show_vestigial = true;
172 wide_enough_for_name = wide;
173 high_enough_for_name = high;
177 warning << "Time Axis Item Duration == 0" << endl;
180 vestigial_frame = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, 1.0, 2.0, trackview.current_height()));
181 CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name()));
182 vestigial_frame->hide ();
183 vestigial_frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_VestigialFrame());
184 vestigial_frame->set_fill_color (ARDOUR_UI::config()->get_canvasvar_VestigialFrame());
186 if (visibility & ShowFrame) {
187 frame = new ArdourCanvas::Rectangle (group,
188 ArdourCanvas::Rect (0.0, 1.0,
189 trackview.editor().sample_to_pixel(duration),
190 trackview.current_height()));
192 CANVAS_DEBUG_NAME (frame, string_compose ("frame for %1", get_item_name()));
195 frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_RecordingRect());
197 frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame());
205 if (visibility & ShowNameHighlight) {
207 if (visibility & FullWidthNameHighlight) {
208 name_highlight = new ArdourCanvas::Rectangle (group,
209 ArdourCanvas::Rect (0.0, trackview.editor().sample_to_pixel(item_duration),
210 trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE,
211 trackview.current_height()));
212 CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name()));
214 name_highlight = new ArdourCanvas::Rectangle (group,
215 ArdourCanvas::Rect (1.0, trackview.editor().sample_to_pixel(item_duration) - 1,
216 trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE,
217 trackview.current_height()));
218 CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name()));
221 name_highlight->set_data ("timeaxisviewitem", this);
222 name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
223 /* we should really use a canvas color property here */
224 name_highlight->set_outline_color (RGBA_TO_UINT (0,0,0,255));
230 if (visibility & ShowNameText) {
231 name_text = new ArdourCanvas::Text (group);
232 CANVAS_DEBUG_NAME (name_text, string_compose ("name text for %1", get_item_name()));
233 name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, trackview.current_height() - NAME_Y_OFFSET));
234 name_text->set_font_description (NAME_FONT);
239 /* create our grab handles used for trimming/duration etc */
240 if (!_recregion && !_automation) {
241 double top = TimeAxisViewItem::GRAB_HANDLE_TOP;
242 double width = TimeAxisViewItem::GRAB_HANDLE_WIDTH;
244 frame_handle_start = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height()));
245 CANVAS_DEBUG_NAME (frame_handle_start, "TAVI frame handle start");
246 frame_handle_start->set_outline (false);
247 frame_handle_start->set_fill (false);
248 frame_handle_start->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::frame_handle_crossing), frame_handle_start));
250 frame_handle_end = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height()));
251 CANVAS_DEBUG_NAME (frame_handle_end, "TAVI frame handle end");
252 frame_handle_end->set_outline (false);
253 frame_handle_end->set_fill (false);
254 frame_handle_end->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::frame_handle_crossing), frame_handle_end));
256 frame_handle_start = frame_handle_end = 0;
259 set_color (base_color);
261 set_duration (item_duration, this);
262 set_position (start, this);
264 Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&TimeAxisViewItem::parameter_changed, this, _1), gui_context ());
265 ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun (*this, &TimeAxisViewItem::parameter_changed));
268 TimeAxisViewItem::~TimeAxisViewItem()
274 TimeAxisViewItem::canvas_group_event (GdkEvent* /*ev*/)
280 TimeAxisViewItem::hide_rect ()
282 rect_visible = false;
285 if (name_highlight) {
286 name_highlight->set_outline_what (ArdourCanvas::Rectangle::What (0));
287 name_highlight->set_fill_color (UINT_RGBA_CHANGE_A (fill_color, 64));
292 TimeAxisViewItem::show_rect ()
297 if (name_highlight) {
298 name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
299 name_highlight->set_fill_color (fill_color);
304 * Set the position of this item on the timeline.
306 * @param pos the new position
307 * @param src the identity of the object that initiated the change
308 * @return true on success
312 TimeAxisViewItem::set_position(framepos_t pos, void* src, double* delta)
314 if (position_locked) {
318 frame_position = pos;
320 /* This sucks. The GnomeCanvas version I am using
321 doesn't correctly implement gnome_canvas_group_set_arg(),
322 so that simply setting the "x" arg of the group
323 fails to move the group. Instead, we have to
324 use gnome_canvas_item_move(), which does the right
325 thing. I see that in GNOME CVS, the current (Sept 2001)
326 version of GNOME Canvas rectifies this issue cleanly.
330 double new_unit_pos = pos / samples_per_pixel;
332 old_unit_pos = group->position().x;
334 if (new_unit_pos != old_unit_pos) {
335 group->set_x_position (new_unit_pos);
339 (*delta) = new_unit_pos - old_unit_pos;
342 PositionChanged (frame_position, src); /* EMIT_SIGNAL */
347 /** @return position of this item on the timeline */
349 TimeAxisViewItem::get_position() const
351 return frame_position;
355 * Set the duration of this item.
357 * @param dur the new duration of this item
358 * @param src the identity of the object that initiated the change
359 * @return true on success
363 TimeAxisViewItem::set_duration (framecnt_t dur, void* src)
365 if ((dur > max_item_duration) || (dur < min_item_duration)) {
366 warning << string_compose (
367 P_("new duration %1 frame is out of bounds for %2", "new duration of %1 frames is out of bounds for %2", dur),
368 get_item_name(), dur)
379 reset_width_dependent_items (trackview.editor().sample_to_pixel (dur));
381 DurationChanged (dur, src); /* EMIT_SIGNAL */
385 /** @return duration of this item */
387 TimeAxisViewItem::get_duration() const
389 return item_duration;
393 * Set the maximum duration that this item can have.
395 * @param dur the new maximum duration
396 * @param src the identity of the object that initiated the change
399 TimeAxisViewItem::set_max_duration(framecnt_t dur, void* src)
401 max_item_duration = dur;
402 MaxDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
405 /** @return the maximum duration that this item may have */
407 TimeAxisViewItem::get_max_duration() const
409 return max_item_duration;
413 * Set the minimum duration that this item may have.
415 * @param the minimum duration that this item may be set to
416 * @param src the identity of the object that initiated the change
419 TimeAxisViewItem::set_min_duration(framecnt_t dur, void* src)
421 min_item_duration = dur;
422 MinDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
425 /** @return the minimum duration that this item mey have */
427 TimeAxisViewItem::get_min_duration() const
429 return min_item_duration;
433 * Set whether this item is locked to its current position.
434 * Locked items cannot be moved until the item is unlocked again.
436 * @param yn true to lock this item to its current position
437 * @param src the identity of the object that initiated the change
440 TimeAxisViewItem::set_position_locked(bool yn, void* src)
442 position_locked = yn;
443 set_trim_handle_colors();
444 PositionLockChanged (position_locked, src); /* EMIT_SIGNAL */
447 /** @return true if this item is locked to its current position */
449 TimeAxisViewItem::get_position_locked() const
451 return position_locked;
455 * Set whether the maximum duration constraint is active.
457 * @param active set true to enforce the max duration constraint
458 * @param src the identity of the object that initiated the change
461 TimeAxisViewItem::set_max_duration_active (bool active, void* /*src*/)
463 max_duration_active = active;
466 /** @return true if the maximum duration constraint is active */
468 TimeAxisViewItem::get_max_duration_active() const
470 return max_duration_active;
474 * Set whether the minimum duration constraint is active.
476 * @param active set true to enforce the min duration constraint
477 * @param src the identity of the object that initiated the change
481 TimeAxisViewItem::set_min_duration_active (bool active, void* /*src*/)
483 min_duration_active = active;
486 /** @return true if the maximum duration constraint is active */
488 TimeAxisViewItem::get_min_duration_active() const
490 return min_duration_active;
494 * Set the name of this item.
496 * @param new_name the new name of this item
497 * @param src the identity of the object that initiated the change
501 TimeAxisViewItem::set_item_name(std::string new_name, void* src)
503 if (new_name != item_name) {
504 std::string temp_name = item_name;
505 item_name = new_name;
506 NameChanged (item_name, temp_name, src); /* EMIT_SIGNAL */
510 /** @return the name of this item */
512 TimeAxisViewItem::get_item_name() const
518 * Set selection status.
520 * @param yn true if this item is currently selected
523 TimeAxisViewItem::set_selected(bool yn)
525 if (_selected != yn) {
526 Selectable::set_selected (yn);
531 /** @return the TimeAxisView that this item is on */
533 TimeAxisViewItem::get_time_axis_view () const
539 * Set the displayed item text.
540 * This item is the visual text name displayed on the canvas item, this can be different to the name of the item.
542 * @param new_name the new name text to display
546 TimeAxisViewItem::set_name_text(const string& new_name)
552 name_text_width = pixel_width (new_name, NAME_FONT) + 2;
553 name_text->set (new_name);
558 * Set the height of this item.
560 * @param h new height
563 TimeAxisViewItem::set_height (double height)
567 manage_name_highlight ();
569 if (visibility & ShowNameText) {
570 name_text->set_y_position (height + 1 - NAME_Y_OFFSET);
574 frame->set_y1 (height - 1);
575 if (frame_handle_start) {
576 frame_handle_start->set_y1 (height - 1);
577 frame_handle_end->set_y1 (height - 1);
581 vestigial_frame->set_y1 (height - 1);
587 TimeAxisViewItem::manage_name_highlight ()
589 if (_height < NAME_HIGHLIGHT_THRESH) {
590 high_enough_for_name = false;
592 high_enough_for_name = true;
596 wide_enough_for_name = false;
598 wide_enough_for_name = true;
601 if (name_highlight && wide_enough_for_name && high_enough_for_name) {
603 name_highlight->show();
605 name_highlight->set_y0 ((double) _height - 1 - NAME_HIGHLIGHT_SIZE);
606 name_highlight->set_y1 ((double) _height - 1);
608 /* x0 is always zero */
609 name_highlight->set_x1 (_width);
612 name_highlight->hide();
619 TimeAxisViewItem::set_color (Gdk::Color const & base_color)
621 compute_colors (base_color);
626 TimeAxisViewItem::get_canvas_frame()
632 TimeAxisViewItem::get_canvas_group()
638 TimeAxisViewItem::get_name_highlight()
640 return name_highlight;
644 * Calculate some contrasting color for displaying various parts of this item, based upon the base color.
646 * @param color the base color of the item
649 TimeAxisViewItem::compute_colors (Gdk::Color const & base_color)
651 unsigned char radius;
656 /* FILL: this is simple */
657 r = base_color.get_red()/256;
658 g = base_color.get_green()/256;
659 b = base_color.get_blue()/256;
660 fill_color = RGBA_TO_UINT(r,g,b,160);
663 if the overall saturation is strong, make the minor colors light.
664 if its weak, make them dark.
666 we do this by moving an equal distance to the other side of the
667 central circle in the color wheel from where we started.
670 radius = (unsigned char) rint (floor (sqrt (static_cast<double>(r*r + g*g + b+b))/3.0f));
671 minor_shift = 125 - radius;
673 /* LABEL: rotate around color wheel by 120 degrees anti-clockwise */
675 r = base_color.get_red()/256;
676 g = base_color.get_green()/256;
677 b = base_color.get_blue()/256;
683 /* red sector => green */
688 /* green sector => blue */
696 /* blue sector => red */
701 /* green sector => blue */
710 label_color = RGBA_TO_UINT(r,g,b,255);
711 r = (base_color.get_red()/256) + 127;
712 g = (base_color.get_green()/256) + 127;
713 b = (base_color.get_blue()/256) + 127;
715 label_color = RGBA_TO_UINT(r,g,b,255);
717 /* XXX can we do better than this ? */
721 //frame_color_r = 192;
722 //frame_color_g = 192;
723 //frame_color_b = 194;
725 //selected_frame_color_r = 182;
726 //selected_frame_color_g = 145;
727 //selected_frame_color_b = 168;
729 //handle_color_r = 25;
730 //handle_color_g = 0;
731 //handle_color_b = 255;
732 //lock_handle_color_r = 235;
733 //lock_handle_color_g = 16;
734 //lock_handle_color_b = 16;
738 * Convenience method to set the various canvas item colors
741 TimeAxisViewItem::set_colors()
745 if (name_highlight) {
746 name_highlight->set_fill_color (fill_color);
752 const double black_r = 0.0;
753 const double black_g = 0.0;
754 const double black_b = 0.0;
756 const double white_r = 1.0;
757 const double white_g = 1.0;
758 const double white_b = 1.0;
760 ArdourCanvas::color_to_rgba (fill_color, r, g, b, a);
762 /* Use W3C contrast guideline calculation */
764 double white_contrast = (max (r, white_r) - min (r, white_r)) +
765 (max (g, white_g) - min (g, white_g)) +
766 (max (b, white_b) - min (b, white_b));
768 double black_contrast = (max (r, black_r) - min (r, black_r)) +
769 (max (g, black_g) - min (g, black_g)) +
770 (max (b, black_b) - min (b, black_b));
772 if (white_contrast > black_contrast) {
774 name_text->set_color (ArdourCanvas::rgba_to_color (1.0, 1.0, 1.0, 1.0));
777 name_text->set_color (ArdourCanvas::rgba_to_color (0.0, 0.0, 0.0, 1.0));
783 ArdourCanvas::color_to_hsv (fill_color, h, s, v);
786 /* fill is black, set text to white */
787 name_text->set_color (ArdourCanvas::rgba_to_color (1.0, 1.0, 1.0, 1.0));
788 } else if (v == 1.0) {
789 /* fill is white, set text to black */
790 name_text->set_color (ArdourCanvas::rgba_to_color (0.0, 0.0, 0.0, 1.0));
793 h = fabs (fmod ((h - 180), 360.0)); /* complementary color */
794 s = 1.0; /* fully saturate */
795 v = 0.9; /* increase lightness/brightness/value */
797 name_text->set_color (ArdourCanvas::hsv_to_color (h, s, v, 1.0));
803 set_trim_handle_colors();
807 TimeAxisViewItem::get_fill_color () const
813 f = ARDOUR_UI::config()->get_canvasvar_SelectedFrameBase();
818 f = ARDOUR_UI::config()->get_canvasvar_RecordingRect();
821 if (high_enough_for_name && !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
822 f = ARDOUR_UI::config()->get_canvasvar_FrameBase();
833 * Sets the frame color depending on whether this item is selected
836 TimeAxisViewItem::set_frame_color()
844 f = get_fill_color ();
847 f = UINT_RGBA_CHANGE_A (f, fill_opacity);
851 f = UINT_RGBA_CHANGE_A (f, 0);
854 frame->set_fill_color (f);
855 set_frame_gradient ();
859 f = ARDOUR_UI::config()->get_canvasvar_SelectedTimeAxisFrame();
861 f = ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame();
865 f = UINT_RGBA_CHANGE_A (f, 64);
868 frame->set_outline_color (f);
873 TimeAxisViewItem::set_frame_gradient ()
875 if (ARDOUR_UI::config()->get_timeline_item_gradient_depth() == 0.0) {
876 frame->set_gradient (ArdourCanvas::Fill::StopList (), 0);
880 ArdourCanvas::Fill::StopList stops;
883 ArdourCanvas::Color f (get_fill_color());
885 /* need to get alpha value */
886 ArdourCanvas::color_to_rgba (f, r, g, b, a);
888 stops.push_back (std::make_pair (0.0, f));
890 /* now a darker version */
892 ArdourCanvas::color_to_hsv (f, h, s, v);
894 v = min (1.0, v * (1.0 - ARDOUR_UI::config()->get_timeline_item_gradient_depth()));
896 ArdourCanvas::Color darker = ArdourCanvas::hsv_to_color (h, s, v, a);
897 stops.push_back (std::make_pair (1.0, darker));
899 frame->set_gradient (stops, true);
903 * Set the colors of the start and end trim handle depending on object state
906 TimeAxisViewItem::set_trim_handle_colors()
908 if (frame_handle_start) {
909 if (position_locked) {
910 frame_handle_start->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandleLocked());
911 frame_handle_end->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandleLocked());
913 frame_handle_start->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandle());
914 frame_handle_end->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandle());
920 TimeAxisViewItem::frame_handle_crossing (GdkEvent* ev, ArdourCanvas::Rectangle* item)
923 case GDK_LEAVE_NOTIFY:
924 item->set_fill (false);
926 case GDK_ENTER_NOTIFY:
927 item->set_fill (true);
935 /** @return the frames per pixel */
937 TimeAxisViewItem::get_samples_per_pixel () const
939 return samples_per_pixel;
942 /** Set the frames per pixel of this item.
943 * This item is used to determine the relative visual size and position of this item
944 * based upon its duration and start value.
946 * @param fpp the new frames per pixel
949 TimeAxisViewItem::set_samples_per_pixel (double fpp)
951 samples_per_pixel = fpp;
952 set_position (this->get_position(), this);
953 reset_width_dependent_items ((double) get_duration() / samples_per_pixel);
957 TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
959 _width = pixel_width;
961 manage_name_highlight ();
963 if (pixel_width < 2.0) {
965 if (show_vestigial) {
966 vestigial_frame->show();
973 if (frame_handle_start) {
974 frame_handle_start->hide();
975 frame_handle_end->hide();
979 vestigial_frame->hide();
983 frame->set_x1 (pixel_width);
986 if (frame_handle_start) {
987 if (pixel_width < (3 * TimeAxisViewItem::GRAB_HANDLE_WIDTH)) {
989 * there's less than GRAB_HANDLE_WIDTH of the region between
990 * the right-hand end of frame_handle_start and the left-hand
991 * end of frame_handle_end, so disable the handles
994 frame_handle_start->hide();
995 frame_handle_end->hide();
997 frame_handle_start->show();
998 frame_handle_end->set_x0 (pixel_width - (TimeAxisViewItem::GRAB_HANDLE_WIDTH));
999 frame_handle_end->set_x1 (pixel_width);
1000 frame_handle_end->show();
1007 TimeAxisViewItem::manage_name_text ()
1009 int visible_name_width;
1015 if (!wide_enough_for_name || !high_enough_for_name) {
1020 if (name_text->text().empty()) {
1024 visible_name_width = name_text_width;
1026 if (visible_name_width > _width - NAME_X_OFFSET) {
1027 visible_name_width = _width - NAME_X_OFFSET;
1030 if (visible_name_width < 1) {
1033 name_text->clamp_width (visible_name_width);
1039 * Callback used to remove this time axis item during the gtk idle loop.
1040 * This is used to avoid deleting the obejct while inside the remove_this_item
1043 * @param item the TimeAxisViewItem to remove.
1044 * @param src the identity of the object that initiated the change.
1047 TimeAxisViewItem::idle_remove_this_item(TimeAxisViewItem* item, void* src)
1049 item->ItemRemoved (item->get_item_name(), src); /* EMIT_SIGNAL */
1056 TimeAxisViewItem::set_y (double y)
1058 group->set_y_position (y);
1062 TimeAxisViewItem::parameter_changed (string p)
1064 if (p == "color-regions-using-track-color") {
1066 } else if (p == "timeline-item-gradient-depth") {
1067 set_frame_gradient ();