Om
1.0.0
A universal framework for multimedia simulation
|
A class that wraps a set of series-connected sound filters. More...
#include <omSoundFilterSeries.h>
Public Member Functions | |
FilterSeries () | |
Create a default sound filter series with no connected sound filters. More... | |
Size | getFilterCount () const |
Return the total number of sound filters that are a part of this filter series. More... | |
SoundFilter * | getFilter (Index filterIndex) |
Return a pointer to the sound filter at the specified index within this filter series. More... | |
Bool | setFilter (Index filterIndex, SoundFilter *newFilter) |
Replace the filter in this filter series at the specified index. More... | |
Bool | addFilter (SoundFilter *newFilter) |
Add a new filter to the end of this sound filter series. More... | |
Bool | insertFilter (Index filterIndex, SoundFilter *newFilter) |
Insert the specified filter at the given index in this filter series. More... | |
Bool | removeFilter (Index filterIndex) |
Remove the filter at the specified index from this filter series. More... | |
void | clearFilters () |
Remove all filters from this sound filter series. More... | |
virtual UTF8String | getInputName (Index inputIndex) const |
Return a human-readable name of the sound filter series input at the specified index. More... | |
virtual UTF8String | getOutputName (Index outputIndex) const |
Return a human-readable name of the sound filter series output at the specified index. More... | |
virtual UTF8String | getName () const |
Return a human-readable name for this sound filter series. More... | |
virtual UTF8String | getManufacturer () const |
Return the manufacturer name of this sound filter series. More... | |
virtual FilterVersion | getVersion () const |
Return an object representing the version of this sound filter series. More... | |
virtual FilterCategory | getCategory () const |
Return an object that describes the category of effect that this filter implements. More... | |
Public Member Functions inherited from om::sound::filters::SoundFilter | |
virtual | ~SoundFilter () |
Destroy this sound filter object. More... | |
SoundResult | read (SoundBuffer &outputBuffer, Size numSamples) |
Fill the specified output buffer with the requested number of samples, based on internal filter state. More... | |
SoundResult | read (SoundFrame &outputFrame, Size numSamples) |
Fill the specified output frame with the requested number of samples, based on internal filter state. More... | |
SoundResult | write (const SoundBuffer &inputBuffer, Size numSamples) |
Process the specified input buffer samples and do something with them. More... | |
SoundResult | write (const SoundFrame &inputFrame, Size numSamples) |
Process the specified input frame samples and do something with them. More... | |
SoundResult | process (const SoundBuffer &inputBuffer, SoundBuffer &outputBuffer, Size numSamples) |
Apply this filter to the specified input buffer data, placing the result in the output buffer. More... | |
SoundResult | process (const SoundBuffer &inputBuffer, SoundFrame &outputFrame, Size numSamples) |
Apply this filter to the specified input buffer data, placing the result in the output frame. More... | |
SoundResult | process (const SoundFrame &inputFrame, SoundFrame &outputFrame, Size numSamples) |
Apply this filter to the specified input frame data, placing the result in the output frame. More... | |
SoundResult | process (const SoundFrame &inputBuffer, SoundBuffer &outputBuffer, Size numSamples) |
Apply this filter to the specified input frame data, placing the result in the output buffer. More... | |
void | reset () |
Signal to the filter that the audio stream is restarting. More... | |
UInt64 | getFrameIndex () const |
Return the index of the next frame to be processed (or the current one if currently processing). More... | |
Size | getInputCount () const |
Return the current number of audio inputs that this filter has. More... | |
Size | getOutputCount () const |
Return the current number of audio outputs that this filter has. More... | |
Size | getMIDIInputCount () const |
Return the current number of MIDI inputs that this filter has. More... | |
virtual UTF8String | getMIDIInputName (Index inputIndex) const |
Return a human-readable name of the filter MIDI input at the specified index. More... | |
Size | getMIDIOutputCount () const |
Return the current number of MIDI outputs that this filter has. More... | |
virtual UTF8String | getMIDIOutputName (Index outputIndex) const |
Return a human-readable name of the filter MIDI output at the specified index. More... | |
virtual Time | getLatency () const |
Return a Time value indicating the latency of this sound filter in seconds. More... | |
virtual Size | getParameterCount () const |
Return the total number of generic accessible parameters this filter has. More... | |
virtual Bool | getParameterIndex (const UTF8String ¶meterName, Index ¶meterIndex) const |
Query the index of the parameter with the specified name. More... | |
virtual Bool | getParameterInfo (Index parameterIndex, FilterParameterInfo &info) const |
Get information about the filter parameter at the specified index. More... | |
virtual Bool | getParameterValueName (Index parameterIndex, const FilterParameter &value, UTF8String &name) const |
Get any special name associated with the specified value of an indexed parameter. More... | |
Bool | getParameter (Index parameterIndex, FilterParameter &value) const |
Place the value of the parameter at the specified index in the output parameter. More... | |
Bool | getParameter (Index parameterIndex, Bool &value) const |
Place the value of the parameter at the specified index in the output parameter. More... | |
Bool | getParameter (Index parameterIndex, Int64 &value) const |
Place the value of the parameter at the specified index in the output parameter. More... | |
Bool | getParameter (Index parameterIndex, Float32 &value) const |
Place the value of the parameter at the specified index in the output parameter. More... | |
Bool | getParameter (Index parameterIndex, Float64 &value) const |
Place the value of the parameter at the specified index in the output parameter. More... | |
template<typename ParameterType > | |
Bool | getParameter (const UTF8String &name, ParameterType &value) const |
Place the value of the parameter with the specified name in the output parameter. More... | |
template<typename ParameterType > | |
Bool | getParameter (const char *name, ParameterType &value) const |
Place the value of the parameter with the specified name in the output parameter. More... | |
Bool | setParameter (Index parameterIndex, const FilterParameter &value) |
Attempt to set the parameter value at the specified index. More... | |
Bool | setParameter (Index parameterIndex, Bool value) |
Attempt to set the parameter value at the specified index. More... | |
Bool | setParameter (Index parameterIndex, Int64 value) |
Attempt to set the parameter value at the specified index. More... | |
Bool | setParameter (Index parameterIndex, Float32 value) |
Attempt to set the parameter value at the specified index. More... | |
Bool | setParameter (Index parameterIndex, Float64 value) |
Attempt to set the parameter value at the specified index. More... | |
template<typename ParameterType > | |
Bool | setParameter (const UTF8String &name, ParameterType value) |
Attempt to set the parameter value with the specified name. More... | |
template<typename ParameterType > | |
Bool | setParameter (const char *name, ParameterType value) |
Attempt to set the parameter value with the specified name. More... | |
virtual Bool | writeState (DataOutputStream &stream) const |
Write the current state of this sound filter to a data output stream. More... | |
virtual Bool | readState (DataInputStream &stream) |
Read a previously saved filter state from the specified data input stream and replace the filter's state. More... | |
virtual Size | getPresetCount () const |
Return the number of standard configuration presets that this sound filter has. More... | |
virtual Bool | getPreset (Index presetIndex, FilterPreset &preset) const |
Get the standard preset for this sound filter with the specified index. More... | |
Bool | getIsSynchronized () const |
Return whether or not this sound filter performs thread synchronization. More... | |
void | setIsSynchronized (Bool newIsSynchronized) |
Set whether or not this sound filter performs thread synchronization. More... | |
virtual Bool | allowsInPlaceProcessing () const |
Return whether or not this sound filter can process audio data in-place. More... | |
Static Public Attributes | |
static const UTF8String | NAME |
A string indicating the human-readable name of this sound filter series. More... | |
static const UTF8String | MANUFACTURER |
A string indicating the manufacturer name of this sound filter series. More... | |
static const FilterVersion | VERSION |
An object indicating the version of this sound filter series. More... | |
Static Public Attributes inherited from om::sound::filters::SoundFilter | |
static const om::resources::ResourceType | RESOURCE_TYPE |
The resource type for a sound filter. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from om::sound::filters::SoundFilter | |
static Size | getMaximumNumberOfInputs () |
Return the maximum number of audio inputs that a SoundFilter can support. More... | |
static Size | getMaximumNumberOfOutputs () |
Return the maximum number of audio outputs that a SoundFilter can support. More... | |
static Size | getMaximumNumberOfMIDIInputs () |
Return the maximum number of MIDI inputs that a SoundFilter can support. More... | |
static Size | getMaximumNumberOfMIDIOutputs () |
Return the maximum number of MIDI outputs that a SoundFilter can support. More... | |
Protected Member Functions inherited from om::sound::filters::SoundFilter | |
SoundFilter () | |
Create a new sound filter with 1 audio input and output, and no MIDI inputs or outputs. More... | |
SoundFilter (Size numInputs, Size numOutputs) | |
Create a new sound filter with the specified number of audio inputs and outputs. More... | |
SoundFilter (Size numInputs, Size numOutputs, Size numMIDIInputs, Size numMIDIOutputs) | |
Create a new sound filter with the specified number of audio inputs and outputs. More... | |
virtual Bool | getParameterValue (Index parameterIndex, FilterParameter &value) const |
Place the value of the parameter at the specified index in the output parameter. More... | |
virtual Bool | setParameterValue (Index parameterIndex, const FilterParameter &value) |
Attempt to set the parameter value at the specified index. More... | |
void | setInputCount (Size newNumInputs) |
Set the number of inputs that this filter should have. More... | |
void | setOutputCount (Size newNumOutputs) |
Set the number of outputs that this filter should have. More... | |
void | setMIDIInputCount (Size newNumMIDIInputs) |
Set the number of MIDI inputs that this filter should have. More... | |
void | setMIDIOutputCount (Size newNumMIDIOutputs) |
Set the number of MIDI outputs that this filter should have. More... | |
Bool | isFirstFrame () const |
Return whether or not the filter's next frame to be processed is also its first frame. More... | |
void | lockMutex () const |
Acquire a mutex which handles subclass rendering parameter synchronization. More... | |
void | unlockMutex () const |
Release a mutex which handles subclass rendering parameter synchronization. More... | |
A class that wraps a set of series-connected sound filters.
This class is a convenience class that allows the user to quickly connect a series of sound filters. This class is analogous to a 'channel strip' in most digital audio workstations.
Note that this class does not own any of the filters that it connects. It merely provides an easy way to process them in series. One should store the filter objects at some other location and pass pointers to this class. The behavior is undefined if any filter is destroyed while a filter series still has a reference to it.
For filters that have multiple inputs or outputs, the filter series uses a 1 to 1 matching for filter inputs/outputs. For instance, if a 2 output filter is followed by a 4-input filter, the two outputs of the first filter are sent to the first two inputs of the second filter. Any non-overlapping inputs or outputs are simply ignored. Use FilterGraph instead if you need complex routing capabilities.
om::sound::filters::FilterSeries::FilterSeries | ( | ) |
Create a default sound filter series with no connected sound filters.
|
inline |
Return the total number of sound filters that are a part of this filter series.
SoundFilter* om::sound::filters::FilterSeries::getFilter | ( | Index | filterIndex | ) |
Return a pointer to the sound filter at the specified index within this filter series.
If the specified filter index is not valid, NULL is returned.
Bool om::sound::filters::FilterSeries::setFilter | ( | Index | filterIndex, |
SoundFilter * | newFilter | ||
) |
Replace the filter in this filter series at the specified index.
If the specified filter index is invalid or the new filter pointer is NULL, FALSE is returned and the filter series is unchanged. Otherwise, the new filter replaces the old one and TRUE is returned.
Bool om::sound::filters::FilterSeries::addFilter | ( | SoundFilter * | newFilter | ) |
Add a new filter to the end of this sound filter series.
If the new filter pointer is NULL, the method fails and returns FALSE. Otherwise, the method adds the new filter to the end of the filter series and returns TRUE.
Bool om::sound::filters::FilterSeries::insertFilter | ( | Index | filterIndex, |
SoundFilter * | newFilter | ||
) |
Insert the specified filter at the given index in this filter series.
If the new filter pointer is NULL, the method fails and returns FALSE. Otherwise, the filter is inserted in the filter series at the specified index and TRUE is returned.
Remove the filter at the specified index from this filter series.
If the specified index is invalid, the method doesn't modify the filter series and returns FALSE. Otherwise, the filter at that index is removed and TRUE is returned.
Removing a filter at any given index causes the index of all filters with larger indices to be shifted back an index.
void om::sound::filters::FilterSeries::clearFilters | ( | ) |
Remove all filters from this sound filter series.
|
virtual |
Return a human-readable name of the sound filter series input at the specified index.
This method returns the name of the input at the specified index in the first filter in the series.
Reimplemented from om::sound::filters::SoundFilter.
|
virtual |
Return a human-readable name of the sound filter series output at the specified index.
This method returns the name of the output at the specified index in the last filter in the series.
Reimplemented from om::sound::filters::SoundFilter.
|
virtual |
Return a human-readable name for this sound filter series.
The method returns the string "Sound Filter Series".
Reimplemented from om::sound::filters::SoundFilter.
|
virtual |
Return the manufacturer name of this sound filter series.
The method returns the string "Om Sound".
Reimplemented from om::sound::filters::SoundFilter.
|
virtual |
Return an object representing the version of this sound filter series.
Reimplemented from om::sound::filters::SoundFilter.
|
virtual |
Return an object that describes the category of effect that this filter implements.
This method returns the value FilterCategory::ROUTING.
Reimplemented from om::sound::filters::SoundFilter.
|
static |
A string indicating the human-readable name of this sound filter series.
|
static |
A string indicating the manufacturer name of this sound filter series.
|
static |
An object indicating the version of this sound filter series.