Merge windows+cc branch into cairocanvas branch. Not finished, need to now merge...
[ardour.git] / gtk2_ardour / audio_region_view.cc
index f95576cd3e7bd7970b25e1821d38e574ee6a4337..d8ec2abb3cbddda694ae89179f8fb1c4d91f04f6 100644 (file)
@@ -19,6 +19,7 @@
 #include <cmath>
 #include <cassert>
 #include <algorithm>
+#include <vector>
 
 #include <boost/scoped_array.hpp>
 
@@ -561,9 +562,9 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, f
 
        uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
        double effective_height;
-       float curve[npoints];
+       std::vector<float> curve(npoints);
 
-       audio_region()->fade_in()->curve().get_vector (0, audio_region()->fade_in()->back()->when, curve, npoints);
+       audio_region()->fade_in()->curve().get_vector (0, audio_region()->fade_in()->back()->when, &curve[0], npoints);
 
        if (_height >= NAME_HIGHLIGHT_THRESH) {
                effective_height = _height - NAME_HIGHLIGHT_SIZE - 1;
@@ -639,9 +640,9 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar,
 
        uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
        double effective_height;
-       float curve[npoints];
+       std::vector<float> curve(npoints);
 
-       audio_region()->fade_out()->curve().get_vector (0, audio_region()->fade_out()->back()->when, curve, npoints);
+       audio_region()->fade_out()->curve().get_vector (0, audio_region()->fade_out()->back()->when, &curve[0], npoints);
 
        if (_height >= NAME_HIGHLIGHT_THRESH) {
                effective_height = _height - (NAME_HIGHLIGHT_SIZE + 1); /* skip the top pixel that shows the frame of this regionview */
@@ -762,8 +763,8 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
 
        } else {
 
-               float vec[npoints];
-               inverse->curve().get_vector (0, inverse->back()->when, vec, npoints);
+               std::vector<float> vec(npoints);
+               inverse->curve().get_vector (0, inverse->back()->when, &vec[0], npoints);
                
                for (Points::size_type i = 0, pci = 0; i < npoints; ++i, ++pci) {
                        ArdourCanvas::Duple &p (ipoints[pci]);
@@ -1256,7 +1257,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
 }
 
 void
-AudioRegionView::remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent */*ev*/)
+AudioRegionView::remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent/*ev*/)
 {
        ControlPoint *cp = reinterpret_cast<ControlPoint *> (item->get_data ("control_point"));
        audio_region()->envelope()->erase (cp->model());