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

#include <TempoSyncKnobModel.h>

Inheritance diagram for lmms::TempoSyncKnobModel:
lmms::FloatModel lmms::TypedAutomatableModel< float > lmms::AutomatableModel lmms::Model lmms::JournallingObject lmms::SerializingObject

Public Types

enum class  SyncMode {
  None , DoubleWholeNote , WholeNote , HalfNote ,
  QuarterNote , EighthNote , SixteenthNote , ThirtysecondNote ,
  Custom
}
Public Types inherited from lmms::AutomatableModel
enum class  ScaleType { Linear , Logarithmic , Decibel }

Public Slots

void disableSync ()
void setTempoSync (SyncMode _note_type)
void setTempoSync (QAction *_item)
Public Slots inherited from lmms::AutomatableModel
virtual void reset ()
void unlink ()
void unlinkControllerConnection ()
void setUseControllerValue (bool b=true)

Signals

void syncModeChanged (lmms::TempoSyncKnobModel::SyncMode _new_mode)
void scaleChanged (float _new_scale)
Signals inherited from lmms::AutomatableModel
void initValueChanged (float val)
void destroyed (lmms::jo_id_t id)
Signals inherited from lmms::Model
void dataChanged ()
void dataUnchanged ()
void propertiesChanged ()

Public Member Functions

 TempoSyncKnobModel (const float _val, const float _min, const float _max, const float _step, const float _scale, Model *_parent, const QString &_display_name=QString())
 ~TempoSyncKnobModel () override=default
void saveSettings (QDomDocument &_doc, QDomElement &_this, const QString &name) override
 Saves settings (value, automation links and controller connections) of AutomatableModel into specified DOM element using <name> as attribute/node name.
void loadSettings (const QDomElement &_this, const QString &name) override
 Loads settings (value, automation links and controller connections) of AutomatableModel from specified DOM element using <name> as attribute/node name.
SyncMode syncMode () const
void setSyncMode (SyncMode _new_mode)
float scale () const
void setScale (float _new_scale)
MeterModelgetCustomMeterModel ()
MeterModel constgetCustomMeterModel () const
Public Member Functions inherited from lmms::FloatModel
 FloatModel (float val=0, float min=0, float max=0, float step=0, Model *parent=nullptr, const QString &displayName=QString(), bool defaultConstructed=false)
float getRoundedValue () const
int getDigitCount () const
QString displayValue (const float val) const override
Public Member Functions inherited from lmms::TypedAutomatableModel< float >
 AutomatableModel (const float val=0, const float min=0, const float max=0, const float step=0, Model *parent=nullptr, const QString &displayName=QString(), bool defaultConstructed=false)
float value (int frameOffset=0) const
float initValue () const
float minValue () const
float maxValue () const
Public Member Functions inherited from lmms::AutomatableModel
 ~AutomatableModel () override
virtual void accept (ModelVisitor &v)=0
virtual void accept (ConstModelVisitor &v) const =0
template<class Target>
Target * dynamicCast (bool doThrow=false)
 Return this class casted to Target.
template<class Target>
const Target * dynamicCast (bool doThrow=false) const
 const overload, see overloaded function
bool isAutomated () const
bool isAutomatedOrControlled () const
ControllerConnectioncontrollerConnection () const
void setControllerConnection (ControllerConnection *c)
template<class T>
value (int frameOffset=0) const
float controllerValue (int frameOffset) const
ValueBuffervalueBuffer ()
 Function that returns sample-exact data as a ValueBuffer.
template<class T>
initValue () const
bool isAtInitValue () const
template<class T>
minValue () const
template<class T>
maxValue () const
template<class T>
step () const
float scaledValue (float value) const
 Returns value scaled with the scale type and min/max values of this model.
float inverseScaledValue (float value) const
 Returns value applied with the inverse of this model's scale type.
void setInitValue (const float value)
void setValue (const float value, const bool isAutomated=false)
void incValue (int steps)
float range () const
void setRange (const float min, const float max, const float step=1)
void setScaleType (ScaleType sc)
void setScaleLogarithmic (bool setToTrue=true)
bool isScaleLogarithmic () const
void setStep (const float step)
float centerValue () const
void setCenterValue (const float centerVal)
void linkToModel (AutomatableModel *model)
 link this to model, copying the value from model
size_t countLinks () const
QString nodeName () const override
bool isLinked () const
bool isValueChanged ()
float globalAutomationValueAt (const TimePos &time)
void setStrictStepSize (const bool b)
bool useControllerValue () const
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 QString displayName () 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 ()
void setHook (SerializingObjectHook *_hook)
SerializingObjectHookhook ()

Protected Slots

void calculateTempoSyncTime (lmms::bpm_t _bpm)
void updateCustom ()

Private Attributes

SyncMode m_tempoSyncMode
SyncMode m_tempoLastSyncMode
float m_scale
MeterModel m_custom

Friends

class gui::TempoSyncKnob

Additional Inherited Members

Static Public Member Functions inherited from lmms::AutomatableModel
template<class T>
static T castValue (const float v)
template<bool>
static bool castValue (const float v)
static void incrementPeriodCounter ()
static void resetPeriodCounter ()
Protected Member Functions inherited from lmms::AutomatableModel
 AutomatableModel (const float val=0, const float min=0, const float max=0, const float step=0, Model *parent=nullptr, const QString &displayName=QString(), bool defaultConstructed=false)
float fittedValue (float value) const
Protected Member Functions inherited from lmms::JournallingObject
void changeID (jo_id_t _id)

Member Enumeration Documentation

◆ SyncMode

Enumerator
None 
DoubleWholeNote 
WholeNote 
HalfNote 
QuarterNote 
EighthNote 
SixteenthNote 
ThirtysecondNote 
Custom 

Constructor & Destructor Documentation

◆ TempoSyncKnobModel()

lmms::TempoSyncKnobModel::TempoSyncKnobModel ( const float _val,
const float _min,
const float _max,
const float _step,
const float _scale,
Model * _parent,
const QString & _display_name = QString() )

◆ ~TempoSyncKnobModel()

lmms::TempoSyncKnobModel::~TempoSyncKnobModel ( )
overridedefault

Member Function Documentation

◆ calculateTempoSyncTime

void lmms::TempoSyncKnobModel::calculateTempoSyncTime ( lmms::bpm_t _bpm)
protectedslot

◆ disableSync

void lmms::TempoSyncKnobModel::disableSync ( )
inlineslot

◆ getCustomMeterModel() [1/2]

MeterModel & lmms::TempoSyncKnobModel::getCustomMeterModel ( )
inline

◆ getCustomMeterModel() [2/2]

MeterModel const & lmms::TempoSyncKnobModel::getCustomMeterModel ( ) const
inline

◆ loadSettings()

void lmms::TempoSyncKnobModel::loadSettings ( const QDomElement & element,
const QString & name )
overridevirtual

Loads settings (value, automation links and controller connections) of AutomatableModel from specified DOM element using <name> as attribute/node name.

Reimplemented from lmms::AutomatableModel.

◆ saveSettings()

void lmms::TempoSyncKnobModel::saveSettings ( QDomDocument & doc,
QDomElement & element,
const QString & name )
overridevirtual

Saves settings (value, automation links and controller connections) of AutomatableModel into specified DOM element using <name> as attribute/node name.

Parameters
docTODO
elementWhere this option shall be saved. Depending on the model, this can be done in an attribute or in a subnode.
nameName to store this model as.

Reimplemented from lmms::AutomatableModel.

◆ scale()

float lmms::TempoSyncKnobModel::scale ( ) const
inline

◆ scaleChanged

void lmms::TempoSyncKnobModel::scaleChanged ( float _new_scale)
signal

◆ setScale()

void lmms::TempoSyncKnobModel::setScale ( float _new_scale)

◆ setSyncMode()

void lmms::TempoSyncKnobModel::setSyncMode ( SyncMode _new_mode)

◆ setTempoSync [1/2]

void lmms::TempoSyncKnobModel::setTempoSync ( QAction * _item)
slot

◆ setTempoSync [2/2]

void lmms::TempoSyncKnobModel::setTempoSync ( SyncMode _note_type)
slot

◆ syncMode()

SyncMode lmms::TempoSyncKnobModel::syncMode ( ) const
inline

◆ syncModeChanged

void lmms::TempoSyncKnobModel::syncModeChanged ( lmms::TempoSyncKnobModel::SyncMode _new_mode)
signal

◆ updateCustom

void lmms::TempoSyncKnobModel::updateCustom ( )
protectedslot

◆ gui::TempoSyncKnob

friend class gui::TempoSyncKnob
friend

Member Data Documentation

◆ m_custom

MeterModel lmms::TempoSyncKnobModel::m_custom
private

◆ m_scale

float lmms::TempoSyncKnobModel::m_scale
private

◆ m_tempoLastSyncMode

SyncMode lmms::TempoSyncKnobModel::m_tempoLastSyncMode
private

◆ m_tempoSyncMode

SyncMode lmms::TempoSyncKnobModel::m_tempoSyncMode
private

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