From 899315f481802a58565cc5681461cadac663ca9b Mon Sep 17 00:00:00 2001 From: Xaymar Date: Fri, 8 Aug 2025 01:24:10 +0200 Subject: [PATCH] Host 0x1F/0x31: Query current input/output speaker arrangement Seems to be completely unsupported in VST 2.4 hosts and all prior hosts seem to just return the exact data we output from VST_EFFECT_OPCODE_GET_SPEAKER_ARRANGEMENT. --- vst.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/vst.h b/vst.h index 79f375c..be079eb 100644 --- a/vst.h +++ b/vst.h @@ -920,7 +920,22 @@ enum VST_HOST_OPCODE { VST_HOST_OPCODE_1E = 0x1E, + /** Retrieve the hosts output speaker arrangement. + * Seems to always reply with the data provided in @ref VST_EFFECT_OPCODE_GET_SPEAKER_ARRANGEMENT p_ptr. + * + * @note (VST 2.3+) Available from VST 2.3 onwards. + * @deprecated (VST 2.4+) Deprecated from VST 2.4 onwards. + * @sa vst_speaker_arrangement_t + * @sa VST_EFFECT_OPCODE_SET_SPEAKER_ARRANGEMENT + * @sa VST_EFFECT_OPCODE_GET_SPEAKER_ARRANGEMENT + * @sa VST_HOST_OPCODE_GET_INPUT_SPEAKER_ARRANGEMENT + * @return Seems to be a valid pointer to @ref vst_speaker_arrangement_t if supported. + */ VST_HOST_OPCODE_1F = 0x1F, + /** @sa VST_HOST_OPCODE_1F */ + VST_HOST_OPCODE_GET_OUTPUT_SPEAKER_ARRANGEMENT = 0x1F, + /** @sa VST_HOST_OPCODE_1F */ + VST_HOST_OPCODE_OUTPUT_GET_SPEAKER_ARRANGEMENT = 0x1F, /** Retrieve the vendor name into the ptr buffer. * @@ -1035,6 +1050,39 @@ enum VST_HOST_OPCODE { VST_HOST_OPCODE_2E = 0x2E, VST_HOST_OPCODE_2F = 0x2F, + /** + * When queried by the plug-in shortly after @ref VST_EFFECT_OPCODE_PROGRAM_LOAD it often crashes compatible hosts + * with a memory access exception. This exception can be controlled with p_ptr but it's unclear what that is + * pointing at so far. In the event that it doesn't crash the memory address we pointed at changes to a path. + * + * @todo Figure out what p_ptr is. + * @note (VST 2.2+) Available from VST 2.2 onwards. + * @deprecated (VST 2.4+) Deprecated from VST 2.4 onwards. + * @param p_ptr A pointer to something + */ + VST_HOST_OPCODE_30 = 0x30, + + //-------------------------------------------------------------------------------- + // VST 2.3 + //-------------------------------------------------------------------------------- + + /** Retrieve the hosts input speaker arrangement. + * Seems to always reply with the data provided in @ref VST_EFFECT_OPCODE_GET_SPEAKER_ARRANGEMENT p_int2. + * + * @note (VST 2.3+) Available from VST 2.3 onwards. + * @deprecated (VST 2.4+) Deprecated from VST 2.4 onwards. + * @sa vst_speaker_arrangement_t + * @sa VST_EFFECT_OPCODE_SET_SPEAKER_ARRANGEMENT + * @sa VST_EFFECT_OPCODE_GET_SPEAKER_ARRANGEMENT + * @sa VST_HOST_OPCODE_GET_OUTPUT_SPEAKER_ARRANGEMENT + * @return Seems to be a valid pointer to @ref vst_speaker_arrangement_t if supported. + */ + VST_HOST_OPCODE_31 = 0x31, + /** @sa VST_HOST_OPCODE_31 */ + VST_HOST_OPCODE_GET_INPUT_SPEAKER_ARRANGEMENT = 0x31, + /** @sa VST_HOST_OPCODE_31 */ + VST_HOST_OPCODE_INPUT_GET_SPEAKER_ARRANGEMENT = 0x31, + // Highest number of known OPCODE. VST_HOST_OPCODE_MAX,