forked from free-audio/clap-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
abstract-gui.hh
56 lines (39 loc) · 1.96 KB
/
abstract-gui.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#include <clap/clap.h>
#include <string>
namespace clap {
class CorePlugin;
class AbstractGuiListener;
class AbstractGui {
public:
AbstractGui(AbstractGuiListener &listener);
virtual ~AbstractGui();
virtual void addImportPath(const std::string& importPath) = 0;
virtual void setSkin(const std::string& skinUrl) = 0;
virtual void defineParameter(const clap_param_info ¶mInfo) = 0;
virtual void updateParameter(clap_id paramId, double value, double modAmount) = 0;
virtual void setParameterMappingIndication(clap_id paramId, bool hasIndication, clap_color color, const char *label, const char *description) = 0;
virtual void setParameterAutomationIndication(clap_id paramId, uint32_t automationState, clap_color color) = 0;
virtual void clearTransport() = 0;
virtual void updateTransport(const clap_event_transport &transport) = 0;
[[nodiscard]] virtual bool openWindow() = 0;
[[nodiscard]] virtual bool attachCocoa(clap_nsview nsView) = 0;
[[nodiscard]] virtual bool attachWin32(clap_hwnd window) = 0;
[[nodiscard]] virtual bool attachX11(clap_xwnd window) = 0;
virtual bool setTransientX11(clap_xwnd window) = 0;
virtual bool setTransientWin32(clap_hwnd window) = 0;
virtual bool setTransientCocoa(clap_nsview nsView) = 0;
[[nodiscard]] virtual bool canResize() = 0;
[[nodiscard]] virtual bool getSize(uint32_t *width, uint32_t *height) = 0;
[[nodiscard]] virtual bool setSize(uint32_t width, uint32_t height) = 0;
[[nodiscard]] virtual bool roundSize(uint32_t *width, uint32_t *height) = 0;
[[nodiscard]] virtual bool setScale(double scale) = 0;
virtual bool show() = 0;
virtual bool hide() = 0;
virtual void destroy() = 0;
AbstractGuiListener& listener() const { return _listener; }
protected:
AbstractGuiListener &_listener;
bool _isTransportSubscribed = false;
};
} // namespace clap