Krotos Modules 3
Loading...
Searching...
No Matches
krotos::Kwidget_Recorder Class Reference

#include <Kwidget_Recorder.h>

Inheritance diagram for krotos::Kwidget_Recorder:
krotos::Kwidget krotos::ResourceLock

Classes

class  Listener
 
struct  Parameters
 

Public Member Functions

void addListener (Listener *listenerToAdd)
 
void removeListener (Listener *listenerToRemove)
 
 Kwidget_Recorder (const String &id)
 
void triggerRecordingStateListenerCallback ()
 
String getTopFilename ()
 
void addFilename (String filename)
 
void handleMidiMessages (MidiBuffer &midiMessages)
 
void setActive (bool activeState)
 
bool getActive ()
 
void setDraggable (bool draggableState)
 
bool getDraggable ()
 
File fetchRecordedFile ()
 
void setPresetName (String newPresetName)
 
- Public Member Functions inherited from krotos::Kwidget
 Kwidget (const String &kwidgetType, const String &kwidgetID)
 
virtual ~Kwidget ()=default
 
void init ()
 
std::unique_ptr< KwidgetProcessorcreateVoice ()
 
std::unique_ptr< KwidgetGUIcreateControls ()
 
KwidgetProcessorgetVoice (int idx) const
 
int getNumVoices () const
 
KwidgetProcessorgetActiveVoice () const
 
virtual void noteOn (int voiceIdx, int midiNote, float velocity)
 
virtual void noteOff (int voiceIdx, float velocity)
 
virtual void noteCleared (int voiceIdx)
 
virtual bool isActive (int voiceIdx)
 
void addModulator (const String &paramID, Kwidget *modulator, int modulatorIdx, float depth=0.99f, KAttachment::Polarity=KAttachment::Polarity::Bipolar)
 
void removeModulator (const String &paramID, Kwidget *modulator, int modulatorIdx)
 
void setModulatorDepth (const String &paramID, Kwidget *modulator, int modulatorIdx, float depth)
 
void setModulatorPolarity (const String &paramID, Kwidget *modulator, int modulatorIdx, KAttachment::Polarity polarity)
 
const std::vector< std::shared_ptr< KParameter > > & getParameters () const
 
KParametergetParameter (const String &parameterID) const noexcept
 Get a raw pointer to a KParameter belonging to this Kwidget's KwidgetProcessor. Useful for low overhead direct parameter access.
 
std::shared_ptr< KParametergetParameterToAttach (const String &parameterID) const noexcept
 Get a shared pointer to a KParameter, for use with KParameter::Listener objects and situations where the parameter lifetime goes beyond local scope.
 
CustomParametergetCustomParameter (const String &parameterID)
 
CustomParameterTreegetCustomParameterTree (const Identifier &type)
 Get a CustomParameterTree belonging to this Kwidget.
 
template<typename T >
T * getCustomParameter (const Identifier &type)
 Get the CustomParameterTree subclass object of the specified type.
 
void notifyAllParametersListeners ()
 Call every parameter's value changed listeners with their current values.
 
const ValueTree & getState ()
 
virtual void setState (const ValueTree &newState, KwidgetAudioProcessor &processor)
 
void flushState ()
 
bool isModulator () const
 
int getNumModulators () const
 
const String & getKwidgetType () const
 
const String & getKwidgetID () const
 
const String & getKwidgetVersionFromCurrentState () const
 
String getKwidgetVersion () const
 
virtual const String & getKwidgetLabel ()
 
StringArray getDragID (const String &parameterID)
 
virtual size_t numGUIImplementations ()
 
virtual String getGuiName (int)
 
virtual void createNestedKwidgets (KwidgetAudioProcessor &)
 
bool isAChildKwidget ()
 
std::vector< Kwidget * > & getChildKwidgets ()
 
bool isStateChanging ()
 
void addChildKwidget (Kwidget *child)
 
void removeChildKwidgetFromTree (String kwidgetID)
 
KwidgetfindChildKwidget (String kiwdgetID)
 
void addParameterCallback (const String &paramID, std::function< void(float)> callback)
 
void addVersionedParameterCallback (StringRef kwidgetVersionTheParameterChangedIn, const String &paramID, std::function< void(float)> callback)
 Add an action to be performed when a specified parameter of a specific kwidget version changes value. This can be used to implement backwards compatibility when older versions of the kwidget state are loaded, and the parameters in newer versions may have been changed or removed.
 
int getTemplateID ()
 
- Public Member Functions inherited from krotos::ResourceLock
 ResourceLock ()
 
bool requestAccess (const StringRef id)
 Called by a client to request access to the resource.
 
bool hasAccess (const StringRef id) const
 Called by a client to enquire whether it has access to the resource.
 
void finishedAccessing (const StringRef id)
 Called by a client to inform the resource that it no longer needs access.
 
void setAccessible (bool isAccessible)
 Called by the resource to grant or deny access to clients.
 

Protected Member Functions

std::vector< ParameterInfocreateParameters () override
 
std::unique_ptr< KwidgetProcessorcreateProcessor () override
 
std::unique_ptr< KwidgetGUIcreateGUI () override
 
- Protected Member Functions inherited from krotos::Kwidget
void addChildGuis (std::unique_ptr< KwidgetGUI > &parentGui)
 
CustomParametercreateAndAddCustomParameter (const String &paramID, const var &value)
 
template<typename T >
T * createAndAddCustomParameter (const Identifier &type)
 Create a highly customizable piece of state for this Kwidget by appending a subclass of CustomParameterTree to this Kwidget's state.
 
void setKwidgetVersion (const String &kwidgetVersionString)
 

Private Member Functions

void setPerformingState (bool isPerforming)
 
void setFinishedPerformingState (bool isFinishedPerforming)
 

Private Attributes

ListenerList< Listenerm_listeners
 
OwnedArray< String > m_dragAndDropFilenames
 
bool m_active {false}
 
bool m_draggable {false}
 
int m_activeVoices
 
RecorderDropName m_recordDragAndDropName
 

Additional Inherited Members

- Public Types inherited from krotos::Kwidget
enum  DragID_Index { KwidgetID = 0 , ParameterID = 1 }
 
- Static Public Member Functions inherited from krotos::Kwidget
static String getParentID (String childKwidgetID)
 
- Protected Attributes inherited from krotos::Kwidget
std::vector< Kwidget * > m_childKwidgets
 

Constructor & Destructor Documentation

◆ Kwidget_Recorder()

krotos::Kwidget_Recorder::Kwidget_Recorder ( const String & id)

Member Function Documentation

◆ addFilename()

void krotos::Kwidget_Recorder::addFilename ( String filename)
inline

◆ addListener()

void krotos::Kwidget_Recorder::addListener ( Listener * listenerToAdd)

◆ createGUI()

std::unique_ptr< KwidgetGUI > krotos::Kwidget_Recorder::createGUI ( )
overrideprotectedvirtual

Override this method to define the type of KwidgetGUI used by this Kwidget.

Implements krotos::Kwidget.

◆ createParameters()

std::vector< Kwidget::ParameterInfo > krotos::Kwidget_Recorder::createParameters ( )
overrideprotectedvirtual

Override this method to define the parameters used by this Kwidget.

Implements krotos::Kwidget.

◆ createProcessor()

std::unique_ptr< KwidgetProcessor > krotos::Kwidget_Recorder::createProcessor ( )
overrideprotectedvirtual

Override this method to define the type of KwidgetProcessor used by this Kwidget.

Implements krotos::Kwidget.

◆ fetchRecordedFile()

File krotos::Kwidget_Recorder::fetchRecordedFile ( )

Copies the recorded File to the OutputAssets directory after renaming it.

◆ getActive()

bool krotos::Kwidget_Recorder::getActive ( )
inline

Returns the active state of the Recorder.

◆ getDraggable()

bool krotos::Kwidget_Recorder::getDraggable ( )
inline

Returns the draggable state of the Recorder.

◆ getTopFilename()

String krotos::Kwidget_Recorder::getTopFilename ( )

◆ handleMidiMessages()

void krotos::Kwidget_Recorder::handleMidiMessages ( MidiBuffer & midiMessages)

Gets called in processBlock and handles midiMessages

Parameters
midiMessagesReference to the MidiBuffer handed from the processBlock

◆ removeListener()

void krotos::Kwidget_Recorder::removeListener ( Listener * listenerToRemove)

◆ setActive()

void krotos::Kwidget_Recorder::setActive ( bool activeState)

Sets the active state of the Recorder and sends message to listeners.

Parameters
activeStateboolean describing if the state of the Recorder is active or not

◆ setDraggable()

void krotos::Kwidget_Recorder::setDraggable ( bool draggableState)

Sets the draggable state of the Recorder to active and sends message to listeners.

Parameters
draggableStateboolean describing if the state of the Recorder is draggable or not

◆ setFinishedPerformingState()

void krotos::Kwidget_Recorder::setFinishedPerformingState ( bool isFinishedPerforming)
private

◆ setPerformingState()

void krotos::Kwidget_Recorder::setPerformingState ( bool isPerforming)
private

◆ setPresetName()

void krotos::Kwidget_Recorder::setPresetName ( String newPresetName)

Sets the preset name to be used in the recorded output filenames, if included in drop name formatting

Parameters
newPresetNameA string of the preset name e.g. "Forest Stream"
See also
RecorderDropName

◆ triggerRecordingStateListenerCallback()

void krotos::Kwidget_Recorder::triggerRecordingStateListenerCallback ( )

Call this method to update listeners with current recording state

Member Data Documentation

◆ m_active

bool krotos::Kwidget_Recorder::m_active {false}
private

◆ m_activeVoices

int krotos::Kwidget_Recorder::m_activeVoices
private

◆ m_dragAndDropFilenames

OwnedArray<String> krotos::Kwidget_Recorder::m_dragAndDropFilenames
private

◆ m_draggable

bool krotos::Kwidget_Recorder::m_draggable {false}
private

◆ m_listeners

ListenerList<Listener> krotos::Kwidget_Recorder::m_listeners
private

◆ m_recordDragAndDropName

RecorderDropName krotos::Kwidget_Recorder::m_recordDragAndDropName
private

The documentation for this class was generated from the following files: