From 7296600434c49b40215ba842af73a8b1517e12eb Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Wed, 28 Jul 2010 09:36:03 +0000 Subject: 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 --- intern/audaspace/FX/AUD_DelayReader.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'intern/audaspace/FX/AUD_DelayReader.h') diff --git a/intern/audaspace/FX/AUD_DelayReader.h b/intern/audaspace/FX/AUD_DelayReader.h index 4662b455dfc..121842b0c6b 100644 --- a/intern/audaspace/FX/AUD_DelayReader.h +++ b/intern/audaspace/FX/AUD_DelayReader.h @@ -27,7 +27,7 @@ #define AUD_DELAYREADER #include "AUD_EffectReader.h" -class AUD_Buffer; +#include "AUD_Buffer.h" /** * This class reads another reader and changes it's delay. @@ -38,35 +38,38 @@ private: /** * The playback buffer. */ - AUD_Buffer *m_buffer; + AUD_Buffer m_buffer; /** * The delay level. */ - int m_delay; + const int m_delay; /** * The remaining delay for playback. */ int m_remdelay; + /** + * Whether the buffer is currently filled with zeros. + */ + bool m_empty; + + // hide copy constructor and operator= + AUD_DelayReader(const AUD_DelayReader&); + AUD_DelayReader& operator=(const AUD_DelayReader&); + public: /** * Creates a new delay reader. * \param reader The reader to read from. * \param delay The delay in seconds. - * \exception AUD_Exception Thrown if the reader specified is NULL. */ AUD_DelayReader(AUD_IReader* reader, float delay); - /** - * Destroys the reader. - */ - virtual ~AUD_DelayReader(); - virtual void seek(int position); - virtual int getLength(); - virtual int getPosition(); + virtual int getLength() const; + virtual int getPosition() const; virtual void read(int & length, sample_t* & buffer); }; -- cgit v1.2.3