VST 3 SDK VST 3.7 SDK for developing VST plug-in

Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
XmlRepresentationHelper Class Reference
VST Implementation Helper Classes

Helper for XML Representation creation. More...

`#include <vstrepresentation.h>`

## Public Member Functions
| XmlRepresentationHelper (const RepresentationInfo &info, const FIDString companyName, const FIDString pluginName, const TUID &pluginUID, IBStream *stream)
virtual | ~XmlRepresentationHelper ()
bool | startPage (FIDString name, int32 unitID=-1)
| Starts a Page before adding a Cell.
bool | endPage ()
| Ends a Page before opening a new one.
bool | startCell ()
| Starts a Cell before adding a Layer.
bool | endCell ()
| Ends a Cell when no more layer needed.
bool | startEndCell ()
| Creates an empty cell (alignment for example).
bool | startLayer (int32 type, int32 id, FIDString _function=nullptr, FIDString style=nullptr)
| Starts a layer for a given type (Vst::LayerType), a parameter id, optionally a function (Vst::AttributesFunction) and a style (Vst::AttributesStyle).
bool | endLayer ()
| Ends a layer before adding new one.
bool | startEndLayer (int32 type, int32 id, FIDString _function=nullptr, FIDString style=nullptr)
| Same than startLayer except that the layer will be ended automatically (no need to call endLayer).
bool | startEndCellOneLayer (int32 type, int32 id, FIDString _function=nullptr, FIDString style=nullptr)
| Creates a Cell with 1 Layer and end it, could be only call after a call to startPage.
bool | startLayer (Vst::ParameterInfo &info, FIDString _function=nullptr)
| Starts a layer for a given parameter info and an optional function (Vst::AttributesFunction).
bool | startEndLayer (Vst::ParameterInfo &info, FIDString _function=nullptr)
| Same than startLayer with end created automatically.
bool | startEndCellOneLayer (Vst::ParameterInfo &info, FIDString _function=nullptr)
| Creates a Cell with 1 Layer and end it, could be only call after a call to startPage.
bool | startEndCellOneLayerWithParamName (Vst::ParameterInfo &info, FIDString _function=nullptr)
| Creates a Cell with 1 Layer (with name) and end it, could be only call after a call to startPage.

## Protected Types
enum | { kInRepresentation = 0 , kInPage , kInCell , kInLayer , kInTitleDisplay , kInName }

## Protected Member Functions
bool | startLayer (int32 type, int32 id, FIDString _function, FIDString style, bool ended)
bool | startLayer (Vst::ParameterInfo &info, FIDString _function, bool ended)
bool | startEndTitleDisplay (Vst::ParameterInfo &info)
bool | checkState (int32 newState)

## Protected Attributes
IPtr< IBStream > | stream
int32 | state

## Detailed Description

Helper for XML Representation creation.

Here an example of how to use this helper:

//------------------------------------------------------------------------
// here the parameter ids used by this example
enum {
kGain = 129,
kSize,
kCutoff,
kResonance,
kMaster,
kEnable1,
kEnable2,
kFrequency1,
kFrequency2,
kGain1,
kGain2,
};
//------------------------------------------------------------------------
tresult PLUGIN_API MyPlugInController::getXmlRepresentationStream (Vst::RepresentationInfo& info,
IBStream* stream)
{
String name (info.name);
if (name == GENERIC_8_CELLS)
{
Vst::XmlRepresentationHelper helper (info, "My Company Name", "My Product Name", gPlugProcessorClassID, stream);
helper.startPage ("Main Page");
helper.startEndCellOneLayer (Vst::LayerType::kKnob, kGain);
helper.startEndCellOneLayer (Vst::LayerType::kKnob, kSize);
helper.startEndCellOneLayer (Vst::LayerType::kKnob, kMaster);
helper.startEndCell (); // empty cell
helper.startEndCellOneLayer (Vst::LayerType::kKnob, kCutoff);
helper.startEndCellOneLayer (Vst::LayerType::kKnob, kResonance);
helper.startEndCell (); // empty cell
helper.startEndCell (); // empty cell
helper.endPage ();
helper.startPage ("Page 2");
helper.startEndCellOneLayer (Vst::LayerType::kSwitch, kEnable1);
helper.startEndCellOneLayer (Vst::LayerType::kKnob, kFrequency1);
helper.startEndCellOneLayer (Vst::LayerType::kKnob, kGain1);
helper.startEndCell (); // empty
helper.startEndCellOneLayer (Vst::LayerType::kSwitch, kEnable2);
helper.startEndCellOneLayer (Vst::LayerType::kKnob, kFrequency2);
helper.startEndCellOneLayer (Vst::LayerType::kKnob, kGain2);
helper.startEndCell (); // empty
helper.endPage ();
return kResultTrue;
}
return kResultFalse;
}
Steinberg::IBStream
Steinberg::Vst::XmlRepresentationHelper
Helper for XML Representation creation.
Definition vstrepresentation.h:109
Steinberg::Vst::XmlRepresentationHelper::stream
IPtr< IBStream > stream
Definition vstrepresentation.h:167
GENERIC_8_CELLS
#define GENERIC_8_CELLS
Steinberg::Vst::LayerType::kSwitch
kSwitch
Steinberg::Vst::LayerType::kKnob
kKnob
Steinberg::kResultTrue
kResultTrue
Steinberg::kResultFalse
kResultFalse
Steinberg::tresult
int32 tresult
Steinberg::Vst::RepresentationInfo
Steinberg::Vst::RepresentationInfo::name
char8 name[kNameSize]

## Member Enumeration Documentation

## ◆ anonymous enum

anonymous enum
| protected

Enumerator
kInRepresentation |
kInPage |
kInCell |
kInLayer |
kInTitleDisplay |
kInName |

## Constructor & Destructor Documentation

## ◆ XmlRepresentationHelper()

XmlRepresentationHelper | ( | const RepresentationInfo & | info,
|  | const FIDString | companyName,
|  | const FIDString | pluginName,
|  | const TUID & | pluginUID,
|  | IBStream * | stream )

## ◆ ~XmlRepresentationHelper()

~XmlRepresentationHelper | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ startPage()

bool startPage | ( | FIDString | name,
|  | int32 | unitID = -1 )

Starts a Page before adding a Cell.

## ◆ endPage()

bool endPage | ( |  | ) |

Ends a Page before opening a new one.

## ◆ startCell()

bool startCell | ( |  | ) |

Starts a Cell before adding a Layer.

## ◆ endCell()

bool endCell | ( |  | ) |

Ends a Cell when no more layer needed.

## ◆ startEndCell()

bool startEndCell | ( |  | ) |

Creates an empty cell (alignment for example).

## ◆ startLayer() [1/4]

bool startLayer | ( | int32 | type,
|  | int32 | id,
|  | FIDString | _function = nullptr,
|  | FIDString | style = nullptr )

Starts a layer for a given type (Vst::LayerType), a parameter id, optionally a function (Vst::AttributesFunction) and a style (Vst::AttributesStyle).

## ◆ endLayer()

bool endLayer | ( |  | ) |

Ends a layer before adding new one.

## ◆ startEndLayer() [1/2]

bool startEndLayer | ( | int32 | type,
|  | int32 | id,
|  | FIDString | _function = nullptr,
|  | FIDString | style = nullptr )

Same than startLayer except that the layer will be ended automatically (no need to call endLayer).

## ◆ startEndCellOneLayer() [1/2]

bool startEndCellOneLayer | ( | int32 | type,
|  | int32 | id,
|  | FIDString | _function = nullptr,
|  | FIDString | style = nullptr )

Creates a Cell with 1 Layer and end it, could be only call after a call to startPage.

## ◆ startLayer() [2/4]

bool startLayer | ( | Vst::ParameterInfo & | info,
|  | FIDString | _function = nullptr )

Starts a layer for a given parameter info and an optional function (Vst::AttributesFunction).

## ◆ startEndLayer() [2/2]

bool startEndLayer | ( | Vst::ParameterInfo & | info,
|  | FIDString | _function = nullptr )

Same than startLayer with end created automatically.

## ◆ startEndCellOneLayer() [2/2]

bool startEndCellOneLayer | ( | Vst::ParameterInfo & | info,
|  | FIDString | _function = nullptr )

Creates a Cell with 1 Layer and end it, could be only call after a call to startPage.

## ◆ startEndCellOneLayerWithParamName()

bool startEndCellOneLayerWithParamName | ( | Vst::ParameterInfo & | info,
|  | FIDString | _function = nullptr )

Creates a Cell with 1 Layer (with name) and end it, could be only call after a call to startPage.

## ◆ startLayer() [3/4]

bool startLayer | ( | int32 | type,
|  | int32 | id,
|  | FIDString | _function,
|  | FIDString | style,
|  | bool | ended )
| protected

## ◆ startLayer() [4/4]

bool startLayer | ( | Vst::ParameterInfo & | info,
|  | FIDString | _function,
|  | bool | ended )
| protected

## ◆ startEndTitleDisplay()

bool startEndTitleDisplay | ( | Vst::ParameterInfo & | info | ) |
| protected

## ◆ checkState()

bool checkState | ( | int32 | newState | ) |
| protected

## Member Data Documentation

## ◆ stream

IPtr<IBStream> stream
| protected

## ◆ state

int32 state
| protected

Empty

Copyright © Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.