introduce the notion that note additions and property changes can cause the removal...
[ardour.git] / libs / ardour / ardour / resampled_source.h
index c8fff0d594721d17ac5c5720a76bb0f247dee272..b61303b65ca7efe18975f036232bb458eeb16391 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2007 Paul Davis 
+    Copyright (C) 2007 Paul Davis
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 namespace ARDOUR {
 
-class ResampledImportableSource : public ImportableSource 
+class ResampledImportableSource : public ImportableSource
 {
   public:
        ResampledImportableSource (boost::shared_ptr<ImportableSource>, nframes_t rate, SrcQuality);
 
        ~ResampledImportableSource ();
-       
+
        nframes_t read (Sample* buffer, nframes_t nframes);
        float ratio() const { return src_data.src_ratio; }
        uint32_t channels() const { return source->channels(); }
        nframes_t length() const { return source->length(); }
        nframes_t samplerate() const { return source->samplerate(); }
-       void      seek (nframes_t pos) { source->seek (pos); }
-       
+       void      seek (nframes_t);
+       nframes64_t natural_position() const { return source->natural_position(); }
+
+       bool clamped_at_unity () const {
+               /* resampling may generate inter-sample peaks with magnitude > 1 */
+               return false;
+       }
+
        static const uint32_t blocksize;
-       
+
    private:
        boost::shared_ptr<ImportableSource> source;
         float* input;
+       int _src_type;
        SRC_STATE*      src_state;
        SRC_DATA        src_data;
 };