LMMS
Loading...
Searching...
No Matches
lmms::gui::Graph Class Reference

#include <Graph.h>

Inheritance diagram for lmms::gui::Graph:
lmms::gui::ModelView

Public Types

enum class  Style { Nearest , Linear , LinearNonCyclic , Bar }

Signals

void drawn ()

Public Member Functions

 Graph (QWidget *_parent, Style _style=Style::Linear, int _width=132, int _height=104)
 Constructor.
 ~Graph () override=default
void setForeground (const QPixmap &_pixmap)
void setGraphColor (const QColor)
graphModelmodel ()
Style getGraphStyle ()
void setGraphStyle (Style _s)
Public Member Functions inherited from lmms::gui::ModelView
 ModelView (Model *model, QWidget *widget)
virtual ~ModelView ()
virtual void setModel (Model *model, bool isOldModelValid=true)
virtual void unsetModel ()
Modelmodel ()
const Modelmodel () const
template<class T>
T * castModel ()
template<class T>
const T * castModel () const

Protected Slots

void updateGraph (int _startPos, int _endPos)
void updateGraph ()

Protected Member Functions

void paintEvent (QPaintEvent *_pe) override
void dropEvent (QDropEvent *_de) override
void dragEnterEvent (QDragEnterEvent *_dee) override
void mousePressEvent (QMouseEvent *_me) override
void mouseMoveEvent (QMouseEvent *_me) override
void mouseReleaseEvent (QMouseEvent *_me) override
Protected Member Functions inherited from lmms::gui::ModelView
QWidget * widget ()
virtual void doConnections ()

Private Member Functions

void modelChanged () override
void changeSampleAt (int _x, int _y)
void drawLineAt (int _x, int _y, int _lastx)

Private Attributes

QPixmap m_foreground
QColor m_graphColor
Style m_graphStyle
bool m_mouseDown
int m_lastCursorX

Member Enumeration Documentation

◆ Style

enum class lmms::gui::Graph::Style
strong
Enumerator
Nearest 

draw as stairs

Linear 

connect each 2 samples with a line, with wrapping

LinearNonCyclic 

Linear without wrapping.

Bar 

draw thick bars

Constructor & Destructor Documentation

◆ Graph()

lmms::gui::Graph::Graph ( QWidget * _parent,
Style _style = Style::Linear,
int _width = 132,
int _height = 104 )

Constructor.

Parameters
_widthPixel width of widget
_heightPixel height of widget

◆ ~Graph()

lmms::gui::Graph::~Graph ( )
overridedefault

Member Function Documentation

◆ changeSampleAt()

void lmms::gui::Graph::changeSampleAt ( int _x,
int _y )
private

◆ dragEnterEvent()

void lmms::gui::Graph::dragEnterEvent ( QDragEnterEvent * _dee)
overrideprotected

◆ drawLineAt()

void lmms::gui::Graph::drawLineAt ( int _x,
int _y,
int _lastx )
private

◆ drawn

void lmms::gui::Graph::drawn ( )
signal

◆ dropEvent()

void lmms::gui::Graph::dropEvent ( QDropEvent * _de)
overrideprotected

◆ getGraphStyle()

Style lmms::gui::Graph::getGraphStyle ( )
inline

◆ model()

graphModel * lmms::gui::Graph::model ( )
inline

◆ modelChanged()

void lmms::gui::Graph::modelChanged ( )
overrideprivatevirtual

Reimplemented from lmms::gui::ModelView.

◆ mouseMoveEvent()

void lmms::gui::Graph::mouseMoveEvent ( QMouseEvent * _me)
overrideprotected

◆ mousePressEvent()

void lmms::gui::Graph::mousePressEvent ( QMouseEvent * _me)
overrideprotected

◆ mouseReleaseEvent()

void lmms::gui::Graph::mouseReleaseEvent ( QMouseEvent * _me)
overrideprotected

◆ paintEvent()

void lmms::gui::Graph::paintEvent ( QPaintEvent * _pe)
overrideprotected

◆ setForeground()

void lmms::gui::Graph::setForeground ( const QPixmap & _pixmap)

◆ setGraphColor()

void lmms::gui::Graph::setGraphColor ( const QColor _graphcol)

◆ setGraphStyle()

void lmms::gui::Graph::setGraphStyle ( Style _s)
inline

◆ updateGraph [1/2]

void lmms::gui::Graph::updateGraph ( )
protectedslot

◆ updateGraph [2/2]

void lmms::gui::Graph::updateGraph ( int _startPos,
int _endPos )
protectedslot

Member Data Documentation

◆ m_foreground

QPixmap lmms::gui::Graph::m_foreground
private

◆ m_graphColor

QColor lmms::gui::Graph::m_graphColor
private

◆ m_graphStyle

Style lmms::gui::Graph::m_graphStyle
private

◆ m_lastCursorX

int lmms::gui::Graph::m_lastCursorX
private

◆ m_mouseDown

bool lmms::gui::Graph::m_mouseDown
private

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