iPlug2 - C++ Audio Plug-in Framework
|
Manages a block of memory, for plug-in settings store/recall. More...
#include <IPlugStructs.h>
Public Member Functions | |
int | PutBytes (const void *pSrc, int nBytesToCopy) |
Copies data into the chunk, placing it at the end, resizing if necessary. More... | |
int | GetBytes (void *pDst, int nBytesToCopy, int startPos) const |
Copy raw bytes from the IByteChunk, returning the new position for subsequent calls. More... | |
template<class T > | |
int | Put (const T *pVal) |
Copies arbitary typed data into the IByteChunk. More... | |
template<class T > | |
int | Get (T *pDst, int startPos) const |
Get arbitary typed data from the IByteChunk. More... | |
int | PutStr (const char *str) |
Put a string into the IByteChunk. More... | |
int | GetStr (WDL_String &str, int startPos) const |
Get a string from the IByteChunk. More... | |
int | PutChunk (const IByteChunk *pRHS) |
Put another IByteChunk into this one. More... | |
void | Clear () |
Clears the chunk (resizes to 0) More... | |
int | Size () const |
Returns the current size of the chunk. More... | |
int | Resize (int newSize) |
Resizes the chunk. More... | |
uint8_t * | GetData () |
Gets a ptr to the chunk data. More... | |
const uint8_t * | GetData () const |
Gets a const ptr to the chunk data. More... | |
bool | IsEqual (IByteChunk &otherChunk) const |
Compares the size & values of the data of another chunk with this one. More... | |
Static Public Member Functions | |
static void | InitChunkWithIPlugVer (IByteChunk &chunk) |
This method is used in order to place the IPlug version number in the chunk when serialising data. More... | |
static int | GetIPlugVerFromChunk (const IByteChunk &chunk, int &position) |
Helper method to retrieve the IPlug version number from the beginning of the byte chunk. More... | |
Manages a block of memory, for plug-in settings store/recall.
Definition at line 111 of file IPlugStructs.h.
|
inline |
Definition at line 114 of file IPlugStructs.h.
|
inline |
Definition at line 115 of file IPlugStructs.h.
|
inline |
Clears the chunk (resizes to 0)
Definition at line 214 of file IPlugStructs.h.
Referenced by IPluginBase::CopyPreset(), InitChunkWithIPlugVer(), IPluginBase::ModifyCurrentPreset(), and IPluginBase::UnserializePresets().
|
inline |
Get arbitary typed data from the IByteChunk.
T | The type of data to be extracted |
pDst | Ptr to the destination where the data will be extracted |
startPos | The starting position in bytes in the chunk |
Definition at line 181 of file IPlugStructs.h.
References GetBytes().
Referenced by IByteChunkReader::Get(), GetIPlugVerFromChunk(), IPluginBase::LoadBankFromFXB(), IPluginBase::LoadPresetFromFXP(), IPluginBase::SaveBankAsFXB(), IGEditorDelegate::UnserializeEditorSize(), IPluginBase::UnserializeParams(), and IPluginBase::UnserializePresets().
|
inline |
Copy raw bytes from the IByteChunk, returning the new position for subsequent calls.
pDst | The destination buffer |
nBytesToCopy | The number of bytes to copy from the chunk |
startPos | The starting position in bytes in the chunk |
Definition at line 160 of file IPlugStructs.h.
References IByteGetter::GetBytes(), and Size().
Referenced by Get(), IByteChunkReader::GetBytes(), IPluginBase::LoadBankFromFXB(), and IPluginBase::LoadPresetFromFXP().
|
inline |
Gets a ptr to the chunk data.
Definition at line 242 of file IPlugStructs.h.
Referenced by IPluginBase::DumpPresetBlob(), IPluginBase::LoadBankFromFXB(), IPluginBase::LoadPresetFromFXP(), IPluginBase::MakePresetFromBlob(), PutChunk(), IPluginBase::SaveBankAsFXB(), and IPluginBase::SavePresetAsFXP().
|
inline |
Gets a const ptr to the chunk data.
Definition at line 249 of file IPlugStructs.h.
|
inlinestatic |
Helper method to retrieve the IPlug version number from the beginning of the byte chunk.
chunk | The incoming byte chunk that contains the version number |
position | The position (in bytes) to start looking |
Definition at line 132 of file IPlugStructs.h.
References Get().
Referenced by IPluginBase::LoadBankFromFXB(), and IPluginBase::LoadPresetFromFXP().
|
inline |
Get a string from the IByteChunk.
str | WDL_String to fill |
startPos | The starting position in bytes in the chunk |
Definition at line 200 of file IPlugStructs.h.
References IByteGetter::GetStr(), and Size().
Referenced by IByteChunkReader::GetStr(), and IPluginBase::UnserializePresets().
|
inlinestatic |
This method is used in order to place the IPlug version number in the chunk when serialising data.
In theory this is for backwards compatibility.
chunk | reference to the chunk where the version number will be placed |
Definition at line 119 of file IPlugStructs.h.
References Clear(), and Put().
Referenced by IPluginBase::SaveBankAsFXB(), and IPluginBase::SavePresetAsFXP().
|
inline |
Compares the size & values of the data of another chunk with this one.
otherChunk | The chunk to compare with |
true
if the chunks are equal Definition at line 257 of file IPlugStructs.h.
References Size().
|
inline |
Copies arbitary typed data into the IByteChunk.
T | The type of data to be stored |
pVal | Ptr to the data to be stored |
Definition at line 170 of file IPlugStructs.h.
References PutBytes().
Referenced by InitChunkWithIPlugVer(), IPluginBase::MakePreset(), PutStr(), IPluginBase::SaveBankAsFXB(), IPluginBase::SavePresetAsFXP(), IGEditorDelegate::SerializeEditorSize(), IPluginBase::SerializeParams(), and IPluginBase::SerializePresets().
|
inline |
Copies data into the chunk, placing it at the end, resizing if necessary.
pSrc | Pointer to the data to copy |
nBytesToCopy | Number of bytes to copy |
Definition at line 147 of file IPlugStructs.h.
Referenced by Put(), PutChunk(), PutStr(), IPluginBase::SaveBankAsFXB(), and IPluginBase::SavePresetAsFXP().
|
inline |
Put another IByteChunk into this one.
pRHS | Ptr to the IByteChunk to copy in |
Definition at line 208 of file IPlugStructs.h.
References GetData(), PutBytes(), and Size().
Referenced by IPluginBase::CopyPreset(), IPluginBase::MakePresetFromChunk(), and IPluginBase::SerializePresets().
|
inline |
Put a string into the IByteChunk.
str | CString to insert into the chunk |
Definition at line 189 of file IPlugStructs.h.
References Put(), and PutBytes().
Referenced by IPluginBase::SerializePresets().
|
inline |
Resizes the chunk.
newSize | Desired size (in bytes) |
Definition at line 229 of file IPlugStructs.h.
Referenced by IPluginBase::LoadBankFromFXB(), IPluginBase::LoadPresetFromFXP(), and IPluginBase::MakePresetFromBlob().
|
inline |
Returns the current size of the chunk.
Definition at line 221 of file IPlugStructs.h.
Referenced by IPluginBase::DumpPresetBlob(), GetBytes(), GetStr(), IsEqual(), PutChunk(), IPluginBase::SaveBankAsFXB(), and IPluginBase::SavePresetAsFXP().