|
Eric Oulashin's C++ Audio Mixer 1.0
|
#include <AudioFile.h>


Public Member Functions | |
| AudioFile (const std::string &pFilename) | |
| Constructor. | |
| AudioFile (const std::string &pFilename, AudioFileModes pFileMode) | |
| AudioFile (const AudioFile &pAudioFile) | |
| virtual | ~AudioFile () |
| virtual void | setAudioFileInfo (const AudioFileInfo &pAudioFileInfo)=0 |
| virtual AudioFileResultType | open (AudioFileModes pOpenMode) |
| virtual bool | BitrateIsAdjustable () const=0 |
| Returns whether or not the audio file bitrate is adjustable. | |
| virtual bool | isOpen () const |
| Returns whether or not the audio file is open. | |
| virtual bool | hasReadMode () const |
| Returns whether or not read mode is enabled for the file. | |
| virtual bool | hasWriteMode () const |
| Returns whether or not write mode is enabled for the file. | |
| virtual void | close () |
| Closes the audio file. | |
| virtual AudioFileResultType | getNextSample_int64 (int64_t &pAudioSample)=0 |
| Gets the next sample from the file, cast to a 64-bit integer. | |
| virtual AudioFileResultType | writeSample_int64 (int64_t pAudioSample)=0 |
| Writes an audio sample to the file. The parameter is a 64-bit integer but will be cast to the bitness of the audio samples in the file. | |
| virtual AudioFileResultType | getHighestSampleValue_int64 (int64_t &pHighestAudioSample)=0 |
| Gets the highest audio sample value from the file, cast to a 64-bit integer. | |
| virtual AudioFileResultType | goToAudioDataPos ()=0 |
| Goes to the audio data position in the audio file. | |
| virtual size_t | numSamples () const=0 |
| Returns the number of audio samples in the audio file. | |
| virtual int64_t | maxValueForSampleSize () const=0 |
| Returns the maximum possible positive value of the audio file's sample size. | |
| const std::string & | Filename () const |
| Gets the filename of the audio file. | |
| void | Filename (const std::string &pFilename) |
| Setter for the filename of the audio file. | |
| void | setMetadata (const std::string &pName, const std::string &pValue) |
| Adds a piece of metadata for the audio file. | |
| template<typename T> | |
| void | setMetadataFromVal (const std::string &pName, const T &pValue) |
| Adds a piece of metadata for the audio file. Templatized for any value type. The value will be converted to a string to store in the metadata. | |
| AudioFileResultType | getMetadata (const std::string &pName, std::string &pValue) const |
| Gets a metadata value as a string. | |
| std::string | getMetadata (const std::string &pName) const |
| Gets a metadata value. | |
| template<typename T> | |
| AudioFileResultType | getMetadataAs (const std::string &pName, T &pValue) const |
| Gets a metadata value. Templatized to capture the value as any type. | |
| template<typename T> | |
| T | getMetadataAs (const std::string &pName) const |
| template<typename T> | |
| T | getMetadataAs (const std::string &pName, const T &pDefaultVal) const |
| Gets a metadata value. Templatized to return it as any type. | |
| bool | hasMetadata (const std::string &pName) const |
| Returns whether or not a metadata item exists. | |
| virtual AudioFileInfo | getAudioFileInfo () const=0 |
| Returns an AudioFile object with information about the audio file. | |
| virtual void | seekOutputToSampleNum (size_t pSampleNum)=0 |
Protected Member Functions | |
| virtual std::streampos | fileSizeAccordingToStream () |
| virtual void | setFileMode (AudioFileModes pFileMode) |
Protected Attributes | |
| std::string | mFilename |
| std::fstream | mFileStream |
| std::ios_base::openmode | mFileOpenMode |
| size_t | mDataSizeBytes |
| std::map< std::string, std::string > | mMetadata |
|
explicit |
Constructor.
| [in] | pFilename | The name of the audio file |
|
explicit |
| EOUtils::AudioFile::AudioFile | ( | const AudioFile & | pAudioFile | ) |
|
virtual |
|
pure virtual |
Returns whether or not the audio file bitrate is adjustable.
|
virtual |
Closes the audio file.
| const string & EOUtils::AudioFile::Filename | ( | ) | const |
Gets the filename of the audio file.
| void EOUtils::AudioFile::Filename | ( | const std::string & | pFilename | ) |
Setter for the filename of the audio file.
| [in] | pFilename | The new filename |
|
protectedvirtual |
|
pure virtual |
Returns an AudioFile object with information about the audio file.
|
pure virtual |
Gets the highest audio sample value from the file, cast to a 64-bit integer.
| [out] | pHighestAudioSample | The highest audio sample from the file, cast to a 64-bit integer |
| std::string EOUtils::AudioFile::getMetadata | ( | const std::string & | pName | ) | const |
Gets a metadata value.
| [in] | pName | The name of the metadata item (string) |
| AudioFileResultType EOUtils::AudioFile::getMetadata | ( | const std::string & | pName, |
| std::string & | pValue ) const |
Gets a metadata value as a string.
| [in] | pName | The name of the metadata item (string) |
| [out] | pValue | This variable will store the value of the metadata item as a string |
|
inline |
|
inline |
Gets a metadata value. Templatized to return it as any type.
| [in] | pName | The name of the metadata item (string) |
|
inline |
Gets a metadata value. Templatized to capture the value as any type.
| [in] | pName | The name of the metadata item (string) |
| [out] | pValue | This variable will store the value of the metadata item. Templatized to store the value as any type. |
|
pure virtual |
Gets the next sample from the file, cast to a 64-bit integer.
| [out] | pAudioSample | The next audio sample from the file, cast to a 64-bit integer |
|
pure virtual |
Goes to the audio data position in the audio file.
| bool EOUtils::AudioFile::hasMetadata | ( | const std::string & | pName | ) | const |
Returns whether or not a metadata item exists.
| [in] | pName | The name of the metadata item to check |
|
virtual |
Returns whether or not read mode is enabled for the file.
|
virtual |
Returns whether or not write mode is enabled for the file.
|
virtual |
Returns whether or not the audio file is open.
|
pure virtual |
Returns the maximum possible positive value of the audio file's sample size.
|
pure virtual |
Returns the number of audio samples in the audio file.
|
virtual |
|
pure virtual |
|
pure virtual |
|
protectedvirtual |
| void EOUtils::AudioFile::setMetadata | ( | const std::string & | pName, |
| const std::string & | pValue ) |
Adds a piece of metadata for the audio file.
| [in] | pName | The name of the metadata item (string) |
| [in] | pValue | The value of the metadata item (string) |
|
inline |
Adds a piece of metadata for the audio file. Templatized for any value type. The value will be converted to a string to store in the metadata.
| [in] | pName | The name of the metadata item (string) |
| [in] | pValue | The value of the metadata item (templatized for any type) |
|
pure virtual |
Writes an audio sample to the file. The parameter is a 64-bit integer but will be cast to the bitness of the audio samples in the file.
| [in] | pAudioSample | The audio sample to write to the file |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |