From e81a1f91e234f41dd8d9cb2ef7f4ecdc32f6b4ed Mon Sep 17 00:00:00 2001 From: Xaymar Date: Fri, 8 Aug 2025 01:24:10 +0200 Subject: [PATCH] Host 0x1E: Request a resize of the window containing our custom editor The host is not required to accept our request and may ignore it. --- vst.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/vst.h b/vst.h index 71e630a..7f631fa 100644 --- a/vst.h +++ b/vst.h @@ -625,7 +625,20 @@ enum VST_HOST_OPCODE { VST_HOST_OPCODE_0E = 0x0E, + /** Request that the host changes the size of the containing window. + * + * @note (VST 2.x) Available from VST 2.0 onwards. + * @sa vst_host_supports_t.sizeWindow + * + * @param p_int1 Width (in pixels) that we'd like to have. + * @param p_int2 Height (in pixels) that we'd like to have. + * @param p_ptr Must be zero'd. + * @param p_float Must be zero'd. + * @return @ref VST_STATUS_TRUE if change was accepted, anything else if not. Do not rely on the return code being 0. + */ VST_HOST_OPCODE_0F = 0x0F, + /** @sa VST_HOST_OPCODE_0F */ + VST_HOST_OPCODE_EDITOR_RESIZE = 0x0F, VST_HOST_OPCODE_10 = 0x10, @@ -785,6 +798,13 @@ struct vst_host_supports_t { */ const char* shellCategory; + /** Can we request that the host changes the editor window size? + * + * @note (VST 2.0+) Available from VST 2.0 onwards. + * @sa VST_HOST_OPCODE_EDITOR_RESIZE + */ + const char* sizeWindow; + const char* sendVstEvents; const char* receiveVstEvents; @@ -794,7 +814,7 @@ struct vst_host_supports_t { const char* sendVstTimeInfo; const char* reportConnectionChanges; // Seems related to speakers? - const char* sizeWindow; + const char* offline; const char* openFileSelector; @@ -803,6 +823,7 @@ struct vst_host_supports_t { .acceptIOChanges = "acceptIOChanges", .startStopProcess = "startStopProcess", .shellCategory = "shellCategory", + .sizeWindow = "sizeWindow", .sendVstEvents = "sendVstEvents", .receiveVstEvents = "receiveVstEvents", .sendVstMidiEvent = "sendVstMidiEvent", @@ -810,7 +831,6 @@ struct vst_host_supports_t { .sendVstMidiEventFlagIsRealtime = "sendVstMidiEventFlagIsRealtime", .sendVstTimeInfo = "sendVstTimeInfo", .reportConnectionChanges = "reportConnectionChanges", - .sizeWindow = "sizeWindow", .offline = "offline", .openFileSelector = "openFileSelector", .closeFileSelector = "closeFileSelector",