|
3 | 3 | */ |
4 | 4 |
|
5 | 5 | #include "DistrhoUI.hpp" |
| 6 | +#ifdef DISTRHO_OS_WASM |
| 7 | +#include "DistrhoStandaloneUtils.hpp" |
| 8 | +#endif |
6 | 9 | #include "ResizeHandle.hpp" |
7 | 10 | #include "veramobd.hpp" |
8 | 11 | #include "wstdcolors.hpp" |
@@ -96,6 +99,9 @@ class ImGuiPluginUI : public UI |
96 | 99 | const float width = getWidth(); |
97 | 100 | const float height = getHeight(); |
98 | 101 | const float margin = 0.0f; |
| 102 | + #ifdef DISTRHO_OS_WASM |
| 103 | + static bool inputActive = false; |
| 104 | + #endif |
99 | 105 |
|
100 | 106 | ImGui::SetNextWindowPos(ImVec2(margin, margin)); |
101 | 107 | ImGui::SetNextWindowSize(ImVec2(width - 2 * margin, height - 2 * margin)); |
@@ -136,6 +142,25 @@ class ImGuiPluginUI : public UI |
136 | 142 | { |
137 | 143 | ImGui::Dummy(ImVec2(0.0f, 8.0f * getScaleFactor())); |
138 | 144 | 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 | + |
139 | 164 | auto ImGuiKnob_Flags = ImGuiKnobFlags_DoubleClickReset + ImGuiKnobFlags_ValueTooltip + ImGuiKnobFlags_NoInput + ImGuiKnobFlags_ValueTooltipHideOnClick; |
140 | 165 | auto ImGuiKnob_FlagsDB = ImGuiKnob_Flags + ImGuiKnobFlags_dB; |
141 | 166 | auto ImGuiKnob_FlagsLog = ImGuiKnob_Flags + ImGuiKnobFlags_Logarithmic; |
|
0 commit comments