Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Mueller <nexyon@gmail.com>2010-07-28 13:36:03 +0400
committerJoerg Mueller <nexyon@gmail.com>2010-07-28 13:36:03 +0400
commit7296600434c49b40215ba842af73a8b1517e12eb (patch)
treeba41a61f147073c91cf370c1f470b7c519397766 /intern/audaspace/SRC/AUD_SRCResampleReader.h
parent3e3f874a65e9c20353fdc26a20a2f5da9b41e90e (diff)
Audaspace: HUGE Refactor.
Some points of the refactor not sorted by importance: * Fixed immutability of readers and factories (there are exceptions...) * Fixed copy constructors and = operators * Removed messaging system * Removed reader types * Added const where possible * Using initalisers when possible * Avoided use of pointers when possible * Removed AUD_NEW and AUD_DELETE macros * Removed useless NULL pointer checks * Fixed exception catching * Fixed some yet unknown bugs * Lots of other stuff
Diffstat (limited to 'intern/audaspace/SRC/AUD_SRCResampleReader.h')
-rw-r--r--intern/audaspace/SRC/AUD_SRCResampleReader.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/intern/audaspace/SRC/AUD_SRCResampleReader.h b/intern/audaspace/SRC/AUD_SRCResampleReader.h
index e09d1b66f13..5e3dafb359b 100644
--- a/intern/audaspace/SRC/AUD_SRCResampleReader.h
+++ b/intern/audaspace/SRC/AUD_SRCResampleReader.h
@@ -27,7 +27,7 @@
#define AUD_SRCRESAMPLEREADER
#include "AUD_EffectReader.h"
-class AUD_Buffer;
+#include "AUD_Buffer.h"
#include <samplerate.h>
@@ -38,14 +38,19 @@ class AUD_SRCResampleReader : public AUD_EffectReader
{
private:
/**
+ * The sample specification of the source.
+ */
+ const AUD_Specs m_sspecs;
+
+ /**
* The resampling factor.
*/
- double m_factor;
+ const double m_factor;
/**
* The sound output buffer.
*/
- AUD_Buffer *m_buffer;
+ AUD_Buffer m_buffer;
/**
* The target specification.
@@ -53,11 +58,6 @@ private:
AUD_Specs m_tspecs;
/**
- * The sample specification of the source.
- */
- AUD_Specs m_sspecs;
-
- /**
* The src state structure.
*/
SRC_STATE* m_src;
@@ -67,14 +67,17 @@ private:
*/
int m_position;
+ // hide copy constructor and operator=
+ AUD_SRCResampleReader(const AUD_SRCResampleReader&);
+ AUD_SRCResampleReader& operator=(const AUD_SRCResampleReader&);
+
public:
/**
* Creates a resampling reader.
* \param reader The reader to mix.
* \param specs The target specification.
* \exception AUD_Exception Thrown if the source specification cannot be
- * mixed to the target specification or if the reader is
- * NULL.
+ * resampled to the target specification.
*/
AUD_SRCResampleReader(AUD_IReader* reader, AUD_Specs specs);
@@ -92,9 +95,9 @@ public:
long doCallback(float** data);
virtual void seek(int position);
- virtual int getLength();
- virtual int getPosition();
- virtual AUD_Specs getSpecs();
+ virtual int getLength() const;
+ virtual int getPosition() const;
+ virtual AUD_Specs getSpecs() const;
virtual void read(int & length, sample_t* & buffer);
};