|
AudioDataLib
A C++ library of classes supporting a variety of audio-data tasks.
|
Derivatives of this class must impliment an interface that can be used to read or write file data from or to a given stream. More...
#include <FileFormat.h>
Public Member Functions | |
| FileFormat () | |
| virtual | ~FileFormat () |
| virtual bool | ReadFromStream (ByteStream &inputStream, FileData *&fileData, Error &error)=0 |
| virtual bool | WriteToStream (ByteStream &outputStream, const FileData *fileData, Error &error)=0 |
Static Public Member Functions | |
| static std::shared_ptr< FileFormat > | CreateForFile (const std::string &filePath) |
Derivatives of this class must impliment an interface that can be used to read or write file data from or to a given stream.
| FileFormat::FileFormat | ( | ) |
|
virtual |
|
static |
This is a factory method which will create and return a shared pointer to a FileFormat class instance derivatve that can handle the given file.
| [in] | filePath | The extension of the given file is used to determine what FileFormat to return. |
|
pure virtual |
The given file data pointer is assigned an instance of some derivative of the FileData class which is, in turn, populated with the data found in the given stream.
| [in,out] | inputStream | This must be a ByteStream derivative that can handle read operations. |
| [out] | fileData | On success, this pointer is assigned a heap allocation the user is reponsible for freeing. |
| [out] | error | This will contain error information if false is returned. |
Implemented in AudioDataLib::AiffFileFormat, AudioDataLib::DownloadableSoundFormat, AudioDataLib::MidiFileFormat, AudioDataLib::SoundFontFormat, and AudioDataLib::WaveFileFormat.
|
pure virtual |
The given file data is written to the given stream.
| [out] | outputStream | This must be a ByteStream derivative that can accept write operations. |
| [in] | fileData | This is the file data to be written to the stream. |
| [out] | error | This will contain error information if false is returned. |
Implemented in AudioDataLib::AiffFileFormat, AudioDataLib::DownloadableSoundFormat, AudioDataLib::MidiFileFormat, AudioDataLib::SoundFontFormat, and AudioDataLib::WaveFileFormat.