Skip to content

Fix documentation drift in the visualizer and artwork docs - #109

Merged
kahrendt merged 1 commit into
mainfrom
docs-drift-fixes
Aug 31, 2026
Merged

Fix documentation drift in the visualizer and artwork docs#109
kahrendt merged 1 commit into
mainfrom
docs-drift-fixes

Conversation

@kahrendt

@kahrendt kahrendt commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Three documentation defect fixes.

What changed

VisualizerDataType enum table (docs/integration-guide.md)

The table was missing the PEAK row entirely, and described F_PEAK as "Peak frequency" when it carries the dominant frequency and its amplitude (see VisualizerRoleListener::on_f_peak). Row descriptions now match the enum comments in include/sendspin/config.h, and the row order matches declaration order.

VisualizerRole::request_format() (docs/integration-guide.md)

request_format() and its VisualizerFormatRequest struct are public API with no mention anywhere in the guide. Added a snippet in the Visualizer Role section showing a rate-only change and a types change, plus the note that an active stream gets a fresh stream/start (so on_visualizer_stream_start() fires again with the updated config) while an idle server remembers the request for the next stream.

SlotBuffer synchronization (docs/internals.md, "Other Primitives")

The list claimed ArtworkRole::Impl::SlotBuffer::write_idx and drain_active are std::atomic. They are plain uint8_t/bool; every SlotBuffer field is guarded by DrainTask::slot_mutex (see the SlotBuffer doc comment in src/artwork_role_impl.h). Replaced the two false bullets with one mutex bullet covering all the fields it guards.

Notes for reviewers

  • Both designated-initializer forms in the new snippet were compile-tested under -std=c++20 against the real VisualizerFormatRequest layout. .types = {{...}} needs the double braces (outer for the optional, inner for the vector); that is what the snippet uses.
  • The Visualizer Role intro sentence said "peak frequency"; changed to "dominant-frequency" for consistency with the corrected F_PEAK description.
  • The neighboring ArtworkRole::Impl::stream_active bullet was checked and left alone; it is a real std::atomic<bool>.

The VisualizerDataType enum table was missing PEAK and described F_PEAK as
carrying only a frequency; it also carries the amplitude of that frequency.

VisualizerRole::request_format() is public API with no coverage in the guide,
so document the runtime format change alongside the role setup.

The internals "Other Primitives" list described SlotBuffer::write_idx and
drain_active as atomics; every SlotBuffer field is guarded by
DrainTask::slot_mutex.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Changes are documentation-only and the updated statements align with the current public headers and implementation comments for the referenced APIs and synchronization behavior.

Pull request overview

Fixes documentation drift around the Visualizer and Artwork roles so the guides accurately reflect the current public API and synchronization model.

Changes:

  • Corrected VisualizerDataType reference table to include PEAK and to describe F_PEAK as frequency + amplitude, matching include/sendspin/config.h.
  • Documented VisualizerRole::request_format() usage and clarified stream restart behavior when changing visualizer format at runtime.
  • Fixed docs/internals.md to describe ArtworkRole::Impl::SlotBuffer synchronization as mutex-guarded (not atomics), consistent with src/artwork_role_impl.h.
File summaries
File Description
docs/internals.md Updates the “Other Primitives” section to accurately describe SlotBuffer synchronization via DrainTask::slot_mutex.
docs/integration-guide.md Aligns visualizer terminology, documents request_format(), and corrects the VisualizerDataType enum table to match the public headers.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@kahrendt
kahrendt enabled auto-merge (squash) August 31, 2026 12:34
@kahrendt
kahrendt disabled auto-merge August 31, 2026 12:35
@kahrendt
kahrendt merged commit 7c54df6 into main Aug 31, 2026
6 checks passed
@kahrendt
kahrendt deleted the docs-drift-fixes branch August 31, 2026 12:35
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.

2 participants