#include <device.hpp>
|
| using | DeviceChangeCallback = std::function<void()> |
| | Register a callback for device list changes (hotplug/unplug).
|
◆ DeviceChangeCallback
Register a callback for device list changes (hotplug/unplug).
The callback may fire on an OS thread — callers should dispatch to the main/UI thread if needed. Pass nullptr to unregister.
◆ ~AudioSystem()
| virtual pulp::audio::AudioSystem::~AudioSystem |
( |
| ) |
|
|
virtualdefault |
◆ create_device()
| virtual std::unique_ptr< AudioDevice > pulp::audio::AudioSystem::create_device |
( |
const std::string & | device_id = "" | ) |
|
|
pure virtual |
◆ default_input_device()
| virtual DeviceInfo pulp::audio::AudioSystem::default_input_device |
( |
| ) |
|
|
pure virtual |
◆ default_output_device()
| virtual DeviceInfo pulp::audio::AudioSystem::default_output_device |
( |
| ) |
|
|
pure virtual |
◆ enumerate_devices()
| virtual std::vector< DeviceInfo > pulp::audio::AudioSystem::enumerate_devices |
( |
| ) |
|
|
pure virtual |
◆ fire_device_change()
| void pulp::audio::AudioSystem::fire_device_change |
( |
| ) |
|
|
inline |
Dispatch a stored device-change callback.
Safe to call from any thread; the callback itself is responsible for UI-thread marshalling. The callback is retained before invocation so it may unregister or replace itself during dispatch without invalidating the in-flight call.
Must be public, not protected. Platform notifiers (WasapiNotificationClient, Win32 MIDI DeviceWatcher, ALSA seq monitor, etc.) are NOT AudioSystem subclasses — they own a pointer to an AudioSystem and invoke this method from an OS callback thread. C++ protected would require the access to go through the notifier's own derived-class this, which doesn't apply here. MSVC enforces this strictly; making this public matches the design intent of the platform notifier callbacks.
◆ has_device_change_callback()
| bool pulp::audio::AudioSystem::has_device_change_callback |
( |
| ) |
const |
|
inline |
Observe whether a caller registered a callback.
◆ set_device_change_callback()
Default implementation stores the callback in a base-class slot.
Platform hotplug notifiers such as WASAPI IMMNotificationClient, ALSA udev monitors, Win32 MIDI DeviceWatcher, and ALSA seq monitors call fire_device_change() when a change is detected. Backends with richer semantics can still override this entirely.
The documentation for this class was generated from the following file:
- /home/runner/work/pulp/pulp/core/audio/include/pulp/audio/device.hpp