diff options
author | Joerg Mueller <nexyon@gmail.com> | 2010-07-28 13:36:03 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2010-07-28 13:36:03 +0400 |
commit | 7296600434c49b40215ba842af73a8b1517e12eb (patch) | |
tree | ba41a61f147073c91cf370c1f470b7c519397766 /intern/audaspace/sndfile/AUD_SndFileReader.h | |
parent | 3e3f874a65e9c20353fdc26a20a2f5da9b41e90e (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/sndfile/AUD_SndFileReader.h')
-rw-r--r-- | intern/audaspace/sndfile/AUD_SndFileReader.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/intern/audaspace/sndfile/AUD_SndFileReader.h b/intern/audaspace/sndfile/AUD_SndFileReader.h index 8886b6e9efc..a53189fdecd 100644 --- a/intern/audaspace/sndfile/AUD_SndFileReader.h +++ b/intern/audaspace/sndfile/AUD_SndFileReader.h @@ -28,8 +28,9 @@ #include "AUD_IReader.h" #include "AUD_Reference.h" -class AUD_Buffer; +#include "AUD_Buffer.h" +#include <string> #include <sndfile.h> typedef sf_count_t (*sf_read_f)(SNDFILE *sndfile, void *ptr, sf_count_t frames); @@ -63,7 +64,7 @@ private: /** * The playback buffer. */ - AUD_Buffer* m_buffer; + AUD_Buffer m_buffer; /** * The sndfile. @@ -91,6 +92,10 @@ private: static sf_count_t vio_read(void *ptr, sf_count_t count, void *user_data); static sf_count_t vio_tell(void *user_data); + // hide copy constructor and operator= + AUD_SndFileReader(const AUD_SndFileReader&); + AUD_SndFileReader& operator=(const AUD_SndFileReader&); + public: /** * Creates a new reader. @@ -98,7 +103,7 @@ public: * \exception AUD_Exception Thrown if the file specified does not exist or * cannot be read with libsndfile. */ - AUD_SndFileReader(const char* filename); + AUD_SndFileReader(std::string filename); /** * Creates a new reader. @@ -113,13 +118,11 @@ public: */ virtual ~AUD_SndFileReader(); - virtual bool isSeekable(); + virtual bool isSeekable() const; virtual void seek(int position); - virtual int getLength(); - virtual int getPosition(); - virtual AUD_Specs getSpecs(); - virtual AUD_ReaderType getType(); - virtual bool notify(AUD_Message &message); + virtual int getLength() const; + virtual int getPosition() const; + virtual AUD_Specs getSpecs() const; virtual void read(int & length, sample_t* & buffer); }; |