summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-29 18:15:26 +0900
committerAdam Malczewski <[email protected]>2026-06-29 18:15:26 +0900
commit3a9ac984fc8af783805ad223c8a11cbf6172250a (patch)
treeb7e52e6940ff5e5c25a5c25e4b8b07b5dacbc380
parent18a718fdd2239b6c3dc497f472a85c8612d0115c (diff)
downloadstudy-player-3a9ac984fc8af783805ad223c8a11cbf6172250a.tar.gz
study-player-3a9ac984fc8af783805ad223c8a11cbf6172250a.zip
fix: make audio actually play (four flecs systems were dead: with: [])
Same with: [] (zero-term) trap as the drag-and-drop fix, but it silently killed four runtime systems -- so audio loaded but never played and the clock stayed at 0:00: - Update (ON_UPDATE): never called Rl.update_music_stream, so miniaudio never pumped its buffers -> no sound, get_music_time_played stayed 0. - Input (PRE_UPDATE): keyboard controls (space, seek keys, M) dead. - ApplySeek(PRE_UPDATE): seeking dead. - Study (ON_UPDATE): study-mode auto-pause FSM dead. A zero-term system never iterates its block in this flecs build. Gave each a real term (with: [playback_state]) so they match the player entity and run every frame. The play/smart-play buttons already called audio.resume via RmlUi -- they just had no stream pumping behind them. Verified end-to-end (synthetic Xdnd drop + ARGV load): file loads -> plays -> current_time advances 0..duration -> end-of-track auto-pause.
-rw-r--r--game/study_player/study_player.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/game/study_player/study_player.rb b/game/study_player/study_player.rb
index 8b6997b..c9f0508 100644
--- a/game/study_player/study_player.rb
+++ b/game/study_player/study_player.rb
@@ -487,7 +487,7 @@ module StudyPlayer
SEEK_PCT_STEP = 0.10 # 10%: J / L
def self.build_system(world, player_entity, runtime, playback_state, study_state)
- world.system("Input", with: [], phase: Flecs::PRE_UPDATE) do
+ world.system("Input", with: [playback_state], phase: Flecs::PRE_UPDATE) do
pb = player_entity.get(playback_state)
next unless pb
@@ -685,7 +685,7 @@ end
module StudyPlayer
class UpdateSystem
def self.build(world, player_entity, runtime, playback_state)
- world.system("Update", with: [], phase: Flecs::ON_UPDATE) do
+ world.system("Update", with: [playback_state], phase: Flecs::ON_UPDATE) do
pb = player_entity.get(playback_state)
next unless pb && pb[:loaded]
@@ -732,7 +732,7 @@ module StudyPlayer
SKIP_FRAMES = 3
def self.build(world, player_entity, runtime, playback_state)
- world.system("ApplySeek", with: [], phase: Flecs::PRE_UPDATE) do
+ world.system("ApplySeek", with: [playback_state], phase: Flecs::PRE_UPDATE) do
pb = player_entity.get(playback_state)
next unless pb && pb[:loaded] && pb[:seek_pending]
@@ -768,7 +768,7 @@ end
module StudyPlayer
class StudySystem
def self.build(world, player_entity, runtime, playback_state, study_state)
- world.system("Study", with: [], phase: Flecs::ON_UPDATE) do
+ world.system("Study", with: [playback_state], phase: Flecs::ON_UPDATE) do
pb = player_entity.get(playback_state)
ss = player_entity.get(study_state)
next unless pb && ss && pb[:loaded]