VST 3 Interfaces  VST 3.7
SDK for developing VST plug-in
[3.6.0] Preset Meta-Information Support

Meta attributes of a stream: Vst::IStreamAttributes.

  • [host imp]
  • [extends IBStream]
  • [released: 3.6.0]
  • [optional]

Interface to access preset meta information from stream, used, for example, in setState in order to inform the plug-in about the current context in which the preset loading occurs (Project context or Preset load (see StateType)) or used to get the full file path of the loaded preset (if available).

//------------------------------------------------------------------------
...
tresult PLUGIN_API MyPlugin::setState (IBStream* state)
{
FUnknownPtr<IStreamAttributes> stream (state);
if (stream)
{
IAttributeList* list = stream->getAttributes ();
if (list)
{
// get the current type (project/Default..) of this state
String128 string;
if (list->getString (PresetAttributes::kStateType, string, 128 * sizeof (TChar)) == kResultTrue)
{
UString128 tmp (string);
char ascii[128];
tmp.toAscii (ascii, 128);
if (!strncmp (ascii, StateType::kProject, strlen (StateType::kProject)))
{
// we are in project loading context...
}
}
// get the full file path of this state
TChar fullPath[1024];
if (list->getString (PresetAttributes::kFilePathStringType, fullPath, 1024 * sizeof (TChar)) == kResultTrue)
{
// here we have the full path ...
}
}
}
//...read the state here.....
return kResultTrue;
}



Back to Contents

vstpresetkeys.h
Steinberg::Vst::StateType::kProject
const CString kProject
the state is restored from a project loading or it is saved in a project
Definition: vstpresetkeys.h:54
UString128
UStringBuffer< 128 > UString128
ustring.h
Steinberg::Vst::String128
TChar String128[128]
128 character UTF-16 string
Definition: vsttypes.h:62
Steinberg::Vst::PresetAttributes::kFilePathStringType
const CString kFilePathStringType
Full file path string (if available) where the preset comes from (be sure to use a bigger string when...
Definition: vstpresetkeys.h:40
kResultTrue
kResultTrue
Steinberg::Vst::TChar
char16 TChar
UTF-16 character.
Definition: vsttypes.h:61
Steinberg::Vst::PresetAttributes::kStateType
const CString kStateType
Type of the given state see StateType : Project / Default Preset or Normal Preset.
Definition: vstpresetkeys.h:39
Empty

Copyright ©2020 Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.