summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_axis_view_item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/time_axis_view_item.cc')
-rw-r--r--gtk2_ardour/time_axis_view_item.cc32
1 files changed, 29 insertions, 3 deletions
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc
index 18ea3c255e..87eac74ccf 100644
--- a/gtk2_ardour/time_axis_view_item.cc
+++ b/gtk2_ardour/time_axis_view_item.cc
@@ -95,6 +95,35 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group&
have_name_font = true;
}
+ group = new ArdourCanvas::Group (parent);
+
+ init (it_name, spu, base_color, start, duration, vis);
+
+}
+
+TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
+ : trackview (other.trackview)
+{
+
+ Gdk::Color c;
+ int r,g,b,a;
+
+ UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a);
+ c.set_rgb_p (r/255.0, g/255.0, b/255.0);
+
+ /* share the other's parent, but still create a new group */
+
+ Gnome::Canvas::Group* parent = other.group->property_parent();
+
+ group = new ArdourCanvas::Group (*parent);
+
+ init (other.item_name, other.samples_per_unit, c, other.frame_position, other.item_duration, other.visibility);
+}
+
+
+void
+TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_color, nframes_t start, nframes_t duration, Visibility vis)
+{
item_name = it_name ;
samples_per_unit = spu ;
should_show_selection = true;
@@ -112,8 +141,6 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group&
warning << "Time Axis Item Duration == 0" << endl ;
}
- group = new ArdourCanvas::Group (parent);
-
vestigial_frame = new ArdourCanvas::SimpleRect (*group);
vestigial_frame->property_x1() = (double) 0.0;
vestigial_frame->property_y1() = (double) 1.0;
@@ -220,7 +247,6 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group&
set_position (start, this) ;
}
-
/**
* Destructor
*/