ardour
time_axis_view_item.cc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 Paul Davis
3 
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.
8 
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.
13 
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.
17 
18 */
19 
20 #include <utility>
21 
22 #include "pbd/error.h"
23 #include "pbd/stacktrace.h"
24 
25 #include "ardour/types.h"
26 #include "ardour/ardour.h"
27 
28 #include "gtkmm2ext/utils.h"
29 #include "gtkmm2ext/gui_thread.h"
30 
31 #include "canvas/container.h"
32 #include "canvas/rectangle.h"
33 #include "canvas/debug.h"
34 #include "canvas/text.h"
35 #include "canvas/colors.h"
36 
37 #include "ardour/profile.h"
38 
39 #include "ardour_ui.h"
40 /*
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
44  */
45 
46 #include "public_editor.h"
47 #include "time_axis_view_item.h"
48 #include "time_axis_view.h"
49 #include "utils.h"
50 #include "rgb_macros.h"
51 
52 #include "i18n.h"
53 
54 using namespace std;
55 using namespace Editing;
56 using namespace Glib;
57 using namespace PBD;
58 using namespace ARDOUR;
59 using namespace ARDOUR_UI_UTILS;
60 using namespace Gtkmm2ext;
61 
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 
71 
72 void
74 {
75  NAME_FONT = Pango::FontDescription (ARDOUR_UI::config()->get_SmallFont());
76 
77  Gtk::Window win;
78  Gtk::Label foo;
79  win.add (foo);
80 
81  Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout (X_("Hg")); /* ascender + descender */
82  int width = 0;
83  int height = 0;
84 
85  layout->set_font_description (NAME_FONT);
86  get_pixel_size (layout, width, height);
87 
88  layout = foo.create_pango_layout (X_("H")); /* just the ascender */
89 
90  NAME_HEIGHT = height;
91 
92  /* Config->get_show_name_highlight) == true:
93  Y_OFFSET is measured from bottom of the time axis view item.
94  Config->get_show_name_highlight) == false:
95  Y_OFFSET is measured from the top of the time axis view item.
96  */
97 
98  if (ARDOUR_UI::config()->get_show_name_highlight()) {
99  NAME_Y_OFFSET = height + 1;
100  NAME_HIGHLIGHT_SIZE = height + 2;
101  } else {
102  NAME_Y_OFFSET = 3;
103  NAME_HIGHLIGHT_SIZE = 0;
104  }
105  NAME_HIGHLIGHT_THRESH = NAME_HIGHLIGHT_SIZE * 3;
106 }
107 
122  const string & it_name, ArdourCanvas::Item& parent, TimeAxisView& tv, double spu, uint32_t base_color,
123  framepos_t start, framecnt_t duration, bool recording, bool automation, Visibility vis
124  )
125  : trackview (tv)
126  , frame_position (-1)
127  , item_name (it_name)
128  , selection_frame (0)
129  , _height (1.0)
130  , _recregion (recording)
131  , _automation (automation)
132  , _dragging (false)
133  , _width (0.0)
134 {
135  init (&parent, spu, base_color, start, duration, vis, true, true);
136 }
137 
139  : trackable (other)
140  , Selectable (other)
142  , trackview (other.trackview)
143  , frame_position (-1)
144  , item_name (other.item_name)
145  , selection_frame (0)
146  , _height (1.0)
147  , _recregion (other._recregion)
148  , _automation (other._automation)
149  , _dragging (other._dragging)
150  , _width (0.0)
151 {
152  /* share the other's parent, but still create a new group */
153 
154  ArdourCanvas::Item* parent = other.group->parent();
155 
156  _selected = other._selected;
157 
158  init (parent, other.samples_per_pixel, other.fill_color, other.frame_position,
160 }
161 
162 void
163 TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_color,
164  framepos_t start, framepos_t duration, Visibility vis,
165  bool wide, bool high)
166 {
167  group = new ArdourCanvas::Container (parent);
168  CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
169  group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
170 
171  fill_color = base_color;
172  fill_color_name = "time axis view item base";
173  samples_per_pixel = fpp;
175  item_duration = duration;
176  name_connected = false;
177  position_locked = false;
179  min_item_duration = 0;
180  show_vestigial = true;
181  visibility = vis;
182  _sensitive = true;
183  name_text_width = 0;
184  last_item_width = 0;
185  wide_enough_for_name = wide;
186  high_enough_for_name = high;
187  vestigial_frame = 0;
188 
189  if (duration == 0) {
190  warning << "Time Axis Item Duration == 0" << endl;
191  }
192 
193  if (visibility & ShowFrame) {
194  frame = new ArdourCanvas::Rectangle (group,
195  ArdourCanvas::Rect (0.0, 0.0,
196  trackview.editor().sample_to_pixel(duration),
198 
199  frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
200 
201  CANVAS_DEBUG_NAME (frame, string_compose ("frame for %1", get_item_name()));
202 
203  if (_recregion) {
204  frame->set_outline_color (ARDOUR_UI::config()->color ("recording rect"));
205  } else {
206  frame->set_outline_color (ARDOUR_UI::config()->color ("time axis frame"));
207  }
208  }
209 
210  if (ARDOUR_UI::config()->get_show_name_highlight() && (visibility & ShowNameHighlight)) {
211 
212  double width;
213  double start = 1.0;
214 
217  } else {
219  }
220 
221  name_highlight = new ArdourCanvas::Rectangle (group,
222  ArdourCanvas::Rect (start,
224  width - 2.0,
225  trackview.current_height() - 1.0));
226  CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name()));
227  name_highlight->set_data ("timeaxisviewitem", this);
228  name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
229  name_highlight->set_outline_color (RGBA_TO_UINT (0,0,0,255));
230 
231  } else {
232  name_highlight = 0;
233  }
234 
235  if (visibility & ShowNameText) {
236  name_text = new ArdourCanvas::Text (group);
237  CANVAS_DEBUG_NAME (name_text, string_compose ("name text for %1", get_item_name()));
238  if (ARDOUR_UI::config()->get_show_name_highlight()) {
239  name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, trackview.current_height() - NAME_Y_OFFSET));
240  } else {
241  name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, NAME_Y_OFFSET));
242  }
243  name_text->set_font_description (NAME_FONT);
244  name_text->set_ignore_events (true);
245  } else {
246  name_text = 0;
247  }
248 
249  /* create our grab handles used for trimming/duration etc */
250  if (!_recregion && !_automation) {
253 
254  frame_handle_start = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height()));
255  CANVAS_DEBUG_NAME (frame_handle_start, "TAVI frame handle start");
256  frame_handle_start->set_outline (false);
257  frame_handle_start->set_fill (false);
258  frame_handle_start->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::frame_handle_crossing), frame_handle_start));
259 
260  frame_handle_end = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height()));
261  CANVAS_DEBUG_NAME (frame_handle_end, "TAVI frame handle end");
262  frame_handle_end->set_outline (false);
263  frame_handle_end->set_fill (false);
264  frame_handle_end->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::frame_handle_crossing), frame_handle_end));
265  } else {
267  }
268 
269  set_color (base_color);
270 
271  set_duration (item_duration, this);
272  set_position (start, this);
273 
274  Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&TimeAxisViewItem::parameter_changed, this, _1), gui_context ());
275  ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun (*this, &TimeAxisViewItem::parameter_changed));
276 }
277 
279 {
280  delete group;
281 }
282 
283 bool
285 {
286  return false;
287 }
288 
297 bool
298 TimeAxisViewItem::set_position(framepos_t pos, void* src, double* delta)
299 {
300  if (position_locked) {
301  return false;
302  }
303 
304  frame_position = pos;
305 
306  double new_unit_pos = trackview.editor().sample_to_pixel (pos);
307 
308  if (delta) {
309  (*delta) = new_unit_pos - group->position().x;
310  if (*delta == 0.0) {
311  return true;
312  }
313  } else {
314  if (new_unit_pos == group->position().x) {
315  return true;
316  }
317  }
318 
319  group->set_x_position (new_unit_pos);
320  PositionChanged (frame_position, src); /* EMIT_SIGNAL */
321 
322  return true;
323 }
324 
328 {
329  return frame_position;
330 }
331 
340 bool
342 {
343  if ((dur > max_item_duration) || (dur < min_item_duration)) {
345  P_("new duration %1 frame is out of bounds for %2", "new duration of %1 frames is out of bounds for %2", dur),
346  get_item_name(), dur)
347  << endmsg;
348  return false;
349  }
350 
351  if (dur == 0) {
352  group->hide();
353  }
354 
355  item_duration = dur;
356 
357  double end_pixel = trackview.editor().sample_to_pixel (frame_position + dur);
358  double first_pixel = trackview.editor().sample_to_pixel (frame_position);
359 
360  reset_width_dependent_items (end_pixel - first_pixel);
361 
362  DurationChanged (dur, src); /* EMIT_SIGNAL */
363  return true;
364 }
365 
369 {
370  return item_duration;
371 }
372 
379 void
381 {
382  max_item_duration = dur;
383  MaxDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
384 }
385 
389 {
390  return max_item_duration;
391 }
392 
399 void
401 {
402  min_item_duration = dur;
403  MinDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
404 }
405 
409 {
410  return min_item_duration;
411 }
412 
420 void
422 {
423  position_locked = yn;
425  PositionLockChanged (position_locked, src); /* EMIT_SIGNAL */
426 }
427 
429 bool
431 {
432  return position_locked;
433 }
434 
441 void
443 {
445 }
446 
448 bool
450 {
451  return max_duration_active;
452 }
453 
461 void
463 {
465 }
466 
468 bool
470 {
471  return min_duration_active;
472 }
473 
481 void
482 TimeAxisViewItem::set_item_name(std::string new_name, void* src)
483 {
484  if (new_name != item_name) {
485  std::string temp_name = item_name;
486  item_name = new_name;
487  NameChanged (item_name, temp_name, src); /* EMIT_SIGNAL */
488  }
489 }
490 
492 std::string
494 {
495  return item_name;
496 }
497 
503 void
505 {
506  if (_selected == yn) {
507  return;
508  }
509 
511  set_frame_color ();
513 
514  if (_selected && frame) {
515  if (!selection_frame) {
516  selection_frame = new ArdourCanvas::Rectangle (group);
517  selection_frame->set_fill (false);
518  selection_frame->set_outline_color (ARDOUR_UI::config()->color ("selected time axis frame"));
519  selection_frame->set_ignore_events (true);
520  }
521  selection_frame->set (frame->get().shrink (1.0));
522  selection_frame->show ();
523  } else {
524  if (selection_frame) {
525  selection_frame->hide ();
526  }
527  }
528 }
529 
533 {
534  return trackview;
535 }
536 
544 void
545 TimeAxisViewItem::set_name_text(const string& new_name)
546 {
547  if (!name_text) {
548  return;
549  }
550 
551  name_text_width = pixel_width (new_name, NAME_FONT) + 2;
552  name_text->set (new_name);
553 
554 }
555 
561 void
563 {
564  _height = height;
565 
567 
568  if (visibility & ShowNameText) {
569  if (ARDOUR_UI::config()->get_show_name_highlight()) {
570  name_text->set_y_position (height - NAME_Y_OFFSET);
571  } else {
572  name_text->set_y_position (NAME_Y_OFFSET);
573  }
574  }
575 
576  if (frame) {
577 
578  frame->set_y0 (1.0);
579  frame->set_y1 (height);
580 
581  if (frame_handle_start) {
582  frame_handle_start->set_y1 (height);
583  frame_handle_end->set_y1 (height);
584  }
585 
586  if (selection_frame) {
587  selection_frame->set (frame->get().shrink (1.0));
588  }
589  }
590 
591  if (vestigial_frame) {
592  vestigial_frame->set_y0 (1.0);
593  vestigial_frame->set_y1 (height);
594  }
595 
596  set_colors ();
597 }
598 
599 void
601 {
602  if (!name_highlight) {
603  return;
604  }
605 
607  high_enough_for_name = false;
608  } else {
609  high_enough_for_name = true;
610  }
611 
612  if (_width < 2.0) {
613  wide_enough_for_name = false;
614  } else {
615  wide_enough_for_name = true;
616  }
617 
619 
620  name_highlight->show();
621  name_highlight->set (ArdourCanvas::Rect (1.0, (double) _height - NAME_HIGHLIGHT_SIZE, _width, (double) _height - 1.0));
622 
623  } else {
624  name_highlight->hide();
625  }
626 
627  manage_name_text ();
628 }
629 
630 void
631 TimeAxisViewItem::set_color (uint32_t base_color)
632 {
633  fill_color = base_color;
634  set_colors ();
635 }
636 
637 ArdourCanvas::Item*
639 {
640  return frame;
641 }
642 
643 ArdourCanvas::Item*
645 {
646  return group;
647 }
648 
649 ArdourCanvas::Item*
651 {
652  return name_highlight;
653 }
654 
658 void
660 {
661  set_frame_color ();
662 
663  if (name_highlight) {
664  name_highlight->set_fill_color (fill_color);
665  }
666 
669 }
670 
671 void
673 {
674  if (!name_text) {
675  return;
676  }
677 
678 
679  uint32_t f;
680 
681  if (ARDOUR_UI::config()->get_show_name_highlight()) {
682  /* name text will always be on top of name highlight, which
683  will always use our fill color.
684  */
685  f = fill_color;
686  } else {
687  /* name text will be on top of the item, whose color
688  may vary depending on various conditions.
689  */
690  f = get_fill_color ();
691  }
692 
694 }
695 
696 ArdourCanvas::Color
698 {
699  const std::string mod_name = (_dragging ? "dragging region" : fill_color_name);
700 
701  if (_selected) {
702  return ARDOUR_UI::config()->color_mod ("selected region base", mod_name);
703  } else if (_recregion) {
704  return ARDOUR_UI::config()->color ("recording rect");
705  } else if ((!ARDOUR_UI::config()->get_show_name_highlight() || high_enough_for_name) &&
706  !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
707  return ARDOUR_UI::config()->color_mod (fill_color_name, mod_name);
708  }
709  return ARDOUR_UI::config()->color_mod (fill_color, mod_name);
710 }
711 
715 void
717 {
718  if (!frame) {
719  return;
720  }
721 
722  frame->set_fill_color (get_fill_color());
724 
725  if (!_recregion) {
726  frame->set_outline_color (ARDOUR_UI::config()->color ("time axis frame"));
727  }
728 }
729 
730 void
732 {
733  if (ARDOUR_UI::config()->get_timeline_item_gradient_depth() == 0.0) {
734  frame->set_gradient (ArdourCanvas::Fill::StopList (), 0);
735  return;
736  }
737 
738  ArdourCanvas::Fill::StopList stops;
739  double r, g, b, a;
740  double h, s, v;
741  ArdourCanvas::Color f (get_fill_color());
742 
743  /* need to get alpha value */
744  ArdourCanvas::color_to_rgba (f, r, g, b, a);
745 
746  stops.push_back (std::make_pair (0.0, f));
747 
748  /* now a darker version */
749 
750  ArdourCanvas::color_to_hsv (f, h, s, v);
751 
752  v = min (1.0, v * (1.0 - ARDOUR_UI::config()->get_timeline_item_gradient_depth()));
753 
754  ArdourCanvas::Color darker = ArdourCanvas::hsva_to_color (h, s, v, a);
755  stops.push_back (std::make_pair (1.0, darker));
756 
757  frame->set_gradient (stops, true);
758 }
759 
763 void
765 {
766 #if 1
767  /* Leave them transparent for now */
768  if (frame_handle_start) {
769  frame_handle_start->set_fill_color (0x00000000);
770  frame_handle_end->set_fill_color (0x00000000);
771  }
772 #else
773  if (frame_handle_start) {
774  if (position_locked) {
775  frame_handle_start->set_fill_color (ARDOUR_UI::config()->get_TrimHandleLocked());
776  frame_handle_end->set_fill_color (ARDOUR_UI::config()->get_TrimHandleLocked());
777  } else {
778  frame_handle_start->set_fill_color (ARDOUR_UI::config()->get_TrimHandle());
779  frame_handle_end->set_fill_color (ARDOUR_UI::config()->get_TrimHandle());
780  }
781  }
782 #endif
783 }
784 
785 bool
786 TimeAxisViewItem::frame_handle_crossing (GdkEvent* ev, ArdourCanvas::Rectangle* item)
787 {
788  switch (ev->type) {
789  case GDK_LEAVE_NOTIFY:
790  /* always hide the handle whenever we leave, no matter what mode */
791  item->set_fill (false);
792  break;
793  case GDK_ENTER_NOTIFY:
794  if (trackview.editor().effective_mouse_mode() == Editing::MouseObject) {
795  /* Never set this to be visible in other modes. Note, however,
796  that we do need to undo visibility (LEAVE_NOTIFY case above) no
797  matter what the mode is. */
798  item->set_fill (true);
799  }
800  break;
801  default:
802  break;
803  }
804  return false;
805 }
806 
808 double
810 {
811  return samples_per_pixel;
812 }
813 
820 void
822 {
823  samples_per_pixel = fpp;
824  set_position (this->get_position(), this);
825 
826  double end_pixel = trackview.editor().sample_to_pixel (frame_position + get_duration());
827  double first_pixel = trackview.editor().sample_to_pixel (frame_position);
828 
829  reset_width_dependent_items (end_pixel - first_pixel);
830 }
831 
832 void
834 {
836 
838  manage_name_text ();
839 
840  if (pixel_width < 2.0) {
841 
842  if (show_vestigial) {
843 
844  if (!vestigial_frame) {
845  vestigial_frame = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, 0.0, 2.0, trackview.current_height()));
846  CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name()));
847  vestigial_frame->set_outline_color (ARDOUR_UI::config()->color ("vestigial frame"));
848  vestigial_frame->set_fill_color (ARDOUR_UI::config()->color ("vestigial frame"));
849  vestigial_frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
850  }
851 
852  vestigial_frame->show();
853  }
854 
855  if (frame) {
856  frame->hide();
857  }
858 
859  if (frame_handle_start) {
860  frame_handle_start->hide();
861  frame_handle_end->hide();
862  }
863 
864  } else {
865  if (vestigial_frame) {
866  vestigial_frame->hide();
867  }
868 
869  if (frame) {
870  frame->show();
871  /* Note: x0 is always zero - the position is defined by
872  * the position of the group, not the frame.
873  */
874  frame->set_x1 (pixel_width);
875 
876  if (selection_frame) {
877  selection_frame->set (frame->get().shrink (1.0));
878  }
879  }
880 
881  if (frame_handle_start) {
882  if (pixel_width < (3 * TimeAxisViewItem::GRAB_HANDLE_WIDTH)) {
883  /*
884  * there's less than GRAB_HANDLE_WIDTH of the region between
885  * the right-hand end of frame_handle_start and the left-hand
886  * end of frame_handle_end, so disable the handles
887  */
888 
889  frame_handle_start->hide();
890  frame_handle_end->hide();
891  } else {
892  frame_handle_start->show();
893  frame_handle_end->set_x0 (pixel_width - (TimeAxisViewItem::GRAB_HANDLE_WIDTH));
894  frame_handle_end->set_x1 (pixel_width);
895  frame_handle_end->show();
896  }
897  }
898  }
899 }
900 
901 void
903 {
904  int visible_name_width;
905 
906  if (!name_text) {
907  return;
908  }
909 
911  name_text->hide ();
912  return;
913  }
914 
915  if (name_text->text().empty()) {
916  name_text->hide ();
917  }
918 
919  visible_name_width = name_text_width;
920 
921  if (visible_name_width > _width - NAME_X_OFFSET) {
922  visible_name_width = _width - NAME_X_OFFSET;
923  }
924 
925  if (visible_name_width < 1) {
926  name_text->hide ();
927  } else {
928  name_text->clamp_width (visible_name_width);
929  name_text->show ();
930  }
931 }
932 
941 gint
943 {
944  item->ItemRemoved (item->get_item_name(), src); /* EMIT_SIGNAL */
945  delete item;
946  item = 0;
947  return false;
948 }
949 
950 void
952 {
953  group->set_y_position (y);
954 }
955 
956 void
958 {
959  if (p == "color-regions-using-track-color") {
960  set_colors ();
961  } else if (p == "timeline-item-gradient-depth") {
963  }
964 }
965 
966 void
968 {
969  _dragging = true;
970  set_frame_color ();
971 }
972 
973 void
975 {
976  _dragging = false;
977  set_frame_color ();
978 }
ArdourCanvas::Item * get_canvas_frame()
static Pango::FontDescription NAME_FONT
ArdourCanvas::Item * get_canvas_group()
ArdourCanvas::Color color(const std::string &, bool *failed=0) const
Definition: ui_config.cc:567
virtual void set_height(double h)
LIBGTKMM2EXT_API void get_pixel_size(Glib::RefPtr< Pango::Layout >, int &width, int &height)
Definition: utils.cc:62
TimeAxisView & get_time_axis_view() const
virtual void drag_end()
sigc::signal< void, bool, void * > PositionLockChanged
PublicEditor & editor() const
bool get_min_duration_active() const
static double NAME_HIGHLIGHT_THRESH
static gint idle_remove_this_item(TimeAxisViewItem *, void *)
void parameter_changed(std::string)
bool get_position_locked() const
sigc::signal< void, framecnt_t, void * > MinDurationChanged
static void set_constant_heights()
virtual void set_frame_gradient()
virtual uint32_t get_fill_color() const
ArdourCanvas::Rectangle * vestigial_frame
TimeAxisView & trackview
virtual void set_position_locked(bool, void *)
std::string fill_color_name
tuple f
Definition: signals.py:35
Definition: Beats.hpp:239
LIBPBD_API Transmitter warning
virtual std::string get_item_name() const
virtual double sample_to_pixel(framepos_t frame) const =0
ArdourCanvas::Text * name_text
ArdourCanvas::Rectangle * name_highlight
sigc::signal< void, std::string, std::string, void * > NameChanged
bool _automation
true if this is an automation region view
std::ostream & endmsg(std::ostream &ostr)
Definition: transmitter.h:71
virtual void set_samples_per_pixel(double)
#define P_(Singular, Plural, HowMany)
Definition: i18n.h:41
LIBARDOUR_API PBD::PropertyDescriptor< framepos_t > start
Definition: region.cc:63
static double NAME_Y_OFFSET
uint32_t current_height() const
framecnt_t get_min_duration() const
virtual void drag_start()
#define invalidator(x)
Definition: gui_thread.h:40
framecnt_t min_item_duration
static const double GRAB_HANDLE_WIDTH
ArdourCanvas::Rectangle * selection_frame
#define X_(Text)
Definition: i18n.h:13
uint32_t contrasting_text_color(uint32_t c)
int64_t framecnt_t
Definition: types.h:76
void set_item_name(std::string, void *)
LIBARDOUR_API RCConfiguration * Config
Definition: globals.cc:119
bool get_max_duration_active() const
virtual void set_min_duration(framecnt_t, void *)
virtual bool set_duration(framecnt_t, void *)
Definition: amp.h:29
framecnt_t get_duration() const
#define gui_context()
Definition: gui_thread.h:36
virtual void set_frame_color()
void set_min_duration_active(bool, void *)
static const double GRAB_HANDLE_TOP
virtual bool canvas_group_event(GdkEvent *)
int64_t framepos_t
Definition: types.h:66
ArdourCanvas::Rectangle * frame_handle_start
`frame' (fade) handle for the start of the item, or 0
virtual Editing::MouseMode effective_mouse_mode() const =0
virtual bool set_position(framepos_t, void *, double *delta=0)
framecnt_t get_max_duration() const
PBD::Signal1< void, std::string > ParameterChanged
Definition: configuration.h:44
virtual double height() const
LIBARDOUR_API PBD::PropertyDescriptor< bool > active
Definition: route_group.cc:43
void set_name_text(const std::string &)
bool _selected
Definition: selectable.h:45
sigc::signal< void, std::string, void * > ItemRemoved
void init(ArdourCanvas::Item *, double, uint32_t, framepos_t, framepos_t, Visibility, bool, bool)
virtual void reset_width_dependent_items(double)
bool frame_handle_crossing(GdkEvent *, ArdourCanvas::Rectangle *)
virtual void set_max_duration(framecnt_t, void *)
ArdourCanvas::Rectangle * frame
ArdourCanvas::Color color_mod(std::string const &color, std::string const &modifier) const
Definition: ui_config.cc:555
static UIConfiguration * config()
Definition: ardour_ui.h:188
virtual void set_colors()
Definition: debug.h:30
sigc::signal< void, framepos_t, void * > PositionChanged
ArdourCanvas::Rectangle * frame_handle_end
`frame' (fade) handle for the end of the item, or 0
void set_max_duration_active(bool, void *)
sigc::signal< void, std::string > ParameterChanged
Definition: ui_config.h:78
sigc::signal< void, framecnt_t, void * > DurationChanged
ArdourCanvas::Container * group
static const framepos_t max_framepos
Definition: types.h:78
LIBGTKMM2EXT_API int pixel_width(const std::string &str, Pango::FontDescription &font)
#define RGBA_TO_UINT(r, g, b, a)
Definition: rgb_macros.h:34
virtual void set_selected(bool yn)
Definition: selectable.h:34
double get_samples_per_pixel() const
sigc::signal< void, framecnt_t, void * > MaxDurationChanged
framepos_t get_position() const
static const double NAME_X_OFFSET
virtual void set_selected(bool yn)
void set_color(uint32_t)
TimeAxisViewItem(const std::string &, ArdourCanvas::Item &, TimeAxisView &, double, uint32_t fill_color, framepos_t, framecnt_t, bool recording=false, bool automation=false, Visibility v=Visibility(0))
std::string string_compose(const std::string &fmt, const T1 &o1)
Definition: compose.h:208
framecnt_t max_item_duration
static double NAME_HIGHLIGHT_SIZE
ArdourCanvas::Item * get_name_highlight()
LIBARDOUR_API PBD::PropertyDescriptor< bool > color
Definition: route_group.cc:50