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

#include <GigPlayer.h>

Inheritance diagram for lmms::GigInstrument:
lmms::Instrument lmms::Plugin lmms::Model lmms::JournallingObject lmms::SerializingObject

Public Slots

void openFile (const QString &_gigFile, bool updateTrackName=true)
void updatePatch ()
void updateSampleRate ()

Signals

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

Public Member Functions

 GigInstrument (InstrumentTrack *_instrument_track)
 ~GigInstrument () override
void play (SampleFrame *_working_buffer) override
void playNote (NotePlayHandle *_n, SampleFrame *_working_buffer) override
void deleteNotePluginData (NotePlayHandle *_n) override
void saveSettings (QDomDocument &_doc, QDomElement &_parent) override
void loadSettings (const QDomElement &_this) override
void loadFile (const QString &_file) override
AutomatableModelchildModel (const QString &_modelName) override
QString nodeName () const override
gui::PluginViewinstantiateView (QWidget *_parent) override
 Create a view for the model.
QString getCurrentPatchName ()
void setParameter (const QString &_param, const QString &_value)
Public Member Functions inherited from lmms::Instrument
 Instrument (InstrumentTrack *_instrument_track, const Descriptor *_descriptor, const Descriptor::SubPluginFeatures::Key *key=nullptr, Flags flags=Flag::NoFlags)
 ~Instrument () override=default
virtual bool hasNoteInput () const
virtual f_cnt_t beatLen (NotePlayHandle *_n) const
virtual float desiredReleaseTimeMs () const
f_cnt_t desiredReleaseFrames () const
sample_rate_t getSampleRate () const
bool isSingleStreamed () const
bool isMidiBased () const
bool isBendable () const
virtual bool handleMidiEvent (const MidiEvent &, const TimePos &=TimePos(), f_cnt_t offset=0)
QString fullDisplayName () const override
virtual bool isFromTrack (const Track *_track) const
InstrumentTrackinstrumentTrack () const
Public Member Functions inherited from lmms::Plugin
 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
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)
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 ()
void setHook (SerializingObjectHook *_hook)
SerializingObjectHookhook ()

Private Member Functions

 mapPropertyFromModel (int, getBank, setBank, m_bankNum)
 mapPropertyFromModel (int, getPatch, setPatch, m_patchNum)
void freeInstance ()
void getInstrument ()
Dimension getDimensions (gig::Region *pRegion, int velocity, bool release)
void loadSample (GigSample &sample, SampleFrame *sampleData, f_cnt_t samples)
f_cnt_t getLoopedIndex (f_cnt_t index, f_cnt_t startf, f_cnt_t endf) const
f_cnt_t getPingPongIndex (f_cnt_t index, f_cnt_t startf, f_cnt_t endf) const
void addSamples (GigNote &gignote, bool wantReleaseSample)

Private Attributes

GigInstancem_instance
gig::Instrument * m_instrument
QString m_filename
gui::LcdSpinBoxModel m_bankNum
gui::LcdSpinBoxModel m_patchNum
FloatModel m_gain
QMutex m_synthMutex
QMutex m_notesMutex
QList< GigNotem_notes
uint32_t m_RandomSeed
float m_currentKeyDimension

Friends

class gui::GigInstrumentView

Additional Inherited Members

Public Types inherited from lmms::Instrument
enum class  Flag { NoFlags = 0x00 , IsSingleStreamed = 0x01 , IsMidiBased = 0x02 , IsNotBendable = 0x04 }
using Flags = lmms::Flags<Flag>
Public Types inherited from lmms::Plugin
enum class  Type {
  Instrument , Effect , ImportFilter , ExportFilter ,
  Tool , Library , Other , Undefined = 255
}
using DescriptorList = QList<Descriptor*>
Static Public Member Functions inherited from lmms::Instrument
static Instrumentinstantiate (const QString &_plugin_name, InstrumentTrack *_instrument_track, const Plugin::Descriptor::SubPluginFeatures::Key *key, bool keyFromDnd=false)
Static Public Member Functions inherited from lmms::Plugin
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 inherited from lmms::Instrument
void applyFadeIn (SampleFrame *buf, NotePlayHandle *n)
void applyRelease (SampleFrame *buf, const NotePlayHandle *_n)
float computeReleaseTimeMsByFrameCount (f_cnt_t frames) const
Protected Member Functions inherited from lmms::Plugin
void collectErrorForUI (QString errMsg)
Protected Member Functions inherited from lmms::JournallingObject
void changeID (jo_id_t _id)

Constructor & Destructor Documentation

◆ GigInstrument()

lmms::GigInstrument::GigInstrument ( InstrumentTrack * _instrument_track)

◆ ~GigInstrument()

lmms::GigInstrument::~GigInstrument ( )
override

Member Function Documentation

◆ addSamples()

void lmms::GigInstrument::addSamples ( GigNote & gignote,
bool wantReleaseSample )
private

◆ childModel()

AutomatableModel * lmms::GigInstrument::childModel ( const QString & modelName)
overridevirtual

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

Reimplemented from lmms::Plugin.

◆ deleteNotePluginData()

void lmms::GigInstrument::deleteNotePluginData ( NotePlayHandle * _n)
overridevirtual

Reimplemented from lmms::Instrument.

◆ fileChanged

void lmms::GigInstrument::fileChanged ( )
signal

◆ fileLoading

void lmms::GigInstrument::fileLoading ( )
signal

◆ freeInstance()

void lmms::GigInstrument::freeInstance ( )
private

◆ getCurrentPatchName()

QString lmms::GigInstrument::getCurrentPatchName ( )

◆ getDimensions()

Dimension lmms::GigInstrument::getDimensions ( gig::Region * pRegion,
int velocity,
bool release )
private

◆ getInstrument()

void lmms::GigInstrument::getInstrument ( )
private

◆ getLoopedIndex()

f_cnt_t lmms::GigInstrument::getLoopedIndex ( f_cnt_t index,
f_cnt_t startf,
f_cnt_t endf ) const
private

◆ getPingPongIndex()

f_cnt_t lmms::GigInstrument::getPingPongIndex ( f_cnt_t index,
f_cnt_t startf,
f_cnt_t endf ) const
private

◆ instantiateView()

gui::PluginView * lmms::GigInstrument::instantiateView ( QWidget * )
overridevirtual

Create a view for the model.

Implements lmms::Plugin.

◆ loadFile()

void lmms::GigInstrument::loadFile ( const QString & file)
overridevirtual

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

Reimplemented from lmms::Plugin.

◆ loadSample()

void lmms::GigInstrument::loadSample ( GigSample & sample,
SampleFrame * sampleData,
f_cnt_t samples )
private

◆ loadSettings()

void lmms::GigInstrument::loadSettings ( const QDomElement & _this)
overridevirtual

◆ mapPropertyFromModel() [1/2]

lmms::GigInstrument::mapPropertyFromModel ( int ,
getBank ,
setBank ,
m_bankNum  )
private

◆ mapPropertyFromModel() [2/2]

lmms::GigInstrument::mapPropertyFromModel ( int ,
getPatch ,
setPatch ,
m_patchNum  )
private

◆ nodeName()

QString lmms::GigInstrument::nodeName ( void ) const
overridevirtual

◆ openFile

void lmms::GigInstrument::openFile ( const QString & _gigFile,
bool updateTrackName = true )
slot

◆ patchChanged

void lmms::GigInstrument::patchChanged ( )
signal

◆ play()

void lmms::GigInstrument::play ( SampleFrame * _working_buffer)
overridevirtual

Reimplemented from lmms::Instrument.

◆ playNote()

void lmms::GigInstrument::playNote ( NotePlayHandle * _n,
SampleFrame * _working_buffer )
overridevirtual

Reimplemented from lmms::Instrument.

◆ saveSettings()

void lmms::GigInstrument::saveSettings ( QDomDocument & _doc,
QDomElement & _parent )
overridevirtual

◆ setParameter()

void lmms::GigInstrument::setParameter ( const QString & _param,
const QString & _value )

◆ updatePatch

void lmms::GigInstrument::updatePatch ( )
slot

◆ updateSampleRate

void lmms::GigInstrument::updateSampleRate ( )
slot

◆ gui::GigInstrumentView

friend class gui::GigInstrumentView
friend

Member Data Documentation

◆ m_bankNum

gui::LcdSpinBoxModel lmms::GigInstrument::m_bankNum
private

◆ m_currentKeyDimension

float lmms::GigInstrument::m_currentKeyDimension
private

◆ m_filename

QString lmms::GigInstrument::m_filename
private

◆ m_gain

FloatModel lmms::GigInstrument::m_gain
private

◆ m_instance

GigInstance* lmms::GigInstrument::m_instance
private

◆ m_instrument

gig::Instrument* lmms::GigInstrument::m_instrument
private

◆ m_notes

QList<GigNote> lmms::GigInstrument::m_notes
private

◆ m_notesMutex

QMutex lmms::GigInstrument::m_notesMutex
private

◆ m_patchNum

gui::LcdSpinBoxModel lmms::GigInstrument::m_patchNum
private

◆ m_RandomSeed

uint32_t lmms::GigInstrument::m_RandomSeed
private

◆ m_synthMutex

QMutex lmms::GigInstrument::m_synthMutex
private

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