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

#include <AutomationEditor.h>

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

Public Types

enum class  EditMode { Draw , Erase , DrawOutValues , EditTangents }

Public Slots

void update ()
void updateAfterClipChange ()

Signals

void currentClipChanged ()

Public Member Functions

void setCurrentClip (AutomationClip *new_clip)
void setGhostMidiClip (MidiClip *newMidiClip)
void setGhostSample (SampleClip *newSample)
const AutomationClipcurrentClip () const
bool validClip () const
void saveSettings (QDomDocument &doc, QDomElement &parent) override
void loadSettings (const QDomElement &parent) override
QString nodeName () const override
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

using timeMap = AutomationClip::timeMap

Protected Slots

void play ()
void stop ()
void horScrolled (int new_pos)
void verScrolled (int new_pos)
void setEditMode (AutomationEditor::EditMode mode)
void setEditMode (int mode)
void setProgressionType (AutomationClip::ProgressionType type)
void setProgressionType (int type)
 This method handles the AutomationEditorWindow event of changing progression types. After that, it calls updateEditTanButton so the edit tangents button is updated accordingly.
void setTension ()
void updatePosition ()
void zoomingXChanged ()
void zoomingYChanged ()
void setQuantization ()
 Updates the clip's quantization using the current user selected value.
void resetGhostNotes ()

Protected Member Functions

void keyPressEvent (QKeyEvent *ke) override
void leaveEvent (QEvent *e) override
void mousePressEvent (QMouseEvent *mouseEvent) override
void mouseDoubleClickEvent (QMouseEvent *mouseEvent) override
void mouseReleaseEvent (QMouseEvent *mouseEvent) override
void mouseMoveEvent (QMouseEvent *mouseEvent) override
void paintEvent (QPaintEvent *pe) override
void resizeEvent (QResizeEvent *re) override
void wheelEvent (QWheelEvent *we) override
float getLevel (int y)
int xCoordOfTick (int tick)
float yCoordOfLevel (float level)
void drawLevelTick (QPainter &p, int tick, float value)
timeMap::iterator getNodeAt (int x, int y, bool outValue=false, int r=5)
 Given a mouse coordinate, returns a timeMap::iterator that points to the first node inside a square of side "r" pixels from those coordinates. In simpler terms, returns the automation node on those coordinates.
timeMap::iterator getClosestNode (int x)
 Given a mouse X coordinate, returns a timeMap::iterator that points to the closest node.
void drawLine (int x0, float y0, int x1, float y1)
bool fineTuneValue (timeMap::iterator node, bool editingOutValue)
Protected Member Functions inherited from lmms::JournallingObject
void changeID (jo_id_t _id)

Properties

QColor barLineColor
QColor beatLineColor
QColor lineColor
QColor nodeInValueColor
QColor nodeOutValueColor
QColor nodeTangentLineColor
QBrush scaleColor
QBrush graphColor
QColor crossColor
QColor backgroundShade
QColor ghostNoteColor
QColor detuningNoteColor
QColor ghostSampleColor
QColor outOfBoundsShade

Private Types

enum class  Action {
  None , MoveValue , EraseValues , MoveOutValue ,
  ResetOutValues , DrawLine , MoveTangent , ResetTangents
}

Private Member Functions

 AutomationEditor ()
 AutomationEditor (const AutomationEditor &)
 ~AutomationEditor () override
void centerTopBottomScroll ()
void updateTopBottomLevels ()
void adjustLeftRightScoll (int value)
void drawCross (QPainter &p)
void drawAutomationPoint (QPainter &p, timeMap::iterator it)
void drawAutomationTangents (QPainter &p, timeMap::iterator it)
bool inPatternEditor ()

Private Attributes

QPixmap m_toolDraw = embed::getIconPixmap("edit_draw")
QPixmap m_toolErase = embed::getIconPixmap("edit_erase")
QPixmap m_toolDrawOut = embed::getIconPixmap("edit_draw_outvalue")
QPixmap m_toolEditTangents = embed::getIconPixmap("edit_tangent")
QPixmap m_toolMove = embed::getIconPixmap("edit_move")
QPixmap m_toolYFlip = embed::getIconPixmap("flip_y")
QPixmap m_toolXFlip = embed::getIconPixmap("flip_x")
ComboBoxModel m_zoomingXModel
ComboBoxModel m_zoomingYModel
ComboBoxModel m_quantizeModel
FloatModelm_tensionModel
AutomationClipm_clip
float m_minLevel
float m_maxLevel
float m_step
float m_scrollLevel
float m_bottomLevel
float m_topLevel
MidiClipm_ghostNotes = nullptr
QPointer< SampleClipm_ghostSample = nullptr
bool m_renderSample = false
QScrollBar * m_leftRightScroll
QScrollBar * m_topBottomScroll
TimePos m_currentPosition
Action m_action
int m_moveXOffset
float m_drawLastLevel
tick_t m_drawLastTick
int m_ppb
int m_y_delta
bool m_y_auto
int m_draggedOutValueKey
int m_draggedTangentTick
bool m_draggedOutTangent
EditMode m_editMode
bool m_mouseDownLeft
bool m_mouseDownRight
TimeLineWidgetm_timeLine
bool m_scrollBack
QColor m_barLineColor
QColor m_beatLineColor
QColor m_lineColor
QBrush m_graphColor
QColor m_nodeInValueColor
QColor m_nodeOutValueColor
QColor m_nodeTangentLineColor
QBrush m_scaleColor
QColor m_crossColor
QColor m_backgroundShade
QColor m_ghostNoteColor
QColor m_detuningNoteColor
QColor m_ghostSampleColor
QColor m_outOfBoundsShade
SampleThumbnail m_sampleThumbnail

Static Private Attributes

static const int SCROLLBAR_SIZE = 12
static const int TOP_MARGIN = 16
static const int DEFAULT_Y_DELTA = 6
static const int DEFAULT_STEPS_PER_BAR = 16
static const int DEFAULT_PPB = 12 * DEFAULT_STEPS_PER_BAR
static const int VALUES_WIDTH = 64
static const int NOTE_HEIGHT = 10
static const int NOTE_MARGIN = 40
static const int MIN_NOTE_RANGE = 20
static const int SAMPLE_MARGIN = 40
static constexpr int MAX_SAMPLE_HEIGHT = 400
static const std::array< float, 7 > m_zoomXLevels

Friends

class AutomationEditorWindow

Member Typedef Documentation

◆ timeMap

Member Enumeration Documentation

◆ Action

enum class lmms::gui::AutomationEditor::Action
strongprivate
Enumerator
None 
MoveValue 
EraseValues 
MoveOutValue 
ResetOutValues 
DrawLine 
MoveTangent 
ResetTangents 

◆ EditMode

Enumerator
Draw 
Erase 
DrawOutValues 
EditTangents 

Constructor & Destructor Documentation

◆ AutomationEditor() [1/2]

lmms::gui::AutomationEditor::AutomationEditor ( )
private

◆ AutomationEditor() [2/2]

lmms::gui::AutomationEditor::AutomationEditor ( const AutomationEditor & )
private

◆ ~AutomationEditor()

lmms::gui::AutomationEditor::~AutomationEditor ( )
overrideprivate

Member Function Documentation

◆ adjustLeftRightScoll()

void lmms::gui::AutomationEditor::adjustLeftRightScoll ( int value)
private

◆ centerTopBottomScroll()

void lmms::gui::AutomationEditor::centerTopBottomScroll ( )
private

◆ currentClip()

const AutomationClip * lmms::gui::AutomationEditor::currentClip ( ) const
inline

◆ currentClipChanged

void lmms::gui::AutomationEditor::currentClipChanged ( )
signal

◆ drawAutomationPoint()

void lmms::gui::AutomationEditor::drawAutomationPoint ( QPainter & p,
timeMap::iterator it )
inlineprivate

◆ drawAutomationTangents()

void lmms::gui::AutomationEditor::drawAutomationTangents ( QPainter & p,
timeMap::iterator it )
inlineprivate

◆ drawCross()

void lmms::gui::AutomationEditor::drawCross ( QPainter & p)
inlineprivate

◆ drawLevelTick()

void lmms::gui::AutomationEditor::drawLevelTick ( QPainter & p,
int tick,
float value )
inlineprotected

◆ drawLine()

void lmms::gui::AutomationEditor::drawLine ( int x0,
float y0,
int x1,
float y1 )
protected

◆ fineTuneValue()

bool lmms::gui::AutomationEditor::fineTuneValue ( timeMap::iterator node,
bool editingOutValue )
protected

◆ getClosestNode()

AutomationEditor::timeMap::iterator lmms::gui::AutomationEditor::getClosestNode ( int x)
protected

Given a mouse X coordinate, returns a timeMap::iterator that points to the closest node.

Parameters
IntX coordinate
Returns
timeMap::iterator with the closest node or timeMap.end() if there are no nodes.

◆ getLevel()

float lmms::gui::AutomationEditor::getLevel ( int y)
protected

◆ getNodeAt()

AutomationEditor::timeMap::iterator lmms::gui::AutomationEditor::getNodeAt ( int x,
int y,
bool outValue = false,
int r = 5 )
protected

Given a mouse coordinate, returns a timeMap::iterator that points to the first node inside a square of side "r" pixels from those coordinates. In simpler terms, returns the automation node on those coordinates.

Parameters
IntX coordinate
IntY coordinate
Boolean.True to check if the outValue of the node was clicked instead (defaults to false)
IntR distance in pixels
Returns
timeMap::iterator with the clicked node, or timeMap.end() if none was clicked.

◆ horScrolled

void lmms::gui::AutomationEditor::horScrolled ( int new_pos)
protectedslot

◆ inPatternEditor()

bool lmms::gui::AutomationEditor::inPatternEditor ( )
inlineprivate

◆ keyPressEvent()

void lmms::gui::AutomationEditor::keyPressEvent ( QKeyEvent * ke)
overrideprotected

◆ leaveEvent()

void lmms::gui::AutomationEditor::leaveEvent ( QEvent * e)
overrideprotected

◆ loadSettings()

void lmms::gui::AutomationEditor::loadSettings ( const QDomElement & parent)
overridevirtual

◆ mouseDoubleClickEvent()

void lmms::gui::AutomationEditor::mouseDoubleClickEvent ( QMouseEvent * mouseEvent)
overrideprotected

◆ mouseMoveEvent()

void lmms::gui::AutomationEditor::mouseMoveEvent ( QMouseEvent * mouseEvent)
overrideprotected

◆ mousePressEvent()

void lmms::gui::AutomationEditor::mousePressEvent ( QMouseEvent * mouseEvent)
overrideprotected

◆ mouseReleaseEvent()

void lmms::gui::AutomationEditor::mouseReleaseEvent ( QMouseEvent * mouseEvent)
overrideprotected

◆ nodeName()

QString lmms::gui::AutomationEditor::nodeName ( void ) const
inlineoverridevirtual

◆ paintEvent()

void lmms::gui::AutomationEditor::paintEvent ( QPaintEvent * pe)
overrideprotected
Todo
move this horizontal line drawing code into the same loop as the value ticks?

◆ play

void lmms::gui::AutomationEditor::play ( )
protectedslot

◆ resetGhostNotes

void lmms::gui::AutomationEditor::resetGhostNotes ( )
inlineprotectedslot

◆ resizeEvent()

void lmms::gui::AutomationEditor::resizeEvent ( QResizeEvent * re)
overrideprotected

◆ saveSettings()

void lmms::gui::AutomationEditor::saveSettings ( QDomDocument & doc,
QDomElement & parent )
overridevirtual

◆ setCurrentClip()

void lmms::gui::AutomationEditor::setCurrentClip ( AutomationClip * new_clip)

◆ setEditMode [1/2]

void lmms::gui::AutomationEditor::setEditMode ( AutomationEditor::EditMode mode)
protectedslot

◆ setEditMode [2/2]

void lmms::gui::AutomationEditor::setEditMode ( int mode)
protectedslot

◆ setGhostMidiClip()

void lmms::gui::AutomationEditor::setGhostMidiClip ( MidiClip * newMidiClip)

◆ setGhostSample()

void lmms::gui::AutomationEditor::setGhostSample ( SampleClip * newSample)

◆ setProgressionType [1/2]

void lmms::gui::AutomationEditor::setProgressionType ( AutomationClip::ProgressionType type)
protectedslot

◆ setProgressionType [2/2]

void lmms::gui::AutomationEditor::setProgressionType ( int type)
protectedslot

This method handles the AutomationEditorWindow event of changing progression types. After that, it calls updateEditTanButton so the edit tangents button is updated accordingly.

Parameters
IntNew progression type

◆ setQuantization

void lmms::gui::AutomationEditor::setQuantization ( )
protectedslot

Updates the clip's quantization using the current user selected value.

◆ setTension

void lmms::gui::AutomationEditor::setTension ( )
protectedslot

◆ stop

void lmms::gui::AutomationEditor::stop ( )
protectedslot

◆ update

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

◆ updateAfterClipChange

void lmms::gui::AutomationEditor::updateAfterClipChange ( )
slot

◆ updatePosition

void lmms::gui::AutomationEditor::updatePosition ( )
protectedslot

◆ updateTopBottomLevels()

void lmms::gui::AutomationEditor::updateTopBottomLevels ( )
private

◆ validClip()

bool lmms::gui::AutomationEditor::validClip ( ) const
inline

◆ verScrolled

void lmms::gui::AutomationEditor::verScrolled ( int new_pos)
protectedslot

◆ wheelEvent()

void lmms::gui::AutomationEditor::wheelEvent ( QWheelEvent * we)
overrideprotected

◆ xCoordOfTick()

int lmms::gui::AutomationEditor::xCoordOfTick ( int tick)
protected

◆ yCoordOfLevel()

float lmms::gui::AutomationEditor::yCoordOfLevel ( float level)
protected

◆ zoomingXChanged

void lmms::gui::AutomationEditor::zoomingXChanged ( )
protectedslot

◆ zoomingYChanged

void lmms::gui::AutomationEditor::zoomingYChanged ( )
protectedslot

◆ AutomationEditorWindow

friend class AutomationEditorWindow
friend

Member Data Documentation

◆ DEFAULT_PPB

const int lmms::gui::AutomationEditor::DEFAULT_PPB = 12 * DEFAULT_STEPS_PER_BAR
staticprivate

◆ DEFAULT_STEPS_PER_BAR

const int lmms::gui::AutomationEditor::DEFAULT_STEPS_PER_BAR = 16
staticprivate

◆ DEFAULT_Y_DELTA

const int lmms::gui::AutomationEditor::DEFAULT_Y_DELTA = 6
staticprivate

◆ m_action

Action lmms::gui::AutomationEditor::m_action
private

◆ m_backgroundShade

QColor lmms::gui::AutomationEditor::m_backgroundShade
private

◆ m_barLineColor

QColor lmms::gui::AutomationEditor::m_barLineColor
private

◆ m_beatLineColor

QColor lmms::gui::AutomationEditor::m_beatLineColor
private

◆ m_bottomLevel

float lmms::gui::AutomationEditor::m_bottomLevel
private

◆ m_clip

AutomationClip* lmms::gui::AutomationEditor::m_clip
private

◆ m_crossColor

QColor lmms::gui::AutomationEditor::m_crossColor
private

◆ m_currentPosition

TimePos lmms::gui::AutomationEditor::m_currentPosition
private

◆ m_detuningNoteColor

QColor lmms::gui::AutomationEditor::m_detuningNoteColor
private

◆ m_draggedOutTangent

bool lmms::gui::AutomationEditor::m_draggedOutTangent
private

◆ m_draggedOutValueKey

int lmms::gui::AutomationEditor::m_draggedOutValueKey
private

◆ m_draggedTangentTick

int lmms::gui::AutomationEditor::m_draggedTangentTick
private

◆ m_drawLastLevel

float lmms::gui::AutomationEditor::m_drawLastLevel
private

◆ m_drawLastTick

tick_t lmms::gui::AutomationEditor::m_drawLastTick
private

◆ m_editMode

EditMode lmms::gui::AutomationEditor::m_editMode
private

◆ m_ghostNoteColor

QColor lmms::gui::AutomationEditor::m_ghostNoteColor
private

◆ m_ghostNotes

MidiClip* lmms::gui::AutomationEditor::m_ghostNotes = nullptr
private

◆ m_ghostSample

QPointer<SampleClip> lmms::gui::AutomationEditor::m_ghostSample = nullptr
private

◆ m_ghostSampleColor

QColor lmms::gui::AutomationEditor::m_ghostSampleColor
private

◆ m_graphColor

QBrush lmms::gui::AutomationEditor::m_graphColor
private

◆ m_leftRightScroll

QScrollBar* lmms::gui::AutomationEditor::m_leftRightScroll
private

◆ m_lineColor

QColor lmms::gui::AutomationEditor::m_lineColor
private

◆ m_maxLevel

float lmms::gui::AutomationEditor::m_maxLevel
private

◆ m_minLevel

float lmms::gui::AutomationEditor::m_minLevel
private

◆ m_mouseDownLeft

bool lmms::gui::AutomationEditor::m_mouseDownLeft
private

◆ m_mouseDownRight

bool lmms::gui::AutomationEditor::m_mouseDownRight
private

◆ m_moveXOffset

int lmms::gui::AutomationEditor::m_moveXOffset
private

◆ m_nodeInValueColor

QColor lmms::gui::AutomationEditor::m_nodeInValueColor
private

◆ m_nodeOutValueColor

QColor lmms::gui::AutomationEditor::m_nodeOutValueColor
private

◆ m_nodeTangentLineColor

QColor lmms::gui::AutomationEditor::m_nodeTangentLineColor
private

◆ m_outOfBoundsShade

QColor lmms::gui::AutomationEditor::m_outOfBoundsShade
private

◆ m_ppb

int lmms::gui::AutomationEditor::m_ppb
private

◆ m_quantizeModel

ComboBoxModel lmms::gui::AutomationEditor::m_quantizeModel
private

◆ m_renderSample

bool lmms::gui::AutomationEditor::m_renderSample = false
private

◆ m_sampleThumbnail

SampleThumbnail lmms::gui::AutomationEditor::m_sampleThumbnail
private

◆ m_scaleColor

QBrush lmms::gui::AutomationEditor::m_scaleColor
private

◆ m_scrollBack

bool lmms::gui::AutomationEditor::m_scrollBack
private

◆ m_scrollLevel

float lmms::gui::AutomationEditor::m_scrollLevel
private

◆ m_step

float lmms::gui::AutomationEditor::m_step
private

◆ m_tensionModel

FloatModel* lmms::gui::AutomationEditor::m_tensionModel
private

◆ m_timeLine

TimeLineWidget* lmms::gui::AutomationEditor::m_timeLine
private

◆ m_toolDraw

QPixmap lmms::gui::AutomationEditor::m_toolDraw = embed::getIconPixmap("edit_draw")
private

◆ m_toolDrawOut

QPixmap lmms::gui::AutomationEditor::m_toolDrawOut = embed::getIconPixmap("edit_draw_outvalue")
private

◆ m_toolEditTangents

QPixmap lmms::gui::AutomationEditor::m_toolEditTangents = embed::getIconPixmap("edit_tangent")
private

◆ m_toolErase

QPixmap lmms::gui::AutomationEditor::m_toolErase = embed::getIconPixmap("edit_erase")
private

◆ m_toolMove

QPixmap lmms::gui::AutomationEditor::m_toolMove = embed::getIconPixmap("edit_move")
private

◆ m_toolXFlip

QPixmap lmms::gui::AutomationEditor::m_toolXFlip = embed::getIconPixmap("flip_x")
private

◆ m_toolYFlip

QPixmap lmms::gui::AutomationEditor::m_toolYFlip = embed::getIconPixmap("flip_y")
private

◆ m_topBottomScroll

QScrollBar* lmms::gui::AutomationEditor::m_topBottomScroll
private

◆ m_topLevel

float lmms::gui::AutomationEditor::m_topLevel
private

◆ m_y_auto

bool lmms::gui::AutomationEditor::m_y_auto
private

◆ m_y_delta

int lmms::gui::AutomationEditor::m_y_delta
private

◆ m_zoomingXModel

ComboBoxModel lmms::gui::AutomationEditor::m_zoomingXModel
private

◆ m_zoomingYModel

ComboBoxModel lmms::gui::AutomationEditor::m_zoomingYModel
private

◆ m_zoomXLevels

const std::array< float, 7 > lmms::gui::AutomationEditor::m_zoomXLevels
staticprivate
Initial value:
=
{ 0.125f, 0.25f, 0.5f, 1.0f, 2.0f, 4.0f, 8.0f }

◆ MAX_SAMPLE_HEIGHT

int lmms::gui::AutomationEditor::MAX_SAMPLE_HEIGHT = 400
staticconstexprprivate

◆ MIN_NOTE_RANGE

const int lmms::gui::AutomationEditor::MIN_NOTE_RANGE = 20
staticprivate

◆ NOTE_HEIGHT

const int lmms::gui::AutomationEditor::NOTE_HEIGHT = 10
staticprivate

◆ NOTE_MARGIN

const int lmms::gui::AutomationEditor::NOTE_MARGIN = 40
staticprivate

◆ SAMPLE_MARGIN

const int lmms::gui::AutomationEditor::SAMPLE_MARGIN = 40
staticprivate

◆ SCROLLBAR_SIZE

const int lmms::gui::AutomationEditor::SCROLLBAR_SIZE = 12
staticprivate

◆ TOP_MARGIN

const int lmms::gui::AutomationEditor::TOP_MARGIN = 16
staticprivate

◆ VALUES_WIDTH

const int lmms::gui::AutomationEditor::VALUES_WIDTH = 64
staticprivate

Property Documentation

◆ backgroundShade

QColor lmms::gui::AutomationEditor::backgroundShade

◆ barLineColor

QColor lmms::gui::AutomationEditor::barLineColor

◆ beatLineColor

QColor lmms::gui::AutomationEditor::beatLineColor

◆ crossColor

QColor lmms::gui::AutomationEditor::crossColor

◆ detuningNoteColor

QColor lmms::gui::AutomationEditor::detuningNoteColor

◆ ghostNoteColor

QColor lmms::gui::AutomationEditor::ghostNoteColor

◆ ghostSampleColor

QColor lmms::gui::AutomationEditor::ghostSampleColor

◆ graphColor

QBrush lmms::gui::AutomationEditor::graphColor

◆ lineColor

QColor lmms::gui::AutomationEditor::lineColor

◆ nodeInValueColor

QColor lmms::gui::AutomationEditor::nodeInValueColor

◆ nodeOutValueColor

QColor lmms::gui::AutomationEditor::nodeOutValueColor

◆ nodeTangentLineColor

QColor lmms::gui::AutomationEditor::nodeTangentLineColor

◆ outOfBoundsShade

QColor lmms::gui::AutomationEditor::outOfBoundsShade

◆ scaleColor

QBrush lmms::gui::AutomationEditor::scaleColor

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