Skip to content

Split Pad and its helpers out of engine/state.h so sound/ never includes State #3

Description

@mantisdotdev

What

Move engine::Pad and its helpers (index_of, pad_at, is_drum) out of firmware/src/engine/state.h into a narrow header of their own (for example engine/pad.h), and have state.h, events.h and kit.h include it. Then sound/engine.cpp includes the pad header instead of state.h.

Why

sound/ reads events and kit data only and never names engine::State (D-074), but the only header that declares Pad today also declares State, so the boundary is a convention rather than something the include graph shows. Raised by CodeRabbit on PR #2 (thread on firmware/src/sound/engine.cpp:6); deferred there because it is engine/ work and a structural change that must not share a commit with behaviour.

How

  • A pure move: no behaviour change, no test change beyond includes; T-74 and every sound test stay green.
  • One structural commit on its own (CLAUDE.md, Change discipline), so the diff is a rename/move and nothing else.
  • Afterwards the CI layer grep (D-029) could gain engine/state.h in the denylist for firmware/src/sound, so the boundary is enforced, not just observed.

Done when

grep -rn 'engine/state.h' firmware/src/sound is empty, both builds and ./build/tests are green, and the layer grep covers it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions