clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit a1f991f0765cb82918400a5886273ac9e77f68ab
parent a0f64d6779cd5c8375ab607f50deb123be19f78a
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date:   Mon,  4 Apr 2022 10:17:00 +0200

rework gui->set_scale()

Diffstat:
Minclude/clap/ext/gui.h | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/clap/ext/gui.h b/include/clap/ext/gui.h @@ -50,7 +50,7 @@ static CLAP_CONSTEXPR const char CLAP_EXT_GUI[] = "clap.gui"; // embed using https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setparent static const CLAP_CONSTEXPR char CLAP_WINDOW_API_WIN32[] = "win32"; -// uses logical size +// uses logical size, don't call clap_plugin_gui->set_scale() static const CLAP_CONSTEXPR char CLAP_WINDOW_API_COCOA[] = "cocoa"; // uses physical size @@ -117,12 +117,13 @@ typedef struct clap_plugin_gui { void (*destroy)(const clap_plugin_t *plugin); // Set the absolute GUI scaling factor, and override any OS info. + // Should not be used if the windowing api relies upon logical pixels. + // // If the plugin prefers to work out the scaling factor itself by querying the OS directly, - // then return false and ignore the call. + // then ignore the call. // - // Return true on success. - // [main-thread,optional] - bool (*set_scale)(const clap_plugin_t *plugin, double scale); + // [main-thread] + void (*set_scale)(const clap_plugin_t *plugin, double scale); // Get the current size of the plugin UI. // clap_plugin_gui->create() must have been called prior to asking the size.