mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
lighter, simpler math for sample-aligned superclocks
This commit is contained in:
parent
ce226e707e
commit
debef6ab25
2 changed files with 2 additions and 3 deletions
|
|
@ -568,9 +568,9 @@ TempoPoint::superclock_at (Temporal::Beats const & qn) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now round up to the nearest sample-equivalent superclock value */
|
/* Truncate to the nearest sample-equivalent superclock value */
|
||||||
|
|
||||||
return sample_aligned_superclock (r, TEMPORAL_SAMPLE_RATE);
|
return (r / TEMPORAL_SAMPLE_RATE) * TEMPORAL_SAMPLE_RATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
superclock_t
|
superclock_t
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@ static inline superclock_t superclock_ticks_per_second() { return _superclock_ti
|
||||||
|
|
||||||
static inline superclock_t superclock_to_samples (superclock_t s, int sr) { return PBD::muldiv_floor (s, sr, superclock_ticks_per_second()); }
|
static inline superclock_t superclock_to_samples (superclock_t s, int sr) { return PBD::muldiv_floor (s, sr, superclock_ticks_per_second()); }
|
||||||
static inline superclock_t samples_to_superclock (int64_t samples, int sr) { return PBD::muldiv_round (samples, superclock_ticks_per_second(), superclock_t (sr)); }
|
static inline superclock_t samples_to_superclock (int64_t samples, int sr) { return PBD::muldiv_round (samples, superclock_ticks_per_second(), superclock_t (sr)); }
|
||||||
static inline superclock_t sample_aligned_superclock (superclock_t s, int sr) { return PBD::muldiv_floor (s, sr, sr); }
|
|
||||||
|
|
||||||
LIBTEMPORAL_API extern int most_recent_engine_sample_rate;
|
LIBTEMPORAL_API extern int most_recent_engine_sample_rate;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue