Ardour  9.0-pre0-349-gc9645723de
Temporal::TempoMetric Class Reference

#include <tempo.h>

Inheritance diagram for Temporal::TempoMetric:
[legend]

Public Member Functions

 TempoMetric (TempoPoint const &t, MeterPoint const &m)
 
virtual ~TempoMetric ()
 
superclock_t reftime () const
 
TempoPoint const & tempo () const
 
MeterPoint const & meter () const
 
TempoPointget_editable_tempo () const
 
MeterPointget_editable_meter () const
 
superclock_t superclock_at (Beats const &qn) const
 
samplepos_t sample_at (Beats const &qn) const
 
Beats quarters_at (BBT_Time const &bbt) const
 
BBT_Argument bbt_at (Beats const &beats) const
 
superclock_t superclocks_per_note_type () const
 
superclock_t end_superclocks_per_note_type () const
 
superclock_t superclocks_per_note_type (int note_type) const
 
superclock_t superclocks_per_quarter_note () const
 
int note_type () const
 
int divisions_per_bar () const
 
int note_value () const
 
BBT_Argument bbt_add (BBT_Time const &bbt, BBT_Offset const &add) const
 
BBT_Argument bbt_subtract (BBT_Time const &bbt, BBT_Offset const &sub) const
 
BBT_Argument round_to_bar (BBT_Time const &bbt) const
 
BBT_Argument round_up_to_bar (BBT_Time const &bbt) const
 
Beats to_quarters (BBT_Offset const &bbo) const
 
superclock_t superclocks_per_bar () const
 
superclock_t superclocks_per_grid () const
 
superclock_t superclocks_per_note_type_at_superclock (superclock_t sc) const
 
BBT_Argument bbt_at (timepos_t const &) const
 
superclock_t superclock_at (BBT_Time const &) const
 
samplepos_t samples_per_bar (samplecnt_t sr) const
 
Beats quarters_at_sample (samplepos_t sc) const
 
Beats quarters_at_superclock (superclock_t sc) const
 

Protected Attributes

TempoPoint const * _tempo
 
MeterPoint const * _meter
 
superclock_t _reftime
 

Detailed Description

Helper class to perform computations that require both Tempo and Meter at a given point in time.

It may seem nicer to make this IS-A TempoPoint and IS-A MeterPoint. Doing so runs into multiple inheritance of Point, plus the major semantic issue that pairing a tempo and a meter does in fact allow for two positions, not one. That means we have to provide accessors to the TempoPoint and MeterPoint and thus it may as well be HAS-A rather than IS-A.

This object should always be short lived. It holds references to a TempoPoint and a MeterPoint that are not lifetime-managed. It's just a convenience object, in essence, to avoid having to replicate the computation code that requires both tempo and meter information every place it is used.

Definition at line 440 of file temporal/temporal/tempo.h.

Constructor & Destructor Documentation

◆ TempoMetric()

Temporal::TempoMetric::TempoMetric ( TempoPoint const &  t,
MeterPoint const &  m 
)

◆ ~TempoMetric()

virtual Temporal::TempoMetric::~TempoMetric ( )
inlinevirtual

Definition at line 444 of file temporal/temporal/tempo.h.

Member Function Documentation

◆ bbt_add()

BBT_Argument Temporal::TempoMetric::bbt_add ( BBT_Time const &  bbt,
BBT_Offset const &  add 
) const
inline

Definition at line 471 of file temporal/temporal/tempo.h.

◆ bbt_at() [1/2]

BBT_Argument Temporal::TempoMetric::bbt_at ( Beats const &  beats) const
inline

Definition at line 461 of file temporal/temporal/tempo.h.

◆ bbt_at() [2/2]

BBT_Argument Temporal::TempoMetric::bbt_at ( timepos_t const &  ) const

◆ bbt_subtract()

BBT_Argument Temporal::TempoMetric::bbt_subtract ( BBT_Time const &  bbt,
BBT_Offset const &  sub 
) const
inline

Definition at line 472 of file temporal/temporal/tempo.h.

◆ divisions_per_bar()

int Temporal::TempoMetric::divisions_per_bar ( ) const
inline

Definition at line 469 of file temporal/temporal/tempo.h.

◆ end_superclocks_per_note_type()

superclock_t Temporal::TempoMetric::end_superclocks_per_note_type ( ) const
inline

Definition at line 464 of file temporal/temporal/tempo.h.

◆ get_editable_meter()

MeterPoint& Temporal::TempoMetric::get_editable_meter ( ) const
inline

Definition at line 452 of file temporal/temporal/tempo.h.

◆ get_editable_tempo()

TempoPoint& Temporal::TempoMetric::get_editable_tempo ( ) const
inline

Definition at line 451 of file temporal/temporal/tempo.h.

◆ meter()

MeterPoint const& Temporal::TempoMetric::meter ( ) const
inline

Definition at line 449 of file temporal/temporal/tempo.h.

◆ note_type()

int Temporal::TempoMetric::note_type ( ) const
inline

Definition at line 468 of file temporal/temporal/tempo.h.

◆ note_value()

int Temporal::TempoMetric::note_value ( ) const
inline

Definition at line 470 of file temporal/temporal/tempo.h.

◆ quarters_at()

Beats Temporal::TempoMetric::quarters_at ( BBT_Time const &  bbt) const
inline

Definition at line 460 of file temporal/temporal/tempo.h.

◆ quarters_at_sample()

Beats Temporal::TempoMetric::quarters_at_sample ( samplepos_t  sc) const
inline

Definition at line 500 of file temporal/temporal/tempo.h.

◆ quarters_at_superclock()

Beats Temporal::TempoMetric::quarters_at_superclock ( superclock_t  sc) const
inline

Definition at line 501 of file temporal/temporal/tempo.h.

◆ reftime()

superclock_t Temporal::TempoMetric::reftime ( ) const
inline

Definition at line 446 of file temporal/temporal/tempo.h.

◆ round_to_bar()

BBT_Argument Temporal::TempoMetric::round_to_bar ( BBT_Time const &  bbt) const
inline

Definition at line 473 of file temporal/temporal/tempo.h.

◆ round_up_to_bar()

BBT_Argument Temporal::TempoMetric::round_up_to_bar ( BBT_Time const &  bbt) const
inline

Definition at line 474 of file temporal/temporal/tempo.h.

◆ sample_at()

samplepos_t Temporal::TempoMetric::sample_at ( Beats const &  qn) const
inline

Definition at line 459 of file temporal/temporal/tempo.h.

◆ samples_per_bar()

samplepos_t Temporal::TempoMetric::samples_per_bar ( samplecnt_t  sr) const
inline

Definition at line 496 of file temporal/temporal/tempo.h.

◆ superclock_at() [1/2]

superclock_t Temporal::TempoMetric::superclock_at ( BBT_Time const &  ) const

◆ superclock_at() [2/2]

superclock_t Temporal::TempoMetric::superclock_at ( Beats const &  qn) const
inline

Definition at line 458 of file temporal/temporal/tempo.h.

◆ superclocks_per_bar()

superclock_t Temporal::TempoMetric::superclocks_per_bar ( ) const
inline

Definition at line 479 of file temporal/temporal/tempo.h.

◆ superclocks_per_grid()

superclock_t Temporal::TempoMetric::superclocks_per_grid ( ) const
inline

Definition at line 482 of file temporal/temporal/tempo.h.

◆ superclocks_per_note_type() [1/2]

superclock_t Temporal::TempoMetric::superclocks_per_note_type ( ) const
inline

Definition at line 463 of file temporal/temporal/tempo.h.

◆ superclocks_per_note_type() [2/2]

superclock_t Temporal::TempoMetric::superclocks_per_note_type ( int  note_type) const
inline

Definition at line 465 of file temporal/temporal/tempo.h.

◆ superclocks_per_note_type_at_superclock()

superclock_t Temporal::TempoMetric::superclocks_per_note_type_at_superclock ( superclock_t  sc) const
inline

Definition at line 486 of file temporal/temporal/tempo.h.

◆ superclocks_per_quarter_note()

superclock_t Temporal::TempoMetric::superclocks_per_quarter_note ( ) const
inline

Definition at line 466 of file temporal/temporal/tempo.h.

◆ tempo()

TempoPoint const& Temporal::TempoMetric::tempo ( ) const
inline

Definition at line 448 of file temporal/temporal/tempo.h.

◆ to_quarters()

Beats Temporal::TempoMetric::to_quarters ( BBT_Offset const &  bbo) const
inline

Definition at line 475 of file temporal/temporal/tempo.h.

Member Data Documentation

◆ _meter

MeterPoint const* Temporal::TempoMetric::_meter
protected

Definition at line 505 of file temporal/temporal/tempo.h.

◆ _reftime

superclock_t Temporal::TempoMetric::_reftime
protected

Definition at line 506 of file temporal/temporal/tempo.h.

◆ _tempo

TempoPoint const* Temporal::TempoMetric::_tempo
protected

Definition at line 504 of file temporal/temporal/tempo.h.


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