|
Decompose the 778-line src/main.c into 7 focused modules with separate
headers for code isolation and parallel agent development:
types.h shared types: PlayerState, SilenceRegion, UILayout, constants
player.{h,c} audio playback: load, play, pause, seek, update, format_time
study.{h,c} study mode: silence detection, portion navigation, auto-pause
ui.{h,c} rendering + input: fonts, colors, drawing, keyboard/mouse
config.{h,c} UI layout persistence (moved UILayout to types.h)
layout_editor.{h,c} layout editor tab (unchanged)
main.c thin composition root (main loop, tabs, platform glue)
Module boundaries follow the dispatch-project style:
- .h files are contracts (self-contained, #pragma once, forward-declare)
- .c files are private (static helpers, no cross-module .c includes)
- All shared state passed by pointer (PlayerState*/UIState*)
- font_data.h (xxd-generated array definition) included in exactly one .c
Updated documentation (AGENTS.md, ORCHESTRATOR.md, GLOSSARY.md, README.md,
tasks.md) and bin/ scripts (dispatch-style conventions, added bin/build-web).
Build: make clean && make -j$(nproc) exits 0 with zero warnings.
|