Fix CC region view length.
authorDavid Robillard <d@drobilla.net>
Fri, 31 Aug 2007 19:29:23 +0000 (19:29 +0000)
committerDavid Robillard <d@drobilla.net>
Fri, 31 Aug 2007 19:29:23 +0000 (19:29 +0000)
git-svn-id: svn://localhost/ardour2/trunk@2360 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/midi_region_view.cc
gtk2_ardour/midi_region_view.h
gtk2_ardour/region_view.cc
gtk2_ardour/region_view.h

index 2d70eb1c95ab4c0e2743c17e9da6cff254e7a3ca..580282185fe9e12c583d958349eda5f1f93d730e 100644 (file)
@@ -432,6 +432,8 @@ MidiRegionView::redisplay_model()
                                                        *at.get(), _region, i->second->list(),
                                                        midi_stream_view()->get_samples_per_unit(), col));
 
+                               arv->set_duration(_region->length(), this);
+
                                _automation_children.insert(std::make_pair(i->second->parameter(), arv));
                        }
 
index 1d37ed26e5403f457ff885914a59db378463931f..d2c0df182d52c5765fff461e128ef968b43f1f24 100644 (file)
@@ -178,9 +178,6 @@ class MidiRegionView : public RegionView
        ArdourCanvas::CanvasNote**                  _active_notes;
        ArdourCanvas::Group*                        _note_group;
        ARDOUR::MidiModel::DeltaCommand*            _delta_command;
-
-       typedef std::map<const ARDOUR::Parameter, boost::shared_ptr<AutomationRegionView> > AutomationChildren;
-       AutomationChildren _automation_children;
                
        MouseState _mouse_state;
        int _pressed_button;
index 70e82d7d12a2f7807b24708c882c4afcceb0e429..04e2bf88509a82cb1528d55078dfb619a7a07faa 100644 (file)
@@ -34,6 +34,7 @@
 #include "ardour_ui.h"
 #include "streamview.h"
 #include "region_view.h"
+#include "automation_region_view.h"
 #include "route_time_axis.h"
 #include "simplerect.h"
 #include "simpleline.h"
@@ -256,6 +257,11 @@ RegionView::reset_width_dependent_items (double pixel_width)
 {
        TimeAxisViewItem::reset_width_dependent_items (pixel_width);
        _pixel_width = pixel_width;
+
+       for (AutomationChildren::iterator i = _automation_children.begin();
+                       i != _automation_children.end(); ++i) {
+               i->second->reset_width_dependent_items(pixel_width);
+       }
 }
 
 void
index 28a2b11c0cdd0964976114f31d688a87bb4466d2..23ac2fcc7182837662e56f5ab1d9ce8e8d38f6ea 100644 (file)
@@ -36,6 +36,7 @@ class TimeAxisView;
 class RegionEditor;
 class GhostRegion;
 class AutomationTimeAxisView;
+class AutomationRegionView;
 
 class RegionView : public TimeAxisViewItem
 {
@@ -138,6 +139,9 @@ class RegionView : public TimeAxisViewItem
     sigc::connection data_ready_connection;
     
     vector<GhostRegion*> ghosts;
+       
+       typedef std::map<const ARDOUR::Parameter, boost::shared_ptr<AutomationRegionView> > AutomationChildren;
+       AutomationChildren _automation_children;
 };
 
 #endif /* __gtk_ardour_region_view_h__ */