Abstract implementation backend for AudioFile. More...
#include <audiofile.h>

Public Member Functions | |
| Impl (Operation op) | |
| Constructs an Impl for the given operation. | |
| virtual | ~Impl () |
| Virtual destructor. | |
| bool | isValid () const |
| Returns true if this implementation has a valid operation. | |
| Operation | operation () const |
| Returns the operation type for this implementation. | |
| const String & | filename () const |
| Returns the filename associated with this audio file. | |
| void | setFilename (const String &val) |
| Sets the filename for this audio file. | |
| AudioDesc | desc () const |
| Returns the audio description (format, channels, sample rate, etc.). | |
| void | setDesc (const AudioDesc &val) |
| Sets the audio description for writing. | |
| IODevice * | device () const |
| Returns the IODevice associated with this audio file. | |
| void | setDevice (IODevice *dev) |
| Sets the IODevice for this audio file. | |
| const String & | formatHint () const |
| Returns the format hint (e.g. "wav"), no dot. | |
| void | setFormatHint (const String &val) |
| Sets the format hint for device-based operation. | |
| virtual Error | open () |
| Opens the audio file. | |
| virtual void | close () |
| Closes the audio file. | |
| virtual Error | read (Audio &audio, size_t maxSamples) |
| Reads audio samples from the file. | |
| virtual Error | write (const Audio &audio) |
| Writes audio samples to the file. | |
| virtual Error | seekToSample (size_t sample) |
| Seeks to a specific sample position in the file. | |
| virtual size_t | sampleCount () const |
| Returns the total number of samples in the file. | |
Protected Attributes | |
| Operation | _operation |
| String | _filename |
| AudioDesc | _desc |
| IODevice * | _device = nullptr |
| bool | _ownsDevice = false |
| String | _formatHint |
Abstract implementation backend for AudioFile.
Subclasses provide format-specific logic for opening, reading, writing, seeking, and closing audio files.
|
inline |
Constructs an Impl for the given operation.
| op | The operation this implementation will perform. |
|
inline |
Returns the audio description (format, channels, sample rate, etc.).
|
inline |
Returns the IODevice associated with this audio file.
Returns the filename associated with this audio file.
Returns the format hint (e.g. "wav"), no dot.
|
inline |
Returns true if this implementation has a valid operation.
Opens the audio file.
|
inline |
Returns the operation type for this implementation.
Returns the total number of samples in the file.
Seeks to a specific sample position in the file.
| sample | The sample index to seek to. |
Sets the audio description for writing.
| val | The AudioDesc to set. |
Sets the filename for this audio file.
| val | The filename to set. |
Sets the format hint for device-based operation.
| val | The format hint (e.g. "wav"), no dot. |