#include "ardour/types.h"
#include "ardour/ardour.h"
-#include <gtkmm2ext/utils.h>
+#include "gtkmm2ext/utils.h"
+#include "gtkmm2ext/gui_thread.h"
#include "ardour_ui.h"
/*
last_item_width = 0;
wide_enough_for_name = wide;
high_enough_for_name = high;
+ rect_visible = true;
if (duration == 0) {
warning << "Time Axis Item Duration == 0" << endl;
set_duration (item_duration, this);
set_position (start, this);
+
+ Config->ParameterChanged.connect (*this, invalidator (*this), ui_bind (&TimeAxisViewItem::parameter_changed, this, _1), gui_context ());
}
TimeAxisViewItem::~TimeAxisViewItem()
delete group;
}
+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;
+ }
+}
+
/**
* Set the position of this item on the timeline.
vestigial_frame->property_y2() = height - 1;
update_name_pixbuf_visibility ();
+ set_colors ();
}
void
void
TimeAxisViewItem::set_frame_color()
{
+ uint32_t f = 0;
+
if (!frame) {
return;
}
if (_selected) {
+
+ f = ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get();
+
if (fill_opacity) {
- frame->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get(), fill_opacity);
- } else {
- frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get();
- }
+ f = UINT_RGBA_CHANGE_A (f, fill_opacity);
+ }
+
+ if (!rect_visible) {
+ f = UINT_RGBA_CHANGE_A (f, 0);
+ }
+
} else {
+
if (_recregion) {
- frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
+ f = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
} else {
- if (fill_opacity) {
- frame->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_FrameBase.get(), fill_opacity);
+
+ if (high_enough_for_name && !Config->get_color_regions_using_track_color()) {
+ f = ARDOUR_UI::config()->canvasvar_FrameBase.get();
} else {
- frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameBase.get();
+ f = fill_color;
}
- }
+
+ if (fill_opacity) {
+ f = UINT_RGBA_CHANGE_A (f, fill_opacity);
+ }
+
+ if (!rect_visible) {
+ f = UINT_RGBA_CHANGE_A (f, 0);
+ }
+ }
}
+
+ 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;
+ }
}
/**
}
}
+void
+TimeAxisViewItem::parameter_changed (string p)
+{
+ if (p == "color-regions-using-track-color") {
+ set_frame_color ();
+ }
+}