|
Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
|
An observable, serializable musical position stored as ticks. More...
#include <src/dsp/position.h>


Public Types | |
| using | ConstraintFunction |
| Function that clamps/adjusts tick values on setTicks (e.g. | |
Signals | |
| void | positionChanged () |
Public Member Functions | |
| Position (QObject *parent=nullptr) | |
| Construct a Position without a value constraint. | |
| Position (ConstraintFunction constraint, QObject *parent=nullptr) | |
| Construct a Position with a value constraint. | |
| double | ticks () const |
| The stored tick value (meaning depends on owner context). | |
| void | setTicks (double ticks) |
| void | set_ticks_without_constraint (double ticks) |
| Set ticks without applying constraint_. | |
| Q_INVOKABLE void | addTicks (double ticks) |
Properties | |
| double | ticks |
Friends | |
| void | to_json (nlohmann::json &j, const Position &pos) |
| void | from_json (const nlohmann::json &j, Position &pos) |
An observable, serializable musical position stored as ticks.
The stored value's meaning (timeline ticks vs. content ticks) is determined by the owner context — Position does not encode coordinate space. Callers know from the property/variable name whether they are working with a timeline position (e.g. position_) or a content-space value (e.g. length_, loop_start_pos_).
Non-atomic: arranger-object positions are never read from the audio thread. For Transport marker positions, see Transport's farbot::RealtimeObject snapshot which pre-computes samples for RT access.
Definition at line 32 of file position.h.
Function that clamps/adjusts tick values on setTicks (e.g.
min-length enforcement).
Definition at line 42 of file position.h.
|
explicit |
Construct a Position without a value constraint.
| parent | QObject parent. |
|
explicit |
Construct a Position with a value constraint.
| constraint | Function that clamps/adjusts tick values on setTicks (e.g. min-length enforcement). |
| parent | QObject parent. |
|
inline |
Definition at line 70 of file position.h.
| void zrythm::dsp::Position::set_ticks_without_constraint | ( | double | ticks | ) |
Set ticks without applying constraint_.
Intended for atomic batch updates by callers that maintain position invariants themselves (e.g. structure::arrangement::Clip::setLoopRange). Still emits positionChanged when the value actually changes.
|
inline |
The stored tick value (meaning depends on owner context).
Definition at line 60 of file position.h.
|
readwrite |
Definition at line 35 of file position.h.