StoneyVCV v2
StoneyDSP Modules for VCV Rack 2.
Loading...
Searching...
No Matches
HP2.hpp
Go to the documentation of this file.
1
31#pragma once
32
33#define STONEYVCV_HP2_HPP_INCLUDED 1
34
35#if defined (STONEYVCV_BUILD_HP2)
36
37//==============================================================================
38
39#include <StoneyVCV.hpp>
41#include <StoneyVCV/plugin.hpp>
42
43//==============================================================================
44
45#include <rack.hpp>
46#include <StoneyDSP/Core.hpp>
47
48//==============================================================================
49
50#include <array>
51
52//==============================================================================
53
54namespace StoneyDSP
55{
60//==============================================================================
61
62namespace StoneyVCV
63{
68//==============================================================================
69
77namespace HP2
78{
83//==============================================================================
84
89struct HP2Module final : virtual ::rack::engine::Module
90{
91
92 //==========================================================================
93
94public:
95
96 //==========================================================================
97
102
107
112
117
118 //==========================================================================
119
125
131
132 //==========================================================================
133
134private:
135
136 //==========================================================================
137
140};
141
142//==============================================================================
143
149{
150
151 //==========================================================================
152
153public:
154
155 using DrawArgs = ::rack::widget::Widget::DrawArgs;
156
157 //==========================================================================
158
164
170
171 //==========================================================================
172
177 virtual void step() override;
178
186 virtual void draw(const ::StoneyDSP::StoneyVCV::HP2::HP2Widget::DrawArgs& args) override;
187
188 //==========================================================================
189
190private:
191
192 //==========================================================================
193
198 ::rack::widget::FramebufferWidget *hp2WidgetFrameBuffer;
199
204 ::rack::app::PanelBorder *panelBorder;
205
206 //==========================================================================
207
210};
211
212//==============================================================================
213
218struct HP2ModuleWidget final : virtual ::rack::app::ModuleWidget
219{
220
221 //==========================================================================
222
223public:
224
225 //==========================================================================
226
234
240
241 //==========================================================================
242
247 virtual void step() override;
248
249 //==========================================================================
250
251private:
252
253 //==========================================================================
254
258 const ::rack::math::Vec size;
259
263 ::rack::app::ThemedSvgPanel* panel;
264
269 ::StoneyDSP::StoneyVCV::HP2::HP2Widget* hp2Widget;
270
275 ::rack::widget::FramebufferWidget* hp2ModuleWidgetFrameBuffer;
276
277 //==========================================================================
278
283 const ::std::array<::rack::math::Vec, 4> screwsPositions;
284
289 const ::std::array<::rack::componentlibrary::ThemedScrew *, 4> screws;
290
291
292 //==========================================================================
293
298 bool lastPrefersDarkPanels;
299
300 //==========================================================================
301
304};
305
306//==============================================================================
307
319 ::std::string name = "",
320 ::std::string description = "",
321 ::std::string manualUrl = "",
322 bool hidden = true
323) noexcept(false); // STONEYDSP_NOEXCEPT(false);
324
325//==============================================================================
326
328} // namespace HP2
329
330//==============================================================================
331
333} // namespace StoneyVCV
334
335//==============================================================================
336
338} // namespace StoneyDSP
339
340//==============================================================================
341
342#endif // defined (STONEYVCV_BUILD_HP2)
343
344//==============================================================================
StoneyDSP Modules for VCV Rack 2.
StoneyDSP Modules for VCV Rack 2.
::rack::plugin::Model * createModelHP2(::std::string name="", ::std::string description="", ::std::string manualUrl="", bool hidden=true) noexcept(false)
The StoneyDSP namespace.
Definition StoneyVCV.hpp:78
StoneyDSP Modules for VCV Rack 2.
Definition StoneyVCV.hpp:125
The HP2ModuleWidget struct.
Definition HP2.hpp:219
HP2ModuleWidget(::StoneyDSP::StoneyVCV::HP2::HP2Module *module)
Construct a new HP2ModuleWidget object.
virtual ~HP2ModuleWidget() noexcept
Destroys the HP2ModuleWidget object.
The HP2Module struct.
Definition HP2.hpp:90
@ NUM_LIGHTS
Number of Lights.
Definition HP2.hpp:115
virtual ~HP2Module() noexcept
Destroys the HP2Module object.
HP2Module()
Construct a new HP2Module object.
IdxOutputs
Definition HP2.hpp:108
@ NUM_OUTPUTS
Number of Output ports.
Definition HP2.hpp:110
@ NUM_INPUTS
Number of Input ports.
Definition HP2.hpp:105
@ NUM_PARAMS
Number of Parameters.
Definition HP2.hpp:100
The HP2Widget struct.
Definition HP2.hpp:149
::rack::widget::Widget::DrawArgs DrawArgs
Definition HP2.hpp:155
virtual ~HP2Widget() noexcept
Destroys the HP2Widget object.
HP2Widget()
Construct a new HP2Widget object.