synthclone  0.3.0
synthclone::Participant Class Reference

Participants objects interact with synthclone. More...

#include <synthclone/participant.h>

Inheritance diagram for synthclone::Participant:
Collaboration diagram for synthclone::Participant:

Public Member Functions

virtual void activate (Context &context, const QVariant &state=QVariant())
 Links the Participant with the application. More...
 
virtual void deactivate (Context &context)
 Unlinks the Participant from the application. More...
 
QString getAuthor () const
 Gets the author of this Participant. More...
 
int getMajorVersion () const
 Gets the major version for this Participant. More...
 
int getMinorVersion () const
 Gets the minor version for this Participant. More...
 
QString getName () const
 Gets the translated name for this Participant. More...
 
int getRevision () const
 Gets the revision portion of the Participant version. More...
 
virtual QVariant getState () const
 Gets the state of the Participant. More...
 
virtual QVariant getState (const synthclone::Effect *effect) const
 Gets the state of an Effect created by this Participant. More...
 
virtual QVariant getState (const synthclone::Sampler *sampler) const
 Gets the state of a Sampler created by this Participant. More...
 
virtual QVariant getState (const synthclone::Target *target) const
 Gets the state of a Target created by this Participant. More...
 
QString getSummary () const
 Gets the translated summary for this participant. More...
 
virtual void restoreEffect (const QVariant &state)
 Called to restore an Effect. More...
 
virtual void restoreSampler (const QVariant &state)
 Called to restore a Sampler. More...
 
virtual void restoreTarget (const QVariant &state)
 Called to restore a Target. More...
 

Protected Member Functions

 Participant (const QString &name, int majorVersion, int minorVersion, int revision, const QString &author, const QString &summary, QObject *parent=0)
 Constructs a new participant. More...
 
virtual ~Participant ()
 Destroys a participant. More...
 

Detailed Description

Participants objects interact with synthclone.

Interaction takes place through the Context object that is passed with activate().

Constructor & Destructor Documentation

◆ Participant()

synthclone::Participant::Participant ( const QString &  name,
int  majorVersion,
int  minorVersion,
int  revision,
const QString &  author,
const QString &  summary,
QObject *  parent = 0 
)
protected

Constructs a new participant.

This constructor should not be called directly; instead, Participant subclasses should call this constructor in their constructors.

Parameters
nameThe translated participant name.
majorVersionThe major version of the participant.
minorVersionThe minor version of the participant.
revisionThe revision portion of the version of the participant.
authorThe author of the participant.
summaryA translated summary for the participant.
parentThe parent object of the new participant.

◆ ~Participant()

virtual synthclone::Participant::~Participant ( )
protectedvirtual

Destroys a participant.

Member Function Documentation

◆ activate()

virtual void synthclone::Participant::activate ( Context context,
const QVariant &  state = QVariant() 
)
virtual

Links the Participant with the application.

Parameters
contextA context object specific to this participant. The context object serves as a mediator between this participant and synthclone.
stateIf a session is being restored, then the state argument will contain the return value of getState(), called when the session was previously loaded; otherwise, the argument is an invalid QVariant.

◆ deactivate()

virtual void synthclone::Participant::deactivate ( Context context)
virtual

Unlinks the Participant from the application.

After returning from this method, the Context object will be destroyed.

Parameters
contextThe Context object that was passed to activate(). This object will be destroyed some time after this call returns.

◆ getAuthor()

QString synthclone::Participant::getAuthor ( ) const

Gets the author of this Participant.

Returns
The author.

◆ getMajorVersion()

int synthclone::Participant::getMajorVersion ( ) const

Gets the major version for this Participant.

Returns
The major version.

◆ getMinorVersion()

int synthclone::Participant::getMinorVersion ( ) const

Gets the minor version for this Participant.

Returns
The minor version.

◆ getName()

QString synthclone::Participant::getName ( ) const

Gets the translated name for this Participant.

Returns
The translated name.

◆ getRevision()

int synthclone::Participant::getRevision ( ) const

Gets the revision portion of the Participant version.

Returns
The revision.

◆ getState() [1/4]

virtual QVariant synthclone::Participant::getState ( ) const
virtual

Gets the state of the Participant.

The state will be passed to the activate() method if the current session is reloaded. The default implementation returns an invalid QVariant.

Returns
The participant state.

◆ getState() [2/4]

virtual QVariant synthclone::Participant::getState ( const synthclone::Effect effect) const
virtual

Gets the state of an Effect created by this Participant.

The state should contain all the details necessary to recreate the Effect. The state will be passed to the restoreEffect() method if the current session is reloaded.

Parameters
effectAn effect created by this participant.
Returns
The effect state.

◆ getState() [3/4]

virtual QVariant synthclone::Participant::getState ( const synthclone::Sampler sampler) const
virtual

Gets the state of a Sampler created by this Participant.

The state should contain all the details necessary to recreate the Sampler. The state will be passed to the restoreSampler() method if the current session is reloaded.

Parameters
samplerA sampler created by this participant.
Returns
The sampler state.

◆ getState() [4/4]

virtual QVariant synthclone::Participant::getState ( const synthclone::Target target) const
virtual

Gets the state of a Target created by this Participant.

The state should contain all the details necessary to recreate the Target. The state will be passed to the restoreTarget() method if the current session is reloaded.

Parameters
targetA target created by this participant.
Returns
The target state.

◆ getSummary()

QString synthclone::Participant::getSummary ( ) const

Gets the translated summary for this participant.

Returns
The translated summary.

◆ restoreEffect()

virtual void synthclone::Participant::restoreEffect ( const QVariant &  state)
virtual

Called to restore an Effect.

The Participant should create the Effect specified by the given state, and append the effect to the session's Effect list using the Context object.

Parameters
stateThe state of the effect.

◆ restoreSampler()

virtual void synthclone::Participant::restoreSampler ( const QVariant &  state)
virtual

Called to restore a Sampler.

The Participant should create the Sampler specified by the given state, and set the Sampler using the Context object.

Parameters
stateThe state of the sampler.

◆ restoreTarget()

virtual void synthclone::Participant::restoreTarget ( const QVariant &  state)
virtual

Called to restore a Target.

The Participant should create the Target specified by the given state, and append the Target to the session's Target list using the Context object.

Parameters
stateThe state of the target.

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