VCV Rack API v2
Loading...
Searching...
No Matches
SvgSwitch.hpp
Go to the documentation of this file.
1#pragma once
2#include <app/common.hpp>
6#include <app/Switch.hpp>
7
8
9namespace rack {
10namespace app {
11
12
14struct SvgSwitch : Switch {
15 struct Internal;
16 Internal* internal;
17
21 std::vector<std::shared_ptr<window::Svg>> frames;
22
25 bool latch = false;
26
30 void addFrame(std::shared_ptr<window::Svg> svg);
31
32 void onDragStart(const DragStartEvent& e) override;
33 void onDragEnd(const DragEndEvent& e) override;
34 void onChange(const ChangeEvent& e) override;
35};
36
37
39
40
41} // namespace app
42} // namespace rack
#define DEPRECATED
Attribute for deprecated functions and symbols.
Definition common.hpp:26
DEPRECATED typedef SvgSwitch SVGSwitch
Definition SvgSwitch.hpp:38
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9
Definition CircularShadow.hpp:10
A ParamWidget with multiple frames corresponding to its value.
Definition SvgSwitch.hpp:14
void addFrame(std::shared_ptr< window::Svg > svg)
Adds an SVG file to represent the next switch position.
void onChange(const ChangeEvent &e) override
void onDragStart(const DragStartEvent &e) override
CircularShadow * shadow
Definition SvgSwitch.hpp:19
widget::SvgWidget * sw
Definition SvgSwitch.hpp:20
widget::FramebufferWidget * fb
Definition SvgSwitch.hpp:18
void onDragEnd(const DragEndEvent &e) override
bool latch
Use frames 0 and 1 when the mouse is pressed and released, instead of using the param value as the fr...
Definition SvgSwitch.hpp:25
std::vector< std::shared_ptr< window::Svg > > frames
Definition SvgSwitch.hpp:21
Internal * internal
Definition SvgSwitch.hpp:16
A ParamWidget that represents an integer.
Definition Switch.hpp:15
Caches its children's draw() result to a framebuffer image.
Definition FramebufferWidget.hpp:12
Owns and draws a window::Svg.
Definition SvgWidget.hpp:10
Occurs after the value of a Widget changes.
Definition Widget.hpp:451
Occurs when a Widget stops being dragged by releasing the mouse button.
Definition Widget.hpp:375
Occurs when a Widget begins being dragged.
Definition Widget.hpp:369