- cpp3ds
- SoundFileFactory
Manages and instantiates sound file readers and writers. More...
#include <SoundFileFactory.hpp>
Static Public Member Functions | |
template<typename T > | |
static void | registerReader () |
Register a new reader. More... | |
template<typename T > | |
static void | unregisterReader () |
Unregister a reader. More... | |
template<typename T > | |
static void | registerWriter () |
Register a new writer. More... | |
template<typename T > | |
static void | unregisterWriter () |
Unregister a writer. More... | |
static SoundFileReader * | createReaderFromFilename (const std::string &filename) |
Instantiate the right reader for the given file on disk. More... | |
static SoundFileReader * | createReaderFromMemory (const void *data, std::size_t sizeInBytes) |
Instantiate the right codec for the given file in memory. More... | |
static SoundFileReader * | createReaderFromStream (InputStream &stream) |
Instantiate the right codec for the given file in stream. More... | |
static SoundFileWriter * | createWriterFromFilename (const std::string &filename) |
Instantiate the right writer for the given file on disk. More... | |
Manages and instantiates sound file readers and writers.
This class is where all the sound file readers and writers are registered.
You should normally only need to use its registration and unregistration functions; readers/writers creation and manipulation are wrapped into the higher-level classes cpp3ds::InputSoundFile and cpp3ds::OutputSoundFile.
To register a new reader (writer) use the cpp3ds::SoundFileFactory::registerReader (registerWriter) static function. You don't have to call the unregisterReader (unregisterWriter) function, unless you want to unregister a format before your application ends (typically, when a plugin is unloaded).
Usage example:
Definition at line 45 of file SoundFileFactory.hpp.
|
static |
Instantiate the right reader for the given file on disk.
It's up to the caller to release the returned reader
filename | Path of the sound file |
|
static |
Instantiate the right codec for the given file in memory.
It's up to the caller to release the returned reader
data | Pointer to the file data in memory |
sizeInBytes | Total size of the file data, in bytes |
|
static |
Instantiate the right codec for the given file in stream.
It's up to the caller to release the returned reader
stream | Source stream to read from |
|
static |
Instantiate the right writer for the given file on disk.
It's up to the caller to release the returned writer
filename | Path of the sound file |
|
static |
Register a new reader.
|
static |
Register a new writer.
|
static |
Unregister a reader.
|
static |
Unregister a writer.