summaryrefslogtreecommitdiffhomepage
path: root/game
AgeCommit message (Collapse)Author
2026-06-29fix: study-mode checkbox wasn't visible or bound (wrong RmlUi flow)rewriteAdam Malczewski
The checkbox used data-value (binds the element's 'value' string attribute) instead of data-checked (binds the 'checked' bool state) -- per RmlUi docs, checkboxes must use data-checked with a bool. So it neither reflected nor toggled study_mode, and with no explicit styling it rendered invisibly. Fix: wrap the input in a <form> (canonical RmlUi form-control flow), switch data-value -> data-checked, and give #cb-study an explicit visible style (border + background, green fill when :checked). Verified the document loads with no RmlUi parse errors. Note: RmlUi's border shorthand is 'width color' (no 'solid' keyword).
2026-06-29fix: UI time was stuck at 0:00 (flecs ecs_set of iterated component discarded)Adam Malczewski
Root cause: the Input/Update/ApplySeek/Study systems iterated 'with: [playback_state]' AND wrote playback_state back via ecs_set. In this flecs build, an ecs_set on the component a system is currently iterating is deferred and then DISCARDED -- so current_time never committed and the elapsed_str binding always read 0.0 (audio played fine because play/resume are imperative, but the clock and seek/keyboard state never persisted). Fix: each of those systems now iterates 'with: [audio_file]' -- a component the player always has but these systems do NOT mutate -- so their ecs_set on playback_state/study_state is immediate and persists. Verified: current_time now persists across world.progress (0.5, 1.0, 1.499, ...), the elapsed_str getter is re-evaluated every frame, and the app runs clean (no crash, audio loads + streams + shuts down cleanly). Note: LoadSystem still iterates audio_file and mutates it (af[:duration]), so the total-time display stays 0:00 for now -- left for a follow-up to avoid iterating a tag, which crashed the flecs binding.
2026-06-29fix: make audio actually play (four flecs systems were dead: with: [])Adam Malczewski
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.
2026-06-29fix: poll drag-and-drop in the main loop (drop events were never read)Adam Malczewski
Root cause: the file-drop check was a flecs system registered with with: [] (zero terms). In this flecs build a zero-term system never iterates its block, so Rl.file_dropped? was never polled and dropped files were silently ignored -- the SDL backend was receiving the Xdnd events fine all along. Moved the IsFileDropped()/LoadDroppedFiles() check into the main loop (before world.progress, so the LoadSystem picks up the file the same frame), matching the original C study-player. Verified end-to-end with a synthetic Xdnd drop: file detected -> loaded as a music stream.
2026-06-29refactor: font-scale targets #body-root element (coherent id alignment)Adam Malczewski
Aligns apply_font_scale to the body element's id across study_player.rb / layout.rb / main.rml (was probing element('body')||element('__body__')). Verified: build green, run clean, player view renders correctly. (these edits were left uncommitted by the Phase 6 agent's timed-out turn; orchestrator verified + committed.)
2026-06-29phase 6: config persistence, layout settings, final end-to-end verificationAdam Malczewski
- Config: INI-style study-player.cfg (forward-compatible with the original C config.c format). Persists window size, study_mode_default, volume, last_audio_path, font_scale. - Layout: UILayout keys mapped to RmlUi element properties (RCSS-tunable). Adapted the C drag-to-reposition editor to RmlUi-appropriate settings (P4: RmlUi uses declarative RCSS, so pixel-drag doesn't map cleanly; persist what's meaningful). load on startup, save on change. - study_player.rb wiring + main.rml/rcss settings panel. (orchestrator-committed: agent completed + built green, but its turn timed out before committing — it was running gen_ai_reference.rb at the timeout.)
2026-06-29phase 5: RmlUi player UI (progress bar, buttons, checkbox, counter, help)Adam Malczewski
2026-06-29phase 4: study mode auto-pause FSM + smart play overrideAdam Malczewski
2026-06-29phase 3: silence detection, speaking portions, portion navigationAdam Malczewski
- mrbgems/study_audio: native C scanner (scan_silence) avoids Ruby array overflow for large audio files; returns normalized silence region pairs directly - Core.detect_silence: pure Ruby algorithm (threshold 0.015, min 0.75s) for testing with synthetic data; pad_silence_regions (0.25s padding) - Core portion navigation: find_silence_at, current_speaking_portion, total_speaking_portions, portion_seek_target (2 frames into padding zone), in_padding_zone?, speaking_portion_start - Input: V/B keys for prev/next portion navigation - Draw: section counter (N/total) displayed below play state - build_config.rb: added study_audio gem to both desktop and web builds - Runtime: silence_regions, raw_silence_regions, analysis_done fields - Load system: triggers C scan_silence after audio load, pads with pure Ruby - Knowledge doc updated with Phase 3 scar tissue (array limits, gem naming, Wayland screenshot gap) Verification: build clean, pure Core smoke test passes (CRuby), game runs with country.mp3 without overflow, load system processes the file.
2026-06-29phase 2: audio core, argv file loading, playback, non-blocking seekAdam Malczewski
(orchestrator-committed: Phase 2 agent (deepseek-v4-pro) completed the work and verified via build+run+screenshot, but its turn timed out before committing.)
2026-06-29phase 1: study-player rewrite plan + scaffoldAdam Malczewski
2026-06-28import template from raylib-jamstackAdam Malczewski