StoneyVCV v2
StoneyDSP Modules for VCV Rack 2.
Loading...
Searching...
No Matches
PortWidget.hpp
Go to the documentation of this file.
1
31#pragma once
32
33#define STONEYVCV_COMPONENTLIBRARY_PORTWIDGET_HPP_INCLUDED 1
34
35#if defined (STONEYVCV_BUILD_COMPONENTLIBRARY)
36
37//==============================================================================
38
39#include <StoneyVCV.hpp>
42
43//==============================================================================
44
45#include <rack.hpp>
46#include <StoneyDSP/Core.hpp>
47
48//==============================================================================
49
50namespace StoneyDSP
51{
56//==============================================================================
57
58namespace StoneyVCV
59{
64//==============================================================================
65
66namespace ComponentLibrary
67{
72//==============================================================================
73
85{
86
87 //==========================================================================
88
89public:
90
91 //==========================================================================
92
94
95 //==========================================================================
96
102
108
109 //==========================================================================
110
117
125 virtual void draw(const ::StoneyDSP::StoneyVCV::ComponentLibrary::ThemedPortPanelWidget::DrawArgs &args) override;
126
127 //==========================================================================
128
130
131 //==========================================================================
132
134
136
137 //==========================================================================
138
140
142
143 //==========================================================================
144
146
147 //==========================================================================
148
149 ::std::string labelText;
150
156
157 //==========================================================================
158
159private:
160
161 //==========================================================================
162
167
168 //==========================================================================
169
172};
173
174//==============================================================================
175
180struct ThemedPortWidget : virtual ::rack::app::ThemedSvgPort
181{
182
183 //==========================================================================
184
185public:
186
187 //==========================================================================
188
189 using DrawArgs = ::rack::app::ThemedSvgPort::DrawArgs;
190
191 //==========================================================================
192
194
196
197 //==========================================================================
198
200
206 virtual void draw(const ::StoneyDSP::StoneyVCV::ComponentLibrary::ThemedPortWidget::DrawArgs &args) override;
207
208 //==========================================================================
209
211
212 //==========================================================================
213
214 ::std::shared_ptr<::rack::window::Svg> lightSvg;
215
216 ::std::shared_ptr<::rack::window::Svg> darkSvg;
217
218 //==========================================================================
219
220private:
221
222 //==========================================================================
223
226};
227
228//==============================================================================
229
231} // namespace ComponentLibrary
232
233//==============================================================================
234
236} // namespace StoneyVCV
237
238//==============================================================================
239
241} // namespace StoneyDSP
242
243//==============================================================================
244
245#endif // STONEYVCV_BUILD_COMPONENTLIBRARY
246
247//==============================================================================
StoneyDSP Modules for VCV Rack 2.
StoneyDSP Modules for VCV Rack 2.
StoneyDSP Modules for VCV Rack 2.
The StoneyDSP namespace.
Definition StoneyVCV.hpp:78
The ThemedPortPanelWidget struct.
Definition PortWidget.hpp:85
ThemedPortPanelWidget()
Constructs a new ThemedPortPanelWidget object.
virtual void step() override
Advances the ThemedPortPanelWidget by one frame.
virtual const bool & getPrefersDarkPanels() const noexcept
bool isOutput
Set whether the parent is an input or an output port.
Definition PortWidget.hpp:155
::std::string labelText
Definition PortWidget.hpp:149
virtual void setIsOutput(const bool &newIsOutput) noexcept
const bool * prefersDarkPanelsPtr
{&::rack::settings::preferDarkPanels}
Definition PortWidget.hpp:166
virtual const ::std::string & getLabelText() const noexcept
virtual void draw(const ::StoneyDSP::StoneyVCV::ComponentLibrary::ThemedPortPanelWidget::DrawArgs &args) override
Renders the ThemedPortPanelWidget to the NanoVG context.
virtual ~ThemedPortPanelWidget() noexcept
Destroys the ThemedPortPanelWidget object.
virtual void setLabelText(const ::std::string &newLabelText) noexcept
::StoneyDSP::StoneyVCV::ComponentLibrary::TransparentWidget::DrawArgs DrawArgs
Definition PortWidget.hpp:93
The ThemedPortWidget struct.
Definition PortWidget.hpp:181
::rack::app::ThemedSvgPort::DrawArgs DrawArgs
Definition PortWidget.hpp:189
::StoneyDSP::StoneyVCV::ComponentLibrary::Widget::DrawArgs DrawArgs
Definition Widget.hpp:394
Definition StoneyVCV.hpp:125