diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-04-30 12:49:47 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-04-30 12:49:47 +1000 |
commit | d3d4345e057d95d784e34be9b23e7fe07fb9a7c1 (patch) | |
tree | f59fa890e5be1d590e42a337448cecfc6b61850a /source/game/StarSongbook.cpp | |
parent | 86e229012f84744a1e878124d9a6e2991c0460bb (diff) | |
parent | 885502bf11057e7de961f178bc85ce93a9f40723 (diff) |
Merge branch 'main' into pr/218
Diffstat (limited to 'source/game/StarSongbook.cpp')
-rw-r--r-- | source/game/StarSongbook.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/source/game/StarSongbook.cpp b/source/game/StarSongbook.cpp index 68db655..72f2b2b 100644 --- a/source/game/StarSongbook.cpp +++ b/source/game/StarSongbook.cpp @@ -158,7 +158,7 @@ void Songbook::render(RenderCallback* renderCallback) { m_pendingAudio.clear(); } -void Songbook::keepalive(String const& instrument, Vec2F const& position) { +void Songbook::keepAlive(String const& instrument, Vec2F const& position) { if (instrument != m_instrument) { m_instrument = instrument; m_dataUpdated = true; @@ -681,11 +681,11 @@ void Songbook::play(Json const& song, String const& timeSource) { m_activeCooldown = 3; } -bool Songbook::active() { +bool Songbook::active() const { return m_activeCooldown > 0; } -bool Songbook::instrumentPlaying() { +bool Songbook::instrumentPlaying() const { if (!active()) return false; if (m_timeSourceInstance) { @@ -698,6 +698,18 @@ bool Songbook::instrumentPlaying() { return false; } +Maybe<String> Songbook::timeSource() const { + return m_timeSource; +} + +Maybe<String> Songbook::instrument() const { + return m_instrument; +} + +Json Songbook::song() const { + return m_song; +} + double Songbook::fundamentalFrequency(double p) { return 55.0 * pow(2.0, (p - 69.0) / 12.0 + 3.0); } |