A Processor that uses an audio sample. More...
Public Member Functions | |
const AudioSampleBuffer * | getBuffer () |
Returns a const pointer to the audio sample buffer. More... | |
String | getFileName () const |
Returns the filename that was loaded. More... | |
Range< int > | getRange () const |
Returns the range of the sample. More... | |
virtual void | newFileLoaded () |
Overwrite this method and do whatever needs to be done when a new file is loaded. More... | |
virtual void | rangeUpdated () |
Overwrite this method and do whatever needs to be done when the selected range changes. More... | |
void | restoreFromValueTree (const ValueTree &v) |
Call this method within your restoreFromValueTree() method to load the sample settings. More... | |
void | saveToValueTree (ValueTree &v) const |
Call this method within your exportAsValueTree method to store the sample settings. More... | |
void | setLoadedFile (const String &fileName, bool loadThisFile=false, bool forceReload=false) |
This loads the file from disk (or from the pool, if existing and loadThisFile is false. More... | |
void | setRange (Range< int > newSampleRange) |
Sets the sample range that should be used in the plugin. More... | |
virtual | ~AudioSampleProcessor () |
Automatically releases the sample in the pool. More... | |
Public Member Functions inherited from PoolBase::Listener | |
virtual void | poolEntryAdded () |
Called whenever a pool entry was added. More... | |
virtual void | poolEntryChanged (PoolReference referenceThatWasChanged) |
If a pool entry gets changed, this will be called. More... | |
virtual void | poolEntryRemoved () |
Called when a pool entry was removed. More... | |
Protected Member Functions | |
AudioSampleProcessor (Processor *p) | |
Call this constructor within your subclass constructor. More... | |
A Processor that uses an audio sample.
If you want to use a audio sample from the pool, subclass your Processor from this and you will get some nice tools:
In order to use this class with a AudioSampleBufferComponent, just follow these steps:
|
virtual |
Automatically releases the sample in the pool.
|
protected |
Call this constructor within your subclass constructor.
|
inline |
Returns a const pointer to the audio sample buffer.
The pointer references a object from a AudioSamplePool and should be valid as long as the pool is not cleared.
|
inline |
Returns the filename that was loaded.
It is possible that the file does not exist on your system: If you restore a pool completely from a ValueTree, it still uses the absolute filename as identification.
|
inline |
Returns the range of the sample.
|
inlinevirtual |
Overwrite this method and do whatever needs to be done when a new file is loaded.
You don't need to call setLoadedFile(), but if you got some internal stuff going on, this is the place.
|
inlinevirtual |
Overwrite this method and do whatever needs to be done when the selected range changes.
void restoreFromValueTree | ( | const ValueTree & | v | ) |
Call this method within your restoreFromValueTree() method to load the sample settings.
void saveToValueTree | ( | ValueTree & | v | ) | const |
Call this method within your exportAsValueTree method to store the sample settings.
void setLoadedFile | ( | const String & | fileName, |
bool | loadThisFile = false , |
||
bool | forceReload = false |
||
) |
This loads the file from disk (or from the pool, if existing and loadThisFile is false.
void setRange | ( | Range< int > | newSampleRange | ) |
Sets the sample range that should be used in the plugin.
This is called automatically if a AudioSampleBufferComponent is set up correctly.