* @param duration the duration of this item
*/
TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color,
- nframes_t start, nframes_t duration,
+ nframes_t start, nframes_t duration, bool recording,
Visibility vis)
- : trackview (tv)
+ : trackview (tv), _recregion(recording)
{
if (!have_name_font) {
vestigial_frame = new ArdourCanvas::SimpleRect (*group);
vestigial_frame->property_x1() = (double) 0.0;
vestigial_frame->property_y1() = (double) 1.0;
- vestigial_frame->property_x2() = 2.0;
- vestigial_frame->property_y2() = (double) trackview.height;
+ vestigial_frame->property_x2() = (double) 2.0;
+ vestigial_frame->property_y2() = (double) trackview.current_height();
vestigial_frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_VestigialFrame.get();
vestigial_frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_VestigialFrame.get();
vestigial_frame->hide ();
frame->property_x1() = (double) 0.0;
frame->property_y1() = (double) 1.0;
frame->property_x2() = (double) trackview.editor.frame_to_pixel(duration);
- frame->property_y2() = (double) trackview.height;
+ frame->property_y2() = (double) trackview.current_height();
frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get();
- frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get();
/* by default draw all 4 edges */
name_highlight->property_x1() = (double) 1.0;
name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration)) - 1;
}
- name_highlight->property_y1() = (double) (trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE);
- name_highlight->property_y2() = (double) (trackview.height - 1);
- name_highlight->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_NameHighlightFill.get();
- name_highlight->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_NameHighlightOutline.get();
+ name_highlight->property_y1() = (double) (trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE);
+ name_highlight->property_y2() = (double) (trackview.current_height() - 1);
name_highlight->set_data ("timeaxisviewitem", this);
name_highlight = 0;
}
- if (visibility & ShowNameText) {
- name_text = new ArdourCanvas::Text (*group);
- name_text->property_x() = (double) TimeAxisViewItem::NAME_X_OFFSET;
- /* trackview.height is the bottom of the trackview. subtract 1 to get back to the bottom of the highlight,
- then NAME_Y_OFFSET to position the text in the vertical center of the highlight
- */
- name_text->property_y() = (double) trackview.height - 1.0 - TimeAxisViewItem::NAME_Y_OFFSET;
- name_text->property_font_desc() = *NAME_FONT;
- name_text->property_anchor() = Gtk::ANCHOR_NW;
-
- name_text->set_data ("timeaxisviewitem", this);
-
- } else {
- name_text = 0;
- }
-
/* create our grab handles used for trimming/duration etc */
if (visibility & ShowHandles) {
frame_handle_start->property_y1() = (double) 1.0;
frame_handle_start->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH+1;
frame_handle_start->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle.get();
- frame_handle_start->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle.get();
-
+
frame_handle_end = new ArdourCanvas::SimpleRect (*group);
frame_handle_end->property_x1() = (double) (trackview.editor.frame_to_pixel(get_duration())) - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
frame_handle_end->property_x2() = (double) trackview.editor.frame_to_pixel(get_duration());
frame_handle_end->property_y1() = (double) 1;
frame_handle_end->property_y2() = (double) TimeAxisViewItem::GRAB_HANDLE_LENGTH + 1;
frame_handle_end->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle.get();
- frame_handle_end->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameHandle.get();
} else {
frame_handle_start = 0;
frame_handle_end = 0;
}
- set_color (base_color) ;
+ if (visibility & ShowNameText) {
+ name_text = new ArdourCanvas::Text (*group);
+ name_text->property_x() = (double) TimeAxisViewItem::NAME_X_OFFSET;
+ /* trackview.current_height() is the bottom of the trackview. subtract 1 to get back to the bottom of the highlight,
+ then NAME_Y_OFFSET to position the text in the vertical center of the highlight
+ */
+ name_text->property_y() = (double) trackview.current_height() - 1.0 - TimeAxisViewItem::NAME_Y_OFFSET;
+ name_text->property_font_desc() = *NAME_FONT;
+ name_text->property_anchor() = Gtk::ANCHOR_NW;
+
+ name_text->set_data ("timeaxisviewitem", this);
+
+ } else {
+ name_text = 0;
+ }
+ set_color (base_color) ;
+
set_duration (item_duration, this) ;
set_position (start, this) ;
}
if (height > NAME_HIGHLIGHT_SIZE) {
name_highlight->property_y1() = (double) height+1 - NAME_HIGHLIGHT_SIZE;
name_highlight->property_y2() = (double) height;
- }
- else {
+ } else {
/* it gets hidden now anyway */
- name_highlight->property_y1() = (double) 1.0;
- name_highlight->property_y2() = (double) height;
+ //name_highlight->property_y1() = (double) 1.0;
+ //name_highlight->property_y2() = (double) height;
}
}
name_text->property_y() = height+1 - NAME_Y_OFFSET;
if (height < NAME_HIGHLIGHT_THRESH) {
name_text->property_fill_color_rgba() = fill_color;
- }
- else {
+ } else {
name_text->property_fill_color_rgba() = label_color;
}
}
/**
*
*/
-ArdourCanvas::Item*
+ArdourCanvas::Group*
TimeAxisViewItem::get_canvas_group()
{
return (group) ;
UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get(), &r, &g, &b, &a);
frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, fill_opacity ? fill_opacity : a);// Lets still use the theme's opacity value if Opaque is not set
} else {
- 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);
+ 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);
+ } else {
+ 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);
+ }
}
}
}
void
TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
{
- if (pixel_width < GRAB_HANDLE_LENGTH * 2) {
-
- if (frame_handle_start) {
- frame_handle_start->hide();
- frame_handle_end->hide();
- }
-
- } if (pixel_width < 2.0) {
+ if (pixel_width < 2.0) {
if (show_vestigial) {
vestigial_frame->show();
if (pixel_width < (2*TimeAxisViewItem::GRAB_HANDLE_LENGTH)) {
frame_handle_start->hide();
frame_handle_end->hide();
+ } else {
+ frame_handle_start->show();
+ frame_handle_end->property_x1() = pixel_width - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
+ frame_handle_end->property_x2() = pixel_width;
+ frame_handle_end->show();
}
- frame_handle_start->show();
- frame_handle_end->property_x1() = pixel_width - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
- frame_handle_end->show();
- frame_handle_end->property_x2() = pixel_width;
}
}
}
item = 0;
return false;
}
+