Browse Source

Fix docstrings. Add createParamCentered to rack0.hpp.

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
871617ad6c
3 changed files with 21 additions and 2 deletions
  1. +5
    -1
      include/app/Switch.hpp
  2. +1
    -1
      include/engine/Light.hpp
  3. +15
    -0
      include/rack0.hpp

+ 5
- 1
include/app/Switch.hpp View File

@@ -7,7 +7,11 @@ namespace rack {
namespace app {


/** A ParamWidget that controls */
/** A ParamWidget that represents an integer.
Increases by 1 each time it is clicked.
When maxValue is reached, the next click resets to minValue.
In momentary mode, the value is instead set to maxValue when the mouse is held and minValue when released.
*/
struct Switch : ParamWidget {
/** Return to original position when released */
bool momentary = false;


+ 1
- 1
include/engine/Light.hpp View File

@@ -35,7 +35,7 @@ struct Light {
}
}

/** Use `setSmoothBrightness(brightness, APP->engine->getSampleTime())` instead. */
/** Use `setSmoothBrightness(brightness, sampleTime * frames)` instead. */
DEPRECATED void setBrightnessSmooth(float brightness, float frames = 1.f) {
setSmoothBrightness(brightness, frames / 44100.f);
}


+ 15
- 0
include/rack0.hpp View File

@@ -47,6 +47,12 @@ DEPRECATED inline float interpf(const float *p, float x) {return interpolateLine
DEPRECATED inline void complexMult(float *cr, float *ci, float ar, float ai, float br, float bi) {complexMult(ar, ai, br, bi, cr, ci);}
DEPRECATED inline void cmultf(float *cr, float *ci, float ar, float ai, float br, float bi) {return complexMult(ar, ai, br, bi, cr, ci);}

////////////////////
// string
////////////////////

#define stringf string::f

////////////////////
// random
////////////////////
@@ -126,6 +132,15 @@ DEPRECATED TParamWidget *createParam(math::Vec pos, Module *module, int paramId,
return o;
}

template <class TParamWidget>
DEPRECATED TParamWidget *createParamCentered(math::Vec pos, Module *module, int paramId, float minValue, float maxValue, float defaultValue) {
TParamWidget *o = createParamCentered<TParamWidget>(pos, module, paramId);
if (module) {
module->configParam(paramId, minValue, maxValue, defaultValue);
}
return o;
}

/** Use createInput() and createOutput() without the `type` variable */
template <class TPortWidget>
DEPRECATED TPortWidget *createPort(math::Vec pos, PortWidget::Type type, Module *module, int inputId) {


Loading…
Cancel
Save