Browse Source

Add various API documentation

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
52151a709d
34 changed files with 115 additions and 18 deletions
  1. +3
    -0
      docs/Makefile
  2. +2
    -0
      include/app.hpp
  3. +1
    -0
      include/app/ModuleWidget.hpp
  4. +1
    -1
      include/app/ParamQuantity.hpp
  5. +1
    -0
      include/app/ParamWidget.hpp
  6. +1
    -0
      include/app/PortWidget.hpp
  7. +1
    -0
      include/app/RackWidget.hpp
  8. +4
    -0
      include/audio.hpp
  9. +3
    -0
      include/color.hpp
  10. +10
    -0
      include/component.hpp
  11. +4
    -0
      include/dsp/common.hpp
  12. +1
    -1
      include/engine/Module.hpp
  13. +2
    -0
      include/event.hpp
  14. +4
    -0
      include/gamepad.hpp
  15. +1
    -0
      include/history.hpp
  16. +4
    -0
      include/keyboard.hpp
  17. +7
    -1
      include/logger.hpp
  18. +4
    -0
      include/math.hpp
  19. +4
    -0
      include/midi.hpp
  20. +4
    -0
      include/network.hpp
  21. +4
    -0
      include/plugin.hpp
  22. +5
    -0
      include/random.hpp
  23. +4
    -0
      include/string.hpp
  24. +15
    -2
      include/system.hpp
  25. +4
    -0
      include/ui.hpp
  26. +1
    -1
      include/widget/FramebufferWidget.hpp
  27. +1
    -7
      include/widget/ObstructWidget.hpp
  28. +1
    -1
      include/widget/OpaqueWidget.hpp
  29. +5
    -1
      include/widget/OpenGlWidget.hpp
  30. +1
    -1
      include/widget/SvgWidget.hpp
  31. +1
    -1
      include/widget/TransparentWidget.hpp
  32. +7
    -1
      include/widget/Widget.hpp
  33. +1
    -0
      include/widget/ZoomWidget.hpp
  34. +3
    -0
      include/window.hpp

+ 3
- 0
docs/Makefile View File

@@ -4,6 +4,9 @@ all: doxygen
doxygen: doxygen:
doxygen Doxyfile doxygen Doxyfile


run: doxygen
http-server html

upload: doxygen upload: doxygen
rsync html/ vcvrack.com:vcvrack.com/docs/ -ruvz --delete rsync html/ vcvrack.com:vcvrack.com/docs/ -ruvz --delete




+ 2
- 0
include/app.hpp View File

@@ -28,6 +28,8 @@ struct Window;
struct PatchManager; struct PatchManager;




/** Rack-specific GUI widgets and functions that control and offer feedback for the rack state.
*/
namespace app { namespace app {






+ 1
- 0
include/app/ModuleWidget.hpp View File

@@ -12,6 +12,7 @@ namespace rack {
namespace app { namespace app {




/** Manages an engine::Module in the rack. */
struct ModuleWidget : widget::OpaqueWidget { struct ModuleWidget : widget::OpaqueWidget {
plugin::Model *model = NULL; plugin::Model *model = NULL;
/** Owns the module pointer */ /** Owns the module pointer */


+ 1
- 1
include/app/ParamQuantity.hpp View File

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




/** A ui::Quantity that wraps an engine Param */
/** A ui::Quantity that wraps an engine::Param. */
struct ParamQuantity : ui::Quantity { struct ParamQuantity : ui::Quantity {
engine::Module *module = NULL; engine::Module *module = NULL;
int paramId = 0; int paramId = 0;


+ 1
- 0
include/app/ParamWidget.hpp View File

@@ -10,6 +10,7 @@ namespace rack {
namespace app { namespace app {




/** Manages an engine::Param on a ModuleWidget. */
struct ParamWidget : widget::OpaqueWidget { struct ParamWidget : widget::OpaqueWidget {
ParamQuantity *paramQuantity = NULL; ParamQuantity *paramQuantity = NULL;
float dirtyValue = NAN; float dirtyValue = NAN;


+ 1
- 0
include/app/PortWidget.hpp View File

@@ -9,6 +9,7 @@ namespace rack {
namespace app { namespace app {




/** Manages an engine::Port on a ModuleWidget. */
struct PortWidget : widget::OpaqueWidget { struct PortWidget : widget::OpaqueWidget {
engine::Module *module = NULL; engine::Module *module = NULL;
int portId; int portId;


+ 1
- 0
include/app/RackWidget.hpp View File

@@ -12,6 +12,7 @@ namespace rack {
namespace app { namespace app {




/** Container for ModuleWidget and CableWidget. */
struct RackWidget : widget::OpaqueWidget { struct RackWidget : widget::OpaqueWidget {
widget::FramebufferWidget *rails; widget::FramebufferWidget *rails;
widget::Widget *moduleContainer; widget::Widget *moduleContainer;


+ 4
- 0
include/audio.hpp View File

@@ -11,6 +11,10 @@




namespace rack { namespace rack {


/** Audio driver
*/
namespace audio { namespace audio {






+ 3
- 0
include/color.hpp View File

@@ -5,6 +5,9 @@




namespace rack { namespace rack {

/** Utilities for `NVGcolor`
*/
namespace color { namespace color {






+ 10
- 0
include/component.hpp View File

@@ -3,6 +3,16 @@




namespace rack { namespace rack {

/** Component Library by [Grayscale](https://grayscale.info/).

Copied from `LICENSE.md`:

The **Component Library graphics** in the `res/ComponentLibrary` directory are copyright © 2019 [Grayscale](http://grayscale.info/) and licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/).
You may not freely sell plugins using Component Library graphics.
However, a free commercial license is available for plugins sold through the [VCV Store](https://vcvrack.com/plugins.html).
Email contact@vcvrack.com for more information about licensing or the VCV Store.
*/
namespace component { namespace component {






+ 4
- 0
include/dsp/common.hpp View File

@@ -3,6 +3,10 @@




namespace rack { namespace rack {


/** Digital signal processing routines for plugins
*/
namespace dsp { namespace dsp {






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

@@ -39,7 +39,7 @@ struct Module {
void randomize(); void randomize();


/** Advances the module by one audio sample. /** Advances the module by one audio sample.
Override this method to read Inputs and Params, and to write Outputs and Lights.
Override this method to read Inputs and Params and to write Outputs and Lights.
*/ */
virtual void step() {} virtual void step() {}




+ 2
- 0
include/event.hpp View File

@@ -12,6 +12,8 @@ namespace widget {
} // namespace widget } // namespace widget




/** Event state machine for Widgets
*/
namespace event { namespace event {






+ 4
- 0
include/gamepad.hpp View File

@@ -3,6 +3,10 @@




namespace rack { namespace rack {


/** Gamepad/joystick/controller MIDI driver
*/
namespace gamepad { namespace gamepad {






+ 1
- 0
include/history.hpp View File

@@ -16,6 +16,7 @@ namespace app {
} // namespace app } // namespace app




/** Undo history actions for the Rack application */
namespace history { namespace history {






+ 4
- 0
include/keyboard.hpp View File

@@ -3,6 +3,10 @@




namespace rack { namespace rack {


/** Computer keyboard MIDI driver
*/
namespace keyboard { namespace keyboard {






+ 7
- 1
include/logger.hpp View File

@@ -13,6 +13,10 @@ will print something like




namespace rack { namespace rack {


/** Logs messages to a file or the console with decoration
*/
namespace logger { namespace logger {




@@ -25,7 +29,9 @@ enum Level {


void init(bool devMode); void init(bool devMode);
void destroy(); void destroy();
/** Do not use this function directly. Use the macros below. */
/** Do not use this function directly. Use the macros below.
Thread-safe.
*/
void log(Level level, const char *filename, int line, const char *format, ...); void log(Level level, const char *filename, int line, const char *format, ...);






+ 4
- 0
include/math.hpp View File

@@ -4,6 +4,10 @@




namespace rack { namespace rack {


/** Supplemental `<cmath>` functions and types
*/
namespace math { namespace math {






+ 4
- 0
include/midi.hpp View File

@@ -7,6 +7,10 @@




namespace rack { namespace rack {


/** MIDI driver
*/
namespace midi { namespace midi {






+ 4
- 0
include/network.hpp View File

@@ -4,6 +4,10 @@




namespace rack { namespace rack {


/** Networking functions for HTTP requests, URLs, and downloads
*/
namespace network { namespace network {






+ 4
- 0
include/plugin.hpp View File

@@ -7,6 +7,10 @@




namespace rack { namespace rack {


/** Plugin loader and plugin manager
*/
namespace plugin { namespace plugin {






+ 5
- 0
include/random.hpp View File

@@ -4,6 +4,10 @@




namespace rack { namespace rack {


/** Random number generator
*/
namespace random { namespace random {




@@ -11,6 +15,7 @@ namespace random {
void init(); void init();
/** Returns a uniform random uint32_t from 0 to UINT32_MAX */ /** Returns a uniform random uint32_t from 0 to UINT32_MAX */
uint32_t u32(); uint32_t u32();
/** Returns a uniform random uint64_t from 0 to UINT64_MAX */
uint64_t u64(); uint64_t u64();
/** Returns a uniform random float in the interval [0.0, 1.0) */ /** Returns a uniform random float in the interval [0.0, 1.0) */
float uniform(); float uniform();


+ 4
- 0
include/string.hpp View File

@@ -3,6 +3,10 @@




namespace rack { namespace rack {


/** Supplemental `std::string` functions
*/
namespace string { namespace string {






+ 15
- 2
include/system.hpp View File

@@ -4,20 +4,33 @@




namespace rack { namespace rack {


/** Cross-platform functions for operating systems routines
*/
namespace system { namespace system {




/** Returns a list of all entries (directories, files, symbols) in a directory. */
std::list<std::string> listEntries(const std::string &path); std::list<std::string> listEntries(const std::string &path);
/** Returns whether the given path is a file. */
bool isFile(const std::string &path); bool isFile(const std::string &path);
/** Returns whether the given path is a directory. */
bool isDirectory(const std::string &path); bool isDirectory(const std::string &path);
/** Copies a file. */
void copyFile(const std::string &srcPath, const std::string &destPath); void copyFile(const std::string &srcPath, const std::string &destPath);
/** Creates a directory.
The parent directory must exist.
*/
void createDirectory(const std::string &path); void createDirectory(const std::string &path);

/** Returns the number of logical simultaneous multithreading (SMT) (e.g. Intel Hyperthreaded) threads on the CPU. */
int getLogicalCoreCount(); int getLogicalCoreCount();
/** Sets a name of the current thread for debuggers and OS-specific process viewers. */
void setThreadName(const std::string &name); void setThreadName(const std::string &name);
/** Sets the current thread to be high-priority. */
void setThreadRealTime(); void setThreadRealTime();
/** Returns the caller's human-readable stack trace with "\n"-separated lines. */
std::string getStackTrace(); std::string getStackTrace();

/** Opens a URL, also happens to work with PDFs and folders. /** Opens a URL, also happens to work with PDFs and folders.
Shell injection is possible, so make sure the URL is trusted or hard coded. Shell injection is possible, so make sure the URL is trusted or hard coded.
May block, so open in a new thread. May block, so open in a new thread.


+ 4
- 0
include/ui.hpp View File

@@ -4,6 +4,10 @@




namespace rack { namespace rack {


/** General user interface widgets using Blendish
*/
namespace ui { namespace ui {






+ 1
- 1
include/widget/FramebufferWidget.hpp View File

@@ -6,7 +6,7 @@ namespace rack {
namespace widget { namespace widget {




/** Caches a widget's draw() result to a framebuffer so it is called less frequently
/** Caches a widget's draw() result to a framebuffer so it is called less frequently.
When `dirty` is true, its children will be re-rendered on the next call to step() override. When `dirty` is true, its children will be re-rendered on the next call to step() override.
Events are not passed to the underlying scene. Events are not passed to the underlying scene.
*/ */


+ 1
- 7
include/widget/ObstructWidget.hpp View File

@@ -6,7 +6,7 @@ namespace rack {
namespace widget { namespace widget {




/** Widget that consumes recursing events without giving a chance for children to consume.
/** A Widget that consumes recursing events without giving a chance for children to consume.
*/ */
struct ObstructWidget : Widget { struct ObstructWidget : Widget {
void onHover(const event::Hover &e) override { void onHover(const event::Hover &e) override {
@@ -21,15 +21,9 @@ struct ObstructWidget : Widget {
void onHoverText(const event::HoverText &e) override { void onHoverText(const event::HoverText &e) override {
e.consume(this); e.consume(this);
} }
void onHoverScroll(const event::HoverScroll &e) override {
e.consume(this);
}
void onDragHover(const event::DragHover &e) override { void onDragHover(const event::DragHover &e) override {
e.consume(this); e.consume(this);
} }
void onPathDrop(const event::PathDrop &e) override {
e.consume(this);
}
}; };






+ 1
- 1
include/widget/OpaqueWidget.hpp View File

@@ -6,7 +6,7 @@ namespace rack {
namespace widget { namespace widget {




/** Widget that consumes recursing events but gives a chance for children to consume first.
/** A Widget that consumes recursing events but gives a chance for children to consume first.
You can of course override the events. You can of course override the events.
You may also call OpaqueWidget::on*() from the overridden method to continue recursing/consuming the event. You may also call OpaqueWidget::on*() from the overridden method to continue recursing/consuming the event.
*/ */


+ 5
- 1
include/widget/OpenGlWidget.hpp View File

@@ -6,11 +6,15 @@ namespace rack {
namespace widget { namespace widget {




/** A FramebufferWidget that can be drawn on with OpenGL commands */
struct OpenGlWidget : FramebufferWidget { struct OpenGlWidget : FramebufferWidget {
/** Draws every frame by default /** Draws every frame by default
Override this to restore the default behavior of FramebufferWidget.
Override this and call `FramebufferWidget::step()` to restore the default behavior of FramebufferWidget.
*/ */
void step() override; void step() override;
/** Draws to the framebuffer.
Override to initialize, draw, and flush the OpenGL state.
*/
void drawFramebuffer() override; void drawFramebuffer() override;
}; };




+ 1
- 1
include/widget/SvgWidget.hpp View File

@@ -7,7 +7,7 @@ namespace rack {
namespace widget { namespace widget {




/** Draws an SVG */
/** Draws an Svg */
struct SvgWidget : Widget { struct SvgWidget : Widget {
std::shared_ptr<Svg> svg; std::shared_ptr<Svg> svg;




+ 1
- 1
include/widget/TransparentWidget.hpp View File

@@ -6,7 +6,7 @@ namespace rack {
namespace widget { namespace widget {




/** Widget that does not respond to events and does not pass events to children */
/** A Widget that does not respond to events and does not pass events to children */
struct TransparentWidget : Widget { struct TransparentWidget : Widget {
/** Override behavior to do nothing instead. */ /** Override behavior to do nothing instead. */
void onHover(const event::Hover &e) override {} void onHover(const event::Hover &e) override {}


+ 7
- 1
include/widget/Widget.hpp View File

@@ -8,6 +8,10 @@




namespace rack { namespace rack {


/** General UI widgets
*/
namespace widget { namespace widget {




@@ -17,7 +21,9 @@ struct DrawContext {
}; };




/** A node in the 2D scene graph
/** A node in the 2D [scene graph](https://en.wikipedia.org/wiki/Scene_graph).
The bounding box of a Widget is a rectangle specified by `box` relative to their parent.
The appearance is defined by overriding `draw()`, and the behavior is defined by overriding `step()` and `on*()` event handlers.
*/ */
struct Widget { struct Widget {
/** Stores position and size */ /** Stores position and size */


+ 1
- 0
include/widget/ZoomWidget.hpp View File

@@ -6,6 +6,7 @@ namespace rack {
namespace widget { namespace widget {




/** A Widget with a dynamic zoom level. */
struct ZoomWidget : Widget { struct ZoomWidget : Widget {
float zoom = 1.f; float zoom = 1.f;




+ 3
- 0
include/window.hpp View File

@@ -42,6 +42,7 @@ namespace rack {
struct Font { struct Font {
NVGcontext *vg; NVGcontext *vg;
int handle; int handle;
/** Don't call this directly but instead use `APP->window->loadFont()` */
Font(NVGcontext *vg, const std::string &filename); Font(NVGcontext *vg, const std::string &filename);
~Font(); ~Font();
/** Use `APP->window->loadFont()` instead. */ /** Use `APP->window->loadFont()` instead. */
@@ -51,6 +52,7 @@ struct Font {
struct Image { struct Image {
NVGcontext *vg; NVGcontext *vg;
int handle; int handle;
/** Don't call this directly but instead use `APP->window->loadImage()` */
Image(NVGcontext *vg, const std::string &filename); Image(NVGcontext *vg, const std::string &filename);
~Image(); ~Image();
/** Use `APP->window->loadImage()` instead. */ /** Use `APP->window->loadImage()` instead. */
@@ -59,6 +61,7 @@ struct Image {


struct Svg { struct Svg {
NSVGimage *handle; NSVGimage *handle;
/** Don't call this directly but instead use `APP->window->loadSvg()` */
Svg(const std::string &filename); Svg(const std::string &filename);
~Svg(); ~Svg();
/** Use `APP->window->loadSvg()` instead. */ /** Use `APP->window->loadSvg()` instead. */


Loading…
Cancel
Save