diff options
author | Chris Robinson <[email protected]> | 2023-12-12 20:10:47 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-12-12 20:10:47 -0800 |
commit | c7774aa488961e0af2895008fb0063fb790b0a58 (patch) | |
tree | 8579a6813db24e03a49e89e21f7e373874006868 /core/device.h | |
parent | bdd54018f3dd63a9591fae8b7a21a71e8adc3ddb (diff) |
Track the device state for being properly configured
And don't allow resuming if the backend device isn't properly set up.
Diffstat (limited to 'core/device.h')
-rw-r--r-- | core/device.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/device.h b/core/device.h index e813b182..668779fa 100644 --- a/core/device.h +++ b/core/device.h @@ -161,8 +161,6 @@ enum { // Specifies if the DSP is paused at user request DevicePaused, - // Specifies if the device is currently running - DeviceRunning, // Specifies if the output plays directly on/in ears (headphones, headset, // ear buds, etc). @@ -176,6 +174,12 @@ enum { DeviceFlagsCount }; +enum class DeviceState : uint8_t { + Unprepared, + Configured, + Playing +}; + struct DeviceBase { /* To avoid extraneous allocations, a 0-sized FlexArray<ContextBase*> is * defined globally as a sharable object. @@ -205,6 +209,7 @@ struct DeviceBase { // Device flags std::bitset<DeviceFlagsCount> Flags{}; + DeviceState mDeviceState{DeviceState::Unprepared}; uint NumAuxSends{}; |