mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 14:14:45 +03:00
LibDSP: Remove Transport's time counter reference API
This is what the old Transport in Piano had, but as everyone just references Transport directly, there's no need for it anymore.
This commit is contained in:
parent
f23aea0c4b
commit
4d65607649
Notes:
sideshowbarker
2024-07-17 10:55:28 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/4d65607649 Pull-request: https://github.com/SerenityOS/serenity/pull/14010
@ -27,7 +27,7 @@ Track::Track(u32 const& time)
|
||||
|
||||
void Track::fill_sample(Sample& sample)
|
||||
{
|
||||
m_temporary_transport->time() = m_time;
|
||||
m_temporary_transport->set_time(m_time);
|
||||
|
||||
auto playing_notes = LibDSP::RollNotes {};
|
||||
|
||||
|
@ -15,7 +15,6 @@ namespace LibDSP {
|
||||
// The DAW-wide timekeeper and synchronizer
|
||||
class Transport final : public RefCounted<Transport> {
|
||||
public:
|
||||
constexpr u32& time() { return m_time; }
|
||||
constexpr u32 time() const { return m_time; }
|
||||
constexpr u16 beats_per_minute() const { return m_beats_per_minute; }
|
||||
constexpr double current_second() const { return static_cast<double>(m_time) / m_sample_rate; }
|
||||
@ -24,6 +23,8 @@ public:
|
||||
constexpr double ms_sample_rate() const { return m_sample_rate / 1000.; }
|
||||
constexpr double current_measure() const { return m_time / samples_per_measure(); }
|
||||
|
||||
void set_time(u32 time) { m_time = time; }
|
||||
|
||||
Transport(u16 beats_per_minute, u8 beats_per_measure, u32 sample_rate)
|
||||
: m_beats_per_minute(beats_per_minute)
|
||||
, m_beats_per_measure(beats_per_measure)
|
||||
|
Loading…
Reference in New Issue
Block a user