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/container.h"
32 #include "canvas/rectangle.h"
33 #include "canvas/debug.h"
34 #include "canvas/text.h"
35 #include "canvas/utils.h"
37 #include "ardour/profile.h"
39 #include "ardour_ui.h"
41 * ardour_ui.h was moved up in the include list
42 * due to a conflicting definition of 'Rect' between
43 * Apple's MacTypes.h file and GTK
46 #include "public_editor.h"
47 #include "time_axis_view_item.h"
48 #include "time_axis_view.h"
50 #include "rgb_macros.h"
55 using namespace Editing;
58 using namespace ARDOUR;
59 using namespace ARDOUR_UI_UTILS;
60 using namespace Gtkmm2ext;
62 Pango::FontDescription TimeAxisViewItem::NAME_FONT;
63 const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
64 const double TimeAxisViewItem::GRAB_HANDLE_TOP = 0.0;
65 const double TimeAxisViewItem::GRAB_HANDLE_WIDTH = 10.0;
66 const double TimeAxisViewItem::RIGHT_EDGE_SHIFT = 1.0;
68 int TimeAxisViewItem::NAME_HEIGHT;
69 double TimeAxisViewItem::NAME_Y_OFFSET;
70 double TimeAxisViewItem::NAME_HIGHLIGHT_SIZE;
71 double TimeAxisViewItem::NAME_HIGHLIGHT_THRESH;
74 TimeAxisViewItem::set_constant_heights ()
76 NAME_FONT = Pango::FontDescription (ARDOUR_UI::config()->get_canvasvar_SmallFont());
82 Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout (X_("Hg")); /* ascender + descender */
86 layout->set_font_description (NAME_FONT);
87 get_pixel_size (layout, width, height);
89 layout = foo.create_pango_layout (X_("H")); /* just the ascender */
93 /* Config->get_show_name_highlight) == true:
94 Y_OFFSET is measured from bottom of the time axis view item.
95 Config->get_show_name_highlight) == false:
96 Y_OFFSET is measured from the top of the time axis view item.
99 if (Config->get_show_name_highlight()) {
100 NAME_Y_OFFSET = height + 1;
101 NAME_HIGHLIGHT_SIZE = height + 2;
104 NAME_HIGHLIGHT_SIZE = 0;
106 NAME_HIGHLIGHT_THRESH = NAME_HIGHLIGHT_SIZE * 3;
110 * Construct a new TimeAxisViewItem.
112 * @param it_name the unique name of this item
113 * @param parent the parent canvas group
114 * @param tv the TimeAxisView we are going to be added to
115 * @param spu samples per unit
117 * @param start the start point of this item
118 * @param duration the duration of this item
119 * @param recording true if this is a recording region view
120 * @param automation true if this is an automation region view
122 TimeAxisViewItem::TimeAxisViewItem(
123 const string & it_name, ArdourCanvas::Item& parent, TimeAxisView& tv, double spu, uint32_t base_color,
124 framepos_t start, framecnt_t duration, bool recording, bool automation, Visibility vis
127 , frame_position (-1)
128 , item_name (it_name)
130 , _recregion (recording)
131 , _automation (automation)
135 init (&parent, spu, base_color, start, duration, vis, true, true);
138 TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
141 , PBD::ScopedConnectionList()
142 , trackview (other.trackview)
143 , frame_position (-1)
144 , item_name (other.item_name)
146 , _recregion (other._recregion)
147 , _automation (other._automation)
148 , _dragging (other._dragging)
151 /* share the other's parent, but still create a new group */
153 ArdourCanvas::Item* parent = other.group->parent();
155 _selected = other._selected;
157 init (parent, other.samples_per_pixel, other.fill_color, other.frame_position,
158 other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name);
162 TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_color,
163 framepos_t start, framepos_t duration, Visibility vis,
164 bool wide, bool high)
166 group = new ArdourCanvas::Container (parent);
167 CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
168 group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
170 fill_color = base_color;
171 samples_per_pixel = fpp;
172 frame_position = start;
173 item_duration = duration;
174 name_connected = false;
175 position_locked = false;
176 max_item_duration = ARDOUR::max_framepos;
177 min_item_duration = 0;
178 show_vestigial = true;
183 wide_enough_for_name = wide;
184 high_enough_for_name = high;
188 warning << "Time Axis Item Duration == 0" << endl;
191 vestigial_frame = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, 1.0, 2.0, trackview.current_height()));
192 CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name()));
193 vestigial_frame->hide ();
194 vestigial_frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_VestigialFrame());
195 vestigial_frame->set_fill_color (ARDOUR_UI::config()->get_canvasvar_VestigialFrame());
197 if (visibility & ShowFrame) {
198 frame = new ArdourCanvas::Rectangle (group,
199 ArdourCanvas::Rect (0.0, 0.0,
200 trackview.editor().sample_to_pixel(duration) + RIGHT_EDGE_SHIFT,
201 trackview.current_height() - 1.0));
203 CANVAS_DEBUG_NAME (frame, string_compose ("frame for %1", get_item_name()));
205 if (Config->get_show_name_highlight()) {
206 frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
208 frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT|ArdourCanvas::Rectangle::BOTTOM));
212 frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_RecordingRect());
214 frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame());
222 if (Config->get_show_name_highlight() && (visibility & ShowNameHighlight)) {
227 if (visibility & FullWidthNameHighlight) {
229 width = trackview.editor().sample_to_pixel(item_duration) + RIGHT_EDGE_SHIFT;
232 width = trackview.editor().sample_to_pixel(item_duration) - 2.0 + RIGHT_EDGE_SHIFT;
235 name_highlight = new ArdourCanvas::Rectangle (group,
236 ArdourCanvas::Rect (start,
237 trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE,
238 width - 2.0 + RIGHT_EDGE_SHIFT,
239 trackview.current_height() - 1.0));
240 CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name()));
241 name_highlight->set_data ("timeaxisviewitem", this);
242 name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
243 name_highlight->set_outline_color (RGBA_TO_UINT (0,0,0,255));
249 if (visibility & ShowNameText) {
250 name_text = new ArdourCanvas::Text (group);
251 CANVAS_DEBUG_NAME (name_text, string_compose ("name text for %1", get_item_name()));
252 if (Config->get_show_name_highlight()) {
253 name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, trackview.current_height() - NAME_Y_OFFSET));
255 name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, NAME_Y_OFFSET));
257 name_text->set_font_description (NAME_FONT);
258 name_text->set_ignore_events (true);
263 /* create our grab handles used for trimming/duration etc */
264 if (!_recregion && !_automation) {
265 double top = TimeAxisViewItem::GRAB_HANDLE_TOP;
266 double width = TimeAxisViewItem::GRAB_HANDLE_WIDTH;
268 frame_handle_start = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height()));
269 CANVAS_DEBUG_NAME (frame_handle_start, "TAVI frame handle start");
270 frame_handle_start->set_outline (false);
271 frame_handle_start->set_fill (false);
272 frame_handle_start->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::frame_handle_crossing), frame_handle_start));
274 frame_handle_end = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height()));
275 CANVAS_DEBUG_NAME (frame_handle_end, "TAVI frame handle end");
276 frame_handle_end->set_outline (false);
277 frame_handle_end->set_fill (false);
278 frame_handle_end->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::frame_handle_crossing), frame_handle_end));
280 frame_handle_start = frame_handle_end = 0;
283 set_color (base_color);
285 set_duration (item_duration, this);
286 set_position (start, this);
288 Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&TimeAxisViewItem::parameter_changed, this, _1), gui_context ());
289 ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun (*this, &TimeAxisViewItem::parameter_changed));
292 TimeAxisViewItem::~TimeAxisViewItem()
298 TimeAxisViewItem::canvas_group_event (GdkEvent* /*ev*/)
304 TimeAxisViewItem::hide_rect ()
306 rect_visible = false;
309 if (name_highlight) {
310 name_highlight->set_outline_what (ArdourCanvas::Rectangle::What (0));
311 name_highlight->set_fill_color (UINT_RGBA_CHANGE_A (fill_color, 64));
316 TimeAxisViewItem::show_rect ()
321 if (name_highlight) {
322 name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
323 name_highlight->set_fill_color (fill_color);
328 * Set the position of this item on the timeline.
330 * @param pos the new position
331 * @param src the identity of the object that initiated the change
332 * @return true on success
336 TimeAxisViewItem::set_position(framepos_t pos, void* src, double* delta)
338 if (position_locked) {
342 frame_position = pos;
344 double new_unit_pos = trackview.editor().sample_to_pixel (pos);
347 (*delta) = new_unit_pos - group->position().x;
352 if (new_unit_pos == group->position().x) {
357 group->set_x_position (new_unit_pos);
359 PositionChanged (frame_position, src); /* EMIT_SIGNAL */
364 /** @return position of this item on the timeline */
366 TimeAxisViewItem::get_position() const
368 return frame_position;
372 * Set the duration of this item.
374 * @param dur the new duration of this item
375 * @param src the identity of the object that initiated the change
376 * @return true on success
380 TimeAxisViewItem::set_duration (framecnt_t dur, void* src)
382 if ((dur > max_item_duration) || (dur < min_item_duration)) {
383 warning << string_compose (
384 P_("new duration %1 frame is out of bounds for %2", "new duration of %1 frames is out of bounds for %2", dur),
385 get_item_name(), dur)
396 reset_width_dependent_items (trackview.editor().sample_to_pixel (dur));
398 DurationChanged (dur, src); /* EMIT_SIGNAL */
402 /** @return duration of this item */
404 TimeAxisViewItem::get_duration() const
406 return item_duration;
410 * Set the maximum duration that this item can have.
412 * @param dur the new maximum duration
413 * @param src the identity of the object that initiated the change
416 TimeAxisViewItem::set_max_duration(framecnt_t dur, void* src)
418 max_item_duration = dur;
419 MaxDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
422 /** @return the maximum duration that this item may have */
424 TimeAxisViewItem::get_max_duration() const
426 return max_item_duration;
430 * Set the minimum duration that this item may have.
432 * @param the minimum duration that this item may be set to
433 * @param src the identity of the object that initiated the change
436 TimeAxisViewItem::set_min_duration(framecnt_t dur, void* src)
438 min_item_duration = dur;
439 MinDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
442 /** @return the minimum duration that this item mey have */
444 TimeAxisViewItem::get_min_duration() const
446 return min_item_duration;
450 * Set whether this item is locked to its current position.
451 * Locked items cannot be moved until the item is unlocked again.
453 * @param yn true to lock this item to its current position
454 * @param src the identity of the object that initiated the change
457 TimeAxisViewItem::set_position_locked(bool yn, void* src)
459 position_locked = yn;
460 set_trim_handle_colors();
461 PositionLockChanged (position_locked, src); /* EMIT_SIGNAL */
464 /** @return true if this item is locked to its current position */
466 TimeAxisViewItem::get_position_locked() const
468 return position_locked;
472 * Set whether the maximum duration constraint is active.
474 * @param active set true to enforce the max duration constraint
475 * @param src the identity of the object that initiated the change
478 TimeAxisViewItem::set_max_duration_active (bool active, void* /*src*/)
480 max_duration_active = active;
483 /** @return true if the maximum duration constraint is active */
485 TimeAxisViewItem::get_max_duration_active() const
487 return max_duration_active;
491 * Set whether the minimum duration constraint is active.
493 * @param active set true to enforce the min duration constraint
494 * @param src the identity of the object that initiated the change
498 TimeAxisViewItem::set_min_duration_active (bool active, void* /*src*/)
500 min_duration_active = active;
503 /** @return true if the maximum duration constraint is active */
505 TimeAxisViewItem::get_min_duration_active() const
507 return min_duration_active;
511 * Set the name of this item.
513 * @param new_name the new name of this item
514 * @param src the identity of the object that initiated the change
518 TimeAxisViewItem::set_item_name(std::string new_name, void* src)
520 if (new_name != item_name) {
521 std::string temp_name = item_name;
522 item_name = new_name;
523 NameChanged (item_name, temp_name, src); /* EMIT_SIGNAL */
527 /** @return the name of this item */
529 TimeAxisViewItem::get_item_name() const
535 * Set selection status.
537 * @param yn true if this item is currently selected
540 TimeAxisViewItem::set_selected(bool yn)
542 if (_selected != yn) {
543 Selectable::set_selected (yn);
545 set_name_text_color ();
548 if (!Config->get_show_name_highlight() && yn) {
549 frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT|ArdourCanvas::Rectangle::BOTTOM|ArdourCanvas::Rectangle::TOP));
550 frame->set_y1 (_height - 1.0);
552 if (Config->get_show_name_highlight()) {
553 frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
555 frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT|ArdourCanvas::Rectangle::BOTTOM));
557 frame->set_y1 (_height);
563 /** @return the TimeAxisView that this item is on */
565 TimeAxisViewItem::get_time_axis_view () const
571 * Set the displayed item text.
572 * This item is the visual text name displayed on the canvas item, this can be different to the name of the item.
574 * @param new_name the new name text to display
578 TimeAxisViewItem::set_name_text(const string& new_name)
584 name_text_width = pixel_width (new_name, NAME_FONT) + 2;
585 name_text->set (new_name);
590 * Set the height of this item.
592 * @param h new height
595 TimeAxisViewItem::set_height (double height)
599 manage_name_highlight ();
601 if (visibility & ShowNameText) {
602 if (Config->get_show_name_highlight()) {
603 name_text->set_y_position (height - NAME_Y_OFFSET);
605 name_text->set_y_position (NAME_Y_OFFSET);
610 if (!Config->get_show_name_highlight() && _selected) {
611 frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT|ArdourCanvas::Rectangle::BOTTOM|ArdourCanvas::Rectangle::TOP));
612 frame->set_y1 (_height - 1.0);
614 if (Config->get_show_name_highlight()) {
615 frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
617 frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT|ArdourCanvas::Rectangle::BOTTOM));
619 frame->set_y1 (_height);
622 if (frame_handle_start) {
623 frame_handle_start->set_y1 (height);
624 frame_handle_end->set_y1 (height);
628 vestigial_frame->set_y1 (height - 1.0);
634 TimeAxisViewItem::manage_name_highlight ()
636 if (!name_highlight) {
640 if (_height < NAME_HIGHLIGHT_THRESH) {
641 high_enough_for_name = false;
643 high_enough_for_name = true;
647 wide_enough_for_name = false;
649 wide_enough_for_name = true;
652 if (name_highlight && wide_enough_for_name && high_enough_for_name) {
654 name_highlight->show();
655 name_highlight->set (ArdourCanvas::Rect (0.0, (double) _height - NAME_HIGHLIGHT_SIZE, _width+RIGHT_EDGE_SHIFT, (double) _height - 1.0));
658 name_highlight->hide();
665 TimeAxisViewItem::set_color (uint32_t base_color)
667 fill_color = base_color;
672 TimeAxisViewItem::get_canvas_frame()
678 TimeAxisViewItem::get_canvas_group()
684 TimeAxisViewItem::get_name_highlight()
686 return name_highlight;
690 * Convenience method to set the various canvas item colors
693 TimeAxisViewItem::set_colors()
697 if (name_highlight) {
698 name_highlight->set_fill_color (fill_color);
701 set_name_text_color ();
702 set_trim_handle_colors();
706 TimeAxisViewItem::set_name_text_color ()
715 if (Config->get_show_name_highlight()) {
716 /* name text will always be on top of name highlight, which
717 will always use our fill color.
721 /* name text will be on top of the item, whose color
722 may vary depending on various conditions.
724 f = get_fill_color ();
727 name_text->set_color (ArdourCanvas::contrasting_text_color (f));
731 TimeAxisViewItem::fill_opacity () const
734 /* if the frame/rect is marked as invisible, then the
735 * fill should be transparent. simplest: set
737 * alpha/opacity to zero.
746 uint32_t col = ARDOUR_UI::config()->get_canvasvar_FrameBase();
747 return UINT_RGBA_A (col);
751 TimeAxisViewItem::get_fill_color () const
760 f = ARDOUR_UI::config()->get_canvasvar_SelectedFrameBase();
763 /* some condition of this item has set fill opacity to
764 * zero, but it has been selected, so use a mid-way
765 * alpha value to make it reasonably visible.
773 f = ARDOUR_UI::config()->get_canvasvar_RecordingRect();
775 if ((!Config->get_show_name_highlight() || high_enough_for_name) && !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
776 f = ARDOUR_UI::config()->get_canvasvar_FrameBase();
783 return UINT_RGBA_CHANGE_A (f, o);
787 * Sets the frame color depending on whether this item is selected
790 TimeAxisViewItem::set_frame_color()
796 frame->set_fill_color (get_fill_color());
797 set_frame_gradient ();
803 f = ARDOUR_UI::config()->get_canvasvar_SelectedTimeAxisFrame();
805 f = ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame();
809 /* make the frame outline be visible but rather transparent */
810 f = UINT_RGBA_CHANGE_A (f, 64);
813 frame->set_outline_color (f);
818 TimeAxisViewItem::set_frame_gradient ()
820 if (ARDOUR_UI::config()->get_timeline_item_gradient_depth() == 0.0) {
821 frame->set_gradient (ArdourCanvas::Fill::StopList (), 0);
825 ArdourCanvas::Fill::StopList stops;
828 ArdourCanvas::Color f (get_fill_color());
830 /* need to get alpha value */
831 ArdourCanvas::color_to_rgba (f, r, g, b, a);
833 stops.push_back (std::make_pair (0.0, f));
835 /* now a darker version */
837 ArdourCanvas::color_to_hsv (f, h, s, v);
839 v = min (1.0, v * (1.0 - ARDOUR_UI::config()->get_timeline_item_gradient_depth()));
841 ArdourCanvas::Color darker = ArdourCanvas::hsv_to_color (h, s, v, a);
842 stops.push_back (std::make_pair (1.0, darker));
844 frame->set_gradient (stops, true);
848 * Set the colors of the start and end trim handle depending on object state
851 TimeAxisViewItem::set_trim_handle_colors()
854 /* Leave them transparent for now */
855 if (frame_handle_start) {
856 frame_handle_start->set_fill_color (0x00000000);
857 frame_handle_end->set_fill_color (0x00000000);
860 if (frame_handle_start) {
861 if (position_locked) {
862 frame_handle_start->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandleLocked());
863 frame_handle_end->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandleLocked());
865 frame_handle_start->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandle());
866 frame_handle_end->set_fill_color (ARDOUR_UI::config()->get_canvasvar_TrimHandle());
873 TimeAxisViewItem::frame_handle_crossing (GdkEvent* ev, ArdourCanvas::Rectangle* item)
876 case GDK_LEAVE_NOTIFY:
877 /* always hide the handle whenever we leave, no matter what mode */
878 item->set_fill (false);
880 case GDK_ENTER_NOTIFY:
881 if (trackview.editor().effective_mouse_mode() == Editing::MouseObject &&
882 !trackview.editor().internal_editing()) {
883 /* never set this to be visible in internal
884 edit mode. Note, however, that we do need to
885 undo visibility (LEAVE_NOTIFY case above) no
886 matter what the mode is.
888 item->set_fill (true);
897 /** @return the frames per pixel */
899 TimeAxisViewItem::get_samples_per_pixel () const
901 return samples_per_pixel;
904 /** Set the frames per pixel of this item.
905 * This item is used to determine the relative visual size and position of this item
906 * based upon its duration and start value.
908 * @param fpp the new frames per pixel
911 TimeAxisViewItem::set_samples_per_pixel (double fpp)
913 samples_per_pixel = fpp;
914 set_position (this->get_position(), this);
915 reset_width_dependent_items ((double) get_duration() / samples_per_pixel);
919 TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
921 _width = pixel_width;
923 manage_name_highlight ();
926 if (pixel_width < 2.0) {
928 if (show_vestigial) {
929 vestigial_frame->show();
936 if (frame_handle_start) {
937 frame_handle_start->hide();
938 frame_handle_end->hide();
942 vestigial_frame->hide();
946 frame->set_x1 (pixel_width + RIGHT_EDGE_SHIFT);
949 if (frame_handle_start) {
950 if (pixel_width < (3 * TimeAxisViewItem::GRAB_HANDLE_WIDTH)) {
952 * there's less than GRAB_HANDLE_WIDTH of the region between
953 * the right-hand end of frame_handle_start and the left-hand
954 * end of frame_handle_end, so disable the handles
957 frame_handle_start->hide();
958 frame_handle_end->hide();
960 frame_handle_start->show();
961 frame_handle_end->set_x0 (pixel_width + RIGHT_EDGE_SHIFT - (TimeAxisViewItem::GRAB_HANDLE_WIDTH));
962 frame_handle_end->set_x1 (pixel_width + RIGHT_EDGE_SHIFT);
963 frame_handle_end->show();
970 TimeAxisViewItem::manage_name_text ()
972 int visible_name_width;
978 if (!wide_enough_for_name || !high_enough_for_name) {
983 if (name_text->text().empty()) {
987 visible_name_width = name_text_width;
989 if (visible_name_width > _width - NAME_X_OFFSET) {
990 visible_name_width = _width - NAME_X_OFFSET;
993 if (visible_name_width < 1) {
996 name_text->clamp_width (visible_name_width);
1002 * Callback used to remove this time axis item during the gtk idle loop.
1003 * This is used to avoid deleting the obejct while inside the remove_this_item
1006 * @param item the TimeAxisViewItem to remove.
1007 * @param src the identity of the object that initiated the change.
1010 TimeAxisViewItem::idle_remove_this_item(TimeAxisViewItem* item, void* src)
1012 item->ItemRemoved (item->get_item_name(), src); /* EMIT_SIGNAL */
1019 TimeAxisViewItem::set_y (double y)
1021 group->set_y_position (y);
1025 TimeAxisViewItem::parameter_changed (string p)
1027 if (p == "color-regions-using-track-color") {
1029 } else if (p == "timeline-item-gradient-depth") {
1030 set_frame_gradient ();
1035 TimeAxisViewItem::drag_start ()
1042 TimeAxisViewItem::drag_end ()