LMMS
Loading...
Searching...
No Matches
lmms::Lv2ControlBase Class Reference

#include <Lv2ControlBase.h>

Inheritance diagram for lmms::Lv2ControlBase:
lmms::LinkedModelGroups lmms::Lv2FxControls lmms::Lv2Instrument

Public Member Functions

void shutdown ()
void init (Model *meAsModel)
const LilvPlugingetPlugin () const
Lv2Proccontrol (std::size_t idx)
const Lv2Proccontrol (std::size_t idx) const
bool hasGui () const
void setHasGui (bool val)
Public Member Functions inherited from lmms::LinkedModelGroups
virtual ~LinkedModelGroups ()=default
void linkAllModels ()
void saveSettings (class QDomDocument &doc, class QDomElement &that)
void loadSettings (const class QDomElement &that)

Static Public Member Functions

static Plugin::Type check (const LilvPlugin *m_plugin, std::vector< PluginIssue > &issues)

Protected Member Functions

 Lv2ControlBase (class Model *that, const QString &uri)
 Lv2ControlBase (const Lv2ControlBase &)=delete
 ~Lv2ControlBase () override
void reload ()
Lv2ControlBaseoperator= (const Lv2ControlBase &)=delete
LinkedModelGroupgetGroup (std::size_t idx) override
const LinkedModelGroupgetGroup (std::size_t idx) const override
void copyModelsFromLmms ()
void copyModelsToLmms () const
 Bring values from all ports to the LMMS core.
void copyBuffersFromLmms (const SampleFrame *buf, f_cnt_t frames)
 Copy buffer passed by LMMS into our ports.
void copyBuffersToLmms (SampleFrame *buf, f_cnt_t frames) const
 Copy our ports into buffers passed by LMMS.
void run (f_cnt_t frames)
 Run the Lv2 plugin instance for.
void saveSettings (QDomDocument &doc, QDomElement &that)
void loadSettings (const QDomElement &that)
void loadFile (const QString &file)
std::size_t controlCount () const
QString nodeName () const
bool hasNoteInput () const
void handleMidiInputEvent (const class MidiEvent &event, const class TimePos &time, f_cnt_t offset)

Private Attributes

std::vector< std::unique_ptr< Lv2Proc > > m_procs
bool m_hasGUI = false
unsigned m_channelsPerProc
const LilvPluginm_plugin

Detailed Description

Common base class for Lv2 plugins

This class contains a vector of Lv2Proc, usually 1 (for stereo plugins) or 2 (for mono plugins). Most of the logic is done there, this class primarily forwards work to the Lv2Proc and collects the results.

This class provides everything Lv2 plugins have in common. It's not named Lv2Plugin, because it does not inherit Instrument the Plugin subclass Effect does not inherit this class

This class would usually be a Model subclass. However, Qt doesn't allow this: inheriting only from Model will cause diamond inheritance for QObject, which will cause errors with Q_OBJECT making this a direct subclass of Instrument resp. EffectControls would require CRTP, which would make this class a template class, which would conflict with Q_OBJECT

The consequence is that this class can neither inherit QObject or Model, nor Instrument or EffectControls, which means in fact: this class contains no signals or slots, but it offers stubs for slots that shall be called by child classes this class can not override virtuals of Instrument or EffectControls, so it will offer functions that must be called by virtuals in its child class

Constructor & Destructor Documentation

◆ Lv2ControlBase() [1/2]

lmms::Lv2ControlBase::Lv2ControlBase ( class Model * that,
const QString & uri )
protected
Parameters
thatthe class inheriting this class and inheriting Model; this is the same pointer as this, but a different type
urithe Lv2 URI telling this class what plugin to construct

◆ Lv2ControlBase() [2/2]

lmms::Lv2ControlBase::Lv2ControlBase ( const Lv2ControlBase & )
protecteddelete

◆ ~Lv2ControlBase()

lmms::Lv2ControlBase::~Lv2ControlBase ( )
overrideprotecteddefault

Member Function Documentation

◆ check()

Plugin::Type lmms::Lv2ControlBase::check ( const LilvPlugin * m_plugin,
std::vector< PluginIssue > & issues )
static

◆ control() [1/2]

Lv2Proc * lmms::Lv2ControlBase::control ( std::size_t idx)
inline

◆ control() [2/2]

const Lv2Proc * lmms::Lv2ControlBase::control ( std::size_t idx) const
inline

◆ controlCount()

std::size_t lmms::Lv2ControlBase::controlCount ( ) const
protected

◆ copyBuffersFromLmms()

void lmms::Lv2ControlBase::copyBuffersFromLmms ( const SampleFrame * buf,
f_cnt_t frames )
protected

Copy buffer passed by LMMS into our ports.

◆ copyBuffersToLmms()

void lmms::Lv2ControlBase::copyBuffersToLmms ( SampleFrame * buf,
f_cnt_t frames ) const
protected

Copy our ports into buffers passed by LMMS.

◆ copyModelsFromLmms()

void lmms::Lv2ControlBase::copyModelsFromLmms ( )
protected

Copy values from the LMMS core (connected models, MIDI events, ...) into the respective ports

◆ copyModelsToLmms()

void lmms::Lv2ControlBase::copyModelsToLmms ( ) const
protected

Bring values from all ports to the LMMS core.

◆ getGroup() [1/2]

const LinkedModelGroup * lmms::Lv2ControlBase::getGroup ( std::size_t idx) const
overrideprotectedvirtual
See also
getGroup

Implements lmms::LinkedModelGroups.

◆ getGroup() [2/2]

LinkedModelGroup * lmms::Lv2ControlBase::getGroup ( std::size_t idx)
overrideprotectedvirtual

Derived classes must return the group with index idx, or nullptr if is out of range

Implements lmms::LinkedModelGroups.

◆ getPlugin()

const LilvPlugin * lmms::Lv2ControlBase::getPlugin ( ) const
inline

◆ handleMidiInputEvent()

void lmms::Lv2ControlBase::handleMidiInputEvent ( const class MidiEvent & event,
const class TimePos & time,
f_cnt_t offset )
protected

◆ hasGui()

bool lmms::Lv2ControlBase::hasGui ( ) const
inline

◆ hasNoteInput()

bool lmms::Lv2ControlBase::hasNoteInput ( ) const
protected

◆ init()

void lmms::Lv2ControlBase::init ( Model * meAsModel)

◆ loadFile()

void lmms::Lv2ControlBase::loadFile ( const QString & file)
protected

◆ loadSettings()

void lmms::Lv2ControlBase::loadSettings ( const QDomElement & that)
protected

◆ nodeName()

QString lmms::Lv2ControlBase::nodeName ( void ) const
inlineprotected

◆ operator=()

Lv2ControlBase & lmms::Lv2ControlBase::operator= ( const Lv2ControlBase & )
protecteddelete

◆ reload()

void lmms::Lv2ControlBase::reload ( )
protected

◆ run()

void lmms::Lv2ControlBase::run ( f_cnt_t frames)
protected

Run the Lv2 plugin instance for.

Parameters
framesframes

◆ saveSettings()

void lmms::Lv2ControlBase::saveSettings ( QDomDocument & doc,
QDomElement & that )
protected

◆ setHasGui()

void lmms::Lv2ControlBase::setHasGui ( bool val)
inline

◆ shutdown()

void lmms::Lv2ControlBase::shutdown ( )

Member Data Documentation

◆ m_channelsPerProc

unsigned lmms::Lv2ControlBase::m_channelsPerProc
private

◆ m_hasGUI

bool lmms::Lv2ControlBase::m_hasGUI = false
private

◆ m_plugin

const LilvPlugin* lmms::Lv2ControlBase::m_plugin
private

◆ m_procs

std::vector<std::unique_ptr<Lv2Proc> > lmms::Lv2ControlBase::m_procs
private

Independent processors If this is a mono effect, the vector will have size 2 in order to fulfill LMMS' requirement of having stereo input and output


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