diff options
author | Joerg Mueller <nexyon@gmail.com> | 2012-11-05 18:24:35 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2012-11-05 18:24:35 +0400 |
commit | 5a8d5f77af84d3f790d749dfd2d76a3b487eb06a (patch) | |
tree | 22326dd7033689c8e33dd59a265874ca5249bf14 /intern/audaspace/sndfile | |
parent | 0f9559fe714b582039677de9dea5a3956dcdc4aa (diff) |
Audaspace:
Replacing AUD_Reference with boost::shared_ptr.
Diffstat (limited to 'intern/audaspace/sndfile')
-rw-r--r-- | intern/audaspace/sndfile/AUD_SndFileFactory.cpp | 8 | ||||
-rw-r--r-- | intern/audaspace/sndfile/AUD_SndFileFactory.h | 6 | ||||
-rw-r--r-- | intern/audaspace/sndfile/AUD_SndFileReader.cpp | 2 | ||||
-rw-r--r-- | intern/audaspace/sndfile/AUD_SndFileReader.h | 6 |
4 files changed, 11 insertions, 11 deletions
diff --git a/intern/audaspace/sndfile/AUD_SndFileFactory.cpp b/intern/audaspace/sndfile/AUD_SndFileFactory.cpp index 1fc77fbde66..106b2937a06 100644 --- a/intern/audaspace/sndfile/AUD_SndFileFactory.cpp +++ b/intern/audaspace/sndfile/AUD_SndFileFactory.cpp @@ -43,10 +43,10 @@ AUD_SndFileFactory::AUD_SndFileFactory(const data_t* buffer, int size) : memcpy(m_buffer->getBuffer(), buffer, size); } -AUD_Reference<AUD_IReader> AUD_SndFileFactory::createReader() +boost::shared_ptr<AUD_IReader> AUD_SndFileFactory::createReader() { - if(m_buffer.isNull()) - return new AUD_SndFileReader(m_filename); + if(m_buffer.get()) + return boost::shared_ptr<AUD_IReader>(new AUD_SndFileReader(m_buffer)); else - return new AUD_SndFileReader(m_buffer); + return boost::shared_ptr<AUD_IReader>(new AUD_SndFileReader(m_filename)); } diff --git a/intern/audaspace/sndfile/AUD_SndFileFactory.h b/intern/audaspace/sndfile/AUD_SndFileFactory.h index 7039c7a2615..bc96325d6eb 100644 --- a/intern/audaspace/sndfile/AUD_SndFileFactory.h +++ b/intern/audaspace/sndfile/AUD_SndFileFactory.h @@ -31,10 +31,10 @@ #define __AUD_SNDFILEFACTORY_H__ #include "AUD_IFactory.h" -#include "AUD_Reference.h" #include "AUD_Buffer.h" #include <string> +#include <boost/shared_ptr.hpp> /** * This factory reads a sound file via libsndfile. @@ -50,7 +50,7 @@ private: /** * The buffer to read from. */ - AUD_Reference<AUD_Buffer> m_buffer; + boost::shared_ptr<AUD_Buffer> m_buffer; // hide copy constructor and operator= AUD_SndFileFactory(const AUD_SndFileFactory&); @@ -70,7 +70,7 @@ public: */ AUD_SndFileFactory(const data_t* buffer, int size); - virtual AUD_Reference<AUD_IReader> createReader(); + virtual boost::shared_ptr<AUD_IReader> createReader(); }; #endif //__AUD_SNDFILEFACTORY_H__ diff --git a/intern/audaspace/sndfile/AUD_SndFileReader.cpp b/intern/audaspace/sndfile/AUD_SndFileReader.cpp index 8dbb43cb17e..aaee814f56b 100644 --- a/intern/audaspace/sndfile/AUD_SndFileReader.cpp +++ b/intern/audaspace/sndfile/AUD_SndFileReader.cpp @@ -100,7 +100,7 @@ AUD_SndFileReader::AUD_SndFileReader(std::string filename) : m_seekable = sfinfo.seekable; } -AUD_SndFileReader::AUD_SndFileReader(AUD_Reference<AUD_Buffer> buffer) : +AUD_SndFileReader::AUD_SndFileReader(boost::shared_ptr<AUD_Buffer> buffer) : m_position(0), m_membuffer(buffer), m_memoffset(0) diff --git a/intern/audaspace/sndfile/AUD_SndFileReader.h b/intern/audaspace/sndfile/AUD_SndFileReader.h index 81d8b45120c..5cac5051ee2 100644 --- a/intern/audaspace/sndfile/AUD_SndFileReader.h +++ b/intern/audaspace/sndfile/AUD_SndFileReader.h @@ -31,11 +31,11 @@ #define __AUD_SNDFILEREADER_H__ #include "AUD_IReader.h" -#include "AUD_Reference.h" #include "AUD_Buffer.h" #include <string> #include <sndfile.h> +#include <boost/shared_ptr.hpp> typedef sf_count_t (*sf_read_f)(SNDFILE *sndfile, void *ptr, sf_count_t frames); @@ -78,7 +78,7 @@ private: /** * The pointer to the memory file. */ - AUD_Reference<AUD_Buffer> m_membuffer; + boost::shared_ptr<AUD_Buffer> m_membuffer; /** * The current reading pointer of the memory file. @@ -110,7 +110,7 @@ public: * \exception AUD_Exception Thrown if the buffer specified cannot be read * with libsndfile. */ - AUD_SndFileReader(AUD_Reference<AUD_Buffer> buffer); + AUD_SndFileReader(boost::shared_ptr<AUD_Buffer> buffer); /** * Destroys the reader and closes the file. |