VCV Rack API v2
Loading...
Searching...
No Matches
CableWidget.hpp
Go to the documentation of this file.
1#pragma once
2#include <map>
3#include <app/common.hpp>
4#include <widget/Widget.hpp>
5#include <app/PortWidget.hpp>
6#include <engine/Cable.hpp>
7
8
9namespace rack {
10namespace app {
11
12
13struct PlugWidget;
14
15
17 struct Internal;
18 Internal* internal;
19
22 NVGcolor color;
23 PlugWidget* inputPlug;
24 PlugWidget* outputPlug;
25
30
33 bool isComplete();
44 void mergeJson(json_t* rootJ);
45 void fromJson(json_t* rootJ);
46 void step() override;
47 void draw(const DrawArgs& args) override;
48 void drawLayer(const DrawArgs& args, int layer) override;
50};
51
52
53} // namespace app
54} // namespace rack
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9
Definition CableWidget.hpp:16
void fromJson(json_t *rootJ)
PlugWidget * outputPlug
Definition CableWidget.hpp:24
Internal * internal
Definition CableWidget.hpp:18
void step() override
Advances the module by one frame.
void drawLayer(const DrawArgs &args, int layer) override
Draw additional layers.
math::Vec getOutputPos()
PortWidget * outputPort
Definition CableWidget.hpp:27
PortWidget * hoveredInputPort
Definition CableWidget.hpp:28
engine::Cable * releaseCable()
PortWidget * inputPort
Definition CableWidget.hpp:26
PlugWidget * inputPlug
Definition CableWidget.hpp:23
NVGcolor color
Definition CableWidget.hpp:22
PortWidget * hoveredOutputPort
Definition CableWidget.hpp:29
void updateCable()
Based on the input/output ports, re-creates the cable and removes/adds it to the Engine.
void mergeJson(json_t *rootJ)
engine::Cable * getCable()
void setCable(engine::Cable *cable)
From a cable, sets the input/output ports.
engine::Cable * cable
Owned.
Definition CableWidget.hpp:21
void draw(const DrawArgs &args) override
Draws the widget to the NanoVG context.
Manages an engine::Port on a ModuleWidget.
Definition PortWidget.hpp:14
Definition Cable.hpp:10
2-dimensional vector of floats, representing a point on the plane for graphics.
Definition math.hpp:189
Definition Widget.hpp:141
A node in the 2D scene graph.
Definition Widget.hpp:21