From 287967df7134d3b9e5bd134c6b16884addaeec9f Mon Sep 17 00:00:00 2001 From: Xaymar Date: Fri, 8 Aug 2025 01:24:10 +0200 Subject: [PATCH] Host 0x11/0x12: Current effect sample rate and block size Some hosts can randomly "forget" to send these updates to the effect and that's why we can ask the host for them. Most modern ones though do properly handle all of this. --- vst.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/vst.h b/vst.h index 1f4c8d7..b499958 100644 --- a/vst.h +++ b/vst.h @@ -856,9 +856,27 @@ enum VST_HOST_OPCODE { /** @sa VST_HOST_OPCODE_0F */ VST_HOST_OPCODE_EDITOR_RESIZE = 0x0F, + /** Get the current sample rate the effect should be running at. + * + * @note (VST 2.x) Available from VST 2.0 onwards. + * @sa VST_EFFECT_OPCODE_SET_SAMPLE_RATE + * + * @return The current sample rate in Hertz. + */ VST_HOST_OPCODE_10 = 0x10, + /** @sa VST_HOST_OPCODE_10 */ + VST_HOST_OPCODE_GET_SAMPLE_RATE = 0x10, + /** Get the current block size for the effect. + * + * @note (VST 2.x) Available from VST 2.0 onwards. + * @sa VST_EFFECT_OPCODE_SET_BLOCK_SIZE + * + * @return The current block size in samples. + */ VST_HOST_OPCODE_11 = 0x11, + /** @sa VST_HOST_OPCODE_11 */ + VST_HOST_OPCODE_GET_BLOCK_SIZE = 0x11, VST_HOST_OPCODE_12 = 0x12,