Skip to content

Decouple audio capture from projectM wrapper + GHA fixes - #135

Open
kblaschke wants to merge 1 commit into
projectM-visualizer:masterfrom
kblaschke:decouple-audio-capture-from-projectm
Open

Decouple audio capture from projectM wrapper + GHA fixes#135
kblaschke wants to merge 1 commit into
projectM-visualizer:masterfrom
kblaschke:decouple-audio-capture-from-projectm

Conversation

@kblaschke

@kblaschke kblaschke commented Sep 8, 2026

Copy link
Copy Markdown
Member

This changeset removes the direct projectM dependency in the audio capture implementations, using notifications instead.

This provides a few advantages:

  • No need to pass in/know the projectM handle or use projectM API functions in the audio capture classes.
  • Since a notification can have multiple subscribers, which are notified in sequence, this allows to pass captured audio to multiple projectM instances without the audio capture driver needing to know the number of recipients (can be >=0).
  • Audio data is now transferred to a buffer in the ProjectMWrapper class in a thread-safe manner, removing any possible race conditions.
  • This change allows to have more than one projectM instance at the same time, e.g. to implement a multi-window mode or show a small UI window with an animated preset preview.

The audio capture driver can still capture asynchronously in a separate thread or read the audio data when its FillBuffer() method is called. Audio data is transferred to the projectM instance immediately before the frame render function is called.

Edit: merged the build fixed to master separately to re-enable build checks in other branches.

@kblaschke kblaschke self-assigned this Sep 8, 2026
@kblaschke kblaschke added the enhancement New feature or request label Sep 8, 2026
This change uses notifications to notify the projectM wrapper that new audio is available, either from an async recording thread or via the FillBuffer() method.

This pattern allows to pass audio in a thread-safe manner to projectM and remove any direct dependency on projectM from the capture implementations.

Additionally, using notifications also allows to transparently pass the same audio data to multiple projectM instances. This enables implementation of multi-window support as well as animated preset preview windows.
@kblaschke
kblaschke force-pushed the decouple-audio-capture-from-projectm branch from b1057f6 to 3f82eff Compare September 10, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant