Skip to content

[#314][#404] Audio Tape automation refactor and C4 architecture docs - #405

Merged
vbmacher merged 7 commits into
developfrom
feature-314
Jul 1, 2026
Merged

[#314][#404] Audio Tape automation refactor and C4 architecture docs#405
vbmacher merged 7 commits into
developfrom
feature-314

Conversation

@vbmacher

@vbmacher vbmacher commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR bundles work from two tickets:

Audio Tape Player automation (#314)

  • Replace AutomationRunner with a new AutomationController:
    • Explicit lifecycle states (PLAYING, STOPPED, CLOSED).
    • Backed by an ExecutorService instead of a raw thread.
    • AutomationListener interface for state / current-index callbacks.
    • preciseSleepNanos instead of Thread.sleep; RadixUtils.parseRadix instead of custom parsing.
  • Reimplement TimelinePanel as a JTable (index + event columns) with active-row highlighting and word-wrapped event text.
  • Fix an NPE in AutomationController when no listener is set (headless automation): drain the queue and notify only when a listener exists; add regression tests for the no-listener path.
  • Lower tape EAR inference volume to 40% (Beeper).
  • Rename and add toolbar icons (auto-*, play, stop, reset, …).
  • Replace AutomationRunnerTest with AutomationControllerTest (async state coverage).

Architecture documentation (#404)

  • Add C4 model docs under docs/ (context, containers, components, code, index) in AsciiDoc.
  • Add a Gradle doc task to render the docs to HTML (build.gradle).
  • Genericize sibling-repo references in AGENTS.md: GitHub links instead of local paths, and instruct the agent to look for local checkouts and report when a repo is missing rather than guessing.

Testing

  • :plugins:device:audiotape-player:test — all tests pass, including the new AutomationControllerTest.

vbmacher and others added 6 commits May 9, 2026 09:54
- Reduce tape input mixing amplitude from MAX_SAMPLE_AMPLITUDE/10
  to MAX_SAMPLE_AMPLITUDE/25 (40% of previous level)
- Beeper volume unchanged
- Replace JList-based TimelinePanel with JTable (two columns: #, Event)
- Remove custom TimelineCellRenderer with circle/connector painting
- Add active row highlighting via prepareRenderer override
- Update TapePlayerGui to use JTable API (getSelectedRow, setRowSelectionInterval, scrollRectToVisible)
- Rename GUI icon resources for clarity
- Rename AutomationRunner to AutomationController
- Add lifecycle states: PLAYING, STOPPED, CLOSED
- Use ExecutorService instead of raw Thread
- Add AutomationListener interface for state/index changes
- Move event deserialization from runner to call sites
- Replace Thread.sleep with preciseSleepNanos
- Replace parseSeconds with RadixUtils.parseRadix
- TapePlayerGui implements AutomationListener directly
- Disable add/remove/move buttons during automation play
- Update buttons when automation finishes via stateChanged
- Add word wrap renderer to timeline event column
- Rename automation toolbar icons to auto-* prefix
- Add AutomationControllerTest with async state tests
- Remove old AutomationRunnerTest
Add C4 model architecture documentation (context, containers, components,
code) in AsciiDoc under docs/, with C4-PlantUML diagrams. Add a 'doc'
Gradle task using the asciidoctor.jvm.convert plugin to render docs/ to
HTML in docs/output/. Ignore the generated docs/output/ directory.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
notifyStateChange() eagerly evaluated listener::stateChanged as the
ifPresent argument, throwing NPE whenever no listener was set (headless
automation via DeviceImpl.reset()). This broke stop(), close() and
play-completion. Drain the queue and notify only when a listener exists,
matching the null-guard already used in play(). Add regression tests for
the no-listener path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace machine-specific local paths with GitHub links and instruct the
agent to look for sibling repos as local checkouts, reporting when a repo
is not available locally instead of guessing paths. Prepares the file for
public availability.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vbmacher vbmacher changed the title Feature 314 [#314][#404] Audio Tape automation refactor and C4 architecture docs Jul 1, 2026
AbstractMemoryStub's constructor invokes the overridable clear(), which
TimingMemoryStub overrides to call clearCounters(). This ran before the
subclass map fields were initialized, causing a NullPointerException in
setUp() and failing 146 z80-cpu tests. Guard clearCounters() against the
not-yet-initialized maps.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vbmacher
vbmacher merged commit d25beda into develop Jul 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant