21#include <pluginterfaces/base/ftypes.h>
22#include <pluginterfaces/vst/ivstmessage.h>
25#include <public.sdk/source/vst/vstpresetfile.h>
35using namespace Steinberg;
36using namespace Steinberg::Vst;
60 inline int64
getInt(IAttributeList::AttrID
id, int64 defaultValue)
const
63 if(
fMessage->getAttributes()->getInt(
id, value) != kResultOk)
68 inline void setInt(IAttributeList::AttrID
id, int64 value)
70 fMessage->getAttributes()->setInt(
id, value);
73 inline double getFloat(IAttributeList::AttrID
id,
double defaultValue)
const
76 if(
fMessage->getAttributes()->getFloat(
id, value) != kResultOk)
81 inline void setFloat(IAttributeList::AttrID
id,
double value)
83 fMessage->getAttributes()->setFloat(
id, value);
94 inline tresult
setBinary(IAttributeList::AttrID
id,
const T *iData, uint32 iSize)
96 return fMessage->getAttributes()->setBinary(
id, iData, iSize *
sizeof(T));
108 inline int32
getBinary(IAttributeList::AttrID
id, T *iData, uint32 iSize)
const;
137 if(
fMessage->getAttributes()->getBinary(
id, data, size) != kResultOk)
140 uint32 oSize = size /
sizeof(T);
141 oSize = std::min(iSize, oSize);
143 memcpy(iData, data, oSize *
sizeof(T));
156 IBStreamer streamer{&stream};
175 tresult res =
fMessage->getAttributes()->getBinary(
id, data, size);
181 stream.
seek(IBStream::kIBSeekSet, 0,
nullptr);
183 IBStreamer streamer{&stream};
A vst parameter is represented by a ParamValue type which is a double in the range [0,...
Definition ParamSerializers.h:109
virtual tresult readFromStream(IBStreamer &iStreamer, ParamType &oValue) const
This method should read from the stream and populate oValue accordingly (aka deserialization).
Definition ParamSerializers.h:117
virtual tresult writeToStream(const ParamType &iValue, IBStreamer &oStreamer) const
This method should write iValue to the stream (aka serialization).
Definition ParamSerializers.h:123
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:152
Message(IMessage *message)
Definition Messaging.h:48
MessageID getMessageID() const
Definition Messaging.h:50
tresult setBinary(IAttributeList::AttrID id, const T *iData, uint32 iSize)
Sets a binary message.
Definition Messaging.h:94
IMessage * fMessage
Definition Messaging.h:125
double getFloat(IAttributeList::AttrID id, double defaultValue) const
Definition Messaging.h:73
void setFloat(IAttributeList::AttrID id, double value)
Definition Messaging.h:81
int32 getBinary(IAttributeList::AttrID id, T *iData, uint32 iSize) const
Gets a binary message.
Definition Messaging.h:132
void setInt(IAttributeList::AttrID id, int64 value)
Definition Messaging.h:68
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:170
int64 getInt(IAttributeList::AttrID id, int64 defaultValue) const
Definition Messaging.h:60
void setMessageID(MessageID messageID)
Definition Messaging.h:55
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:38
int MessageID
Definition Messaging.h:40