Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::gui::qquick::AutomationClipCanvasItem Class Reference
Inheritance diagram for zrythm::gui::qquick::AutomationClipCanvasItem:
Collaboration diagram for zrythm::gui::qquick::AutomationClipCanvasItem:

Signals

void automationClipChanged ()
void curveColorChanged ()
void selectionModelChanged ()
void dragActiveChanged ()
void dragDeltaPxChanged ()
void dragDeltaYChanged ()
void drawPointsChanged ()
void applyLoopsChanged ()
void hoveredXChanged ()
void contentWidthChanged ()
void contentLeftMarginChanged ()
Signals inherited from zrythm::gui::qquick::ClipCanvasItemBase
void referenceWidthChanged ()
void referenceXChanged ()
void loopPreviewChanged ()

Public Member Functions

 AutomationClipCanvasItem (QQuickItem *parent=nullptr)
QCanvasPainterItemRenderer * createItemRenderer () const override
structure::arrangement::AutomationClipautomationClip () const
void setAutomationClip (structure::arrangement::AutomationClip *clip)
QColor curveColor () const
void setCurveColor (const QColor &color)
QItemSelectionModel * selectionModel () const
void setSelectionModel (QItemSelectionModel *model)
bool dragActive () const
void setDragActive (bool active)
qreal dragDeltaPx () const
void setDragDeltaPx (qreal px)
qreal dragDeltaY () const
void setDragDeltaY (qreal dy)
bool drawPoints () const
 When true, small circles are drawn at each automation point.
void setDrawPoints (bool draw)
bool applyLoops () const
 When true (default), the renderer applies the clip's loop unwrapping (timeline clip preview).
void setApplyLoops (bool apply)
qreal hoveredX () const
 Canvas-local X of the cursor while it is over a draggable curve segment, or -1 when it is not.
void setHoveredX (qreal x)
qreal contentWidth () const
 The total width needed for the curve canvas to show every point on both sides of the clip: spans from the leftmost (live, drag-included) point (or the clip start, whichever is earlier) to the rightmost point (or the clip end, whichever is later).
qreal contentLeftMargin () const
 How far left of the clip start (source 0) the canvas must extend, in pixels, so that points before the clip start remain visible.
std::unordered_set< structure::arrangement::ArrangerObject::UuiddraggedUuids () const
 Returns the set of UUIDs of currently selected (dragged) automation points.
Q_INVOKABLE structure::arrangement::AutomationPointsegmentHitTest (qreal x, qreal y, qreal tolerance) const
 Hit-tests the curve for a curviness drag.
Public Member Functions inherited from zrythm::gui::qquick::ClipCanvasItemBase
 ClipCanvasItemBase (QQuickItem *parent=nullptr)
qreal referenceWidth () const
void setReferenceWidth (qreal w)
qreal referenceX () const
void setReferenceX (qreal x)
qreal effectiveReferenceWidth () const
 Returns referenceWidth if set (> 0), otherwise the actual width().
bool loopPreview () const
 When true, the renderer wraps content into the loop region even if the clip is not currently looped.
void setLoopPreview (bool preview)

Properties

zrythm::structure::arrangement::AutomationClipautomationClip
QColor curveColor
QItemSelectionModel * selectionModel
bool dragActive
qreal dragDeltaPx
qreal dragDeltaY
bool drawPoints
bool applyLoops
qreal hoveredX
qreal contentWidth
qreal contentLeftMargin
Properties inherited from zrythm::gui::qquick::ClipCanvasItemBase
qreal referenceWidth
qreal referenceX
bool loopPreview

Detailed Description

Definition at line 23 of file automation_clip_canvas_item.h.

Member Function Documentation

◆ applyLoops()

bool zrythm::gui::qquick::AutomationClipCanvasItem::applyLoops ( ) const
inline

When true (default), the renderer applies the clip's loop unwrapping (timeline clip preview).

When false, it renders only the original source sequence — points at their authored positions with no loop repetition and no clip-start offset — which is what the automation editor wants so the curve aligns with the editable point delegates.

Definition at line 73 of file automation_clip_canvas_item.h.

◆ automationClip()

structure::arrangement::AutomationClip * zrythm::gui::qquick::AutomationClipCanvasItem::automationClip ( ) const
inline

Definition at line 44 of file automation_clip_canvas_item.h.

◆ contentLeftMargin()

qreal zrythm::gui::qquick::AutomationClipCanvasItem::contentLeftMargin ( ) const

How far left of the clip start (source 0) the canvas must extend, in pixels, so that points before the clip start remain visible.

QML shifts the canvas x left by this and sets referenceX to its negation.

◆ contentWidth()

qreal zrythm::gui::qquick::AutomationClipCanvasItem::contentWidth ( ) const

The total width needed for the curve canvas to show every point on both sides of the clip: spans from the leftmost (live, drag-included) point (or the clip start, whichever is earlier) to the rightmost point (or the clip end, whichever is later).

QML binds the canvas item's width to this.

◆ curveColor()

QColor zrythm::gui::qquick::AutomationClipCanvasItem::curveColor ( ) const
inline

Definition at line 50 of file automation_clip_canvas_item.h.

◆ dragActive()

bool zrythm::gui::qquick::AutomationClipCanvasItem::dragActive ( ) const
inline

Definition at line 56 of file automation_clip_canvas_item.h.

◆ dragDeltaPx()

qreal zrythm::gui::qquick::AutomationClipCanvasItem::dragDeltaPx ( ) const
inline

Definition at line 58 of file automation_clip_canvas_item.h.

◆ dragDeltaY()

qreal zrythm::gui::qquick::AutomationClipCanvasItem::dragDeltaY ( ) const
inline

Definition at line 60 of file automation_clip_canvas_item.h.

◆ draggedUuids()

std::unordered_set< structure::arrangement::ArrangerObject::Uuid > zrythm::gui::qquick::AutomationClipCanvasItem::draggedUuids ( ) const

Returns the set of UUIDs of currently selected (dragged) automation points.

Shared between the item's bounds computation and the renderer's source-only mode to avoid duplicating the selection-model traversal.

◆ drawPoints()

bool zrythm::gui::qquick::AutomationClipCanvasItem::drawPoints ( ) const
inline

When true, small circles are drawn at each automation point.

Default false — the curve alone is usually what's wanted.

Definition at line 65 of file automation_clip_canvas_item.h.

◆ hoveredX()

qreal zrythm::gui::qquick::AutomationClipCanvasItem::hoveredX ( ) const
inline

Canvas-local X of the cursor while it is over a draggable curve segment, or -1 when it is not.

The renderer highlights the single emitted segment (the one actually under the cursor, so looped copies — which are not draggable — are never highlighted) containing this X.

Definition at line 80 of file automation_clip_canvas_item.h.

◆ segmentHitTest()

Q_INVOKABLE structure::arrangement::AutomationPoint * zrythm::gui::qquick::AutomationClipCanvasItem::segmentHitTest ( qreal x,
qreal y,
qreal tolerance ) const

Hit-tests the curve for a curviness drag.

Maps the pixel position to a content-tick, finds the curve segment under it, samples the curve, and returns the AutomationPoint whose curve options govern that segment when the point is within tolerance pixels of the curve line (vertically), otherwise nullptr.

◆ selectionModel()

QItemSelectionModel * zrythm::gui::qquick::AutomationClipCanvasItem::selectionModel ( ) const
inline

Definition at line 53 of file automation_clip_canvas_item.h.

Property Documentation

◆ applyLoops

bool zrythm::gui::qquick::AutomationClipCanvasItem::applyLoops
readwrite

Definition at line 35 of file automation_clip_canvas_item.h.

◆ automationClip

zrythm::structure::arrangement::AutomationClip * zrythm::gui::qquick::AutomationClipCanvasItem::automationClip
readwrite

Definition at line 28 of file automation_clip_canvas_item.h.

◆ contentLeftMargin

qreal zrythm::gui::qquick::AutomationClipCanvasItem::contentLeftMargin
read

Definition at line 38 of file automation_clip_canvas_item.h.

◆ contentWidth

qreal zrythm::gui::qquick::AutomationClipCanvasItem::contentWidth
read

Definition at line 37 of file automation_clip_canvas_item.h.

◆ curveColor

QColor zrythm::gui::qquick::AutomationClipCanvasItem::curveColor
readwrite

Definition at line 29 of file automation_clip_canvas_item.h.

◆ dragActive

bool zrythm::gui::qquick::AutomationClipCanvasItem::dragActive
readwrite

Definition at line 31 of file automation_clip_canvas_item.h.

◆ dragDeltaPx

qreal zrythm::gui::qquick::AutomationClipCanvasItem::dragDeltaPx
readwrite

Definition at line 32 of file automation_clip_canvas_item.h.

◆ dragDeltaY

qreal zrythm::gui::qquick::AutomationClipCanvasItem::dragDeltaY
readwrite

Definition at line 33 of file automation_clip_canvas_item.h.

◆ drawPoints

bool zrythm::gui::qquick::AutomationClipCanvasItem::drawPoints
readwrite

Definition at line 34 of file automation_clip_canvas_item.h.

◆ hoveredX

qreal zrythm::gui::qquick::AutomationClipCanvasItem::hoveredX
readwrite

Definition at line 36 of file automation_clip_canvas_item.h.

◆ selectionModel

QItemSelectionModel * zrythm::gui::qquick::AutomationClipCanvasItem::selectionModel
readwrite

Definition at line 30 of file automation_clip_canvas_item.h.


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