vst3_uid.h
A VST3 class id, between its bytes and its text.
#include <sonore/vst3_uid.h>- 5other declarations
- Guides: Getting started, Platforms and formats
On this page
Design notes
A VST3 class is named by 16 bytes, and everything a person or another program sees of it is 32 hex characters: a DAW's session, a .vstpreset's header, Steinberg's FUID::toString. On macOS and Linux the text is the bytes in order. On Windows the VST3 SDK is built COM-compatible, and SMTG_INLINE_UID stores a GUID's first three fields -- 4, 2 and 2 bytes -- little-endian, the way COM's GUID struct does. So a class declared with one GUID has DIFFERENT bytes on the two platforms and the SAME text, and the text is what a session carries from one to the other.
Ours were the same bytes on both, which made the text differ: a session saved on Windows named a class a Mac build of the same plugin did not answer to. Every id here is now worked out in the GUID's own order and stored the way the VST3 SDK stores it on the platform -- the bytes vst3_c_api.h's own SMTG_INLINE_UID produces, which the tests compare against -- and turned into text through the same rule, so a .vstpreset another host wrote for a plugin matches it.
Functions 4
- fn
inline void swapComFields(uint8_t b[16])The three leading fields swapped between a GUID's own order and COM's. Its own inverse.vst3uid::swapComFields · vst3_uid.h:42 - fn
inline void canonicalToNative(const uint8_t canonical[16], uint8_t native[16])The bytes this platform's VST3 SDK stores for a GUID given in its own (text) order.vst3uid::canonicalToNative · vst3_uid.h:51 - fn
inline void nativeToCanonical(const uint8_t native[16], uint8_t canonical[16])The GUID's own order from the bytes this platform's VST3 SDK stores.vst3uid::nativeToCanonical · vst3_uid.h:57 - fn
inline std::string toText(const void* nativeBytes)FUID::toString: 32 upper-case hex digits of the GUID's own order -- the same text for the same class on every platform.vst3uid::toText · vst3_uid.h:64
Constants 1
- const
constexpr bool kComOrder = …Whether this platform's VST3 SDK stores ids COM-compatible: the rule vst3_c_api.h applies, _WIN32.vst3uid::kComOrder · vst3_uid.h:33