summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_axis_view_item.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-02-11 02:34:03 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-02-11 02:34:03 +0000
commitcf0da62ff0e4ef7dfcf0730f1af057edd34dc15a (patch)
treef32b38dad9f06bb1d803b699acc816edfefd1e5f /gtk2_ardour/time_axis_view_item.cc
parent9ab70fb55284537228577d575f15aa03949bd678 (diff)
miscellaneous fixes post-jesse's 24 bit file format changes
git-svn-id: svn://localhost/trunk/ardour2@317 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/time_axis_view_item.cc')
-rw-r--r--gtk2_ardour/time_axis_view_item.cc61
1 files changed, 48 insertions, 13 deletions
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc
index bab9e9e1b5..a9663b8630 100644
--- a/gtk2_ardour/time_axis_view_item.cc
+++ b/gtk2_ardour/time_axis_view_item.cc
@@ -64,7 +64,7 @@ const double TimeAxisViewItem::GRAB_HANDLE_LENGTH = 6 ;
*/
TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color,
jack_nframes_t start, jack_nframes_t duration,
- Visibility visibility)
+ Visibility vis)
: trackview (tv)
{
if (!have_name_font) {
@@ -83,6 +83,7 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group&
max_item_duration = ARDOUR::max_frames;
min_item_duration = 0 ;
show_vestigial = true;
+ visibility = vis;
if (duration == 0) {
warning << "Time Axis Item Duration == 0" << endl ;
@@ -108,14 +109,33 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group&
frame->property_outline_color_rgba() = color_map[cTimeAxisFrameOutline];
frame->property_fill_color_rgba() = color_map[cTimeAxisFrameFill];
+ /* by default draw all 4 edges */
+
+ uint32_t outline_what = 0x1|0x2|0x4|0x8;
+
+ if (visibility & HideFrameLR) {
+ outline_what &= ~(0x1 | 0x2);
+ }
+
+ if (visibility & HideFrameTB) {
+ outline_what &= ~(0x4 | 0x8);
+ }
+
+ frame->property_outline_what() = outline_what;
+
} else {
frame = 0;
}
if (visibility & ShowNameHighlight) {
name_highlight = new ArdourCanvas::SimpleRect (*group);
- name_highlight->property_x1() = (double) 1.0;
- name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration)) - 1;
+ if (visibility & FullWidthNameHighlight) {
+ name_highlight->property_x1() = (double) 0.0;
+ name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration));
+ } else {
+ 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() = color_map[cNameHighlightFill];
@@ -508,10 +528,14 @@ TimeAxisViewItem::set_height(double height)
if (name_highlight) {
if (height < NAME_HIGHLIGHT_THRESH) {
name_highlight->hide();
- name_text->hide();
+ if (name_text) {
+ name_text->hide();
+ }
} else {
name_highlight->show();
- name_text->show();
+ if (name_text) {
+ name_text->show();
+ }
}
if (height > NAME_HIGHLIGHT_SIZE) {
@@ -567,7 +591,7 @@ TimeAxisViewItem::get_canvas_frame()
ArdourCanvas::Item*
TimeAxisViewItem::get_canvas_group()
{
- return(group) ;
+ return (group) ;
}
/**
@@ -576,7 +600,7 @@ TimeAxisViewItem::get_canvas_group()
ArdourCanvas::Item*
TimeAxisViewItem::get_name_highlight()
{
- return(name_highlight) ;
+ return (name_highlight) ;
}
/**
@@ -585,7 +609,7 @@ TimeAxisViewItem::get_name_highlight()
ArdourCanvas::Text*
TimeAxisViewItem::get_name_text()
{
- return(name_text) ;
+ return (name_text) ;
}
/**
@@ -780,7 +804,9 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
if (name_highlight) {
name_highlight->hide();
- name_text->hide();
+ if (name_text) {
+ name_text->hide();
+ }
}
if (frame) {
@@ -801,14 +827,23 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
if (height < NAME_HIGHLIGHT_THRESH) {
name_highlight->hide();
- name_text->hide();
+ if (name_text) {
+ name_text->hide();
+ }
} else {
name_highlight->show();
- name_text->show();
- reset_name_width (pixel_width);
+ if (name_text) {
+ name_text->show();
+ reset_name_width (pixel_width);
+ }
+ }
+
+ if (visibility & FullWidthNameHighlight) {
+ name_highlight->property_x2() = pixel_width;
+ } else {
+ name_highlight->property_x2() = pixel_width - 1.0;
}
- name_highlight->property_x2() = pixel_width - 1.0;
}
if (frame) {