lmms
Cross-platform music production software
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
auto midiPatch () const -> std::optional< MidiPatch > override
 For applicable instruments: Provides host with current MIDI bank and program.
AutomatableModel * childModel (std::string_view modelName) override
QString nodeName () const override
gui::PluginView * instantiateView (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
InstrumentTrack * instrumentTrack () const
Public Member Functions inherited from lmms::Plugin
 Plugin (const Descriptor *descriptor, Model *parent, const Descriptor::SubPluginFeatures::Key *key=nullptr)
 Constructor of a plugin.
 ~Plugin () override=default
QString displayName () const override
 Return display-name out of sub plugin or descriptor.
const PixmapLoader * logo () const
 Return logo out of sub plugin or descriptor.
Type type () const
 Return plugin type.
const Descriptor * descriptor () const
 Return plugin Descriptor.
const Descriptor::SubPluginFeatures::Key & key () const
gui::PluginView * createView (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
Model * parentModel () 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)
SerializingObjectHook * hook ()

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

GigInstance * m_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< GigNote > m_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 Instrument * instantiate (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 Plugin * instantiateWithKey (const QString &pluginName, Model *parent, const Descriptor::SubPluginFeatures::Key *key, bool keyFromDnd=false)
static Plugin * instantiate (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 ( std::string_view modelName)
overridevirtual

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

Reimplemented from lmms::Instrument.

◆ 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 * _parent)
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

◆ midiPatch()

auto lmms::GigInstrument::midiPatch ( ) const -> std::optional< MidiPatch >
overridevirtual

For applicable instruments: Provides host with current MIDI bank and program.

Reimplemented from lmms::Instrument.

◆ 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: