remove reference "const int32_t&" -> const int32_t"
[ardour.git] / libs / ardour / ardour / resampled_source.h
index 1f6947aeaca49c85055a6a0cbf2e6c6677153290..0c90581a29a0d6f8184d787cf027bc4260ddf71b 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
 
 #include <samplerate.h>
 
+#include "ardour/libardour_visibility.h"
 #include "ardour/types.h"
 #include "ardour/importable_source.h"
 
 namespace ARDOUR {
 
-class ResampledImportableSource : public ImportableSource 
+class LIBARDOUR_API ResampledImportableSource : public ImportableSource
 {
   public:
-       ResampledImportableSource (boost::shared_ptr<ImportableSource>, nframes_t rate, SrcQuality);
+       ResampledImportableSource (boost::shared_ptr<ImportableSource>, framecnt_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); }
-       nframes64_t natural_position() const { return source->natural_position(); }
-       
+
+       framecnt_t read (Sample* buffer, framecnt_t nframes);
+       float      ratio() const { return _src_data.src_ratio; }
+       uint32_t   channels() const { return source->channels(); }
+       framecnt_t length() const { return source->length(); }
+       framecnt_t samplerate() const { return source->samplerate(); }
+       void       seek (framepos_t);
+       framepos_t natural_position() const;
+
+       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;
-       SRC_STATE*      src_state;
-       SRC_DATA        src_data;
+       float*          _input;
+       int             _src_type;
+       SRC_STATE*      _src_state;
+       SRC_DATA        _src_data;
+       bool            _end_of_input;
 };
 
 }