1 #include "simplerect.h"
3 #include "ghostregion.h"
4 #include "automation_time_axis.h"
5 #include "rgb_macros.h"
7 using namespace Editing;
8 using namespace ArdourCanvas;
10 GhostRegion::GhostRegion (AutomationTimeAxisView& atv, double initial_pos)
13 //group = gnome_canvas_item_new (GNOME_CANVAS_GROUP(trackview.canvas_display),
14 // gnome_canvas_group_get_type(),
18 group = new ArdourCanvas::Group (*trackview.canvas_display);
19 group->property_x() = initial_pos;
20 group->property_y() = 0.0;
22 base_rect = new ArdourCanvas::SimpleRect (*group);
23 base_rect->property_x1() = (double) 0.0;
24 base_rect->property_y1() = (double) 0.0;
25 base_rect->property_y2() = (double) trackview.height;
26 base_rect->property_outline_what() = (guint32) 0;
27 base_rect->property_outline_color_rgba() = color_map[cGhostTrackBaseOutline];
28 base_rect->property_fill_color_rgba() = color_map[cGhostTrackBaseFill];
29 group->lower_to_bottom ();
34 GhostRegion::~GhostRegion ()
42 GhostRegion::set_samples_per_unit (double spu)
44 for (vector<WaveView*>::iterator i = waves.begin(); i != waves.end(); ++i) {
45 (*i)->property_samples_per_unit() = spu;
50 GhostRegion::set_duration (double units)
52 base_rect->property_x2() = units;
56 GhostRegion::set_height ()
59 vector<WaveView*>::iterator i;
62 base_rect->property_y2() = (double) trackview.height;
63 ht = ((trackview.height) / (double) waves.size());
65 for (n = 0, i = waves.begin(); i != waves.end(); ++i, ++n) {
66 gdouble yoff = n * ht;
67 (*i)->property_height() = ht;
68 (*i)->property_y() = yoff;