JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Steinberg::Vst::PresetFile Class Reference

Handler for a VST 3 Preset File. More...

#include "vstpresetfile.h"

Classes

struct  Entry
 Internal structure used for chunk handling. More...
 

Public Member Functions

 PresetFile (IBStream *stream)
 Constructor of Preset file based on a stream.
 
IBStreamgetStream () const
 Returns the associated stream.
 
const FUIDgetClassID () const
 Returns the associated classID (component ID: Processor part (not the controller!)).
 
void setClassID (const FUID &uid)
 Sets the associated classID (component ID: Processor part (not the controller!)).
 
const EntrygetEntry (ChunkType which) const
 Returns an entry for a given chunk type.
 
const EntrygetLastEntry () const
 Returns the last available entry.
 
int32 getEntryCount () const
 Returns the number of total entries in the current stream.
 
const Entryat (int32 index) const
 Returns the entry at a given position.
 
bool contains (ChunkType which) const
 Checks if a given chunk type exist in the stream.
 
bool readChunkList ()
 Reads and build the chunk list (including the header chunk).
 
bool writeHeader ()
 Writes into the stream the main header.
 
bool writeChunkList ()
 Writes into the stream the chunk list (should be at the end).
 
bool readMetaInfo (char *xmlBuffer, int32 &size)
 Reads the meta XML info and its size, the size could be retrieved by passing zero as xmlBuffer.
 
bool writeMetaInfo (const char *xmlBuffer, int32 size=-1, bool forceWriting=false)
 Writes the meta XML info, -1 means null-terminated, forceWriting to true will force to rewrite the XML Info when the chunk already exists.
 
bool prepareMetaInfoUpdate ()
 checks if meta info chunk is the last one and jump to correct position.
 
bool writeChunk (const void *data, int32 size, ChunkType which=kComponentState)
 Writes a given data of a given size as "which" chunk type.
 
bool seekToComponentState ()
 Seeks to the begin of the Component State.
 
bool storeComponentState (IComponent *component)
 Stores the component state (only one time).
 
bool storeComponentState (IBStream *componentStream)
 Stores the component state from stream (only one time).
 
bool restoreComponentState (IComponent *component)
 Restores the component state.
 
bool seekToControllerState ()
 Seeks to the begin of the Controller State.
 
bool storeControllerState (IEditController *editController)
 Stores the controller state (only one time).
 
bool storeControllerState (IBStream *editStream)
 Stores the controller state from stream (only one time).
 
bool restoreControllerState (IEditController *editController)
 Restores the controller state.
 
bool restoreComponentState (IEditController *editController)
 Restores the component state and apply it to the controller.
 
bool storeProgramData (IBStream *inStream, ProgramListID listID)
 Store program data or unit data from stream (including the header chunk).
 
bool storeProgramData (IProgramListData *programListData, ProgramListID programListID, int32 programIndex)
 Stores a IProgramListData with a given identifier and index (including the header chunk).
 
bool restoreProgramData (IProgramListData *programListData, ProgramListID *programListID=nullptr, int32 programIndex=0)
 Restores a IProgramListData with a given identifier and index.
 
bool storeProgramData (IUnitData *unitData, UnitID unitID)
 Stores a IUnitData with a given unitID (including the header chunk).
 
bool restoreProgramData (IUnitData *unitData, UnitID *unitID=nullptr)
 Restores a IUnitData with a given unitID (optional).
 
bool restoreProgramData (IUnitInfo *unitInfo, int32 unitProgramListID, int32 programIndex=-1)
 for keeping the controller part in sync concerning preset data stream, unitProgramListID could be ProgramListID or UnitID.
 
bool getUnitProgramListID (int32 &unitProgramListID)
 Gets the unitProgramListID saved in the kProgramData chunk (if available).
 

Static Public Member Functions

static bool savePreset (IBStream *stream, const FUID &classID, IComponent *component, IEditController *editController=nullptr, const char *xmlBuffer=nullptr, int32 xmlSize=-1)
 Shortcut helper to create preset from component/controller state.
 
static bool savePreset (IBStream *stream, const FUID &classID, IBStream *componentStream, IBStream *editStream=nullptr, const char *xmlBuffer=nullptr, int32 xmlSize=-1)
 
static bool loadPreset (IBStream *stream, const FUID &classID, IComponent *component, IEditController *editController=nullptr, std::vector< FUID > *otherClassIDArray=nullptr)
 Shortcut helper to load preset with component/controller state.
 

Protected Types

enum  { kMaxEntries }
 

Protected Member Functions

bool readID (ChunkID id)
 
bool writeID (const ChunkID id)
 
bool readEqualID (const ChunkID id)
 
bool readSize (TSize &size)
 
bool writeSize (TSize size)
 
bool readInt32 (int32 &value)
 
bool writeInt32 (int32 value)
 
bool seekTo (TSize offset)
 
bool beginChunk (Entry &e, ChunkType which)
 
bool endChunk (Entry &e)
 

Protected Attributes

IBStreamstream
 
FUID classID
 classID is the FUID of the component (processor) part
 
Entry entries [kMaxEntries]
 
int32 entryCount
 

Detailed Description

Handler for a VST 3 Preset File.

See also
presetformat

Definition at line 112 of file vstpresetfile.h.


Class Documentation

◆ Steinberg::Vst::PresetFile::Entry

struct Steinberg::Vst::PresetFile::Entry

Internal structure used for chunk handling.

Definition at line 120 of file vstpresetfile.h.

Class Members
ChunkID id
TSize offset
TSize size

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected

Definition at line 224 of file vstpresetfile.h.

Constructor & Destructor Documentation

◆ PresetFile()

Steinberg::Vst::PresetFile::PresetFile ( IBStream stream)

Constructor of Preset file based on a stream.

Definition at line 179 of file vstpresetfile.cpp.

◆ ~PresetFile()

Steinberg::Vst::PresetFile::~PresetFile ( )
virtual

Definition at line 188 of file vstpresetfile.cpp.

Member Function Documentation

◆ at()

const Entry & Steinberg::Vst::PresetFile::at ( int32  index) const

Returns the entry at a given position.

Definition at line 135 of file vstpresetfile.h.

◆ beginChunk()

bool Steinberg::Vst::PresetFile::beginChunk ( Entry e,
ChunkType  which 
)
protected

Definition at line 362 of file vstpresetfile.cpp.

◆ contains()

bool Steinberg::Vst::PresetFile::contains ( ChunkType  which) const

Checks if a given chunk type exist in the stream.

Definition at line 136 of file vstpresetfile.h.

◆ endChunk()

bool Steinberg::Vst::PresetFile::endChunk ( Entry e)
protected

Definition at line 375 of file vstpresetfile.cpp.

◆ getClassID()

const FUID & Steinberg::Vst::PresetFile::getClassID ( ) const

Returns the associated classID (component ID: Processor part (not the controller!)).

Definition at line 129 of file vstpresetfile.h.

◆ getEntry()

const PresetFile::Entry * Steinberg::Vst::PresetFile::getEntry ( ChunkType  which) const

Returns an entry for a given chunk type.

Definition at line 195 of file vstpresetfile.cpp.

◆ getEntryCount()

int32 Steinberg::Vst::PresetFile::getEntryCount ( ) const

Returns the number of total entries in the current stream.

Definition at line 134 of file vstpresetfile.h.

◆ getLastEntry()

const PresetFile::Entry * Steinberg::Vst::PresetFile::getLastEntry ( ) const

Returns the last available entry.

Definition at line 205 of file vstpresetfile.cpp.

◆ getStream()

IBStream * Steinberg::Vst::PresetFile::getStream ( ) const

Returns the associated stream.

Definition at line 127 of file vstpresetfile.h.

◆ getUnitProgramListID()

bool Steinberg::Vst::PresetFile::getUnitProgramListID ( int32 &  unitProgramListID)

Gets the unitProgramListID saved in the kProgramData chunk (if available).

Definition at line 668 of file vstpresetfile.cpp.

◆ loadPreset()

bool Steinberg::Vst::PresetFile::loadPreset ( IBStream stream,
const FUID classID,
IComponent component,
IEditController editController = nullptr,
std::vector< FUID > *  otherClassIDArray = nullptr 
)
static

Shortcut helper to load preset with component/controller state.

classID is the FUID of the component (processor) part.

Definition at line 142 of file vstpresetfile.cpp.

◆ prepareMetaInfoUpdate()

bool Steinberg::Vst::PresetFile::prepareMetaInfoUpdate ( )

checks if meta info chunk is the last one and jump to correct position.

Definition at line 427 of file vstpresetfile.cpp.

◆ readChunkList()

bool Steinberg::Vst::PresetFile::readChunkList ( )

Reads and build the chunk list (including the header chunk).

Definition at line 286 of file vstpresetfile.cpp.

◆ readEqualID()

bool Steinberg::Vst::PresetFile::readEqualID ( const ChunkID  id)
protected

Definition at line 227 of file vstpresetfile.cpp.

◆ readID()

bool Steinberg::Vst::PresetFile::readID ( ChunkID  id)
protected

Definition at line 211 of file vstpresetfile.cpp.

◆ readInt32()

bool Steinberg::Vst::PresetFile::readInt32 ( int32 &  value)
protected

Definition at line 256 of file vstpresetfile.cpp.

◆ readMetaInfo()

bool Steinberg::Vst::PresetFile::readMetaInfo ( char xmlBuffer,
int32 &  size 
)

Reads the meta XML info and its size, the size could be retrieved by passing zero as xmlBuffer.

Definition at line 388 of file vstpresetfile.cpp.

◆ readSize()

bool Steinberg::Vst::PresetFile::readSize ( TSize &  size)
protected

Definition at line 234 of file vstpresetfile.cpp.

◆ restoreComponentState() [1/2]

bool Steinberg::Vst::PresetFile::restoreComponentState ( IComponent component)

Restores the component state.

Definition at line 488 of file vstpresetfile.cpp.

◆ restoreComponentState() [2/2]

bool Steinberg::Vst::PresetFile::restoreComponentState ( IEditController editController)

Restores the component state and apply it to the controller.

Definition at line 500 of file vstpresetfile.cpp.

◆ restoreControllerState()

bool Steinberg::Vst::PresetFile::restoreControllerState ( IEditController editController)

Restores the controller state.

Definition at line 540 of file vstpresetfile.cpp.

◆ restoreProgramData() [1/3]

bool Steinberg::Vst::PresetFile::restoreProgramData ( IProgramListData programListData,
ProgramListID programListID = nullptr,
int32  programIndex = 0 
)

Restores a IProgramListData with a given identifier and index.

Definition at line 588 of file vstpresetfile.cpp.

◆ restoreProgramData() [2/3]

bool Steinberg::Vst::PresetFile::restoreProgramData ( IUnitData unitData,
UnitID unitID = nullptr 
)

Restores a IUnitData with a given unitID (optional).

Definition at line 624 of file vstpresetfile.cpp.

◆ restoreProgramData() [3/3]

bool Steinberg::Vst::PresetFile::restoreProgramData ( IUnitInfo unitInfo,
int32  unitProgramListID,
int32  programIndex = -1 
)

for keeping the controller part in sync concerning preset data stream, unitProgramListID could be ProgramListID or UnitID.

Definition at line 645 of file vstpresetfile.cpp.

◆ savePreset() [1/2]

bool Steinberg::Vst::PresetFile::savePreset ( IBStream stream,
const FUID classID,
IBStream componentStream,
IBStream editStream = nullptr,
const char xmlBuffer = nullptr,
int32  xmlSize = -1 
)
static

Definition at line 121 of file vstpresetfile.cpp.

◆ savePreset() [2/2]

bool Steinberg::Vst::PresetFile::savePreset ( IBStream stream,
const FUID classID,
IComponent component,
IEditController editController = nullptr,
const char xmlBuffer = nullptr,
int32  xmlSize = -1 
)
static

Shortcut helper to create preset from component/controller state.

classID is the FUID of the component (processor) part.

Definition at line 100 of file vstpresetfile.cpp.

◆ seekTo()

bool Steinberg::Vst::PresetFile::seekTo ( TSize  offset)
protected

Definition at line 278 of file vstpresetfile.cpp.

◆ seekToComponentState()

bool Steinberg::Vst::PresetFile::seekToComponentState ( )

Seeks to the begin of the Component State.

Definition at line 461 of file vstpresetfile.cpp.

◆ seekToControllerState()

bool Steinberg::Vst::PresetFile::seekToControllerState ( )

Seeks to the begin of the Controller State.

Definition at line 512 of file vstpresetfile.cpp.

◆ setClassID()

void Steinberg::Vst::PresetFile::setClassID ( const FUID uid)

Sets the associated classID (component ID: Processor part (not the controller!)).

Definition at line 130 of file vstpresetfile.h.

◆ storeComponentState() [1/2]

bool Steinberg::Vst::PresetFile::storeComponentState ( IBStream componentStream)

Stores the component state from stream (only one time).

Definition at line 478 of file vstpresetfile.cpp.

◆ storeComponentState() [2/2]

bool Steinberg::Vst::PresetFile::storeComponentState ( IComponent component)

Stores the component state (only one time).

Definition at line 468 of file vstpresetfile.cpp.

◆ storeControllerState() [1/2]

bool Steinberg::Vst::PresetFile::storeControllerState ( IBStream editStream)

Stores the controller state from stream (only one time).

Definition at line 530 of file vstpresetfile.cpp.

◆ storeControllerState() [2/2]

bool Steinberg::Vst::PresetFile::storeControllerState ( IEditController editController)

Stores the controller state (only one time).

Definition at line 519 of file vstpresetfile.cpp.

◆ storeProgramData() [1/3]

bool Steinberg::Vst::PresetFile::storeProgramData ( IBStream inStream,
ProgramListID  listID 
)

Store program data or unit data from stream (including the header chunk).

Parameters
inStream
listIDcould be ProgramListID or UnitID.

Definition at line 552 of file vstpresetfile.cpp.

◆ storeProgramData() [2/3]

bool Steinberg::Vst::PresetFile::storeProgramData ( IProgramListData programListData,
ProgramListID  programListID,
int32  programIndex 
)

Stores a IProgramListData with a given identifier and index (including the header chunk).

Definition at line 574 of file vstpresetfile.cpp.

◆ storeProgramData() [3/3]

bool Steinberg::Vst::PresetFile::storeProgramData ( IUnitData unitData,
UnitID  unitID 
)

Stores a IUnitData with a given unitID (including the header chunk).

Definition at line 611 of file vstpresetfile.cpp.

◆ writeChunk()

bool Steinberg::Vst::PresetFile::writeChunk ( const void *  data,
int32  size,
ChunkType  which = kComponentState 
)

Writes a given data of a given size as "which" chunk type.

Definition at line 451 of file vstpresetfile.cpp.

◆ writeChunkList()

bool Steinberg::Vst::PresetFile::writeChunkList ( )

Writes into the stream the chunk list (should be at the end).

Definition at line 338 of file vstpresetfile.cpp.

◆ writeHeader()

bool Steinberg::Vst::PresetFile::writeHeader ( )

Writes into the stream the main header.

Definition at line 326 of file vstpresetfile.cpp.

◆ writeID()

bool Steinberg::Vst::PresetFile::writeID ( const ChunkID  id)
protected

Definition at line 219 of file vstpresetfile.cpp.

◆ writeInt32()

bool Steinberg::Vst::PresetFile::writeInt32 ( int32  value)
protected

Definition at line 267 of file vstpresetfile.cpp.

◆ writeMetaInfo()

bool Steinberg::Vst::PresetFile::writeMetaInfo ( const char xmlBuffer,
int32  size = -1,
bool  forceWriting = false 
)

Writes the meta XML info, -1 means null-terminated, forceWriting to true will force to rewrite the XML Info when the chunk already exists.

Definition at line 408 of file vstpresetfile.cpp.

◆ writeSize()

bool Steinberg::Vst::PresetFile::writeSize ( TSize  size)
protected

Definition at line 245 of file vstpresetfile.cpp.

Member Data Documentation

◆ classID

FUID Steinberg::Vst::PresetFile::classID
protected

classID is the FUID of the component (processor) part

Definition at line 223 of file vstpresetfile.h.

◆ entries

Entry Steinberg::Vst::PresetFile::entries[kMaxEntries]
protected

Definition at line 225 of file vstpresetfile.h.

◆ entryCount

int32 Steinberg::Vst::PresetFile::entryCount
protected

Definition at line 226 of file vstpresetfile.h.

◆ stream

IBStream* Steinberg::Vst::PresetFile::stream
protected

Definition at line 222 of file vstpresetfile.h.


The documentation for this class was generated from the following files: