![]() |
Cinder
0.9.1
|
#include <Source.h>
Inherits cinder::Noncopyable.
Inherited by cinder::audio::SourceFile.
Public Member Functions | |
virtual | ~Source () |
size_t | getSampleRate () const |
virtual size_t | getNumChannels () const =0 |
virtual size_t | getSampleRateNative () const =0 |
size_t | getMaxFramesPerRead () const |
virtual void | setMaxFramesPerRead (size_t count) |
virtual size_t | read (Buffer *buffer)=0 |
virtual std::string | getMetaData () const |
Protected Member Functions | |
Source (size_t sampleRate) | |
virtual size_t | performRead (Buffer *buffer, size_t bufferFrameOffset, size_t numFramesNeeded)=0 |
virtual bool | supportsConversion () |
void | setSampleRate (size_t sampleRate) |
Protected Attributes | |
std::unique_ptr< dsp::Converter > | mConverter |
BufferDynamic | mConverterReadBuffer |
Base class that is used to load and read from an audio source.
|
virtual |
|
protected |
size_t cinder::audio::Source::getSampleRate | ( | ) | const |
Returns the user facing samplerate (output).
|
pure virtual |
Returns the number of channels.
Implemented in cinder::audio::cocoa::SourceFileCoreAudio, cinder::audio::SourceFileOggVorbis, and cinder::audio::msw::SourceFileMediaFoundation.
|
pure virtual |
Returns the true samplerate of the Source.
Implemented in cinder::audio::cocoa::SourceFileCoreAudio, cinder::audio::SourceFileOggVorbis, and cinder::audio::msw::SourceFileMediaFoundation.
size_t cinder::audio::Source::getMaxFramesPerRead | ( | ) | const |
Returns the maximum number of frames that can be read with one call to read().
|
virtual |
Sets the maximum number of frames that can be read in one chunk.
|
pure virtual |
Loads either as many frames as buffer can hold, or as many as there are left.
Implemented in cinder::audio::SourceFile.
|
virtual |
Returns the metadata, if any, as a string.
Reimplemented in cinder::audio::SourceFileOggVorbis.
|
protectedpure virtual |
Implement to perform read of frames into buffer starting at offset bufferFrameOffset
Implemented in cinder::audio::SourceFileOggVorbis, and cinder::audio::msw::SourceFileMediaFoundation.
|
protectedvirtual |
Implementations should override and return true if they can provide samplerate conversion. If false (default), a Converter will be used if needed.
|
protected |
Allows implementations to set the output samplerate.
|
protected |
|
protected |