do not crash when loading old history files with MIDI edits; add all notes in region...
[ardour.git] / libs / ardour / rb_effect.cc
index d0a8a3abbf587bb0a517170e13ec7707a410cfd4..b61170da096b48c734e2783d287de6c22c0f6f72 100644 (file)
 #include <algorithm>
 #include <cmath>
 
-#include <pbd/error.h>
-#include <rubberband/RubberBandStretcher.h>
+#include "pbd/error.h"
+#include "rubberband/RubberBandStretcher.h"
 
-#include <ardour/types.h>
-#include <ardour/stretch.h>
-#include <ardour/pitch.h>
-#include <ardour/audiofilesource.h>
-#include <ardour/session.h>
-#include <ardour/audioregion.h>
+#include "ardour/types.h"
+#include "ardour/stretch.h"
+#include "ardour/pitch.h"
+#include "ardour/audiofilesource.h"
+#include "ardour/session.h"
+#include "ardour/audioregion.h"
 
 #include "i18n.h"
 
@@ -42,7 +42,7 @@ Pitch::Pitch (Session& s, TimeFXRequest& req)
 {
 }
 
-Stretch::Stretch (Session& s, TimeFXRequest& req)
+RBStretch::RBStretch (Session& s, TimeFXRequest& req)
        : RBEffect (s, req)
 {
 }
@@ -206,7 +206,7 @@ RBEffect::run (boost::shared_ptr<Region> r)
                while (pos < read_duration && !tsr.cancel) {
                        
                        nframes_t this_read = 0;
-                       
+
                        for (uint32_t i = 0; i < channels; ++i) {
                                
                                this_read = 0;
@@ -229,7 +229,7 @@ RBEffect::run (boost::shared_ptr<Region> r)
                                if (this_read != this_time) {
                                        error << string_compose
                                                (_("tempoize: error reading data from %1 at %2 (wanted %3, got %4)"),
-                                                region->name(), pos + region->position(), this_time, this_read) << endmsg;
+                                                region->name(), this_position, this_time, this_read) << endmsg;
                                        goto out;
                                }
                        }
@@ -358,9 +358,7 @@ RBEffect::run (boost::shared_ptr<Region> r)
 
   out:
 
-       if (gain_buffer) {
-               delete [] gain_buffer;
-       }
+       delete [] gain_buffer;
 
        if (buffers) {
                for (uint32_t i = 0; i < channels; ++i) {