Update device naming to be more apparent about the device being used
This commit is contained in:
parent
694e9a5fec
commit
da1dee351d
11
Alc/alsa.c
11
Alc/alsa.c
@ -114,7 +114,7 @@ MAKE_FUNC(snd_card_next);
|
||||
#undef MAKE_FUNC
|
||||
|
||||
|
||||
static const ALCchar alsaDevice[] = "ALSA Software";
|
||||
static const ALCchar alsaDevice[] = "ALSA Default";
|
||||
static DevMap *allDevNameMap;
|
||||
static ALuint numDevNames;
|
||||
static DevMap *allCaptureDevNameMap;
|
||||
@ -231,9 +231,7 @@ static DevMap *probe_devices(snd_pcm_stream_t stream, ALuint *count)
|
||||
AL_PRINT("Failed to find a card: %s\n", psnd_strerror(err));
|
||||
|
||||
DevList = malloc(sizeof(DevMap) * 1);
|
||||
DevList[0].name = strdup((stream == SND_PCM_STREAM_PLAYBACK) ?
|
||||
"ALSA Software on default" :
|
||||
"ALSA Capture on default");
|
||||
DevList[0].name = strdup("ALSA Default");
|
||||
idx = 1;
|
||||
while(card >= 0)
|
||||
{
|
||||
@ -276,9 +274,8 @@ static DevMap *probe_devices(snd_pcm_stream_t stream, ALuint *count)
|
||||
DevList = temp;
|
||||
cname = psnd_ctl_card_info_get_name(info);
|
||||
dname = psnd_pcm_info_get_name(pcminfo);
|
||||
snprintf(name, sizeof(name), "ALSA %s on %s [%s] (hw:%d,%d)",
|
||||
((stream == SND_PCM_STREAM_PLAYBACK) ?
|
||||
"Software" : "Capture"), cname, dname, card, dev);
|
||||
snprintf(name, sizeof(name), "%s [%s] (hw:%d,%d) via ALSA",
|
||||
cname, dname, card, dev);
|
||||
DevList[idx].name = strdup(name);
|
||||
DevList[idx].card = card;
|
||||
DevList[idx].dev = dev;
|
||||
|
@ -123,7 +123,7 @@ static BOOL CALLBACK DSoundEnumDevices(LPGUID guid, LPCSTR desc, LPCSTR drvname,
|
||||
{
|
||||
DeviceList = temp;
|
||||
|
||||
snprintf(str, sizeof(str), "DirectSound Software on %s", desc);
|
||||
snprintf(str, sizeof(str), "%s via DirectSound", desc);
|
||||
|
||||
DeviceList[NumDevices].name = strdup(str);
|
||||
DeviceList[NumDevices].guid = *guid;
|
||||
|
@ -47,8 +47,7 @@
|
||||
#define SOUND_MIXER_WRITE MIXER_WRITE
|
||||
#endif
|
||||
|
||||
static const ALCchar oss_device[] = "OSS Software";
|
||||
static const ALCchar oss_device_capture[] = "OSS Capture";
|
||||
static const ALCchar oss_device[] = "OSS Default";
|
||||
|
||||
typedef struct {
|
||||
int fd;
|
||||
@ -324,8 +323,8 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName)
|
||||
strncpy(driver, GetConfigValue("oss", "capture", "/dev/dsp"), sizeof(driver)-1);
|
||||
driver[sizeof(driver)-1] = 0;
|
||||
if(!deviceName)
|
||||
deviceName = oss_device_capture;
|
||||
else if(strcmp(deviceName, oss_device_capture) != 0)
|
||||
deviceName = oss_device;
|
||||
else if(strcmp(deviceName, oss_device) != 0)
|
||||
return ALC_FALSE;
|
||||
|
||||
data = (oss_data*)calloc(1, sizeof(oss_data));
|
||||
@ -513,6 +512,6 @@ void alc_oss_probe(int type)
|
||||
struct stat buf;
|
||||
if(stat(GetConfigValue("oss", "capture", "/dev/dsp"), &buf) == 0)
|
||||
#endif
|
||||
AppendCaptureDeviceList(oss_device_capture);
|
||||
AppendCaptureDeviceList(oss_device);
|
||||
}
|
||||
}
|
||||
|
@ -46,8 +46,7 @@ MAKE_FUNC(Pa_GetStreamInfo);
|
||||
#undef MAKE_FUNC
|
||||
|
||||
|
||||
static const ALCchar pa_device[] = "PortAudio Software";
|
||||
static const ALCchar pa_capture[] = "PortAudio Capture";
|
||||
static const ALCchar pa_device[] = "PortAudio Default";
|
||||
|
||||
|
||||
void *pa_load(void)
|
||||
@ -281,8 +280,8 @@ static ALCboolean pa_open_capture(ALCdevice *device, const ALCchar *deviceName)
|
||||
PaError err;
|
||||
|
||||
if(!deviceName)
|
||||
deviceName = pa_capture;
|
||||
else if(strcmp(deviceName, pa_capture) != 0)
|
||||
deviceName = pa_device;
|
||||
else if(strcmp(deviceName, pa_device) != 0)
|
||||
return ALC_FALSE;
|
||||
|
||||
if(!pa_load())
|
||||
@ -435,5 +434,5 @@ void alc_pa_probe(int type)
|
||||
else if(type == ALL_DEVICE_PROBE)
|
||||
AppendAllDeviceList(pa_device);
|
||||
else if(type == CAPTURE_DEVICE_PROBE)
|
||||
AppendCaptureDeviceList(pa_capture);
|
||||
AppendCaptureDeviceList(pa_device);
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ typedef struct {
|
||||
} DevMap;
|
||||
|
||||
|
||||
static const ALCchar pulse_device[] = "PulseAudio Software";
|
||||
static const ALCchar pulse_device[] = "PulseAudio Default";
|
||||
static DevMap *allDevNameMap;
|
||||
static ALuint numDevNames;
|
||||
static DevMap *allCaptureDevNameMap;
|
||||
@ -424,7 +424,7 @@ static void sink_device_callback(pa_context *context, const pa_sink_info *info,
|
||||
if(temp)
|
||||
{
|
||||
char str[256];
|
||||
snprintf(str, sizeof(str), "PulseAudio on %s", info->description);
|
||||
snprintf(str, sizeof(str), "%s via PulseAudio", info->description);
|
||||
|
||||
allDevNameMap = temp;
|
||||
allDevNameMap[numDevNames].name = strdup(str);
|
||||
@ -450,7 +450,7 @@ static void source_device_callback(pa_context *context, const pa_source_info *in
|
||||
if(temp)
|
||||
{
|
||||
char str[256];
|
||||
snprintf(str, sizeof(str), "PulseAudio on %s", info->description);
|
||||
snprintf(str, sizeof(str), "%s via PulseAudio", info->description);
|
||||
|
||||
allCaptureDevNameMap = temp;
|
||||
allCaptureDevNameMap[numCaptureDevNames].name = strdup(str);
|
||||
@ -590,7 +590,7 @@ static void probe_devices(ALboolean capture)
|
||||
else
|
||||
{
|
||||
allCaptureDevNameMap = malloc(sizeof(DevMap) * 1);
|
||||
allCaptureDevNameMap[0].name = strdup("PulseAudio Capture");
|
||||
allCaptureDevNameMap[0].name = strdup("PulseAudio Default");
|
||||
allCaptureDevNameMap[0].device_name = NULL;
|
||||
numCaptureDevNames = 1;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@
|
||||
#include <sys/audioio.h>
|
||||
|
||||
|
||||
static const ALCchar solaris_device[] = "Solaris Software";
|
||||
static const ALCchar solaris_device[] = "Solaris Default";
|
||||
|
||||
typedef struct {
|
||||
int fd;
|
||||
|
@ -70,7 +70,7 @@ static void ProbeDevices(void)
|
||||
if(waveInGetDevCaps(i, &WaveInCaps, sizeof(WAVEINCAPS)) == MMSYSERR_NOERROR)
|
||||
{
|
||||
char name[128];
|
||||
snprintf(name, sizeof(name), "WaveIn on %s", WaveInCaps.szPname);
|
||||
snprintf(name, sizeof(name), "%s via WaveIn", WaveInCaps.szPname);
|
||||
CaptureDeviceList[i] = strdup(name);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user