17 #ifndef DISTRHO_UI_HPP_INCLUDED
18 #define DISTRHO_UI_HPP_INCLUDED
20 #include "extra/LeakDetector.hpp"
21 #include "src/DistrhoPluginChecks.h"
27 # include "OpenGL.hpp"
30 # include "Vulkan.hpp"
33 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
34 # include "../dgl/Base.hpp"
35 # include "extra/ExternalWindow.hpp"
36 typedef DISTRHO_NAMESPACE::ExternalWindow UIWidget;
37 #elif DISTRHO_UI_USE_CUSTOM
38 # include DISTRHO_UI_CUSTOM_INCLUDE_PATH
40 #elif DISTRHO_UI_USE_CAIRO
41 # include "../dgl/Cairo.hpp"
42 typedef DGL_NAMESPACE::CairoTopLevelWidget UIWidget;
43 #elif DISTRHO_UI_USE_NANOVG
44 # include "../dgl/NanoVG.hpp"
45 typedef DGL_NAMESPACE::NanoTopLevelWidget UIWidget;
47 # include "../dgl/TopLevelWidget.hpp"
48 typedef DGL_NAMESPACE::TopLevelWidget UIWidget;
55 START_NAMESPACE_DISTRHO
71 class UI :
public UIWidget
78 UI(uint width = 0, uint height = 0);
145 #if DISTRHO_PLUGIN_WANT_STATE
150 void setState(
const char* key,
const char* value);
153 #if DISTRHO_PLUGIN_WANT_STATEFILES
163 bool requestStateFile(
const char* key);
166 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
171 void sendNote(uint8_t channel, uint8_t note, uint8_t velocity);
174 #if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
185 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
203 # if DISTRHO_PLUGIN_HAS_EMBED_UI
223 #if DISTRHO_PLUGIN_WANT_PROGRAMS
231 #if DISTRHO_PLUGIN_WANT_STATE
236 virtual void stateChanged(
const char* key,
const char* value) = 0;
248 #if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI
258 virtual void uiIdle() {}
266 virtual void uiFocus(
bool focus, DGL_NAMESPACE::CrossingMode mode);
278 virtual void uiReshape(uint width, uint height);
287 virtual void uiScaleFactorChanged(
double scaleFactor);
289 # ifndef DGL_FILE_BROWSER_DISABLED
299 virtual void uiFileBrowserSelected(
const char* filename);
310 void onResize(
const ResizeEvent& ev)
override;
317 PrivateData*
const uiData;
318 friend class DGL_NAMESPACE::PluginWindow;
319 friend class UIExporter;
321 DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(
UI)
344 END_NAMESPACE_DISTRHO
346 #endif // DISTRHO_UI_HPP_INCLUDED
static double getNextScaleFactor() noexcept
virtual void stateChanged(const char *key, const char *value)=0
uint getForegroundColor() const noexcept
virtual void programLoaded(uint32_t index)=0
uint getBackgroundColor() const noexcept
void setParameterValue(uint32_t index, float value)
bool isResizable() const noexcept
Definition: DistrhoUI.hpp:71
void sendNote(uint8_t channel, uint8_t note, uint8_t velocity)
static const char * getNextBundlePath() noexcept
double getSampleRate() const noexcept
UI(uint width=0, uint height=0)
void editParameter(uint32_t index, bool started)
#define DISTRHO_UI_CUSTOM_WIDGET_TYPE
Definition: DistrhoInfo.hpp:594
virtual void sampleRateChanged(double newSampleRate)
void * getPluginInstancePointer() const noexcept
static uintptr_t getNextWindowId() noexcept
void setState(const char *key, const char *value)
virtual void parameterChanged(uint32_t index, float value)=0