Move CC/Automation regions with parent correctly.
authorDavid Robillard <d@drobilla.net>
Mon, 3 Sep 2007 16:12:07 +0000 (16:12 +0000)
committerDavid Robillard <d@drobilla.net>
Mon, 3 Sep 2007 16:12:07 +0000 (16:12 +0000)
git-svn-id: svn://localhost/ardour2/trunk@2363 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/automation_region_view.cc
gtk2_ardour/automation_region_view.h
gtk2_ardour/region_view.cc

index 885a42b5ead118b98ce4cace2b21756ba7dde564..51650e94aee856a82e520984f3a04c2503aa9b69 100644 (file)
@@ -33,6 +33,17 @@ AutomationRegionView::AutomationRegionView(ArdourCanvas::Group*
        _line.show_all_control_points();
        
        group->raise_to_top ();
+       
+       group->signal_event().connect (mem_fun (this, &AutomationRegionView::canvas_event), false);
+}
+
+
+bool
+AutomationRegionView::canvas_event(GdkEvent* ev)
+{
+       cerr << "AUTOMATION EVENT" << endl;
+
+       return false;
 }
 
 
@@ -44,6 +55,12 @@ AutomationRegionView::set_y_position_and_height (double y, double h)
        _line.set_y_position_and_height ((uint32_t)y, (uint32_t) rint (h - NAME_HIGHLIGHT_SIZE));
 }
 
+void
+AutomationRegionView::region_resized (ARDOUR::Change what_changed)
+{
+       // Do nothing, parent will move us
+}
+
 
 void
 AutomationRegionView::entered()
index fc152f67965d01ea05125dea1bad20f60d9e8a83..ba75b2fecbf66dd2a54693f3e71fd8ed4088affa 100644 (file)
@@ -51,7 +51,9 @@ public:
        virtual GhostRegion* add_ghost(AutomationTimeAxisView&) { return NULL; }
 
 protected:
-       void set_y_position_and_height (double y, double h);
+       void set_y_position_and_height(double y, double h);
+       void region_resized(ARDOUR::Change what_changed);
+       bool canvas_event(GdkEvent* ev);
        void entered();
        void exited();
 
index 04e2bf88509a82cb1528d55078dfb619a7a07faa..0554cc41413d6f92322947ebf0875c4ebc00a4b4 100644 (file)
@@ -315,6 +315,11 @@ RegionView::set_position (nframes_t pos, void* src, double* ignored)
                for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
                        (*i)->group->move (delta, 0.0);
                }
+       
+               for (AutomationChildren::iterator i = _automation_children.begin();
+                               i != _automation_children.end(); ++i) {
+                       i->second->get_canvas_group()->move(delta, 0.0);
+               }
        }
 
        return ret;
@@ -495,6 +500,11 @@ RegionView::move (double x_delta, double y_delta)
        for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
                (*i)->group->move (x_delta, 0.0);
        }
+               
+       for (AutomationChildren::iterator i = _automation_children.begin();
+                       i != _automation_children.end(); ++i) {
+               i->second->get_canvas_group()->move(x_delta, 0.0);
+       }
 }
 
 void