LMMS
Loading...
Searching...
No Matches
lmms::Plugin Class Referenceabstract

#include <Plugin.h>

Inheritance diagram for lmms::Plugin:
lmms::Model lmms::JournallingObject lmms::SerializingObject lmms::DummyPlugin lmms::Effect lmms::ExportFilter lmms::ImportFilter lmms::Instrument lmms::ToolPlugin lmms::AmplifierEffect lmms::Analyzer lmms::BassBoosterEffect lmms::BitcrushEffect lmms::CompressorEffect lmms::CrossoverEQEffect lmms::DelayEffect lmms::DispersionEffect lmms::DualFilterEffect lmms::DummyEffect lmms::DynProcEffect lmms::EqEffect lmms::FlangerEffect lmms::FrequencyShifterEffect lmms::GranularPitchShifterEffect lmms::LOMMEffect lmms::LadspaEffect lmms::Lv2Effect lmms::MultitapEchoEffect lmms::PeakControllerEffect lmms::ReverbSCEffect lmms::SlewDistortion lmms::StereoEnhancerEffect lmms::StereoMatrixEffect lmms::Vectorscope lmms::VstEffect lmms::WaveShaperEffect lmms::MidiExport lmms::HydrogenImport lmms::MidiImport lmms::AudioFileProcessor lmms::BitInvader lmms::CarlaInstrument lmms::DummyInstrument lmms::FreeBoyInstrument lmms::GigInstrument lmms::KickerInstrument lmms::Lb302Synth lmms::Lv2Instrument lmms::MalletsInstrument lmms::MonstroInstrument lmms::NesInstrument lmms::OpulenzInstrument lmms::OrganicInstrument lmms::PatmanInstrument lmms::Sf2Instrument lmms::SfxrInstrument lmms::SidInstrument lmms::SlicerT lmms::TripleOscillator lmms::VestigeInstrument lmms::Vibed lmms::WatsynInstrument lmms::Xpressive lmms::ZynAddSubFxInstrument lmms::LadspaBrowser lmms::TapTempo

Classes

struct  Descriptor

Public Types

enum class  Type {
  Instrument , Effect , ImportFilter , ExportFilter ,
  Tool , Library , Other , Undefined = 255
}
using DescriptorList = QList<Descriptor*>

Public Member Functions

 Plugin (const Descriptor *descriptor, Model *parent, const Descriptor::SubPluginFeatures::Key *key=nullptr)
 ~Plugin () override=default
QString displayName () const override
 Return display-name out of sub plugin or descriptor.
const PixmapLoaderlogo () const
 Return logo out of sub plugin or descriptor.
Type type () const
 Return plugin type.
const Descriptordescriptor () const
 Return plugin Descriptor.
const Descriptor::SubPluginFeatures::Keykey () const
virtual void loadFile (const QString &file)
virtual AutomatableModelchildModel (const QString &modelName)
gui::PluginViewcreateView (QWidget *parent)
 Create a view for the model.
Public Member Functions inherited from lmms::Model
 Model (Model *parent, QString displayName=QString(), bool defaultConstructed=false)
 ~Model () override=default
bool isDefaultConstructed () const
ModelparentModel () const
virtual void setDisplayName (const QString &displayName)
virtual QString fullDisplayName () const
Public Member Functions inherited from lmms::JournallingObject
 JournallingObject ()
 ~JournallingObject () override
jo_id_t id () const
void saveJournallingState (const bool newState)
void restoreJournallingState ()
void addJournalCheckPoint ()
QDomElement saveState (QDomDocument &_doc, QDomElement &_parent) override
void restoreState (const QDomElement &_this) override
bool isJournalling () const
void setJournalling (const bool _sr)
bool testAndSetJournalling (const bool newState)
bool isJournallingStateStackEmpty () const
Public Member Functions inherited from lmms::SerializingObject
 SerializingObject ()
virtual ~SerializingObject ()
virtual QString nodeName () const =0
void setHook (SerializingObjectHook *_hook)
SerializingObjectHookhook ()

Static Public Member Functions

static PlugininstantiateWithKey (const QString &pluginName, Model *parent, const Descriptor::SubPluginFeatures::Key *key, bool keyFromDnd=false)
static Plugininstantiate (const QString &pluginName, Model *parent, void *data)

Protected Member Functions

virtual gui::PluginViewinstantiateView (QWidget *)=0
 Create a view for the model.
void collectErrorForUI (QString errMsg)
Protected Member Functions inherited from lmms::JournallingObject
void changeID (jo_id_t _id)
Protected Member Functions inherited from lmms::SerializingObject
virtual void saveSettings (QDomDocument &doc, QDomElement &element)=0
virtual void loadSettings (const QDomElement &element)=0

Private Types

using InstantiationHook = Plugin* (*)(Model*, void*)

Private Attributes

const Descriptorm_descriptor
Descriptor::SubPluginFeatures::Key m_key

Additional Inherited Members

Signals inherited from lmms::Model
void dataChanged ()
void dataUnchanged ()
void propertiesChanged ()

Detailed Description

Abstract representation of a plugin

Such a plugin can be an Instrument, Effect, Tool plugin etc.

Plugins have descriptors, containing meta info, which is used especially by PluginFactory and friends.

There are also Plugin keys (class Key, confusingly under SubPluginFeatures), which contain pointers to the plugin descriptor.

Some plugins have sub plugins, e.g. there is one CALF Plugin and for each CALF effect, there is a CALF sub plugin. For those plugins, there are keys for each sub plugin. These keys also link to the superior Plugin::Descriptor. Additionally, they contain attributes that help the superior Plugin saving them and recognizing them when loading.

In case of sub plugins, the Descriptor has SubPluginFeatures. Those are a bit like values to the sub plugins' keys (in terms of a key-value- map).

Member Typedef Documentation

◆ DescriptorList

◆ InstantiationHook

Member Enumeration Documentation

◆ Type

enum class lmms::Plugin::Type
strong
Enumerator
Instrument 
Effect 
ImportFilter 
ExportFilter 
Tool 
Library 
Other 
Undefined 

Constructor & Destructor Documentation

◆ Plugin()

Plugin::Plugin ( const Descriptor * descriptor,
Model * parent,
const Descriptor::SubPluginFeatures::Key * key = nullptr )

Constructor of a plugin

Parameters
keySub plugins must pass a key here, optional otherwise. See the key() function

◆ ~Plugin()

lmms::Plugin::~Plugin ( )
overridedefault

Member Function Documentation

◆ childModel()

AutomatableModel * Plugin::childModel ( const QString & modelName)
virtual

Called if external source needs to change something but we cannot reference the class header. Should return null if not key not found.

Reimplemented in lmms::GigInstrument, and lmms::Sf2Instrument.

◆ collectErrorForUI()

void Plugin::collectErrorForUI ( QString errMsg)
protected

◆ createView()

gui::PluginView * Plugin::createView ( QWidget * parent)

Create a view for the model.

◆ descriptor()

const Descriptor * lmms::Plugin::descriptor ( ) const
inline

Return plugin Descriptor.

◆ displayName()

QString Plugin::displayName ( ) const
overridevirtual

Return display-name out of sub plugin or descriptor.

Reimplemented from lmms::Model.

◆ instantiate()

Plugin * Plugin::instantiate ( const QString & pluginName,
Model * parent,
void * data )
static

Return an instance of a plugin whose name matches to given one if specified plugin couldn't be loaded, it creates a dummy-plugin

Parameters
dataAnything the plugin expects. If this is a pointer to a sub plugin key, use instantiateWithKey instead

◆ instantiateView()

◆ instantiateWithKey()

Plugin * Plugin::instantiateWithKey ( const QString & pluginName,
Model * parent,
const Descriptor::SubPluginFeatures::Key * key,
bool keyFromDnd = false )
static

Overload if the argument passed to the plugin is a subPluginKey If you can not pass the key and are aware that it's stored in Engine::pickDndPluginKey(), use this function, too

◆ key()

const Descriptor::SubPluginFeatures::Key & lmms::Plugin::key ( ) const
inline

Return the key referencing this plugin. If the Plugin has no sub plugin features, the key is pretty useless. If it has, this key will also contain the sub plugin attributes, and will be a key to those SubPluginFeatures.

◆ loadFile()

void Plugin::loadFile ( const QString & file)
virtual

Can be called if a file matching supportedFileTypes should be loaded/processed with the help of this plugin

Reimplemented in lmms::AudioFileProcessor, lmms::GigInstrument, lmms::Lv2Instrument, lmms::OpulenzInstrument, lmms::PatmanInstrument, lmms::Sf2Instrument, lmms::SlicerT, lmms::VestigeInstrument, and lmms::ZynAddSubFxInstrument.

◆ logo()

const PixmapLoader * Plugin::logo ( ) const

Return logo out of sub plugin or descriptor.

◆ type()

Type lmms::Plugin::type ( ) const
inline

Return plugin type.

Member Data Documentation

◆ m_descriptor

const Descriptor* lmms::Plugin::m_descriptor
private

◆ m_key

Descriptor::SubPluginFeatures::Key lmms::Plugin::m_key
private

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