Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::actions::ClipOperator Class Reference

QML-facing operator for edits on a single clip (the clip-editor scope), mirroring the ArrangerObjectCreator pattern: one instance per project, owned by ProjectSession, with its dependencies (object registry and undo stack) injected in C++. More...

#include <src/actions/clip_operator.h>

Inheritance diagram for zrythm::actions::ClipOperator:
Collaboration diagram for zrythm::actions::ClipOperator:

Public Member Functions

 ClipOperator (utils::IObjectRegistry &registry, undo::UndoStack &undoStack, QObject *parent=nullptr)
structure::arrangement::Clipclip () const
void setClip (structure::arrangement::Clip *clip)
Q_SIGNAL void clipChanged ()
Q_INVOKABLE void beginClipLoopPointsDrag ()
 Begin a loop-points drag gesture.
Q_INVOKABLE void updateClipLoopPointsDrag (double clipStartTicks, double loopStartTicks, double loopEndTicks)
 Live-update the clip's loop points to the given content-tick positions for visual feedback.
Q_INVOKABLE void endClipLoopPointsDrag ()
 Commit the drag: push one SetClipLoopPointsCommand capturing the before/after states.
Q_INVOKABLE void abortClipLoopPointsDrag ()
 Revert the live preview to the pre-drag state without pushing a command.

Properties

zrythm::structure::arrangement::Clipclip

Detailed Description

QML-facing operator for edits on a single clip (the clip-editor scope), mirroring the ArrangerObjectCreator pattern: one instance per project, owned by ProjectSession, with its dependencies (object registry and undo stack) injected in C++.

Loop-point dragging uses a preview-then-commit lifecycle: updateClipLoopPointsDrag mutates the clip directly for live visual feedback, and endClipLoopPointsDrag pushes a single immutable SetClipLoopPointsCommand capturing the before/after states. An entire drag is therefore one undo entry, and no command is ever mutated once it is on the stack. abortClipLoopPointsDrag reverts the live preview without pushing.

Definition at line 30 of file clip_operator.h.

Member Function Documentation

◆ beginClipLoopPointsDrag()

Q_INVOKABLE void zrythm::actions::ClipOperator::beginClipLoopPointsDrag ( )

Begin a loop-points drag gesture.

Captures the pre-drag state; the command is pushed only on endClipLoopPointsDrag.

◆ clip()

structure::arrangement::Clip * zrythm::actions::ClipOperator::clip ( ) const
inline

Definition at line 43 of file clip_operator.h.

◆ endClipLoopPointsDrag()

Q_INVOKABLE void zrythm::actions::ClipOperator::endClipLoopPointsDrag ( )

Commit the drag: push one SetClipLoopPointsCommand capturing the before/after states.

A no-op gesture (no net change) pushes nothing.

◆ updateClipLoopPointsDrag()

Q_INVOKABLE void zrythm::actions::ClipOperator::updateClipLoopPointsDrag ( double clipStartTicks,
double loopStartTicks,
double loopEndTicks )

Live-update the clip's loop points to the given content-tick positions for visual feedback.

The caller passes the pre-drag values for axes not being dragged.

Property Documentation

◆ clip

zrythm::structure::arrangement::Clip * zrythm::actions::ClipOperator::clip
readwrite

Definition at line 33 of file clip_operator.h.


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