diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 301e605a3e..c329a26b1c 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -21,9 +21,10 @@ #include #include #include - #include +#include + #include #include @@ -1330,11 +1331,11 @@ AudioRegion::exportme (Session& session, AudioExportSpecification& spec) } else { - Sample buf[blocksize]; + boost::scoped_array buf (new Sample[blocksize]); for (uint32_t chan = 0; chan < spec.channels; ++chan) { - if (sources[chan]->read (buf, _start + spec.pos, to_read) != to_read) { + if (sources[chan]->read (buf.get(), _start + spec.pos, to_read) != to_read) { goto out; } @@ -1402,7 +1403,7 @@ void AudioRegion::normalize_to (float target_dB) { const nframes_t blocksize = 64 * 1024; - Sample buf[blocksize]; + boost::scoped_array buf (new Sample[blocksize]); nframes_t fpos; nframes_t fend; nframes_t to_read; @@ -1431,11 +1432,11 @@ AudioRegion::normalize_to (float target_dB) /* read it in */ - if (source (n)->read (buf, fpos, to_read) != to_read) { + if (source (n)->read (buf.get(), fpos, to_read) != to_read) { return; } - maxamp = Session::compute_peak (buf, to_read, maxamp); + maxamp = Session::compute_peak (buf.get(), to_read, maxamp); } fpos += to_read; diff --git a/libs/ardour/automation_event.cc b/libs/ardour/automation_event.cc index cd683a2cab..28b7dde050 100644 --- a/libs/ardour/automation_event.cc +++ b/libs/ardour/automation_event.cc @@ -346,6 +346,8 @@ AutomationList::merge_nascent (double when) return; } + cerr << "We have " << nascent.size() << " NI's to merge\n"; + for (list::iterator n = nascent.begin(); n != nascent.end(); ++n) { NascentInfo* ninfo = *n; @@ -368,17 +370,22 @@ AutomationList::merge_nascent (double when) if (!preexisting) { + cerr << "no prexisting - merge\n"; events = nascent_events; } else if (ninfo->end_time < events.front()->when) { /* all points in nascent are before the first existing point */ + + cerr << "all before first, prepend\n"; events.insert (events.begin(), nascent_events.begin(), nascent_events.end()); } else if (ninfo->start_time > events.back()->when) { /* all points in nascent are after the last existing point */ + + cerr << "all after last, append\n"; events.insert (events.end(), nascent_events.begin(), nascent_events.end()); @@ -413,13 +420,16 @@ AutomationList::merge_nascent (double when) if (range_begin != events.begin()) { /* clamp point before */ + cerr << "Add pre-clamp\n"; events.insert (range_begin, point_factory (ninfo->start_time, unlocked_eval (ninfo->start_time))); } - + + cerr << "merge into event list\n"; events.insert (range_begin, nascent_events.begin(), nascent_events.end()); if (range_end != events.end()) { /* clamp point after */ + cerr << "Add post-clamp\n"; events.insert (range_begin, point_factory (ninfo->end_time, end_value)); }