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 Doxyfile

run: doxygen
http-server html

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



+ 2
- 0
include/app.hpp View File

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


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




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

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


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


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

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


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


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

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


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


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

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


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


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

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


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


+ 4
- 0
include/audio.hpp View File

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


namespace rack {


/** Audio driver
*/
namespace audio {




+ 3
- 0
include/color.hpp View File

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


namespace rack {

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




+ 10
- 0
include/component.hpp View File

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


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 {




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

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


namespace rack {


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




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

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

/** 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() {}



+ 2
- 0
include/event.hpp View File

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


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




+ 4
- 0
include/gamepad.hpp View File

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


namespace rack {


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




+ 1
- 0
include/history.hpp View File

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


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




+ 4
- 0
include/keyboard.hpp View File

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


namespace rack {


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




+ 7
- 1
include/logger.hpp View File

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


namespace rack {


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


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

void init(bool devMode);
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, ...);




+ 4
- 0
include/math.hpp View File

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


namespace rack {


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




+ 4
- 0
include/midi.hpp View File

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


namespace rack {


/** MIDI driver
*/
namespace midi {




+ 4
- 0
include/network.hpp View File

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


namespace rack {


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




+ 4
- 0
include/plugin.hpp View File

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


namespace rack {


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




+ 5
- 0
include/random.hpp View File

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


namespace rack {


/** Random number generator
*/
namespace random {


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


+ 4
- 0
include/string.hpp View File

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


namespace rack {


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




+ 15
- 2
include/system.hpp View File

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


namespace rack {


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


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

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

/** 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.
May block, so open in a new thread.


+ 4
- 0
include/ui.hpp View File

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


namespace rack {


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




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

@@ -6,7 +6,7 @@ namespace rack {
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.
Events are not passed to the underlying scene.
*/


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

@@ -6,7 +6,7 @@ namespace rack {
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 {
void onHover(const event::Hover &e) override {
@@ -21,15 +21,9 @@ struct ObstructWidget : Widget {
void onHoverText(const event::HoverText &e) override {
e.consume(this);
}
void onHoverScroll(const event::HoverScroll &e) override {
e.consume(this);
}
void onDragHover(const event::DragHover &e) override {
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 {


/** 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 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 {


/** A FramebufferWidget that can be drawn on with OpenGL commands */
struct OpenGlWidget : FramebufferWidget {
/** 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;
/** Draws to the framebuffer.
Override to initialize, draw, and flush the OpenGL state.
*/
void drawFramebuffer() override;
};



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

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


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



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

@@ -6,7 +6,7 @@ namespace rack {
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 {
/** Override behavior to do nothing instead. */
void onHover(const event::Hover &e) override {}


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

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


namespace rack {


/** General UI widgets
*/
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 {
/** Stores position and size */


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

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


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



+ 3
- 0
include/window.hpp View File

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

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


Loading…
Cancel
Save