Skip to content

Commit f858b45

Browse files
committed
add wasm code
1 parent c3a1b38 commit f858b45

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

override/HeavyDPF_WSTD_EQ_UI.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
*/
44

55
#include "DistrhoUI.hpp"
6+
#ifdef DISTRHO_OS_WASM
7+
#include "DistrhoStandaloneUtils.hpp"
8+
#endif
69
#include "ResizeHandle.hpp"
710
#include "veramobd.hpp"
811
#include "wstdcolors.hpp"
@@ -96,6 +99,9 @@ class ImGuiPluginUI : public UI
9699
const float width = getWidth();
97100
const float height = getHeight();
98101
const float margin = 0.0f;
102+
#ifdef DISTRHO_OS_WASM
103+
static bool inputActive = false;
104+
#endif
99105

100106
ImGui::SetNextWindowPos(ImVec2(margin, margin));
101107
ImGui::SetNextWindowSize(ImVec2(width - 2 * margin, height - 2 * margin));
@@ -136,6 +142,25 @@ class ImGuiPluginUI : public UI
136142
{
137143
ImGui::Dummy(ImVec2(0.0f, 8.0f * getScaleFactor()));
138144
ImGui::PushFont(defaultFont);
145+
146+
#ifdef DISTRHO_OS_WASM
147+
if (!inputActive)
148+
{
149+
ImGui::OpenPopup("Activate");
150+
}
151+
152+
if (ImGui::BeginPopupModal("Activate", nullptr, ImGuiWindowFlags_NoResize + ImGuiWindowFlags_NoMove))
153+
{
154+
if (ImGui::Button("OK", ImVec2(80, 0)))
155+
{
156+
requestAudioInput();
157+
inputActive = true;
158+
ImGui::CloseCurrentPopup();
159+
}
160+
ImGui::EndPopup();
161+
}
162+
#endif
163+
139164
auto ImGuiKnob_Flags = ImGuiKnobFlags_DoubleClickReset + ImGuiKnobFlags_ValueTooltip + ImGuiKnobFlags_NoInput + ImGuiKnobFlags_ValueTooltipHideOnClick;
140165
auto ImGuiKnob_FlagsDB = ImGuiKnob_Flags + ImGuiKnobFlags_dB;
141166
auto ImGuiKnob_FlagsLog = ImGuiKnob_Flags + ImGuiKnobFlags_Logarithmic;

0 commit comments

Comments
 (0)