|
LMMS
|
#include <vstpresetfile.h>
Classes | |
| struct | Entry |
Public Member Functions | |
| PresetFile (IBStream *stream) | |
| Constructor of Preset file based on a stream. | |
| virtual | ~PresetFile () |
| IBStream * | getStream () |
| Returns the associated stream. | |
| const FUID & | getClassID () 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 Entry * | getEntry (ChunkType which) const |
| Returns an entry for a given chunk type. | |
| const Entry * | getLastEntry () const |
| Returns the last available entry. | |
| int32 | getEntryCount () const |
| Returns the number of total entries in the current stream. | |
| const Entry & | at (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) |
| bool | writeMetaInfo (const char *xmlBuffer, int32 size=-1, bool forceWriting=false) |
| 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) |
| 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) |
| bool | storeProgramData (IProgramListData *programListData, ProgramListID programListID, int32 programIndex) |
| bool | restoreProgramData (IProgramListData *programListData, ProgramListID *programListID=nullptr, int32 programIndex=0) |
| bool | storeProgramData (IUnitData *unitData, UnitID unitID) |
| bool | restoreProgramData (IUnitData *unitData, UnitID *unitID=nullptr) |
| bool | restoreProgramData (IUnitInfo *unitInfo, int32 unitProgramListID, int32 programIndex=-1) |
| bool | getUnitProgramListID (int32 &unitProgramListID) |
Static Public Member Functions | |
| static bool | savePreset (IBStream *stream, const FUID &classID, IComponent *component, IEditController *editController=nullptr, const char *xmlBuffer=nullptr, int32 xmlSize=-1) |
| 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) |
Protected Types | |
| enum | { kMaxEntries = 128 } |
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 | |
| IBStream * | stream |
| FUID | classID |
| classID is the FUID of the component (processor) part | |
| Entry | entries [kMaxEntries] |
| int32 | entryCount |
Handler for a VST 3 Preset File.
| Steinberg::Vst::PresetFile::PresetFile | ( | IBStream * | stream | ) |
Constructor of Preset file based on a stream.
|
virtual |
Returns the entry at a given position.
|
inline |
Checks if a given chunk type exist in the stream.
|
protected |
Returns the associated classID (component ID: Processor part (not the controller!)).
| const PresetFile::Entry * Steinberg::Vst::PresetFile::getEntry | ( | ChunkType | which | ) | const |
Returns an entry for a given chunk type.
|
inline |
Returns the number of total entries in the current stream.
| const PresetFile::Entry * Steinberg::Vst::PresetFile::getLastEntry | ( | ) | const |
Returns the last available entry.
|
inline |
Returns the associated stream.
| bool Steinberg::Vst::PresetFile::getUnitProgramListID | ( | int32 & | unitProgramListID | ) |
Gets the unitProgramListID saved in the kProgramData chunk (if available).
|
static |
Shortcut helper to load preset with component/controller state. classID is the FUID of the component (processor) part.
| bool Steinberg::Vst::PresetFile::prepareMetaInfoUpdate | ( | ) |
checks if meta info chunk is the last one and jump to correct position.
| bool Steinberg::Vst::PresetFile::readChunkList | ( | ) |
Reads and build the chunk list (including the header chunk).
|
protected |
|
protected |
| 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.
|
protected |
| bool Steinberg::Vst::PresetFile::restoreComponentState | ( | IComponent * | component | ) |
Restores the component state.
| bool Steinberg::Vst::PresetFile::restoreComponentState | ( | IEditController * | editController | ) |
Restores the component state and apply it to the controller.
| bool Steinberg::Vst::PresetFile::restoreControllerState | ( | IEditController * | editController | ) |
Restores the controller state.
| bool Steinberg::Vst::PresetFile::restoreProgramData | ( | IProgramListData * | programListData, |
| ProgramListID * | programListID = nullptr, | ||
| int32 | programIndex = 0 ) |
Restores a IProgramListData with a given identifier and index.
| bool Steinberg::Vst::PresetFile::restoreProgramData | ( | IUnitData * | unitData, |
| UnitID * | unitID = nullptr ) |
Restores a IUnitData with a given unitID (optional).
| 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.
|
static |
|
static |
Shortcut helper to create preset from component/controller state. classID is the FUID of the component (processor) part.
|
protected |
| bool Steinberg::Vst::PresetFile::seekToComponentState | ( | ) |
| bool Steinberg::Vst::PresetFile::seekToControllerState | ( | ) |
Seeks to the begin of the Controller State.
Sets the associated classID (component ID: Processor part (not the controller!)).
| bool Steinberg::Vst::PresetFile::storeComponentState | ( | IBStream * | componentStream | ) |
Stores the component state from stream (only one time).
| bool Steinberg::Vst::PresetFile::storeComponentState | ( | IComponent * | component | ) |
Stores the component state (only one time).
| bool Steinberg::Vst::PresetFile::storeControllerState | ( | IBStream * | editStream | ) |
Stores the controller state from stream (only one time).
| bool Steinberg::Vst::PresetFile::storeControllerState | ( | IEditController * | editController | ) |
Stores the controller state (only one time).
| bool Steinberg::Vst::PresetFile::storeProgramData | ( | IBStream * | inStream, |
| ProgramListID | listID ) |
Store program data or unit data from stream (including the header chunk).
| inStream | |
| listID | could be ProgramListID or UnitID. |
| bool Steinberg::Vst::PresetFile::storeProgramData | ( | IProgramListData * | programListData, |
| ProgramListID | programListID, | ||
| int32 | programIndex ) |
Stores a IProgramListData with a given identifier and index (including the header chunk).
Stores a IUnitData with a given unitID (including the header chunk).
| 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.
| bool Steinberg::Vst::PresetFile::writeChunkList | ( | ) |
Writes into the stream the chunk list (should be at the end).
| bool Steinberg::Vst::PresetFile::writeHeader | ( | ) |
Writes into the stream the main header.
|
protected |
| 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.
|
protected |
|
protected |
classID is the FUID of the component (processor) part
|
protected |
|
protected |
|
protected |