diff options
author | Chris Robinson <[email protected]> | 2023-11-25 18:58:00 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-11-25 18:58:00 -0800 |
commit | 2a27a2ca5ea0f6b6b8fff065212959ea60021647 (patch) | |
tree | 0eaa72a89e008f8cc52ca34e9c0a81ae3c601d9c | |
parent | 889f2daf1f0453fbbebc7ebba74c58584a335043 (diff) |
Fix some unused parameter and unhandled enum warnings
-rw-r--r-- | alc/alc.cpp | 35 | ||||
-rw-r--r-- | alc/backends/base.h | 5 | ||||
-rw-r--r-- | alc/backends/coreaudio.cpp | 15 | ||||
-rw-r--r-- | alc/backends/pipewire.cpp | 23 | ||||
-rw-r--r-- | alc/backends/pulseaudio.cpp | 18 | ||||
-rw-r--r-- | alc/backends/wasapi.cpp | 25 |
6 files changed, 62 insertions, 59 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index be41f278..6017e743 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -3484,28 +3484,23 @@ FORCE_ALIGN ALCenum ALC_APIENTRY alcEventIsSupportedSOFT(ALCenum eventType, ALCe alcSetError(nullptr, ALC_INVALID_ENUM); return ALC_EVENT_NOT_SUPPORTED_SOFT; } + + auto supported = alc::EventSupport::NoSupport; switch(deviceType) { - case al::to_underlying(alc::DeviceType::Playback): - { - if(!PlaybackFactory) - { - return ALC_EVENT_NOT_SUPPORTED_SOFT; - } + case ALC_PLAYBACK_DEVICE_SOFT: + if(PlaybackFactory) + supported = PlaybackFactory->queryEventSupport(*etype, BackendType::Playback); + break; - auto supported = PlaybackFactory->queryEventSupport(*etype, BackendType::Playback); - return al::to_underlying(supported); - } - case al::to_underlying(alc::DeviceType::Capture): - { - if(!CaptureFactory) - { - return ALC_EVENT_NOT_SUPPORTED_SOFT; - } + case ALC_CAPTURE_DEVICE_SOFT: + if(CaptureFactory) + supported = CaptureFactory->queryEventSupport(*etype, BackendType::Capture); + break; - auto supported = CaptureFactory->queryEventSupport(*etype, BackendType::Capture); - return al::to_underlying(supported); - } + default: + WARN("Invalid device type: 0x%04x\n", deviceType); + alcSetError(nullptr, ALC_INVALID_ENUM); } - return ALC_EVENT_NOT_SUPPORTED_SOFT; -}
\ No newline at end of file + return al::to_underlying(supported); +} diff --git a/alc/backends/base.h b/alc/backends/base.h index ea3b57a3..eea0d238 100644 --- a/alc/backends/base.h +++ b/alc/backends/base.h @@ -80,9 +80,8 @@ struct BackendFactory { virtual bool querySupport(BackendType type) = 0; - virtual alc::EventSupport queryEventSupport(alc::EventType eventType, BackendType type) { - return alc::EventSupport::NoSupport; - } + virtual alc::EventSupport queryEventSupport(alc::EventType, BackendType) + { return alc::EventSupport::NoSupport; } virtual std::string probe(BackendType type) = 0; diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp index eb4e5880..16b0781e 100644 --- a/alc/backends/coreaudio.cpp +++ b/alc/backends/coreaudio.cpp @@ -1013,12 +1013,17 @@ BackendPtr CoreAudioBackendFactory::createBackend(DeviceBase *device, BackendTyp return nullptr; } -alc::EventSupport CoreAudioBackendFactory::queryEventSupport(alc::EventType eventType, BackendType type) +alc::EventSupport CoreAudioBackendFactory::queryEventSupport(alc::EventType eventType, BackendType) { - switch(eventType) { - case alc::EventType::DefaultDeviceChanged: { - return alc::EventSupport::FullSupport; - } + switch(eventType) + { + case alc::EventType::DefaultDeviceChanged: + return alc::EventSupport::FullSupport; + + case alc::EventType::DeviceAdded: + case alc::EventType::DeviceRemoved: + case alc::EventType::Count: + break; } return alc::EventSupport::NoSupport; } diff --git a/alc/backends/pipewire.cpp b/alc/backends/pipewire.cpp index d1a9d095..6a001d7a 100644 --- a/alc/backends/pipewire.cpp +++ b/alc/backends/pipewire.cpp @@ -2266,18 +2266,17 @@ BackendFactory &PipeWireBackendFactory::getFactory() return factory; } -alc::EventSupport PipeWireBackendFactory::queryEventSupport(alc::EventType eventType, BackendType type) +alc::EventSupport PipeWireBackendFactory::queryEventSupport(alc::EventType eventType, BackendType) { - switch(eventType) { - case alc::EventType::DefaultDeviceChanged: { - return alc::EventSupport::FullSupport; - } - case alc::EventType::DeviceAdded: { - return alc::EventSupport::FullSupport; - } - case alc::EventType::DeviceRemoved: { - return alc::EventSupport::FullSupport; - } + switch(eventType) + { + case alc::EventType::DefaultDeviceChanged: + case alc::EventType::DeviceAdded: + case alc::EventType::DeviceRemoved: + return alc::EventSupport::FullSupport; + + case alc::EventType::Count: + break; } return alc::EventSupport::NoSupport; -}
\ No newline at end of file +} diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp index 23ed1415..bebc182d 100644 --- a/alc/backends/pulseaudio.cpp +++ b/alc/backends/pulseaudio.cpp @@ -1491,15 +1491,17 @@ BackendFactory &PulseBackendFactory::getFactory() return factory; } -alc::EventSupport PulseBackendFactory::queryEventSupport(alc::EventType eventType, BackendType type) +alc::EventSupport PulseBackendFactory::queryEventSupport(alc::EventType eventType, BackendType) { - switch(eventType) { - case alc::EventType::DeviceAdded: { - return alc::EventSupport::FullSupport; - } - case alc::EventType::DeviceRemoved: { - return alc::EventSupport::FullSupport; - } + switch(eventType) + { + case alc::EventType::DeviceAdded: + case alc::EventType::DeviceRemoved: + return alc::EventSupport::FullSupport; + + case alc::EventType::DefaultDeviceChanged: + case alc::EventType::Count: + break; } return alc::EventSupport::NoSupport; } diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index a4d6ea2f..3ee98457 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -2741,18 +2741,21 @@ BackendFactory &WasapiBackendFactory::getFactory() return factory; } -alc::EventSupport WasapiBackendFactory::queryEventSupport(alc::EventType eventType, BackendType type) +alc::EventSupport WasapiBackendFactory::queryEventSupport(alc::EventType eventType, BackendType) { - switch(eventType) { - case alc::EventType::DefaultDeviceChanged: { - return alc::EventSupport::FullSupport; - } - case alc::EventType::DeviceAdded: { - return alc::EventSupport::FullSupport; - } - case alc::EventType::DeviceRemoved: { - return alc::EventSupport::FullSupport; - } + switch(eventType) + { + case alc::EventType::DefaultDeviceChanged: + return alc::EventSupport::FullSupport; + + case alc::EventType::DeviceAdded: + case alc::EventType::DeviceRemoved: +#if !defined(ALSOFT_UWP) + return alc::EventSupport::FullSupport; +#endif + + case alc::EventType::Count: + break; } return alc::EventSupport::NoSupport; } |