#include "utils.h"
#include "rgb_macros.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace Editing;
/* share the other's parent, but still create a new group */
ArdourCanvas::Item* parent = other.group->parent();
-
+
_selected = other._selected;
-
+
init (parent, other.samples_per_pixel, other.fill_color, other.frame_position,
other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name);
}
{
group = new ArdourCanvas::Container (parent);
CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
- group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
fill_color = base_color;
fill_color_name = "time axis view item base";
position_locked = false;
max_item_duration = ARDOUR::max_framepos;
min_item_duration = 0;
- show_vestigial = true;
visibility = vis;
_sensitive = true;
name_text_width = 0;
last_item_width = 0;
wide_enough_for_name = wide;
high_enough_for_name = high;
- vestigial_frame = 0;
if (duration == 0) {
warning << "Time Axis Item Duration == 0" << endl;
ArdourCanvas::Rect (0.0, 0.0,
trackview.editor().sample_to_pixel(duration),
trackview.current_height()));
-
+
frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
+ frame->show ();
CANVAS_DEBUG_NAME (frame, string_compose ("frame for %1", get_item_name()));
frame->set_outline_color (UIConfiguration::instance().color ("time axis frame"));
}
}
-
+
if (UIConfiguration::instance().get_show_name_highlight() && (visibility & ShowNameHighlight)) {
/* rectangle size will be set in ::manage_name_highlight() */
frame_handle_start = frame_handle_end = 0;
}
- set_color (base_color);
+ //set_color (base_color);
- set_duration (item_duration, this);
- set_position (start, this);
+ //set_duration (item_duration, this);
+ //set_position (start, this);
- Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&TimeAxisViewItem::parameter_changed, this, _1), gui_context ());
- UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &TimeAxisViewItem::parameter_changed));
+ group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
+ //Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&TimeAxisViewItem::parameter_changed, this, _1), gui_context ());
+ //UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &TimeAxisViewItem::parameter_changed));
}
TimeAxisViewItem::~TimeAxisViewItem()
if (_selected == yn) {
return;
}
-
+
Selectable::set_selected (yn);
set_frame_color ();
set_name_text_color ();
name_text_width = pixel_width (new_name, NAME_FONT) + 2;
name_text->set (new_name);
manage_name_text ();
-
+ manage_name_highlight ();
}
/**
}
if (frame) {
-
+
frame->set_y0 (0.0);
frame->set_y1 (height);
selection_frame->set (frame->get().shrink (1.0));
}
}
-
- if (vestigial_frame) {
- vestigial_frame->set_y0 (0.0);
- vestigial_frame->set_y1 (height);
- }
-
- set_colors ();
}
void
name_highlight->show();
// name_highlight->set_x_position (1.0);
name_highlight->set (ArdourCanvas::Rect (0.0, (double) _height - NAME_HIGHLIGHT_SIZE, _width - 2.0, _height));
-
+
} else {
name_highlight->hide();
}
if (!name_text) {
return;
}
-
+
uint32_t f;
-
+
if (UIConfiguration::instance().get_show_name_highlight()) {
/* name text will always be on top of name highlight, which
will always use our fill color.
frame->set_gradient (ArdourCanvas::Fill::StopList (), 0);
return;
}
-
+
ArdourCanvas::Fill::StopList stops;
double r, g, b, a;
double h, s, v;
/* need to get alpha value */
ArdourCanvas::color_to_rgba (f, r, g, b, a);
-
+
stops.push_back (std::make_pair (0.0, f));
-
+
/* now a darker version */
-
+
ArdourCanvas::color_to_hsv (f, h, s, v);
v = min (1.0, v * (1.0 - UIConfiguration::instance().get_timeline_item_gradient_depth()));
-
+
ArdourCanvas::Color darker = ArdourCanvas::hsva_to_color (h, s, v, a);
stops.push_back (std::make_pair (1.0, darker));
-
+
frame->set_gradient (stops, true);
}
if (pixel_width < 2.0) {
- if (show_vestigial) {
-
- if (!vestigial_frame) {
- vestigial_frame = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, 0.0, 2.0, trackview.current_height()));
- CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name()));
- vestigial_frame->set_outline_color (UIConfiguration::instance().color ("vestigial frame"));
- vestigial_frame->set_fill_color (UIConfiguration::instance().color ("vestigial frame"));
- vestigial_frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
- }
-
- vestigial_frame->show();
- }
-
if (frame) {
- frame->hide();
+ frame->set_outline (false);
+ frame->set_x1 (std::max(1.0, pixel_width));
}
if (frame_handle_start) {
}
} else {
- if (vestigial_frame) {
- vestigial_frame->hide();
- }
-
if (frame) {
- frame->show();
+ frame->set_outline (true);
/* Note: x0 is always zero - the position is defined by
* the position of the group, not the frame.
*/
name_text->hide ();
return;
}
-
+
if (name_text->text().empty()) {
name_text->hide ();
}