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

2 dimensional function plot More...

#include <Graph.h>

Inheritance diagram for lmms::graphModel:
lmms::Model

Public Slots

void setRange (float ymin, float ymax)
 Set range of y values.
void setLength (int _size)
void setSampleAt (int x, float val)
 Update one sample.
void setSamples (const float *_value)
 Update samples array.
void setWaveToSine ()
void setWaveToTriangle ()
void setWaveToSaw ()
void setWaveToSquare ()
void setWaveToNoise ()
QString setWaveToUser ()
void smooth ()
void smoothNonCyclic ()
void normalize ()
void invert ()
void shiftPhase (int _deg)
void clear ()
void clearInvisible ()

Signals

void lengthChanged ()
void samplesChanged (int startPos, int endPos)
void rangeChanged ()
Signals inherited from lmms::Model
void dataChanged ()
void dataUnchanged ()
void propertiesChanged ()

Public Member Functions

 graphModel (float _min, float _max, int _size, Model *_parent, bool _default_constructed=false, float _step=0.0)
 Constructor.
 ~graphModel () override=default
float minValue () const
float maxValue () const
int length () const
const float * samples () const
void convolve (const float *convolution, const int convolutionLength, const int centerOffset)
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

Private Member Functions

void drawSampleAt (int x, float val)

Private Attributes

QVector< float > m_samples
int m_length
float m_minValue
float m_maxValue
float m_step

Friends

class gui::Graph

Detailed Description

2 dimensional function plot

Function plot graph with discrete x scale and continous y scale This makes it possible to display "#x" samples

Constructor & Destructor Documentation

◆ graphModel()

lmms::graphModel::graphModel ( float _min,
float _max,
int _size,
Model * _parent,
bool _default_constructed = false,
float _step = 0.0 )

Constructor.

Parameters
_minMinimum y value to display
_maxMaximum y value to display
_sizeNumber of samples (e.g. x value)
_stepStep size on y axis where values snap to, or 0.0f for "no snapping"

◆ ~graphModel()

lmms::graphModel::~graphModel ( )
overridedefault

Member Function Documentation

◆ clear

void lmms::graphModel::clear ( )
slot

◆ clearInvisible

void lmms::graphModel::clearInvisible ( )
slot

◆ convolve()

void lmms::graphModel::convolve ( const float * convolution,
const int convolutionLength,
const int centerOffset )

Make cyclic convolution

Parameters
convolutionSamples to convolve with
convolutionLengthNumber of samples to take for each sum
centerOffsetOffset for resulting values

◆ drawSampleAt()

void lmms::graphModel::drawSampleAt ( int x,
float val )
private

◆ invert

void lmms::graphModel::invert ( )
slot

◆ length()

int lmms::graphModel::length ( ) const
inline

◆ lengthChanged

void lmms::graphModel::lengthChanged ( )
signal

◆ maxValue()

float lmms::graphModel::maxValue ( ) const
inline

◆ minValue()

float lmms::graphModel::minValue ( ) const
inline

◆ normalize

void lmms::graphModel::normalize ( )
slot

◆ rangeChanged

void lmms::graphModel::rangeChanged ( )
signal

◆ samples()

const float * lmms::graphModel::samples ( ) const
inline

◆ samplesChanged

void lmms::graphModel::samplesChanged ( int startPos,
int endPos )
signal

◆ setLength

void lmms::graphModel::setLength ( int _size)
slot

◆ setRange

void lmms::graphModel::setRange ( float ymin,
float ymax )
slot

Set range of y values.

◆ setSampleAt

void lmms::graphModel::setSampleAt ( int x,
float val )
slot

Update one sample.

◆ setSamples

void lmms::graphModel::setSamples ( const float * _value)
slot

Update samples array.

◆ setWaveToNoise

void lmms::graphModel::setWaveToNoise ( )
slot

◆ setWaveToSaw

void lmms::graphModel::setWaveToSaw ( )
slot

◆ setWaveToSine

void lmms::graphModel::setWaveToSine ( )
slot

◆ setWaveToSquare

void lmms::graphModel::setWaveToSquare ( )
slot

◆ setWaveToTriangle

void lmms::graphModel::setWaveToTriangle ( )
slot

◆ setWaveToUser

QString lmms::graphModel::setWaveToUser ( )
slot

◆ shiftPhase

void lmms::graphModel::shiftPhase ( int _deg)
slot

◆ smooth

void lmms::graphModel::smooth ( )
slot

◆ smoothNonCyclic

void lmms::graphModel::smoothNonCyclic ( )
slot

◆ gui::Graph

friend class gui::Graph
friend

Member Data Documentation

◆ m_length

int lmms::graphModel::m_length
private

◆ m_maxValue

float lmms::graphModel::m_maxValue
private

◆ m_minValue

float lmms::graphModel::m_minValue
private

◆ m_samples

QVector<float> lmms::graphModel::m_samples
private

◆ m_step

float lmms::graphModel::m_step
private

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