convert property_foo().set_value(bar) to property_foo() = bar
[ardour.git] / gtk2_ardour / ghostregion.cc
index f6a081ca35855914cd72c83c04cbc9f3d94ef055..0a001da0b6ddff4ae9fe97052bad119c043668ab 100644 (file)
@@ -1,9 +1,11 @@
-#include "canvas-simplerect.h"
+#include "simplerect.h"
+#include "waveview.h"
 #include "ghostregion.h"
 #include "automation_time_axis.h"
 #include "rgb_macros.h"
 
 using namespace Editing;
+using namespace ArdourCanvas;
 
 GhostRegion::GhostRegion (AutomationTimeAxisView& atv, double initial_pos)
        : trackview (atv)
@@ -13,11 +15,11 @@ GhostRegion::GhostRegion (AutomationTimeAxisView& atv, double initial_pos)
   //                        "x", initial_pos,
   //                        "y", 0.0,
   //                        NULL);
-       group = new Gnome::Canvas::Group (*trackview.canvas_display);
+       group = new ArdourCanvas::Group (*trackview.canvas_display);
        group->set_property ("x", initial_pos);
        group->set_property ("y", 0.0);
 
-       base_rect = new Gnome::Canvas::SimpleRect (*group);
+       base_rect = new ArdourCanvas::SimpleRect (*group);
        base_rect->set_property ("x1", (double) 0.0);
        base_rect->set_property ("y1", (double) 0.0);
        base_rect->set_property ("y2", (double) trackview.height);
@@ -32,14 +34,15 @@ GhostRegion::GhostRegion (AutomationTimeAxisView& atv, double initial_pos)
 GhostRegion::~GhostRegion ()
 {
        GoingAway (this);
-       gtk_object_destroy (GTK_OBJECT(group));
+       delete base_rect;
+       delete group;
 }
 
 void
 GhostRegion::set_samples_per_unit (double spu)
 {
-       for (vector<GnomeCanvasItem*>::iterator i = waves.begin(); i != waves.end(); ++i) {
-               gnome_canvas_item_set ((*i), "samples_per_unit", spu, NULL);
+       for (vector<WaveView*>::iterator i = waves.begin(); i != waves.end(); ++i) {
+               (*i)->property_samples_per_unit() = spu;
        }               
 }
 
@@ -53,7 +56,7 @@ void
 GhostRegion::set_height ()
 {
        gdouble ht;
-       vector<GnomeCanvasItem*>::iterator i;
+       vector<WaveView*>::iterator i;
        uint32_t n;
 
        base_rect->set_property ("y2", (double) trackview.height);
@@ -61,7 +64,8 @@ GhostRegion::set_height ()
        
        for (n = 0, i = waves.begin(); i != waves.end(); ++i, ++n) {
                gdouble yoff = n * ht;
-               gnome_canvas_item_set ((*i), "height", ht, "y", yoff, NULL);
+               (*i)->property_height() = ht;
+               (*i)->property_y() = yoff;
        }
 }