Jamba C++ API 7.5.0
Loading...
Searching...
No Matches
IParamSerializer< T > Class Template Reference

A vst parameter is represented by a ParamValue type which is a double in the range [0,1]. More...

#include <ParamSerializers.h>

Inherited by DiscreteTypeParamSerializer< T, Compare >, and JmbParamDef< T > [private].

Public Types

using ParamType = T

Public Member Functions

virtual tresult readFromStream (IBStreamer &iStreamer, ParamType &oValue) const
 This method should read from the stream and populate oValue accordingly (aka deserialization).
virtual std::string toString (ParamType const &iValue, int32 iPrecision) const
virtual tresult writeToStream (const ParamType &iValue, IBStreamer &oStreamer) const
 This method should write iValue to the stream (aka serialization).
virtual void writeToStream (ParamType const &iValue, std::ostream &oStream) const
 By default, this implementation simply writes the value to the stream IF it is possible (determined at compilation time).

Detailed Description

template<typename T>
class pongasoft::VST::IParamSerializer< T >

A vst parameter is represented by a ParamValue type which is a double in the range [0,1].

This interface represents a way to extend the concept of parameter by allowing any type that cannot be converted to ParamValue (for example a string). The parameter simply needs to provide an implementation of this interface which represents a way to serialize/deserialize the type to the stream.

Note
This interface can also be used to simply display the parameter (even if not serializable)
Template Parameters
Tthe actual type that the parameter represents

Member Typedef Documentation

◆ ParamType

template<typename T>
using ParamType = T

Member Function Documentation

◆ readFromStream()

template<typename T>
virtual tresult readFromStream ( IBStreamer & iStreamer,
ParamType & oValue ) const
inlinevirtual

This method should read from the stream and populate oValue accordingly (aka deserialization).

Returns
kResultOk if reading was successful, kResultFalse otherwise (or kNotImplemented if not supported)

Reimplemented in BooleanParamSerializer, DiscreteTypeParamSerializer< T, Compare >, DoubleParamSerializer, UTF8StringParamSerializer< size >, Int32ParamSerializer, Int64ParamSerializer, JmbParamDef< T >, and RawParamSerializer.

◆ toString()

template<typename T>
virtual std::string toString ( ParamType const & iValue,
int32 iPrecision ) const
inlinevirtual

◆ writeToStream() [1/2]

template<typename T>
virtual tresult writeToStream ( const ParamType & iValue,
IBStreamer & oStreamer ) const
inlinevirtual

This method should write iValue to the stream (aka serialization).

Returns
kResultOk if writing was successful, kResultFalse otherwise (or kNotImplemented if not supported)

Reimplemented in BooleanParamSerializer, DiscreteTypeParamSerializer< T, Compare >, DoubleParamSerializer, UTF8StringParamSerializer< size >, Int32ParamSerializer, Int64ParamSerializer, JmbParamDef< T >, and RawParamSerializer.

◆ writeToStream() [2/2]

template<typename T>
virtual void writeToStream ( ParamType const & iValue,
std::ostream & oStream ) const
inlinevirtual

By default, this implementation simply writes the value to the stream IF it is possible (determined at compilation time).

Doesn't do anything if not. Subclasses can redefine this behavior.

Reimplemented in DiscreteTypeParamSerializer< T, Compare >, and JmbParamDef< T >.


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