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;
51 START_NAMESPACE_DISTRHO
67 class UI :
public UIWidget
74 UI(uint width = 0, uint height = 0);
141 #if DISTRHO_PLUGIN_WANT_STATE
146 void setState(
const char* key,
const char* value);
149 #if DISTRHO_PLUGIN_WANT_STATEFILES
159 bool requestStateFile(
const char* key);
162 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
167 void sendNote(uint8_t channel, uint8_t note, uint8_t velocity);
170 #if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
181 #if DISTRHO_PLUGIN_HAS_EXTERNAL_UI
199 # if DISTRHO_PLUGIN_HAS_EMBED_UI
219 #if DISTRHO_PLUGIN_WANT_PROGRAMS
227 #if DISTRHO_PLUGIN_WANT_STATE
232 virtual void stateChanged(
const char* key,
const char* value) = 0;
244 #if !DISTRHO_PLUGIN_HAS_EXTERNAL_UI
254 virtual void uiIdle() {}
262 virtual void uiFocus(
bool focus, DGL_NAMESPACE::CrossingMode mode);
274 virtual void uiReshape(uint width, uint height);
283 virtual void uiScaleFactorChanged(
double scaleFactor);
285 # ifndef DGL_FILE_BROWSER_DISABLED
295 virtual void uiFileBrowserSelected(
const char* filename);
306 void onResize(
const ResizeEvent& ev)
override;
313 PrivateData*
const uiData;
314 friend class PluginWindow;
315 friend class UIExporter;
317 DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(
UI)
340 END_NAMESPACE_DISTRHO
342 #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:67
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