diff options
author | Chris Robinson <[email protected]> | 2020-03-30 16:00:02 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-03-30 16:00:02 -0700 |
commit | 662d77159bf9b24b9ef48717547a6d454551bc43 (patch) | |
tree | c68e48139a1d4093cc9f01356e8a5d45161f01db /alc | |
parent | f2ddf971df5cbbd112e0d677b0ea5bd6368051dc (diff) |
Get rid of a redundant enum
Diffstat (limited to 'alc')
34 files changed, 64 insertions, 69 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index 0851305a..4992236a 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1221,7 +1221,7 @@ void ProbeAllDevicesList() decltype(alcAllDevicesList){}.swap(alcAllDevicesList); else { - std::string names{PlaybackFactory->probe(DevProbe::Playback)}; + std::string names{PlaybackFactory->probe(BackendType::Playback)}; if(names.empty()) names += '\0'; names.swap(alcAllDevicesList); } @@ -1235,7 +1235,7 @@ void ProbeCaptureDeviceList() decltype(alcCaptureDeviceList){}.swap(alcCaptureDeviceList); else { - std::string names{CaptureFactory->probe(DevProbe::Capture)}; + std::string names{CaptureFactory->probe(BackendType::Capture)}; if(names.empty()) names += '\0'; names.swap(alcCaptureDeviceList); } diff --git a/alc/backends/alsa.cpp b/alc/backends/alsa.cpp index f132cb72..689649dc 100644 --- a/alc/backends/alsa.cpp +++ b/alc/backends/alsa.cpp @@ -1229,7 +1229,7 @@ bool AlsaBackendFactory::init() bool AlsaBackendFactory::querySupport(BackendType type) { return (type == BackendType::Playback || type == BackendType::Capture); } -std::string AlsaBackendFactory::probe(DevProbe type) +std::string AlsaBackendFactory::probe(BackendType type) { std::string outnames; @@ -1242,12 +1242,12 @@ std::string AlsaBackendFactory::probe(DevProbe type) }; switch(type) { - case DevProbe::Playback: + case BackendType::Playback: PlaybackDevices = probe_devices(SND_PCM_STREAM_PLAYBACK); std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_device); break; - case DevProbe::Capture: + case BackendType::Capture: CaptureDevices = probe_devices(SND_PCM_STREAM_CAPTURE); std::for_each(CaptureDevices.cbegin(), CaptureDevices.cend(), add_device); break; diff --git a/alc/backends/alsa.h b/alc/backends/alsa.h index e1c50444..12023cb6 100644 --- a/alc/backends/alsa.h +++ b/alc/backends/alsa.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/base.h b/alc/backends/base.h index 764fb3f4..839fc424 100644 --- a/alc/backends/base.h +++ b/alc/backends/base.h @@ -55,18 +55,13 @@ enum class BackendType { Capture }; -enum class DevProbe { - Playback, - Capture -}; - struct BackendFactory { virtual bool init() = 0; virtual bool querySupport(BackendType type) = 0; - virtual std::string probe(DevProbe type) = 0; + virtual std::string probe(BackendType type) = 0; virtual BackendPtr createBackend(ALCdevice *device, BackendType type) = 0; diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp index 56520641..6201ca47 100644 --- a/alc/backends/coreaudio.cpp +++ b/alc/backends/coreaudio.cpp @@ -637,13 +637,13 @@ bool CoreAudioBackendFactory::init() { return true; } bool CoreAudioBackendFactory::querySupport(BackendType type) { return type == BackendType::Playback || type == BackendType::Capture; } -std::string CoreAudioBackendFactory::probe(DevProbe type) +std::string CoreAudioBackendFactory::probe(BackendType type) { std::string outnames; switch(type) { - case DevProbe::Playback: - case DevProbe::Capture: + case BackendType::Playback: + case BackendType::Capture: /* Includes null char. */ outnames.append(ca_device, sizeof(ca_device)); break; diff --git a/alc/backends/coreaudio.h b/alc/backends/coreaudio.h index 212db92b..16957806 100644 --- a/alc/backends/coreaudio.h +++ b/alc/backends/coreaudio.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/dsound.cpp b/alc/backends/dsound.cpp index abe36e57..e2445cda 100644 --- a/alc/backends/dsound.cpp +++ b/alc/backends/dsound.cpp @@ -869,7 +869,7 @@ bool DSoundBackendFactory::init() bool DSoundBackendFactory::querySupport(BackendType type) { return (type == BackendType::Playback || type == BackendType::Capture); } -std::string DSoundBackendFactory::probe(DevProbe type) +std::string DSoundBackendFactory::probe(BackendType type) { std::string outnames; auto add_device = [&outnames](const DevMap &entry) -> void @@ -885,7 +885,7 @@ std::string DSoundBackendFactory::probe(DevProbe type) HRESULT hrcom{CoInitialize(nullptr)}; switch(type) { - case DevProbe::Playback: + case BackendType::Playback: PlaybackDevices.clear(); hr = DirectSoundEnumerateW(DSoundEnumDevices, &PlaybackDevices); if(FAILED(hr)) @@ -893,7 +893,7 @@ std::string DSoundBackendFactory::probe(DevProbe type) std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_device); break; - case DevProbe::Capture: + case BackendType::Capture: CaptureDevices.clear(); hr = DirectSoundCaptureEnumerateW(DSoundEnumDevices, &CaptureDevices); if(FAILED(hr)) diff --git a/alc/backends/dsound.h b/alc/backends/dsound.h index d1948198..83f7d5c7 100644 --- a/alc/backends/dsound.h +++ b/alc/backends/dsound.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/jack.cpp b/alc/backends/jack.cpp index f784fed9..8d52d6ee 100644 --- a/alc/backends/jack.cpp +++ b/alc/backends/jack.cpp @@ -504,16 +504,16 @@ bool JackBackendFactory::init() bool JackBackendFactory::querySupport(BackendType type) { return (type == BackendType::Playback); } -std::string JackBackendFactory::probe(DevProbe type) +std::string JackBackendFactory::probe(BackendType type) { std::string outnames; switch(type) { - case DevProbe::Playback: + case BackendType::Playback: /* Includes null char. */ outnames.append(jackDevice, sizeof(jackDevice)); break; - case DevProbe::Capture: + case BackendType::Capture: break; } return outnames; diff --git a/alc/backends/jack.h b/alc/backends/jack.h index 793d6f8e..f966c8f0 100644 --- a/alc/backends/jack.h +++ b/alc/backends/jack.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/loopback.cpp b/alc/backends/loopback.cpp index 44ac68d1..071d095d 100644 --- a/alc/backends/loopback.cpp +++ b/alc/backends/loopback.cpp @@ -66,7 +66,7 @@ bool LoopbackBackendFactory::init() bool LoopbackBackendFactory::querySupport(BackendType) { return true; } -std::string LoopbackBackendFactory::probe(DevProbe) +std::string LoopbackBackendFactory::probe(BackendType) { return std::string{}; } BackendPtr LoopbackBackendFactory::createBackend(ALCdevice *device, BackendType) diff --git a/alc/backends/loopback.h b/alc/backends/loopback.h index df4929e6..d000e033 100644 --- a/alc/backends/loopback.h +++ b/alc/backends/loopback.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/null.cpp b/alc/backends/null.cpp index 1b90a1ee..8692e513 100644 --- a/alc/backends/null.cpp +++ b/alc/backends/null.cpp @@ -154,16 +154,16 @@ bool NullBackendFactory::init() bool NullBackendFactory::querySupport(BackendType type) { return (type == BackendType::Playback); } -std::string NullBackendFactory::probe(DevProbe type) +std::string NullBackendFactory::probe(BackendType type) { std::string outnames; switch(type) { - case DevProbe::Playback: + case BackendType::Playback: /* Includes null char. */ outnames.append(nullDevice, sizeof(nullDevice)); break; - case DevProbe::Capture: + case BackendType::Capture: break; } return outnames; diff --git a/alc/backends/null.h b/alc/backends/null.h index 1d714349..8e9c59e5 100644 --- a/alc/backends/null.h +++ b/alc/backends/null.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/opensl.cpp b/alc/backends/opensl.cpp index d9ee47eb..ad85e5fb 100644 --- a/alc/backends/opensl.cpp +++ b/alc/backends/opensl.cpp @@ -939,13 +939,13 @@ bool OSLBackendFactory::init() { return true; } bool OSLBackendFactory::querySupport(BackendType type) { return (type == BackendType::Playback || type == BackendType::Capture); } -std::string OSLBackendFactory::probe(DevProbe type) +std::string OSLBackendFactory::probe(BackendType type) { std::string outnames; switch(type) { - case DevProbe::Playback: - case DevProbe::Capture: + case BackendType::Playback: + case BackendType::Capture: /* Includes null char. */ outnames.append(opensl_device, sizeof(opensl_device)); break; diff --git a/alc/backends/opensl.h b/alc/backends/opensl.h index 4309293b..b1c5cf5a 100644 --- a/alc/backends/opensl.h +++ b/alc/backends/opensl.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/oss.cpp b/alc/backends/oss.cpp index ef3ca556..2176078a 100644 --- a/alc/backends/oss.cpp +++ b/alc/backends/oss.cpp @@ -670,7 +670,7 @@ bool OSSBackendFactory::init() bool OSSBackendFactory::querySupport(BackendType type) { return (type == BackendType::Playback || type == BackendType::Capture); } -std::string OSSBackendFactory::probe(DevProbe type) +std::string OSSBackendFactory::probe(BackendType type) { std::string outnames; @@ -686,13 +686,13 @@ std::string OSSBackendFactory::probe(DevProbe type) switch(type) { - case DevProbe::Playback: + case BackendType::Playback: PlaybackDevices.clear(); ALCossListPopulate(&PlaybackDevices, DSP_CAP_OUTPUT); std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_device); break; - case DevProbe::Capture: + case BackendType::Capture: CaptureDevices.clear(); ALCossListPopulate(&CaptureDevices, DSP_CAP_INPUT); std::for_each(CaptureDevices.cbegin(), CaptureDevices.cend(), add_device); diff --git a/alc/backends/oss.h b/alc/backends/oss.h index 4305dc78..dd92efc3 100644 --- a/alc/backends/oss.h +++ b/alc/backends/oss.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/portaudio.cpp b/alc/backends/portaudio.cpp index 7696e4f6..29715554 100644 --- a/alc/backends/portaudio.cpp +++ b/alc/backends/portaudio.cpp @@ -419,13 +419,13 @@ bool PortBackendFactory::init() bool PortBackendFactory::querySupport(BackendType type) { return (type == BackendType::Playback || type == BackendType::Capture); } -std::string PortBackendFactory::probe(DevProbe type) +std::string PortBackendFactory::probe(BackendType type) { std::string outnames; switch(type) { - case DevProbe::Playback: - case DevProbe::Capture: + case BackendType::Playback: + case BackendType::Capture: /* Includes null char. */ outnames.append(pa_device, sizeof(pa_device)); break; diff --git a/alc/backends/portaudio.h b/alc/backends/portaudio.h index d88d78e1..9dbd6b94 100644 --- a/alc/backends/portaudio.h +++ b/alc/backends/portaudio.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp index 102e3915..51f8cfc8 100644 --- a/alc/backends/pulseaudio.cpp +++ b/alc/backends/pulseaudio.cpp @@ -1501,7 +1501,7 @@ bool PulseBackendFactory::init() bool PulseBackendFactory::querySupport(BackendType type) { return type == BackendType::Playback || type == BackendType::Capture; } -std::string PulseBackendFactory::probe(DevProbe type) +std::string PulseBackendFactory::probe(BackendType type) { std::string outnames; @@ -1515,12 +1515,12 @@ std::string PulseBackendFactory::probe(DevProbe type) switch(type) { - case DevProbe::Playback: + case BackendType::Playback: gGlobalMainloop.probePlaybackDevices(); std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_device); break; - case DevProbe::Capture: + case BackendType::Capture: gGlobalMainloop.probeCaptureDevices(); std::for_each(CaptureDevices.cbegin(), CaptureDevices.cend(), add_device); break; diff --git a/alc/backends/pulseaudio.h b/alc/backends/pulseaudio.h index 575eecc1..86b81502 100644 --- a/alc/backends/pulseaudio.h +++ b/alc/backends/pulseaudio.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/sdl2.cpp b/alc/backends/sdl2.cpp index e894e6a6..b47ff185 100644 --- a/alc/backends/sdl2.cpp +++ b/alc/backends/sdl2.cpp @@ -193,11 +193,11 @@ bool SDL2BackendFactory::init() bool SDL2BackendFactory::querySupport(BackendType type) { return type == BackendType::Playback; } -std::string SDL2BackendFactory::probe(DevProbe type) +std::string SDL2BackendFactory::probe(BackendType type) { std::string outnames; - if(type != DevProbe::Playback) + if(type != BackendType::Playback) return outnames; int num_devices{SDL_GetNumAudioDevices(SDL_FALSE)}; diff --git a/alc/backends/sdl2.h b/alc/backends/sdl2.h index 3c6d09bc..ce79d52e 100644 --- a/alc/backends/sdl2.h +++ b/alc/backends/sdl2.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/sndio.cpp b/alc/backends/sndio.cpp index e9f11791..7ca11430 100644 --- a/alc/backends/sndio.cpp +++ b/alc/backends/sndio.cpp @@ -452,13 +452,13 @@ bool SndIOBackendFactory::init() bool SndIOBackendFactory::querySupport(BackendType type) { return (type == BackendType::Playback || type == BackendType::Capture); } -std::string SndIOBackendFactory::probe(DevProbe type) +std::string SndIOBackendFactory::probe(BackendType type) { std::string outnames; switch(type) { - case DevProbe::Playback: - case DevProbe::Capture: + case BackendType::Playback: + case BackendType::Capture: /* Includes null char. */ outnames.append(sndio_device, sizeof(sndio_device)); break; diff --git a/alc/backends/sndio.h b/alc/backends/sndio.h index 5928ebd9..83d02906 100644 --- a/alc/backends/sndio.h +++ b/alc/backends/sndio.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/solaris.cpp b/alc/backends/solaris.cpp index a6f1c3f0..78f5f142 100644 --- a/alc/backends/solaris.cpp +++ b/alc/backends/solaris.cpp @@ -270,12 +270,12 @@ bool SolarisBackendFactory::init() bool SolarisBackendFactory::querySupport(BackendType type) { return type == BackendType::Playback; } -std::string SolarisBackendFactory::probe(DevProbe type) +std::string SolarisBackendFactory::probe(BackendType type) { std::string outnames; switch(type) { - case DevProbe::Playback: + case BackendType::Playback: { struct stat buf; if(stat(solaris_driver.c_str(), &buf) == 0) @@ -283,7 +283,7 @@ std::string SolarisBackendFactory::probe(DevProbe type) } break; - case DevProbe::Capture: + case BackendType::Capture: break; } return outnames; diff --git a/alc/backends/solaris.h b/alc/backends/solaris.h index 14ace580..4a9e505b 100644 --- a/alc/backends/solaris.h +++ b/alc/backends/solaris.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index 74c3afbe..6082b545 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -1744,7 +1744,7 @@ bool WasapiBackendFactory::init() bool WasapiBackendFactory::querySupport(BackendType type) { return type == BackendType::Playback || type == BackendType::Capture; } -std::string WasapiBackendFactory::probe(DevProbe type) +std::string WasapiBackendFactory::probe(BackendType type) { std::string outnames; auto add_device = [&outnames](const DevMap &entry) -> void @@ -1757,12 +1757,12 @@ std::string WasapiBackendFactory::probe(DevProbe type) switch(type) { - case DevProbe::Playback: + case BackendType::Playback: WasapiProxy::pushMessageStatic(MsgType::EnumeratePlayback).wait(); std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_device); break; - case DevProbe::Capture: + case BackendType::Capture: WasapiProxy::pushMessageStatic(MsgType::EnumerateCapture).wait(); std::for_each(CaptureDevices.cbegin(), CaptureDevices.cend(), add_device); break; diff --git a/alc/backends/wasapi.h b/alc/backends/wasapi.h index ef718a6f..97143c1a 100644 --- a/alc/backends/wasapi.h +++ b/alc/backends/wasapi.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/wave.cpp b/alc/backends/wave.cpp index 2c4c4412..813be401 100644 --- a/alc/backends/wave.cpp +++ b/alc/backends/wave.cpp @@ -373,16 +373,16 @@ bool WaveBackendFactory::init() bool WaveBackendFactory::querySupport(BackendType type) { return type == BackendType::Playback; } -std::string WaveBackendFactory::probe(DevProbe type) +std::string WaveBackendFactory::probe(BackendType type) { std::string outnames; switch(type) { - case DevProbe::Playback: + case BackendType::Playback: /* Includes null char. */ outnames.append(waveDevice, sizeof(waveDevice)); break; - case DevProbe::Capture: + case BackendType::Capture: break; } return outnames; diff --git a/alc/backends/wave.h b/alc/backends/wave.h index 637d082c..5719961f 100644 --- a/alc/backends/wave.h +++ b/alc/backends/wave.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; diff --git a/alc/backends/winmm.cpp b/alc/backends/winmm.cpp index cd63352f..d85b611d 100644 --- a/alc/backends/winmm.cpp +++ b/alc/backends/winmm.cpp @@ -590,7 +590,7 @@ bool WinMMBackendFactory::init() bool WinMMBackendFactory::querySupport(BackendType type) { return type == BackendType::Playback || type == BackendType::Capture; } -std::string WinMMBackendFactory::probe(DevProbe type) +std::string WinMMBackendFactory::probe(BackendType type) { std::string outnames; auto add_device = [&outnames](const std::string &dname) -> void @@ -603,12 +603,12 @@ std::string WinMMBackendFactory::probe(DevProbe type) }; switch(type) { - case DevProbe::Playback: + case BackendType::Playback: ProbePlaybackDevices(); std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_device); break; - case DevProbe::Capture: + case BackendType::Capture: ProbeCaptureDevices(); std::for_each(CaptureDevices.cbegin(), CaptureDevices.cend(), add_device); break; diff --git a/alc/backends/winmm.h b/alc/backends/winmm.h index 28b66e98..bf09ddd9 100644 --- a/alc/backends/winmm.h +++ b/alc/backends/winmm.h @@ -9,7 +9,7 @@ public: bool querySupport(BackendType type) override; - std::string probe(DevProbe type) override; + std::string probe(BackendType type) override; BackendPtr createBackend(ALCdevice *device, BackendType type) override; |