| @@ -11,6 +11,7 @@ struct Param { | |||||
| float value = 0.0; | float value = 0.0; | ||||
| }; | }; | ||||
| struct Light { | struct Light { | ||||
| /** The square of the brightness value */ | /** The square of the brightness value */ | ||||
| float value = 0.0; | float value = 0.0; | ||||
| @@ -24,6 +25,7 @@ struct Light { | |||||
| void setBrightnessSmooth(float brightness, float frames = 1.f); | void setBrightnessSmooth(float brightness, float frames = 1.f); | ||||
| }; | }; | ||||
| struct Input { | struct Input { | ||||
| /** Voltage of the port, zero if not plugged in. Read-only by Module */ | /** Voltage of the port, zero if not plugged in. Read-only by Module */ | ||||
| float value = 0.0; | float value = 0.0; | ||||
| @@ -36,6 +38,7 @@ struct Input { | |||||
| } | } | ||||
| }; | }; | ||||
| struct Output { | struct Output { | ||||
| /** Voltage of the port. Write-only by Module */ | /** Voltage of the port. Write-only by Module */ | ||||
| float value = 0.0; | float value = 0.0; | ||||
| @@ -64,7 +67,9 @@ struct Module { | |||||
| } | } | ||||
| virtual ~Module() {} | virtual ~Module() {} | ||||
| /** Advances the module by 1 audio frame with duration 1.0 / gSampleRate */ | |||||
| /** Advances the module by 1 audio frame with duration 1.0 / gSampleRate | |||||
| Override this method to read inputs and params, and to write outputs and lights. | |||||
| */ | |||||
| virtual void step() {} | virtual void step() {} | ||||
| /** Called when the engine sample rate is changed | /** Called when the engine sample rate is changed | ||||
| @@ -85,7 +90,7 @@ struct Module { | |||||
| randomize(); | randomize(); | ||||
| } | } | ||||
| /** Override these to store extra internal data in the "data" property */ | |||||
| /** Override these to store extra internal data in the "data" property of the module's JSON object */ | |||||
| virtual json_t *toJson() { return NULL; } | virtual json_t *toJson() { return NULL; } | ||||
| virtual void fromJson(json_t *root) {} | virtual void fromJson(json_t *root) {} | ||||
| @@ -95,6 +100,7 @@ struct Module { | |||||
| virtual void randomize() {} | virtual void randomize() {} | ||||
| }; | }; | ||||
| struct Wire { | struct Wire { | ||||
| Module *outputModule = NULL; | Module *outputModule = NULL; | ||||
| int outputId; | int outputId; | ||||
| @@ -103,6 +109,7 @@ struct Wire { | |||||
| void step(); | void step(); | ||||
| }; | }; | ||||
| void engineInit(); | void engineInit(); | ||||
| void engineDestroy(); | void engineDestroy(); | ||||
| /** Launches engine thread */ | /** Launches engine thread */ | ||||
| @@ -121,6 +128,7 @@ float engineGetSampleRate(); | |||||
| /** Returns the inverse of the current sample rate */ | /** Returns the inverse of the current sample rate */ | ||||
| float engineGetSampleTime(); | float engineGetSampleTime(); | ||||
| extern bool gPaused; | extern bool gPaused; | ||||
| /** Plugins should not manipulate other modules or wires unless that is the entire purpose of the module. | /** Plugins should not manipulate other modules or wires unless that is the entire purpose of the module. | ||||
| Your plugin needs to have a clear purpose for manipulating other modules and wires and must be done with a good UX. | Your plugin needs to have a clear purpose for manipulating other modules and wires and must be done with a good UX. | ||||