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


Classes | |
| struct | DecoderClientData |
| Used by FLAC decoder callbacks (same layout as FLAC client data) More... | |
Public Member Functions | |
| FLACFile (const std::string &pFilename) | |
| Constructor for opening an existing FLAC file for reading, which just takes the filename. | |
| FLACFile (const std::string &pFilenam, uint32_t pCompressionLevel) | |
| Constructor for opening an existing FLAC file for reading, which takes the filename and a compression level. | |
| FLACFile (const std::string &pFilename, const FLACFileInfo &pFLACFileInfo) | |
| Constructor for opening an existing FLAC file for reading. | |
| FLACFile (const std::string &pFilename, AudioFileModes pFileMode) | |
| Constructor for opening a FLAC file for reading or writing. | |
| FLACFile (const FLACFile &pFLACFile) | |
| Copy constructor. | |
| FLACFile (FLACFile &&pFLACFile) noexcept | |
| Move constructor. | |
| ~FLACFile () | |
| void | setAudioFileInfo (const AudioFileInfo &pAudioFileInfo) override |
| Sets the audio file info for the FLAC file. | |
| uint32_t | CompressionLevel () const |
| Returns the compression level currently set for the FLAC file. | |
| void | CompressionLevel (uint32_t pCompressionLevel) |
| Sets the compression level to use when writing FLAC files. | |
| AudioFileResultType | open (AudioFileModes pOpenMode) override |
| Opens the audio file in the given mode (read, write, or read/write) | |
| void | close () override |
| Closes the FLAC file. | |
| bool | isOpen () const override |
| Returns whether the FLAC file is open (and also has its encoder and/or decoder initialized) | |
| const FLACFileInfo & | getFileInfo () const |
| Returns a FLACFileInfo object with information about the FLAC file. | |
| AudioFileResultType | getNextSample_int64 (int64_t &pAudioSample) override |
| Gets the next sample from the file, cast to a 64-bit integer. | |
| AudioFileResultType | writeSample_int64 (int64_t pAudioSample) override |
| 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. | |
| AudioFileResultType | getHighestSampleValue_int64 (int64_t &pHighestAudioSample) override |
| Gets the highest audio sample value from the file, cast to a 64-bit integer. | |
| AudioFileResultType | goToAudioDataPos () override |
| Goes to the audio data position in the audio file. | |
| size_t | numSamples () const override |
| Returns the number of audio samples in the audio file. | |
| int64_t | maxValueForSampleSize () const override |
| Returns the maximum possible positive value of the audio file's sample size. | |
| void | seekOutputToSampleNum (size_t pSampleNum) override |
| Returns the maximum possible positive value of the audio file's sample size. | |
| AudioFileInfo | getAudioFileInfo () const override |
| Returns an AudioFile object with information about the audio file. | |
Public Member Functions inherited from EOUtils::AudioFile | |
| AudioFile (const std::string &pFilename) | |
| Constructor. | |
| AudioFile (const std::string &pFilename, AudioFileModes pFileMode) | |
| AudioFile (const AudioFile &pAudioFile) | |
| virtual | ~AudioFile () |
| 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. | |
| 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. | |
| template<typename T > | |
| AudioFileResultType | getMetadataAs (const std::string &pName, T &pValue) const |
| Gets a metadata value. Templatized to capture the value as any type. | |
| std::string | getMetadata (const std::string &pName) const |
| Gets a metadata value. | |
| 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. | |
Additional Inherited Members | |
Protected Member Functions inherited from EOUtils::AudioFile | |
| virtual std::streampos | fileSizeAccordingToStream () |
| virtual void | setFileMode (AudioFileModes pFileMode) |
Protected Attributes inherited from EOUtils::AudioFile | |
| std::string | mFilename |
| std::fstream | mFileStream |
| std::ios_base::openmode | mFileOpenMode |
| size_t | mDataSizeBytes |
| std::map< std::string, std::string > | mMetadata |
| EOUtils::FLACFile::FLACFile | ( | const std::string & | pFilename | ) |
Constructor for opening an existing FLAC file for reading, which just takes the filename.
| [in] | pFilename | The name of the FLAC file |
| EOUtils::FLACFile::FLACFile | ( | const std::string & | pFilenam, |
| uint32_t | pCompressionLevel | ||
| ) |
Constructor for opening an existing FLAC file for reading, which takes the filename and a compression level.
| [in] | pFilename | The name of the FLAC file |
| [in] | pCompressionLevel | The compression level to use when writing FLAC files (0-8, where 0 is fastest and 8 is maximum compression) |
| EOUtils::FLACFile::FLACFile | ( | const std::string & | pFilename, |
| const FLACFileInfo & | pFLACFileInfo | ||
| ) |
Constructor for opening an existing FLAC file for reading.
| [in] | pFilename | The name of the FLAC file |
| [in] | pFLACFileInfo | An object containing information about the new FLAC file |
| EOUtils::FLACFile::FLACFile | ( | const std::string & | pFilename, |
| AudioFileModes | pFileMode | ||
| ) |
Constructor for opening a FLAC file for reading or writing.
| [in] | pFilename | The name of the FLAC file |
| [in] | pFileMode | The mode to open the file in (read, write, or read/write) |
| EOUtils::FLACFile::FLACFile | ( | const FLACFile & | pFLACFile | ) |
Copy constructor.
|
noexcept |
Move constructor.
References EOUtils::AudioFile::close().
| EOUtils::FLACFile::~FLACFile | ( | ) |
References close().
|
overridevirtual |
Closes the FLAC file.
Reimplemented from EOUtils::AudioFile.
References EOUtils::AudioFile::mFileStream, and EOUtils::AudioFileInfo::NumChannels().
Referenced by ~FLACFile().
| uint32_t EOUtils::FLACFile::CompressionLevel | ( | ) | const |
Returns the compression level currently set for the FLAC file.
References EOUtils::FLACFileInfo::CompressionLevel().
| void EOUtils::FLACFile::CompressionLevel | ( | uint32_t | pCompressionLevel | ) |
Sets the compression level to use when writing FLAC files.
| [in] | pCompressionLevel | The compression level to use when writing FLAC files (0-8, where 0 is fastest and 8 is maximum compression) |
References EOUtils::FLACFileInfo::CompressionLevel().
|
overridevirtual |
Returns an AudioFile object with information about the audio file.
Implements EOUtils::AudioFile.
| const FLACFileInfo & EOUtils::FLACFile::getFileInfo | ( | ) | const |
Returns a FLACFileInfo object with information about the FLAC file.
|
overridevirtual |
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 |
Implements EOUtils::AudioFile.
References EOUtils::AudioFileResultType::addError(), getNextSample_int64(), goToAudioDataPos(), numSamples(), and result.
|
overridevirtual |
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 |
Implements EOUtils::AudioFile.
References EOUtils::AudioFileResultType::addError(), EOUtils::AudioFileInfo::BitsPerSample(), EOUtils::AudioFile::hasReadMode(), and result.
Referenced by getHighestSampleValue_int64().
|
overridevirtual |
Goes to the audio data position in the audio file.
Implements EOUtils::AudioFile.
References EOUtils::AudioFileResultType::addError(), and result.
Referenced by getHighestSampleValue_int64().
|
overridevirtual |
Returns whether the FLAC file is open (and also has its encoder and/or decoder initialized)
Reimplemented from EOUtils::AudioFile.
References EOUtils::AudioFile::mFileStream.
|
overridevirtual |
Returns the maximum possible positive value of the audio file's sample size.
Implements EOUtils::AudioFile.
References EOUtils::AudioFileInfo::BitsPerSample().
|
overridevirtual |
Returns the number of audio samples in the audio file.
Implements EOUtils::AudioFile.
References EOUtils::AudioFileInfo::BytesPerSample(), EOUtils::AudioFile::mFilename, and EOUtils::AudioFileInfo::NumChannels().
Referenced by getHighestSampleValue_int64().
|
overridevirtual |
Opens the audio file in the given mode (read, write, or read/write)
Reimplemented from EOUtils::AudioFile.
References EOUtils::AudioFileInfo::BitsPerSample(), EOUtils::FLACFileInfo::CompressionLevel(), EOUtils::FLACFile::DecoderClientData::fileInfo, EOUtils::AudioFile::hasMetadata(), EOUtils::AudioFile::hasReadMode(), EOUtils::AudioFile::hasWriteMode(), EOUtils::AudioFile::mDataSizeBytes, EOUtils::AudioFile::mFilename, EOUtils::AudioFile::mFileStream, EOUtils::AudioFileInfo::NumChannels(), EOUtils::AudioFile::open(), EOUtils::FLACFile::DecoderClientData::readBuffer, EOUtils::FLACFile::DecoderClientData::readChannel, EOUtils::FLACFile::DecoderClientData::readSample, EOUtils::FLACFile::DecoderClientData::result, result, EOUtils::AudioFileInfo::SampleRateHz(), and EOUtils::FLACFile::DecoderClientData::stream.
|
overridevirtual |
Returns the maximum possible positive value of the audio file's sample size.
Implements EOUtils::AudioFile.
References EOUtils::AudioFileInfo::NumChannels().
|
overridevirtual |
Sets the audio file info for the FLAC file.
Implements EOUtils::AudioFile.
References EOUtils::AudioFileInfo::copyAudioFileInfo().
|
overridevirtual |
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 |
Implements EOUtils::AudioFile.
References EOUtils::AudioFileResultType::addError(), EOUtils::AudioFileInfo::BitsPerSample(), EOUtils::AudioFile::hasWriteMode(), EOUtils::AudioFileInfo::NumChannels(), and result.