21#include <pluginterfaces/base/ftypes.h>
22#include <pluginterfaces/vst/ivstmessage.h>
24#include <public.sdk/source/vst/vstpresetfile.h>
32using namespace Steinberg;
33using namespace Steinberg::Vst;
57 int64
getInt(IAttributeList::AttrID
id, int64 defaultValue)
const
60 if(
fMessage->getAttributes()->getInt(
id, value) != kResultOk)
65 void setInt(IAttributeList::AttrID
id, int64 value)
67 fMessage->getAttributes()->setInt(
id, value);
70 double getFloat(IAttributeList::AttrID
id,
double defaultValue)
const
73 if(
fMessage->getAttributes()->getFloat(
id, value) != kResultOk)
78 void setFloat(IAttributeList::AttrID
id,
double value)
80 fMessage->getAttributes()->setFloat(
id, value);
91 tresult
setBinary(IAttributeList::AttrID
id,
const T *iData, uint32 iSize)
93 return fMessage->getAttributes()->setBinary(
id, iData, iSize *
sizeof(T));
105 int32
getBinary(IAttributeList::AttrID
id, T *iData, uint32 iSize)
const;
134 if(
fMessage->getAttributes()->getBinary(
id, data, size) != kResultOk)
137 uint32 oSize = size /
sizeof(T);
138 oSize = std::min(iSize, oSize);
140 memcpy(iData, data, oSize *
sizeof(T));
153 IBStreamer streamer{&stream};
172 tresult res =
fMessage->getAttributes()->getBinary(
id, data, size);
178 stream.
seek(IBStream::kIBSeekSet, 0,
nullptr);
180 IBStreamer streamer{&stream};
A vst parameter is represented by a ParamValue type which is a double in the range [0,...
Definition ParamSerializers.h:111
virtual tresult readFromStream(IBStreamer &iStreamer, ParamType &oValue) const
This method should read from the stream and populate oValue accordingly (aka deserialization).
Definition ParamSerializers.h:122
virtual tresult writeToStream(const ParamType &iValue, IBStreamer &oStreamer) const
This method should write iValue to the stream (aka serialization).
Definition ParamSerializers.h:128
tresult setSerializableValue(IAttributeList::AttrID id, IParamSerializer< T > const &iSerializer, T const &iValue)
Serializes the parameter value as an entry in the message.
Definition Messaging.h:149
Message(IMessage *message)
Definition Messaging.h:45
MessageID getMessageID() const
Definition Messaging.h:47
tresult setBinary(IAttributeList::AttrID id, const T *iData, uint32 iSize)
Sets a binary message.
Definition Messaging.h:91
IMessage * fMessage
Definition Messaging.h:122
double getFloat(IAttributeList::AttrID id, double defaultValue) const
Definition Messaging.h:70
void setFloat(IAttributeList::AttrID id, double value)
Definition Messaging.h:78
int32 getBinary(IAttributeList::AttrID id, T *iData, uint32 iSize) const
Gets a binary message.
Definition Messaging.h:129
void setInt(IAttributeList::AttrID id, int64 value)
Definition Messaging.h:65
tresult getSerializableValue(IAttributeList::AttrID id, IParamSerializer< T > const &iSerializer, T &oValue) const
Deserializes the parameter value from an entry in the message.
Definition Messaging.h:167
int64 getInt(IAttributeList::AttrID id, int64 defaultValue) const
Definition Messaging.h:57
void setMessageID(MessageID messageID)
Definition Messaging.h:52
This class is a copy of MemoryStream for the purpose of fixing the growing issue encountered on Windo...
Definition FastWriteMemoryStream.h:43
TSize getSize() const
Definition FastWriteMemoryStream.h:56
char const * getData() const
Definition FastWriteMemoryStream.h:60
Definition ReadOnlyMemoryStream.h:30
virtual tresult PLUGIN_API seek(int64 pos, int32 mode, int64 *result) SMTG_OVERRIDE
Definition ReadOnlyMemoryStream.cpp:88
static const auto ATTR_MSG_ID
Definition Messaging.h:35
int MessageID
Definition Messaging.h:37