svcore
1.9
|
#include <WavFileWriter.h>
Public Types | |
enum | FileWriteMode { WriteToTemporary, WriteToTarget } |
Specify the method used to open the destination file. More... | |
Public Member Functions | |
WavFileWriter (QString path, sv_samplerate_t sampleRate, int channels, FileWriteMode mode) | |
virtual | ~WavFileWriter () |
bool | isOK () const |
virtual QString | getError () const |
QString | getPath () const |
bool | writeModel (DenseTimeValueModel *source, MultiSelection *selection=0) |
bool | writeSamples (const float *const *samples, sv_frame_t count) |
Write samples from raw arrays; count is per-channel. More... | |
bool | putInterleavedFrames (const floatvec_t &frames) |
As writeSamples, but compatible with WavFileReader api. More expensive. More... | |
bool | close () |
Protected Member Functions | |
QString | getWriteFilename () const |
Protected Attributes | |
QString | m_path |
sv_samplerate_t | m_sampleRate |
int | m_channels |
TempWriteFile * | m_temp |
SNDFILE * | m_file |
QString | m_error |
Detailed Description
Definition at line 34 of file WavFileWriter.h.
Member Enumeration Documentation
Specify the method used to open the destination file.
If WriteToTemporary, the destination will be opened as a temporary file which is moved to the target location when the WavFileWriter is closed or deleted (to avoid clobbering an existing file with a partially written replacement).
If WriteToTarget, the target file will be opened directly (necessary when e.g. doing a series of incremental writes to a file while keeping it open for reading).
Enumerator | |
---|---|
WriteToTemporary | |
WriteToTarget |
Definition at line 49 of file WavFileWriter.h.
Constructor & Destructor Documentation
WavFileWriter::WavFileWriter | ( | QString | path, |
sv_samplerate_t | sampleRate, | ||
int | channels, | ||
FileWriteMode | mode | ||
) |
Definition at line 35 of file WavFileWriter.cpp.
References TempWriteFile::getTemporaryFilename(), m_channels, m_error, m_file, m_path, m_sampleRate, m_temp, SVCERR, FileOperationFailed::what(), and WriteToTemporary.
|
virtual |
Definition at line 86 of file WavFileWriter.cpp.
Member Function Documentation
bool WavFileWriter::isOK | ( | ) | const |
Definition at line 92 of file WavFileWriter.cpp.
References m_error.
Referenced by WritableWaveFileModel::init(), writeModel(), and writeSamples().
|
virtual |
Definition at line 98 of file WavFileWriter.cpp.
References m_error.
Referenced by WritableWaveFileModel::addSamples(), WritableWaveFileModel::init(), and WritableWaveFileModel::normaliseToTarget().
|
inline |
Definition at line 62 of file WavFileWriter.h.
References close(), m_path, putInterleavedFrames(), writeModel(), and writeSamples().
bool WavFileWriter::writeModel | ( | DenseTimeValueModel * | source, |
MultiSelection * | selection = 0 |
||
) |
Definition at line 114 of file WavFileWriter.cpp.
References DenseTimeValueModel::getChannelCount(), DenseTimeValueModel::getData(), Model::getEndFrame(), MultiSelection::getSelections(), Model::getStartFrame(), getWriteFilename(), in_range_for(), isOK(), m_channels, m_error, m_file, MultiSelection::setSelection(), and SVDEBUG.
Referenced by getPath().
bool WavFileWriter::writeSamples | ( | const float *const * | samples, |
sv_frame_t | count | ||
) |
Write samples from raw arrays; count is per-channel.
Definition at line 176 of file WavFileWriter.cpp.
References getWriteFilename(), isOK(), m_channels, m_error, and m_file.
Referenced by WritableWaveFileModel::addSamples(), getPath(), and putInterleavedFrames().
bool WavFileWriter::putInterleavedFrames | ( | const floatvec_t & | frames | ) |
As writeSamples, but compatible with WavFileReader api. More expensive.
Definition at line 204 of file WavFileWriter.cpp.
References m_channels, and writeSamples().
Referenced by getPath(), and WritableWaveFileModel::normaliseToTarget().
bool WavFileWriter::close | ( | ) |
Definition at line 217 of file WavFileWriter.cpp.
References m_file, m_temp, and TempWriteFile::moveToTarget().
Referenced by getPath(), WritableWaveFileModel::normaliseToTarget(), WritableWaveFileModel::writeComplete(), and ~WavFileWriter().
|
protected |
Definition at line 104 of file WavFileWriter.cpp.
References TempWriteFile::getTemporaryFilename(), m_path, and m_temp.
Referenced by writeModel(), and writeSamples().
Member Data Documentation
|
protected |
Definition at line 76 of file WavFileWriter.h.
Referenced by getPath(), getWriteFilename(), and WavFileWriter().
|
protected |
Definition at line 77 of file WavFileWriter.h.
Referenced by WavFileWriter().
|
protected |
Definition at line 78 of file WavFileWriter.h.
Referenced by putInterleavedFrames(), WavFileWriter(), writeModel(), and writeSamples().
|
protected |
Definition at line 79 of file WavFileWriter.h.
Referenced by close(), getWriteFilename(), and WavFileWriter().
|
protected |
Definition at line 80 of file WavFileWriter.h.
Referenced by close(), WavFileWriter(), writeModel(), writeSamples(), and ~WavFileWriter().
|
protected |
Definition at line 81 of file WavFileWriter.h.
Referenced by getError(), isOK(), WavFileWriter(), writeModel(), and writeSamples().
The documentation for this class was generated from the following files:
Generated by 1.8.11