/*
- 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;
};