#define PRIVATE
Attribute for private functions not intended to be called by plugins.
Definition common.hpp:32
#define DEPRECATED
Attribute for deprecated functions and symbols.
Definition common.hpp:26
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9
Manages Modules and Cables and steps them in time.
Definition Engine.hpp:22
void stepBlock(int frames)
Advances the engine by frames frames.
DEPRECATED ParamHandle * getParamHandle(Module *module, int paramId)
Use getParamHandle(moduleId, paramId) instead.
void addCable(Cable *cable)
Adds a Cable to the rack.
void prepareSaveModule(Module *module)
Dispatches Save event to a module.
void removeCable(Cable *cable)
Removes a Cable from the rack.
void moduleFromJson(Module *module, json_t *rootJ)
Serializes the given Module with locking, ensuring that Module::process() is not called simultaneousl...
PRIVATE void removeCable_NoLock(Cable *cable)
void yieldWorkers()
Causes worker threads to block on a mutex instead of spinlock.
double getBlockDuration()
Returns the total time that stepBlock() is advancing, in seconds.
Module * getModule_NoLock(int64_t moduleId)
float getParamSmoothValue(Module *module, int paramId)
Returns the target value before smoothing.
void addParamHandle(ParamHandle *paramHandle)
Adds a ParamHandle to the rack.
std::vector< int64_t > getCableIds()
Returns a vector of cable IDs in the rack.
int getBlockFrames()
Returns the number of frames requested by the last stepBlock() call.
bool hasModule(Module *module)
Checks whether a Module is in the rack.
void clear()
Removes all modules and cables.
size_t getCableIds(int64_t *cableIds, size_t len)
Fills cableIds with up to len cable IDs in the rack.
double getBlockTime()
Returns the time in seconds when stepBlock() was last called.
Internal * internal
Definition Engine.hpp:24
Module * getModule(int64_t moduleId)
Returns the Module with the given ID in the rack.
PRIVATE void addModule_NoLock(Module *module)
json_t * toJson()
Serializes the rack.
void setParamValue(Module *module, int paramId, float value)
Cable * getCable(int64_t cableId)
Returns the Cable with the given ID in the rack.
std::vector< int64_t > getModuleIds()
Returns a vector of module IDs in the rack.
size_t getModuleIds(int64_t *moduleIds, size_t len)
Fills moduleIds with up to len module IDs in the rack.
Module * getMasterModule()
void setMasterModule(Module *module)
Module does not need to belong to the Engine.
int64_t getFrame()
Returns the number of sample frames since the Engine was created.
PRIVATE void addCable_NoLock(Cable *cable)
float getSampleRate()
Returns the sample rate used by the engine for stepping each module.
int64_t getBlockFrame()
Returns the frame when stepBlock() was last called.
void updateParamHandle(ParamHandle *paramHandle, int64_t moduleId, int paramId, bool overwrite=true)
Sets the ParamHandle IDs and module pointer.
ParamHandle * getParamHandle(int64_t moduleId, int paramId)
Returns the unique ParamHandle for the given paramId Share-locks.
ParamHandle * getParamHandle_NoLock(int64_t moduleId, int paramId)
void resetModule(Module *module)
Triggers a ResetEvent for the given Module.
float getSampleTime()
Returns the inverse of the current sample rate.
void addModule(Module *module)
Adds a Module to the rack.
PRIVATE void setSampleRate(float sampleRate)
Sets the sample rate to step the modules.
void removeParamHandle(ParamHandle *paramHandle)
Exclusively locks.
int64_t getBlock()
Returns the number of stepBlock() calls since the Engine was created.
PRIVATE void startFallbackThread()
If no master module is set, the fallback Engine thread will step blocks, using the CPU clock for timi...
void setParamSmoothValue(Module *module, int paramId, float value)
Requests the parameter to smoothly change toward value.
PRIVATE void clear_NoLock()
float getParamValue(Module *module, int paramId)
void removeModule(Module *module)
Removes a Module from the rack.
PRIVATE void removeModule_NoLock(Module *module)
void updateParamHandle_NoLock(ParamHandle *paramHandle, int64_t moduleId, int paramId, bool overwrite=true)
json_t * moduleToJson(Module *module)
Serializes the given Module with locking, ensuring that Module::process() is not called simultaneousl...
double getMeterAverage()
Returns the average block processing time divided by block time in the last T seconds.
void randomizeModule(Module *module)
Triggers a RandomizeEvent for the given Module.
void setMasterModule_NoLock(Module *module)
PRIVATE void removeParamHandle_NoLock(ParamHandle *paramHandle)
void setSuggestedSampleRate(float suggestedSampleRate)
Sets the sample rate if the sample rate in the settings is "Auto".
void prepareSave()
Dispatches Save event to all modules.
void bypassModule(Module *module, bool bypassed)
Sets the bypassed state and triggers a BypassEvent or UnBypassEvent of the given Module.
bool hasCable(Cable *cable)
Checks whether a Cable is in the rack.
void fromJson(json_t *rootJ)
Deserializes the rack.
DSP processor instance for your module.
Definition Module.hpp:29
A weak handle to a Param.
Definition ParamHandle.hpp:13