#include <audio_focus.hpp>
|
| class | Token |
| | RAII subscription token. Move-only; destruction unsubscribes. More...
|
◆ Callback
◆ current()
Snapshot the last published state.
Lock-free. Safe to call from the audio thread.
◆ instance()
| AudioFocusRegistry & pulp::audio::AudioFocusRegistry::instance |
( |
| ) |
|
|
static |
◆ publish()
Publish a new state.
Dispatches to all current subscribers OUTSIDE the internal mutex so a listener that drops its own token (and re-enters unsubscribe) does not deadlock.
◆ reset_for_test()
| void pulp::audio::AudioFocusRegistry::reset_for_test |
( |
| ) |
|
Reset for tests — clears all subscribers + state.
◆ subscribe()
Subscribe a callback.
Callback fires on the thread that calls publish() — typically the JNI thread for Android, main thread on iOS. Callbacks must be cheap and must not block the audio thread; the usual pattern is to stash the state in an atomic and read it from the audio callback.
◆ Token
The documentation for this class was generated from the following file: