'gtk2_ardour' - Use 'std::vector' to implement an array whose size is unknown (required to be buildable with MSVC)
This commit is contained in:
parent
f8574fc39d
commit
d7a16f7de6
|
@ -19,6 +19,7 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <boost/scoped_array.hpp>
|
#include <boost/scoped_array.hpp>
|
||||||
|
|
||||||
|
@ -559,9 +560,9 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, f
|
||||||
|
|
||||||
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
|
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
|
||||||
double effective_height;
|
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) {
|
if (_height >= NAME_HIGHLIGHT_THRESH) {
|
||||||
effective_height = _height - NAME_HIGHLIGHT_SIZE - 2;
|
effective_height = _height - NAME_HIGHLIGHT_SIZE - 2;
|
||||||
|
@ -659,9 +660,9 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar,
|
||||||
|
|
||||||
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
|
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
|
||||||
double effective_height;
|
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) {
|
if (_height >= NAME_HIGHLIGHT_THRESH) {
|
||||||
effective_height = _height - NAME_HIGHLIGHT_SIZE - 2;
|
effective_height = _height - NAME_HIGHLIGHT_SIZE - 2;
|
||||||
|
@ -800,8 +801,8 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
float vec[npoints];
|
std::vector<float> vec(npoints);
|
||||||
inverse->curve().get_vector (0, inverse->back()->when, 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) {
|
for (Points::size_type i = 0, pci = 0; i < npoints; ++i, ++pci) {
|
||||||
ArdourCanvas::Duple &p (ipoints[pci]);
|
ArdourCanvas::Duple &p (ipoints[pci]);
|
||||||
|
@ -1293,7 +1294,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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"));
|
ControlPoint *cp = reinterpret_cast<ControlPoint *> (item->get_data ("control_point"));
|
||||||
audio_region()->envelope()->erase (cp->model());
|
audio_region()->envelope()->erase (cp->model());
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "ardour_ui.h"
|
#include "ardour_ui.h"
|
||||||
#include "audio_clock.h"
|
#include "audio_clock.h"
|
||||||
|
@ -138,11 +139,11 @@ BigClockWindow::text_resizer (int, int)
|
||||||
if (size != current_size) {
|
if (size != current_size) {
|
||||||
|
|
||||||
string family = fd.get_family();
|
string family = fd.get_family();
|
||||||
char buf[family.length()+16];
|
std::vector<char> buf(family.length()+16);
|
||||||
snprintf (buf, family.length()+16, "%s %d", family.c_str(), size);
|
snprintf (&buf[0], family.length()+16, "%s %d", family.c_str(), size);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Pango::FontDescription fd (buf);
|
Pango::FontDescription fd (&buf[0]);
|
||||||
Glib::RefPtr<Gtk::RcStyle> rcstyle = clock.get_modifier_style ();
|
Glib::RefPtr<Gtk::RcStyle> rcstyle = clock.get_modifier_style ();
|
||||||
rcstyle->set_font (fd);
|
rcstyle->set_font (fd);
|
||||||
clock.modify_style (rcstyle);
|
clock.modify_style (rcstyle);
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "pbd/stl_delete.h"
|
#include "pbd/stl_delete.h"
|
||||||
#include "pbd/xml++.h"
|
#include "pbd/xml++.h"
|
||||||
|
@ -309,9 +310,9 @@ GenericPluginUI::build ()
|
||||||
// are similar enough to be grouped together.
|
// are similar enough to be grouped together.
|
||||||
|
|
||||||
string label, previous_label = "";
|
string label, previous_label = "";
|
||||||
int numbers_in_labels[cui_controls_list.size()];
|
std::vector<int> numbers_in_labels(cui_controls_list.size());
|
||||||
|
|
||||||
float similarity_scores[cui_controls_list.size()];
|
std::vector<float> similarity_scores(cui_controls_list.size());
|
||||||
float most_similar = 0.0, least_similar = 1.0;
|
float most_similar = 0.0, least_similar = 1.0;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user