Gin
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Processor Class Reference

A process with internal and external params. More...

Inherits ProcessorBaseClass, juce::ChangeBroadcaster, and juce::Timer.

Public Member Functions

 Processor (bool init=true, ProcessorOptions={})
 If you override any virtual functions, they won't get called by the constructor. More...
 
 Processor (const BusesProperties &ioLayouts, bool init=true, ProcessorOptions={})
 
 ~Processor () override
 
void init ()
 
void reset () override
 
void prepareToPlay (double sampleRate, int samplesPerBlock) override
 
void releaseResources () override
 
virtual juce::PropertiesFile * getSettings ()
 
void addPluginParameter (gin::Parameter *parameter)
 
gin::Parameter * addExtParam (juce::String uid, juce::String name, juce::String shortName, juce::String label, juce::NormalisableRange< float > range, float defaultValue, SmoothingType st, std::function< juce::String(const gin::Parameter &, float)> textFunction=nullptr)
 
gin::Parameter * addIntParam (juce::String uid, juce::String name, juce::String shortName, juce::String label, juce::NormalisableRange< float > range, float defaultValue, SmoothingType st, std::function< juce::String(const gin::Parameter &, float)> textFunction=nullptr)
 
gin::Parameter * getParameter (const juce::String &uid)
 
float parameterValue (const juce::String &uid)
 
int parameterIntValue (const juce::String &uid)
 
bool parameterBoolValue (const juce::String &uid)
 
const juce::Array< gin::Parameter * > & getPluginParameters ()
 
bool isSmoothing ()
 
virtual bool isParamLocked (gin::Parameter *)
 
virtual juce::File getProgramDirectory ()
 
void loadAllPrograms ()
 
const juce::String getName () const override
 
bool acceptsMidi () const override
 
bool producesMidi () const override
 
double getTailLengthSeconds () const override
 
int getNumPrograms () override
 
int getCurrentProgram () override
 
const juce::OwnedArray< Program > & getPrograms ()
 
ProgramgetProgram (const juce::String &name)
 
void setCurrentProgram (juce::String name)
 
void setCurrentProgram (int index) override
 
const juce::String getProgramName (int index) override
 
void changeProgramName (int index, const juce::String &newName) override
 
void saveProgram (juce::String name, juce::String author, juce::String tags)
 
void deleteProgram (int index)
 
bool hasProgram (juce::String name)
 
juce::String getStateXml ()
 
void setStateXml (const juce::String &s)
 
void getStateInformation (juce::MemoryBlock &destData) override
 
void setStateInformation (const void *data, int sizeInBytes) override
 

Public Attributes

const ProcessorOptions processorOptions
 
bool loadingState = false
 
std::unique_ptr< juce::LookAndFeel > lf
 
std::map< juce::String, gin::Parameter * > parameterMap
 
juce::OwnedArray< gin::Parameter > internalParameters
 
juce::ValueTree state
 
int versionHint = 1
 

Protected Member Functions

virtual void stateUpdated ()
 
virtual void updateState ()
 
void extractProgram (const juce::String &name, const juce::MemoryBlock &data)
 
void extractProgram (const juce::String &name, const void *data, int sz)
 

Detailed Description

A process with internal and external params.

Constructor & Destructor Documentation

◆ Processor() [1/2]

Processor::Processor ( bool  init = true,
ProcessorOptions  = {} 
)

If you override any virtual functions, they won't get called by the constructor.

So pass false and then call init manually from your constructor. If you don't override any functions, then it's safe to pass true to the constructor and you don't need to call init.

◆ Processor() [2/2]

Processor::Processor ( const BusesProperties &  ioLayouts,
bool  init = true,
ProcessorOptions  = {} 
)

◆ ~Processor()

Processor::~Processor ( )
override

Member Function Documentation

◆ init()

void Processor::init ( )

◆ reset()

void Processor::reset ( )
override

◆ prepareToPlay()

void Processor::prepareToPlay ( double  sampleRate,
int  samplesPerBlock 
)
override

◆ releaseResources()

void Processor::releaseResources ( )
override

◆ getSettings()

virtual juce::PropertiesFile* Processor::getSettings ( )
virtual

◆ addPluginParameter()

void Processor::addPluginParameter ( gin::Parameter *  parameter)

◆ addExtParam()

gin::Parameter* Processor::addExtParam ( juce::String  uid,
juce::String  name,
juce::String  shortName,
juce::String  label,
juce::NormalisableRange< float >  range,
float  defaultValue,
SmoothingType  st,
std::function< juce::String(const gin::Parameter &, float)>  textFunction = nullptr 
)

◆ addIntParam()

gin::Parameter* Processor::addIntParam ( juce::String  uid,
juce::String  name,
juce::String  shortName,
juce::String  label,
juce::NormalisableRange< float >  range,
float  defaultValue,
SmoothingType  st,
std::function< juce::String(const gin::Parameter &, float)>  textFunction = nullptr 
)

◆ getParameter()

gin::Parameter* Processor::getParameter ( const juce::String &  uid)

◆ parameterValue()

float Processor::parameterValue ( const juce::String &  uid)

◆ parameterIntValue()

int Processor::parameterIntValue ( const juce::String &  uid)

◆ parameterBoolValue()

bool Processor::parameterBoolValue ( const juce::String &  uid)

◆ getPluginParameters()

const juce::Array<gin::Parameter*>& Processor::getPluginParameters ( )

◆ isSmoothing()

bool Processor::isSmoothing ( )

◆ isParamLocked()

virtual bool Processor::isParamLocked ( gin::Parameter *  )
virtual

◆ getProgramDirectory()

virtual juce::File Processor::getProgramDirectory ( )
virtual

◆ loadAllPrograms()

void Processor::loadAllPrograms ( )

◆ getName()

const juce::String Processor::getName ( ) const
override

◆ acceptsMidi()

bool Processor::acceptsMidi ( ) const
override

◆ producesMidi()

bool Processor::producesMidi ( ) const
override

◆ getTailLengthSeconds()

double Processor::getTailLengthSeconds ( ) const
override

◆ getNumPrograms()

int Processor::getNumPrograms ( )
override

◆ getCurrentProgram()

int Processor::getCurrentProgram ( )
override

◆ getPrograms()

const juce::OwnedArray<Program>& Processor::getPrograms ( )

◆ getProgram()

Program* Processor::getProgram ( const juce::String &  name)

◆ setCurrentProgram() [1/2]

void Processor::setCurrentProgram ( juce::String  name)

◆ setCurrentProgram() [2/2]

void Processor::setCurrentProgram ( int  index)
override

◆ getProgramName()

const juce::String Processor::getProgramName ( int  index)
override

◆ changeProgramName()

void Processor::changeProgramName ( int  index,
const juce::String &  newName 
)
override

◆ saveProgram()

void Processor::saveProgram ( juce::String  name,
juce::String  author,
juce::String  tags 
)

◆ deleteProgram()

void Processor::deleteProgram ( int  index)

◆ hasProgram()

bool Processor::hasProgram ( juce::String  name)

◆ getStateXml()

juce::String Processor::getStateXml ( )

◆ setStateXml()

void Processor::setStateXml ( const juce::String &  s)

◆ getStateInformation()

void Processor::getStateInformation ( juce::MemoryBlock &  destData)
override

◆ setStateInformation()

void Processor::setStateInformation ( const void *  data,
int  sizeInBytes 
)
override

◆ stateUpdated()

virtual void Processor::stateUpdated ( )
protectedvirtual

◆ updateState()

virtual void Processor::updateState ( )
protectedvirtual

◆ extractProgram() [1/2]

void Processor::extractProgram ( const juce::String &  name,
const juce::MemoryBlock &  data 
)
protected

◆ extractProgram() [2/2]

void Processor::extractProgram ( const juce::String &  name,
const void *  data,
int  sz 
)
protected

Member Data Documentation

◆ processorOptions

const ProcessorOptions Processor::processorOptions

◆ loadingState

bool Processor::loadingState = false

◆ lf

std::unique_ptr<juce::LookAndFeel> Processor::lf

◆ parameterMap

std::map<juce::String, gin::Parameter*> Processor::parameterMap

◆ internalParameters

juce::OwnedArray<gin::Parameter> Processor::internalParameters

◆ state

juce::ValueTree Processor::state

◆ versionHint

int Processor::versionHint = 1

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