|
Krotos Modules 3
|
#include <KwidgetAudioProcessor.h>
Classes | |
| struct | KListener |
Public Types | |
| using | KType = KwidgetFactory::KwidgetType |
| using | KMod = KwidgetFactory::KwidgetModifiers |
Public Member Functions | |
| KwidgetAudioProcessor (const BusesProperties &ioLayouts, size_t numBusses, size_t channelsPerStereoBus, size_t numRecorders, size_t numInputChannels, size_t numOutputChannels) | |
| ~KwidgetAudioProcessor () override | |
| void | addKListener (KListener *l) |
| void | removeKListener (KListener *l) |
| void | prepareToPlay (double sampleRate, int samplesPerBlock) override |
| void | processBlock (AudioBuffer< float > &, MidiBuffer &) override |
| void | releaseResources () override |
| void | removeEngines () |
| Kwidget * | addUserKwidget (const String &kwidgetType, const String &idModifier="", int typeInstanceLimit=0) |
| Kwidget * | addChildKwidget (const String &kwidgetType, const String &parentID="", const String &childID="", int typeInstanceLimit=0) |
| Kwidget * | addKwidgetFromState (const ValueTree &kwidgetTree) |
| void | removeKwidget (const String &kwidgetID) |
| void | removeDynamicKwidgets () |
| void | removeKwidgetsExcluding (const StringArray &kwidgetsToExclude) |
| void | removeKwidgetsOfType (const StringArray &kwidgetTypesToRemove) |
| bool | addConnection (const String &sourceID, const String &destID) |
| bool | makeStaticConnectionsForKwidget (Kwidget *kwidget) |
| void | clearModulation () |
| bool | setState (const ValueTree &newState) |
| void | loadBundle (const File &bundleDirectory) |
| Load a preset bundle from a directory. | |
| bool | validateState (const ValueTree &newState, bool repairEnabled) |
| void | notifyAllKwidgetsParametersListeners () |
| ValueTree | getState () |
| const Array< Kwidget * > & | getKwidgets () |
| Kwidget * | getKwidget (const String &kwidgetID) |
| Attempt to find a kwidget by its ID. | |
| const Array< Kwidget * > | getKwidgetsOfType (const String kwidgetType) |
| Get a list of all Kwidgets of type m_kwidgetType that have been added. | |
| const Array< Kwidget * > | getKwidgetsOfTypeWithAccessPermission (const StringRef kwidgetType, const StringRef reqId) |
| Get a list of all Kwidgets of type m_kwidgetType that have been added for which access permission can be granted. | |
| Kwidget * | getKwidgetWithAccessPermission (const String &kwidgetID, const StringRef reqId) |
| Attempt to find a kwidget by its ID, and use its ResourceLock to guarantee access. | |
| void | getStateInformation (MemoryBlock &destData) override |
| void | setStateInformation (const void *data, int sizeInBytes) override |
| void | setLastPresetPath (String inLastPresetPath) |
| String & | getLastPresetPath () |
| const String | getName () const override |
| bool | acceptsMidi () const override |
| bool | producesMidi () const override |
| bool | isMidiEffect () const override |
| double | getTailLengthSeconds () const override |
| int | getNumPrograms () override |
| int | getCurrentProgram () override |
| void | setCurrentProgram (int index) override |
| const String | getProgramName (int index) override |
| void | changeProgramName (int index, const String &newName) override |
| bool | isBusesLayoutSupported (const BusesLayout &) const override |
| void | timerCallback () override |
| bool | isRecording () |
| const bool | isRecordingTriggerStarted () |
| const bool | isAStaticKwidgetType (const String &kType) |
| const bool | isAStaticKwidget (const Kwidget &kwidget) |
| void | setReadSpecificFiles (bool canRead) |
| bool | isKwidgetAddedFromState () const |
| void | setAddedFromState (bool isAddedFromState) |
Public Member Functions inherited from krotos::Kwidget_CoreEngine::Listener | |
| virtual | ~Listener ()=default |
Public Member Functions inherited from krotos::Kwidget_Reformer::Listener | |
| virtual | ~Listener ()=default |
Public Member Functions inherited from krotos::Kwidget_TriggerButton::Listener | |
| virtual | ~Listener ()=default |
Public Attributes | |
| std::function< void()> | onAutoplayTimerStop |
| ParameterManager | parameterManager |
| PresetManager | presetManager |
| AssetManager | assetManager |
| PluginHostType | host |
| std::unique_ptr< ValueTree > | presetInfoTree |
| const bool | unitTest {false} |
Static Public Attributes | |
| static const StringArray | StaticKwidgetTypes |
| static const StringArray | StaticKwidgetIDs |
| static SettingsFile | settingsFile |
| static const String | autoPlayMaxDuration {"autoplay_max_duration"} |
| static const String | recorderReleaseTime {"recorder_release_time"} |
| static const String | DroppedFileNameFormat |
| static const String | DefaultDroppedFileNameFormat |
| static const String | T2PStrictMode |
Protected Attributes | |
| bool | bypassPostFx {false} |
Private Member Functions | |
| void | initialiseSettingsFileValues () |
| void | initialiseAudioOutConfiguration () |
| void | initialiseRecorders () |
| void | initialiseMasterFX () |
| void | setInitialState () |
| Kwidget * | addKwidgetWithID (const String &kwidgetType, const String &kwidgetID, bool useEndParams=false, bool isChildKwidget=false) |
| void | addKwidgetInternal (std::unique_ptr< Kwidget > kwidget) |
| void | initialiseStateListeners () |
| void | triggerRecordingStart () |
| void | triggerRecordingStop () |
| virtual void | parameterValueChanged (int, float newValue) override |
| void | parameterGestureChanged (int, bool) override |
| virtual void | soloActivated (Kwidget_CoreEngine *engine) override |
| virtual void | soloDeActivated (Kwidget_CoreEngine *engine) override |
| virtual void | autoPlayChanged (Kwidget_CoreEngine *engine, float newValue) override |
| virtual void | loopEnableChanged (Kwidget_CoreEngine *engine, float newValue) override |
| virtual void | soloActivated (Kwidget_Reformer *engine) override |
| virtual void | soloDeActivated (Kwidget_Reformer *engine) override |
| virtual void | autoPlayChanged (Kwidget_Reformer *engine, float newValue) override |
| virtual void | loopEnableChanged (Kwidget_Reformer *engine, float newValue) override |
| void | soloActivatedAllEngines (const String &callingID) |
| void | soloDeActivatedAllEngines (const String &callingID) |
| virtual void | onClickChanged (Kwidget_TriggerButton *triggerButton, float newValue, MIDIMode midiModeValue) override |
| void | autoPlayGlobalChanged (bool newVal) |
| void | recordOutput (AudioBuffer< float > &buffer, MidiBuffer &midiMessages) |
| void | setRecordersNameData (String currentPresetName) |
| AudioBuffer< float > | extractStereoBuffer (int numChannel1, int numChannel2, AudioBuffer< float > &multiChannelBuffer) |
Friends | |
| class | WeakReference< KwidgetAudioProcessor > |
| krotos::KwidgetAudioProcessor::KwidgetAudioProcessor | ( | const BusesProperties & | ioLayouts, |
| size_t | numBusses, | ||
| size_t | channelsPerStereoBus, | ||
| size_t | numRecorders, | ||
| size_t | numInputChannels, | ||
| size_t | numOutputChannels ) |
|
override |
|
override |
| Kwidget * krotos::KwidgetAudioProcessor::addChildKwidget | ( | const String & | kwidgetType, |
| const String & | parentID = "", | ||
| const String & | childID = "", | ||
| int | typeInstanceLimit = 0 ) |
Add a Child Kwidget to the Audio Processor - this method used internally to create new Kwidgets specifically to be childed to parents
| kwidgetType | The type of Kwidget you wish to create - it will be created and added to state
|
| parentID | Specify the ID of the parent Kwidget you want to be a child of |
| childID | Specify the name you want to give this child for inclusion in the final ID for this child |
| typeInstanceLimit | Specify the maximum range of the numerical suffix on the eventual Kwidget ID
|
| bool krotos::KwidgetAudioProcessor::addConnection | ( | const String & | sourceID, |
| const String & | destID ) |
Attempt to connect the audio of two Kwidgets.
| void krotos::KwidgetAudioProcessor::addKListener | ( | KListener * | l | ) |
| Kwidget * krotos::KwidgetAudioProcessor::addKwidgetFromState | ( | const ValueTree & | kwidgetTree | ) |
Add a Kwidget to the Audio Processor - Use this method to create a new Kwidgets from a value tree representation
| kwidgetTree | A ValueTree specifying the Kwidget you wish to create - it will be created and added to state |
When loading a Kwidget from the state, its parameters will be linked to the same GenericParameters that were linked when the state was saved.
Due to that, this function should probably only be used when switching the entire state of the plugin.
|
private |
|
private |
Internal use. Create & add a new kwidget to the processor, with a specified ID and arguments for static kwidgets to specify exceptions to parameter / state handling
| Kwidget * krotos::KwidgetAudioProcessor::addUserKwidget | ( | const String & | kwidgetType, |
| const String & | idModifier = "", | ||
| int | typeInstanceLimit = 0 ) |
Create & add a new Kwidget of a given type to the audio processor with a uniquely generated unique ID. The kwidget & its parameters will be managed by the processor. Additional arguments may be given to modify ID generation.
| kwidgetType | The type of Kwidget you wish to create. See KType. |
| idModifier | A short string to add extra info into the eventual Kwidget ID - the ID manager will incorporate this into the ID - eg as a prefix to indicate tab - T1, T2 etc Example of use: baseID = "CoreEngine", idModifier = "Tab1", typeInstanceLimit = 100 returns "Tab1CoreEngine<0-99>" Worth noting that although the example above is typical, this method might choose to apply different schemas to different baseIDs. |
| typeInstanceLimit | Specify the maximum range of the numerical suffix on the Kwidget ID
|
|
overrideprivatevirtual |
Implements krotos::Kwidget_CoreEngine::Listener.
|
inlineoverrideprivatevirtual |
Implements krotos::Kwidget_Reformer::Listener.
|
private |
|
override |
| void krotos::KwidgetAudioProcessor::clearModulation | ( | ) |
Clear all modulation instances.
|
private |
Helper function that creates a stereo Buffer from a multichannel one, without copy
|
override |
| Kwidget * krotos::KwidgetAudioProcessor::getKwidget | ( | const String & | kwidgetID | ) |
Attempt to find a kwidget by its ID.
| kwidgetID | Id of the kwidget you wish to find |
| const Array< Kwidget * > & krotos::KwidgetAudioProcessor::getKwidgets | ( | ) |
Get a list of all Kwidgets that have been added.
| const Array< Kwidget * > krotos::KwidgetAudioProcessor::getKwidgetsOfType | ( | const String | kwidgetType | ) |
Get a list of all Kwidgets of type m_kwidgetType that have been added.
| kwidgetType |
| const Array< Kwidget * > krotos::KwidgetAudioProcessor::getKwidgetsOfTypeWithAccessPermission | ( | const StringRef | kwidgetType, |
| const StringRef | reqId ) |
Get a list of all Kwidgets of type m_kwidgetType that have been added for which access permission can be granted.
| kwidgetType |
| Kwidget * krotos::KwidgetAudioProcessor::getKwidgetWithAccessPermission | ( | const String & | kwidgetID, |
| const StringRef | reqId ) |
Attempt to find a kwidget by its ID, and use its ResourceLock to guarantee access.
| kwidgetID | Id of the kwidget you wish to find |
| String & krotos::KwidgetAudioProcessor::getLastPresetPath | ( | ) |
|
override |
|
override |
|
override |
| ValueTree krotos::KwidgetAudioProcessor::getState | ( | ) |
Get a copy of the plugin state.
|
override |
|
override |
|
private |
|
private |
|
private |
|
private |
Initalise settingsFile values required at runtime
|
private |
| const bool krotos::KwidgetAudioProcessor::isAStaticKwidget | ( | const Kwidget & | kwidget | ) |
|
inline |
|
override |
|
inline |
Returns true if a Kwidget was just added from State.
|
override |
| bool krotos::krotos::KwidgetAudioProcessor::isRecording | ( | ) |
Get true if a recording is taking place
|
inline |
| void krotos::KwidgetAudioProcessor::loadBundle | ( | const File & | bundleDirectory | ) |
Load a preset bundle from a directory.
| bundleDirectory | Directory of the uncompressed preset bundle. To open a compressed bundle, |
|
overrideprivatevirtual |
Implements krotos::Kwidget_CoreEngine::Listener.
|
inlineoverrideprivatevirtual |
Implements krotos::Kwidget_Reformer::Listener.
| bool krotos::KwidgetAudioProcessor::makeStaticConnectionsForKwidget | ( | Kwidget * | kwidget | ) |
| void krotos::KwidgetAudioProcessor::notifyAllKwidgetsParametersListeners | ( | ) |
Sends out a value changed message for every parameter.
|
overrideprivatevirtual |
Implements krotos::Kwidget_TriggerButton::Listener.
|
inlineoverrideprivate |
|
overrideprivatevirtual |
Sets boolean to true whenever the parameter Value changes
|
override |
|
override |
|
override |
|
private |
|
inlineoverride |
| void krotos::KwidgetAudioProcessor::removeDynamicKwidgets | ( | ) |
Remove all Kwidgets, except static kwidgets.
| void krotos::KwidgetAudioProcessor::removeEngines | ( | ) |
| void krotos::KwidgetAudioProcessor::removeKListener | ( | KListener * | l | ) |
| void krotos::KwidgetAudioProcessor::removeKwidget | ( | const String & | kwidgetID | ) |
Remove a Kwidget.
| void krotos::KwidgetAudioProcessor::removeKwidgetsExcluding | ( | const StringArray & | kwidgetsToExclude | ) |
Remove all Kwidgets except for those whose IDs are included in the input array, and static kwidgets.
| void krotos::KwidgetAudioProcessor::removeKwidgetsOfType | ( | const StringArray & | kwidgetTypesToRemove | ) |
Remove all kwidgets of a given type
|
inline |
|
override |
|
private |
| void krotos::KwidgetAudioProcessor::setLastPresetPath | ( | String | inLastPresetPath | ) |
| void krotos::KwidgetAudioProcessor::setReadSpecificFiles | ( | bool | canRead | ) |
Can coreEngine/Reformer kwidget read kaf files (licensing related)
|
private |
| bool krotos::KwidgetAudioProcessor::setState | ( | const ValueTree & | newState | ) |
Set the state of the plugin. Return success of state change.
|
override |
|
overrideprivatevirtual |
Implements krotos::Kwidget_CoreEngine::Listener.
|
overrideprivatevirtual |
Implements krotos::Kwidget_Reformer::Listener.
|
private |
This method is called when either Reformer or Core Engine mute buttons activate And allows cross-soloing logic between the different kwidget types ie Core engines can mute Reformers and vice versa
|
overrideprivatevirtual |
Implements krotos::Kwidget_CoreEngine::Listener.
|
overrideprivatevirtual |
Implements krotos::Kwidget_Reformer::Listener.
|
private |
This method is called when either Reformer or Core Engine mute buttons de-activate And allows cross-soloing logic between the different kwidget types ie Core engines can mute Reformers and vice versa
|
override |
Periodic Timer Callback.
|
private |
|
private |
| bool krotos::KwidgetAudioProcessor::validateState | ( | const ValueTree & | newState, |
| bool | repairEnabled ) |
Validate and repair incoming state before loading/calling setState. Return validation success status.
|
friend |
| AssetManager krotos::KwidgetAudioProcessor::assetManager |
|
static |
|
protected |
|
static |
|
static |
| PluginHostType krotos::KwidgetAudioProcessor::host |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| std::function<void()> krotos::KwidgetAudioProcessor::onAutoplayTimerStop |
Callback on recorder timer cutoff being hit.
| ParameterManager krotos::KwidgetAudioProcessor::parameterManager |
| std::unique_ptr<ValueTree> krotos::KwidgetAudioProcessor::presetInfoTree |
| PresetManager krotos::KwidgetAudioProcessor::presetManager |
|
static |
|
static |
|
static |
|
static |
|
static |
| const bool krotos::KwidgetAudioProcessor::unitTest {false} |