Rename DevProbe enum names
This commit is contained in:
+2
-2
@@ -1178,9 +1178,9 @@ static void ProbeDevices(std::string *list, BackendInfo *backendinfo, DevProbe t
|
||||
backendinfo->getFactory().probe(type, list);
|
||||
}
|
||||
static void ProbeAllDevicesList(void)
|
||||
{ ProbeDevices(&alcAllDevicesList, &PlaybackBackend, ALL_DEVICE_PROBE); }
|
||||
{ ProbeDevices(&alcAllDevicesList, &PlaybackBackend, DevProbe::Playback); }
|
||||
static void ProbeCaptureDeviceList(void)
|
||||
{ ProbeDevices(&alcCaptureDeviceList, &CaptureBackend, CAPTURE_DEVICE_PROBE); }
|
||||
{ ProbeDevices(&alcCaptureDeviceList, &CaptureBackend, DevProbe::Capture); }
|
||||
|
||||
|
||||
/************************************************
|
||||
|
||||
@@ -1277,12 +1277,12 @@ void AlsaBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
};
|
||||
switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
PlaybackDevices = probe_devices(SND_PCM_STREAM_PLAYBACK);
|
||||
std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_device);
|
||||
break;
|
||||
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Capture:
|
||||
CaptureDevices = probe_devices(SND_PCM_STREAM_CAPTURE);
|
||||
std::for_each(CaptureDevices.cbegin(), CaptureDevices.cend(), add_device);
|
||||
break;
|
||||
|
||||
@@ -694,8 +694,8 @@ void CoreAudioBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
case DevProbe::Capture:
|
||||
/* Includes null char. */
|
||||
outnames->append(ca_device, sizeof(ca_device));
|
||||
break;
|
||||
|
||||
@@ -924,7 +924,7 @@ void DSoundBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
HRESULT hrcom{CoInitialize(nullptr)};
|
||||
switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
PlaybackDevices.clear();
|
||||
hr = DirectSoundEnumerateW(DSoundEnumDevices, &PlaybackDevices);
|
||||
if(FAILED(hr))
|
||||
@@ -932,7 +932,7 @@ void DSoundBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_device);
|
||||
break;
|
||||
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Capture:
|
||||
CaptureDevices.clear();
|
||||
hr = DirectSoundCaptureEnumerateW(DSoundEnumDevices, &CaptureDevices);
|
||||
if(FAILED(hr))
|
||||
|
||||
@@ -548,12 +548,12 @@ void JackBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
/* Includes null char. */
|
||||
outnames->append(jackDevice, sizeof(jackDevice));
|
||||
break;
|
||||
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Capture:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,11 +161,11 @@ void NullBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
/* Includes null char. */
|
||||
outnames->append(nullDevice, sizeof(nullDevice));
|
||||
break;
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Capture:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -926,8 +926,8 @@ void OSLBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
case DevProbe::Capture:
|
||||
/* Includes null char. */
|
||||
outnames->append(opensl_device, sizeof(opensl_device));
|
||||
break;
|
||||
|
||||
@@ -734,13 +734,13 @@ void OSSBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
PlaybackDevices.clear();
|
||||
ALCossListPopulate(&PlaybackDevices, DSP_CAP_OUTPUT);
|
||||
std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_device);
|
||||
break;
|
||||
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Capture:
|
||||
CaptureDevices.clear();
|
||||
ALCossListPopulate(&CaptureDevices, DSP_CAP_INPUT);
|
||||
std::for_each(CaptureDevices.cbegin(), CaptureDevices.cend(), add_device);
|
||||
|
||||
@@ -459,8 +459,8 @@ void PortBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
case DevProbe::Capture:
|
||||
/* Includes null char. */
|
||||
outnames->append(pa_device, sizeof(pa_device));
|
||||
break;
|
||||
|
||||
@@ -1652,12 +1652,12 @@ void PulseBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
};
|
||||
switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
probePlaybackDevices();
|
||||
std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_device);
|
||||
break;
|
||||
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Capture:
|
||||
probeCaptureDevices();
|
||||
std::for_each(CaptureDevices.cbegin(), CaptureDevices.cend(), add_device);
|
||||
break;
|
||||
|
||||
@@ -941,11 +941,11 @@ void QSABackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
deviceList(SND_PCM_CHANNEL_PLAYBACK, &DeviceNameMap);
|
||||
std::for_each(DeviceNameMap.cbegin(), DeviceNameMap.cend(), add_device);
|
||||
break;
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Capture:
|
||||
deviceList(SND_PCM_CHANNEL_CAPTURE, &CaptureNameMap);
|
||||
std::for_each(CaptureNameMap.cbegin(), CaptureNameMap.cend(), add_device);
|
||||
break;
|
||||
|
||||
@@ -207,7 +207,7 @@ bool SDL2BackendFactory::querySupport(BackendType type)
|
||||
|
||||
void SDL2BackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
{
|
||||
if(type != ALL_DEVICE_PROBE)
|
||||
if(type != DevProbe::Playback)
|
||||
return;
|
||||
|
||||
int num_devices{SDL_GetNumAudioDevices(SDL_FALSE)};
|
||||
|
||||
@@ -481,8 +481,8 @@ void SndIOBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
case DevProbe::Capture:
|
||||
/* Includes null char. */
|
||||
outnames->append(sndio_device, sizeof(sndio_device));
|
||||
break;
|
||||
|
||||
@@ -278,7 +278,7 @@ void SolarisBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
{
|
||||
#ifdef HAVE_STAT
|
||||
struct stat buf;
|
||||
@@ -288,7 +288,7 @@ void SolarisBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
}
|
||||
break;
|
||||
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Capture:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,9 +469,9 @@ DWORD WasapiProxy::messageHandler(void *ptr)
|
||||
{
|
||||
Enumerator = static_cast<IMMDeviceEnumerator*>(ptr);
|
||||
|
||||
if(msg.lParam == ALL_DEVICE_PROBE)
|
||||
if(msg.lParam == DevProbe::Playback)
|
||||
hr = probe_devices(Enumerator, eRender, PlaybackDevices);
|
||||
else if(msg.lParam == CAPTURE_DEVICE_PROBE)
|
||||
else if(msg.lParam == DevProbe::Capture)
|
||||
hr = probe_devices(Enumerator, eCapture, CaptureDevices);
|
||||
|
||||
Enumerator->Release();
|
||||
@@ -673,7 +673,7 @@ ALCenum WasapiPlayback::open(const ALCchar *name)
|
||||
if(PlaybackDevices.empty())
|
||||
{
|
||||
ThreadRequest req = { mMsgEvent, 0 };
|
||||
if(PostThreadMessage(ThreadID, WM_USER_Enumerate, (WPARAM)&req, ALL_DEVICE_PROBE))
|
||||
if(PostThreadMessage(ThreadID, WM_USER_Enumerate, (WPARAM)&req, DevProbe::Playback))
|
||||
(void)WaitForResponse(&req);
|
||||
}
|
||||
|
||||
@@ -1293,7 +1293,7 @@ ALCenum WasapiCapture::open(const ALCchar *name)
|
||||
if(CaptureDevices.empty())
|
||||
{
|
||||
ThreadRequest req{ mMsgEvent, 0 };
|
||||
if(PostThreadMessage(ThreadID, WM_USER_Enumerate, (WPARAM)&req, CAPTURE_DEVICE_PROBE))
|
||||
if(PostThreadMessage(ThreadID, WM_USER_Enumerate, (WPARAM)&req, DevProbe::Capture))
|
||||
(void)WaitForResponse(&req);
|
||||
}
|
||||
|
||||
@@ -1788,11 +1788,11 @@ void WasapiBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
hr = WaitForResponse(&req);
|
||||
if(SUCCEEDED(hr)) switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_device);
|
||||
break;
|
||||
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Capture:
|
||||
std::for_each(CaptureDevices.cbegin(), CaptureDevices.cend(), add_device);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -370,11 +370,11 @@ void WaveBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
/* Includes null char. */
|
||||
outnames->append(waveDevice, sizeof(waveDevice));
|
||||
break;
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Capture:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -623,12 +623,12 @@ void WinMMBackendFactory::probe(DevProbe type, std::string *outnames)
|
||||
};
|
||||
switch(type)
|
||||
{
|
||||
case ALL_DEVICE_PROBE:
|
||||
case DevProbe::Playback:
|
||||
ProbePlaybackDevices();
|
||||
std::for_each(PlaybackDevices.cbegin(), PlaybackDevices.cend(), add_device);
|
||||
break;
|
||||
|
||||
case CAPTURE_DEVICE_PROBE:
|
||||
case DevProbe::Capture:
|
||||
ProbeCaptureDevices();
|
||||
std::for_each(CaptureDevices.cbegin(), CaptureDevices.cend(), add_device);
|
||||
break;
|
||||
|
||||
@@ -85,9 +85,9 @@ struct bs2b;
|
||||
#define MIN_OUTPUT_RATE (8000)
|
||||
|
||||
|
||||
enum DevProbe {
|
||||
ALL_DEVICE_PROBE,
|
||||
CAPTURE_DEVICE_PROBE
|
||||
enum class DevProbe {
|
||||
Playback,
|
||||
Capture
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user