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

#include <TrackContentWidget.h>

Inheritance diagram for lmms::gui::TrackContentWidget:
lmms::JournallingObject lmms::SerializingObject

Public Slots

void update ()
 Update ourselves by updating all the ClipViews attached.
void changePosition (const lmms::TimePos &newPos=TimePos(-1))
 Move the trackContentWidget to a new place in time.
void updateBackground ()
 Updates the background tile pixmap.

Public Member Functions

 TrackContentWidget (TrackView *parent)
 Create a new trackContentWidget.
 ~TrackContentWidget () override=default
void addClipView (ClipView *clipv)
 Adds a ClipView to this widget.
void removeClipView (ClipView *clipv)
 Removes the given ClipView from this widget.
void removeClipView (int clipNum)
bool canPasteSelection (TimePos clipPos, const QDropEvent *de)
 Returns whether a selection of Clips can be pasted into this.
bool canPasteSelection (TimePos clipPos, const QMimeData *md, bool allowSameBar=false)
bool pasteSelection (TimePos clipPos, QDropEvent *de)
 Pastes a selection of Clips onto the track.
bool pasteSelection (TimePos clipPos, const QMimeData *md, bool skipSafetyCheck=false)
TimePos endPosition (const TimePos &posStart)
 Return the end position of the trackContentWidget in Bars.
QBrush darkerColor () const
 CSS theming qproperty access method.
QBrush lighterColor () const
 CSS theming qproperty access method.
QBrush coarseGridColor () const
 CSS theming qproperty access method.
QBrush fineGridColor () const
 CSS theming qproperty access method.
QBrush horizontalColor () const
 CSS theming qproperty access method.
QBrush embossColor () const
 CSS theming qproperty access method.
int coarseGridWidth () const
 CSS theming qproperty access method.
int fineGridWidth () const
 CSS theming qproperty access method.
int horizontalWidth () const
 CSS theming qproperty access method.
int embossWidth () const
 CSS theming qproperty access method.
int embossOffset () const
 CSS theming qproperty access method.
void setDarkerColor (const QBrush &c)
 CSS theming qproperty access method.
void setLighterColor (const QBrush &c)
 CSS theming qproperty access method.
void setCoarseGridColor (const QBrush &c)
 CSS theming qproperty access method.
void setFineGridColor (const QBrush &c)
 CSS theming qproperty access method.
void setHorizontalColor (const QBrush &c)
 CSS theming qproperty access method.
void setEmbossColor (const QBrush &c)
 CSS theming qproperty access method.
void setCoarseGridWidth (int c)
 CSS theming qproperty access method.
void setFineGridWidth (int c)
 CSS theming qproperty access method.
void setHorizontalWidth (int c)
 CSS theming qproperty access method.
void setEmbossWidth (int c)
 CSS theming qproperty access method.
void setEmbossOffset (int c)
 CSS theming qproperty access method.
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 Types

enum class  ContextMenuAction { Paste }

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *cme) override
void contextMenuAction (QContextMenuEvent *cme, ContextMenuAction action)
void dragEnterEvent (QDragEnterEvent *dee) override
 Respond to a drag enter event on the trackContentWidget.
void dropEvent (QDropEvent *de) override
 Respond to a drop event on the trackContentWidget.
void mousePressEvent (QMouseEvent *me) override
 Respond to a mouse press on the trackContentWidget.
void mouseReleaseEvent (QMouseEvent *me) override
void paintEvent (QPaintEvent *pe) override
 Repaint the trackContentWidget on command.
void resizeEvent (QResizeEvent *re) override
 Updates the background tile pixmap on size changes.
QString nodeName () const override
void saveSettings (QDomDocument &doc, QDomElement &element) override
void loadSettings (const QDomElement &element) override
Protected Member Functions inherited from lmms::JournallingObject
void changeID (jo_id_t _id)

Properties

QBrush darkerColor
QBrush lighterColor
QBrush coarseGridColor
QBrush fineGridColor
QBrush horizontalColor
QBrush embossColor
int coarseGridWidth
int fineGridWidth
int horizontalWidth
int embossWidth
int embossOffset

Private Types

using clipViewVector = QVector<ClipView*>

Private Member Functions

TrackgetTrack ()
 Return the track shown by the trackContentWidget.
TimePos getPosition (int mouseX)
 Return the position of the trackContentWidget in bars.

Private Attributes

TrackViewm_trackView
clipViewVector m_clipViews
QPixmap m_background
QBrush m_darkerColor
QBrush m_lighterColor
QBrush m_coarseGridColor
QBrush m_fineGridColor
QBrush m_horizontalColor
QBrush m_embossColor
int m_coarseGridWidth
int m_fineGridWidth
int m_horizontalWidth
int m_embossWidth
int m_embossOffset

Member Typedef Documentation

◆ clipViewVector

Member Enumeration Documentation

◆ ContextMenuAction

Enumerator
Paste 

Constructor & Destructor Documentation

◆ TrackContentWidget()

lmms::gui::TrackContentWidget::TrackContentWidget ( TrackView * parent)

Create a new trackContentWidget.

Creates a new track content widget for the given track. The content widget comprises the 'grip bar' and the 'tools' button for the track's context menu.

Parameters
parentThe parent track.

◆ ~TrackContentWidget()

lmms::gui::TrackContentWidget::~TrackContentWidget ( )
overridedefault

Member Function Documentation

◆ addClipView()

void lmms::gui::TrackContentWidget::addClipView ( ClipView * clipv)

Adds a ClipView to this widget.

Adds a(nother) ClipView to our list of views. We also check that our position is up-to-date.

Parameters
clipvThe ClipView to add.

◆ canPasteSelection() [1/2]

bool lmms::gui::TrackContentWidget::canPasteSelection ( TimePos clipPos,
const QDropEvent * de )

Returns whether a selection of Clips can be pasted into this.

Parameters
clipPosthe position of the Clip slot being pasted on
dethe DropEvent generated

◆ canPasteSelection() [2/2]

bool lmms::gui::TrackContentWidget::canPasteSelection ( TimePos clipPos,
const QMimeData * md,
bool allowSameBar = false )

◆ changePosition

void lmms::gui::TrackContentWidget::changePosition ( const lmms::TimePos & newPos = TimePos( -1 ))
slot

Move the trackContentWidget to a new place in time.

Parameters
newPosThe MIDI time to move to.

◆ coarseGridColor()

QBrush lmms::gui::TrackContentWidget::coarseGridColor ( ) const

CSS theming qproperty access method.

◆ coarseGridWidth()

int lmms::gui::TrackContentWidget::coarseGridWidth ( ) const

CSS theming qproperty access method.

◆ contextMenuAction()

void lmms::gui::TrackContentWidget::contextMenuAction ( QContextMenuEvent * cme,
ContextMenuAction action )
protected

◆ contextMenuEvent()

void lmms::gui::TrackContentWidget::contextMenuEvent ( QContextMenuEvent * cme)
overrideprotected

◆ darkerColor()

QBrush lmms::gui::TrackContentWidget::darkerColor ( ) const

CSS theming qproperty access method.

◆ dragEnterEvent()

void lmms::gui::TrackContentWidget::dragEnterEvent ( QDragEnterEvent * dee)
overrideprotected

Respond to a drag enter event on the trackContentWidget.

Parameters
deethe Drag Enter Event to respond to

◆ dropEvent()

void lmms::gui::TrackContentWidget::dropEvent ( QDropEvent * de)
overrideprotected

Respond to a drop event on the trackContentWidget.

Parameters
dethe Drop Event to respond to

◆ embossColor()

QBrush lmms::gui::TrackContentWidget::embossColor ( ) const

CSS theming qproperty access method.

◆ embossOffset()

int lmms::gui::TrackContentWidget::embossOffset ( ) const

CSS theming qproperty access method.

◆ embossWidth()

int lmms::gui::TrackContentWidget::embossWidth ( ) const

CSS theming qproperty access method.

◆ endPosition()

TimePos lmms::gui::TrackContentWidget::endPosition ( const TimePos & posStart)

Return the end position of the trackContentWidget in Bars.

Parameters
posStartthe starting position of the Widget (from getPosition())

◆ fineGridColor()

QBrush lmms::gui::TrackContentWidget::fineGridColor ( ) const

CSS theming qproperty access method.

◆ fineGridWidth()

int lmms::gui::TrackContentWidget::fineGridWidth ( ) const

CSS theming qproperty access method.

◆ getPosition()

TimePos lmms::gui::TrackContentWidget::getPosition ( int mouseX)
private

Return the position of the trackContentWidget in bars.

Parameters
mouseXthe mouse's current X position in pixels.

◆ getTrack()

Track * lmms::gui::TrackContentWidget::getTrack ( )
private

Return the track shown by the trackContentWidget.

◆ horizontalColor()

QBrush lmms::gui::TrackContentWidget::horizontalColor ( ) const

CSS theming qproperty access method.

◆ horizontalWidth()

int lmms::gui::TrackContentWidget::horizontalWidth ( ) const

CSS theming qproperty access method.

◆ lighterColor()

QBrush lmms::gui::TrackContentWidget::lighterColor ( ) const

CSS theming qproperty access method.

◆ loadSettings()

void lmms::gui::TrackContentWidget::loadSettings ( const QDomElement & element)
inlineoverrideprotectedvirtual

◆ mousePressEvent()

void lmms::gui::TrackContentWidget::mousePressEvent ( QMouseEvent * me)
overrideprotected

Respond to a mouse press on the trackContentWidget.

Parameters
methe mouse press event to respond to

◆ mouseReleaseEvent()

void lmms::gui::TrackContentWidget::mouseReleaseEvent ( QMouseEvent * me)
overrideprotected

◆ nodeName()

QString lmms::gui::TrackContentWidget::nodeName ( void ) const
inlineoverrideprotectedvirtual

◆ paintEvent()

void lmms::gui::TrackContentWidget::paintEvent ( QPaintEvent * pe)
overrideprotected

Repaint the trackContentWidget on command.

Parameters
pethe Paint Event to respond to

◆ pasteSelection() [1/2]

bool lmms::gui::TrackContentWidget::pasteSelection ( TimePos clipPos,
const QMimeData * md,
bool skipSafetyCheck = false )

◆ pasteSelection() [2/2]

bool lmms::gui::TrackContentWidget::pasteSelection ( TimePos clipPos,
QDropEvent * de )

Pastes a selection of Clips onto the track.

Parameters
clipPosthe position of the Clip slot being pasted on
dethe DropEvent generated

◆ removeClipView() [1/2]

void lmms::gui::TrackContentWidget::removeClipView ( ClipView * clipv)

Removes the given ClipView from this widget.

Removes the given ClipView from our list of views.

Parameters
clipvThe ClipView to add.

◆ removeClipView() [2/2]

void lmms::gui::TrackContentWidget::removeClipView ( int clipNum)
inline

◆ resizeEvent()

void lmms::gui::TrackContentWidget::resizeEvent ( QResizeEvent * resizeEvent)
overrideprotected

Updates the background tile pixmap on size changes.

Parameters
resizeEventthe resize event to pass to base class

◆ saveSettings()

void lmms::gui::TrackContentWidget::saveSettings ( QDomDocument & doc,
QDomElement & element )
inlineoverrideprotectedvirtual

◆ setCoarseGridColor()

void lmms::gui::TrackContentWidget::setCoarseGridColor ( const QBrush & c)

CSS theming qproperty access method.

◆ setCoarseGridWidth()

void lmms::gui::TrackContentWidget::setCoarseGridWidth ( int c)

CSS theming qproperty access method.

◆ setDarkerColor()

void lmms::gui::TrackContentWidget::setDarkerColor ( const QBrush & c)

CSS theming qproperty access method.

◆ setEmbossColor()

void lmms::gui::TrackContentWidget::setEmbossColor ( const QBrush & c)

CSS theming qproperty access method.

◆ setEmbossOffset()

void lmms::gui::TrackContentWidget::setEmbossOffset ( int c)

CSS theming qproperty access method.

◆ setEmbossWidth()

void lmms::gui::TrackContentWidget::setEmbossWidth ( int c)

CSS theming qproperty access method.

◆ setFineGridColor()

void lmms::gui::TrackContentWidget::setFineGridColor ( const QBrush & c)

CSS theming qproperty access method.

◆ setFineGridWidth()

void lmms::gui::TrackContentWidget::setFineGridWidth ( int c)

CSS theming qproperty access method.

◆ setHorizontalColor()

void lmms::gui::TrackContentWidget::setHorizontalColor ( const QBrush & c)

CSS theming qproperty access method.

◆ setHorizontalWidth()

void lmms::gui::TrackContentWidget::setHorizontalWidth ( int c)

CSS theming qproperty access method.

◆ setLighterColor()

void lmms::gui::TrackContentWidget::setLighterColor ( const QBrush & c)

CSS theming qproperty access method.

◆ update

void lmms::gui::TrackContentWidget::update ( )
slot

Update ourselves by updating all the ClipViews attached.

◆ updateBackground

void lmms::gui::TrackContentWidget::updateBackground ( )
slot

Updates the background tile pixmap.

Member Data Documentation

◆ m_background

QPixmap lmms::gui::TrackContentWidget::m_background
private

◆ m_clipViews

clipViewVector lmms::gui::TrackContentWidget::m_clipViews
private

◆ m_coarseGridColor

QBrush lmms::gui::TrackContentWidget::m_coarseGridColor
private

◆ m_coarseGridWidth

int lmms::gui::TrackContentWidget::m_coarseGridWidth
private

◆ m_darkerColor

QBrush lmms::gui::TrackContentWidget::m_darkerColor
private

◆ m_embossColor

QBrush lmms::gui::TrackContentWidget::m_embossColor
private

◆ m_embossOffset

int lmms::gui::TrackContentWidget::m_embossOffset
private

◆ m_embossWidth

int lmms::gui::TrackContentWidget::m_embossWidth
private

◆ m_fineGridColor

QBrush lmms::gui::TrackContentWidget::m_fineGridColor
private

◆ m_fineGridWidth

int lmms::gui::TrackContentWidget::m_fineGridWidth
private

◆ m_horizontalColor

QBrush lmms::gui::TrackContentWidget::m_horizontalColor
private

◆ m_horizontalWidth

int lmms::gui::TrackContentWidget::m_horizontalWidth
private

◆ m_lighterColor

QBrush lmms::gui::TrackContentWidget::m_lighterColor
private

◆ m_trackView

TrackView* lmms::gui::TrackContentWidget::m_trackView
private

Property Documentation

◆ coarseGridColor

QBrush lmms::gui::TrackContentWidget::coarseGridColor
readwrite

◆ coarseGridWidth

int lmms::gui::TrackContentWidget::coarseGridWidth
readwrite

◆ darkerColor

QBrush lmms::gui::TrackContentWidget::darkerColor
readwrite

◆ embossColor

QBrush lmms::gui::TrackContentWidget::embossColor
readwrite

◆ embossOffset

int lmms::gui::TrackContentWidget::embossOffset
readwrite

◆ embossWidth

int lmms::gui::TrackContentWidget::embossWidth
readwrite

◆ fineGridColor

QBrush lmms::gui::TrackContentWidget::fineGridColor
readwrite

◆ fineGridWidth

int lmms::gui::TrackContentWidget::fineGridWidth
readwrite

◆ horizontalColor

QBrush lmms::gui::TrackContentWidget::horizontalColor
readwrite

◆ horizontalWidth

int lmms::gui::TrackContentWidget::horizontalWidth
readwrite

◆ lighterColor

QBrush lmms::gui::TrackContentWidget::lighterColor
readwrite

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