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

Self-nesting timebase provider that resolves an effective timebase through a chain of providers. More...

#include <src/dsp/timebase.h>

Inheritance diagram for zrythm::dsp::timebase::TimebaseProvider:
Collaboration diagram for zrythm::dsp::timebase::TimebaseProvider:

Public Member Functions

 TimebaseProvider (QObject *parent=nullptr)
void setSource (TimebaseProvider *source)
 Sets the parent provider to observe. Pass nullptr to detach.
void setOverride (Timebase t)
 Forces a specific timebase value, taking precedence over the source.
void clearOverride ()
bool hasOverride () const
std::optional< TimebaseoverrideValue () const
Timebase effectiveTimebase () const
 Returns the resolved value (override if set, else source, else Musical).
Q_SIGNAL void effectiveTimebaseChanged ()
Q_SIGNAL void overrideChanged ()

Properties

Timebase effectiveTimebase

Detailed Description

Self-nesting timebase provider that resolves an effective timebase through a chain of providers.

A provider holds an optional override (an explicit Timebase value) and an optional source (another provider to observe). The effective timebase is: override if set, else the source's effective timebase, else Timebase::Musical as a safe default.

This allows arbitrary-depth chains: a track's provider (root, override = Musical or Absolute) → a lane's provider (optional override) → a clip's provider (optional override). Each level connects to its source's effectiveTimebaseChanged and re-emits its own when the resolved value changes.

Precondition
The source graph must be acyclic. Resolution is bounded by kMaxChainDepth as a safety net: a cycle (or an unreasonably deep chain) is treated as if the chain ended and Timebase::Musical is returned.

Definition at line 59 of file timebase.h.

Member Function Documentation

◆ hasOverride()

bool zrythm::dsp::timebase::TimebaseProvider::hasOverride ( ) const
inlinenodiscard

Definition at line 76 of file timebase.h.

◆ overrideValue()

std::optional< Timebase > zrythm::dsp::timebase::TimebaseProvider::overrideValue ( ) const
inlinenodiscard

Definition at line 77 of file timebase.h.

Property Documentation

◆ effectiveTimebase

Timebase zrythm::dsp::timebase::TimebaseProvider::effectiveTimebase
read

Definition at line 62 of file timebase.h.


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