const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
const double TimeAxisViewItem::GRAB_HANDLE_LENGTH = 6;
const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
const double TimeAxisViewItem::GRAB_HANDLE_LENGTH = 6;
TimeAxisViewItem::set_constant_heights ()
{
NAME_FONT = get_font_for_style (X_("TimeAxisViewItemName"));
TimeAxisViewItem::set_constant_heights ()
{
NAME_FONT = get_font_for_style (X_("TimeAxisViewItemName"));
*/
TimeAxisViewItem::TimeAxisViewItem(
const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color,
*/
TimeAxisViewItem::TimeAxisViewItem(
const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color,
- nframes64_t start, nframes64_t duration, bool recording, bool automation, Visibility vis
+ framepos_t start, framecnt_t duration, bool recording, bool automation, Visibility vis
- const string& it_name, double spu, Gdk::Color const & base_color, nframes64_t start, nframes64_t duration, Visibility vis, bool wide, bool high)
+ const string& it_name, double spu, Gdk::Color const & base_color, framepos_t start, framepos_t duration, Visibility vis, bool wide, bool high)
if (visibility & ShowFrame) {
frame = new ArdourCanvas::SimpleRect (*group, 0.0, 1.0, trackview.editor().frame_to_pixel(duration), trackview.current_height());
if (visibility & ShowFrame) {
frame = new ArdourCanvas::SimpleRect (*group, 0.0, 1.0, trackview.editor().frame_to_pixel(duration), trackview.current_height());
if (_recregion) {
frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
} else {
frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get();
}
if (_recregion) {
frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
} else {
frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get();
}
if (visibility & FullWidthNameHighlight) {
name_highlight = new ArdourCanvas::SimpleRect (*group, 0.0, trackview.editor().frame_to_pixel(item_duration), trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE, trackview.current_height());
} else {
name_highlight = new ArdourCanvas::SimpleRect (*group, 1.0, trackview.editor().frame_to_pixel(item_duration) - 1, trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE, trackview.current_height());
}
if (visibility & FullWidthNameHighlight) {
name_highlight = new ArdourCanvas::SimpleRect (*group, 0.0, trackview.editor().frame_to_pixel(item_duration), trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE, trackview.current_height());
} else {
name_highlight = new ArdourCanvas::SimpleRect (*group, 1.0, trackview.editor().frame_to_pixel(item_duration) - 1, trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE, trackview.current_height());
}
name_highlight->set_data ("timeaxisviewitem", this);
name_highlight->property_outline_what() = 0x4;
/* we should really use a canvas color property here */
name_highlight->set_data ("timeaxisviewitem", this);
name_highlight->property_outline_what() = 0x4;
/* we should really use a canvas color property here */
set_duration (item_duration, this);
set_position (start, this);
set_duration (item_duration, this);
set_position (start, this);
+void
+TimeAxisViewItem::hide_rect ()
+{
+ rect_visible = false;
+ set_frame_color ();
+
+ if (name_highlight) {
+ name_highlight->property_outline_what() = 0x0;
+ name_highlight->property_fill_color_rgba() = UINT_RGBA_CHANGE_A(fill_color,64);
+ }
+}
+
+void
+TimeAxisViewItem::show_rect ()
+{
+ rect_visible = true;
+ set_frame_color ();
+
+ if (name_highlight) {
+ name_highlight->property_outline_what() = 0x4;
+ name_highlight->property_fill_color_rgba() = fill_color;
+ }
+}
+
{
if ((dur > max_item_duration) || (dur < min_item_duration)) {
warning << string_compose (_("new duration %1 frames is out of bounds for %2"), get_item_name(), dur)
{
if ((dur > max_item_duration) || (dur < min_item_duration)) {
warning << string_compose (_("new duration %1 frames is out of bounds for %2"), get_item_name(), dur)
{
max_item_duration = dur;
MaxDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
}
/** @return the maximum duration that this item may have */
{
max_item_duration = dur;
MaxDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
}
/** @return the maximum duration that this item may have */
{
min_item_duration = dur;
MinDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
}
/** @return the minimum duration that this item mey have */
{
min_item_duration = dur;
MinDurationChanged(max_item_duration, src); /* EMIT_SIGNAL */
}
/** @return the minimum duration that this item mey have */
-/**
- * Set whether an item should show its selection status.
- *
- * @param yn true if this item should show its selected status
- */
-
-void
-TimeAxisViewItem::set_should_show_selection (bool yn)
-{
- if (should_show_selection != yn) {
- should_show_selection = yn;
- set_frame_color ();
- }
-}
-
name_pixbuf->property_pixbuf() = pixbuf_from_string(new_name, NAME_FONT, name_pixbuf_width, NAME_HEIGHT, Gdk::Color ("#000000"));
}
name_pixbuf->property_pixbuf() = pixbuf_from_string(new_name, NAME_FONT, name_pixbuf_width, NAME_HEIGHT, Gdk::Color ("#000000"));
}
- if (_selected && should_show_selection) {
- UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get(), &r, &g, &b, &a);
- frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, a);
+ if (!frame) {
+ return;
+ }
+
+ if (_selected) {
+
+ f = ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get();
+
+ if (fill_opacity) {
+ f = UINT_RGBA_CHANGE_A (f, fill_opacity);
+ }
+
+ if (!rect_visible) {
+ f = UINT_RGBA_CHANGE_A (f, 0);
+ }
+
+ } else {
+
+ if (_recregion) {
+ f = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
- if (_recregion) {
- UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_RecordingRect.get(), &r, &g, &b, &a);
- frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, a);
+
+ if (high_enough_for_name && !Config->get_color_regions_using_track_color()) {
+ f = ARDOUR_UI::config()->canvasvar_FrameBase.get();
- UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_FrameBase.get(), &r, &g, &b, &a);
- frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, fill_opacity ? fill_opacity : a);
+
+ frame->property_fill_color_rgba() = f;
+
+ if (!_recregion) {
+ if (_selected) {
+ f = ARDOUR_UI::config()->canvasvar_SelectedTimeAxisFrame.get();
+ } else {
+ f = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get();
+ }
+
+ if (!rect_visible) {
+ f = UINT_RGBA_CHANGE_A (f, 64);
+ }
+
+ frame->property_outline_color_rgba() = f;
+ }