Skip to content

Commit 590c82b

Browse files
committed
Issue 116 - Recognize two digit number, as well as single digit
number, for Windows audio device number in configuration file ADEVICE.
1 parent b81de60 commit 590c82b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

audio_win.c

+8
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,15 @@ int audio_open (struct audio_s *pa)
313313

314314
/* Does config file have a number? */
315315
/* If so, it is an index into list of devices. */
316+
/* Originally only a single digit was recognized. */
317+
/* v 1.5 also recognizes two digits. (Issue 116) */
316318

317319
if (strlen(pa->adev[a].adevice_in) == 1 && isdigit(pa->adev[a].adevice_in[0])) {
318320
in_dev_no[a] = atoi(pa->adev[a].adevice_in);
319321
}
322+
else if (strlen(pa->adev[a].adevice_in) == 2 && isdigit(pa->adev[a].adevice_in[0]) && isdigit(pa->adev[a].adevice_in[1])) {
323+
in_dev_no[a] = atoi(pa->adev[a].adevice_in);
324+
}
320325

321326
/* Otherwise, does it have search string? */
322327

@@ -344,6 +349,9 @@ int audio_open (struct audio_s *pa)
344349
if (strlen(pa->adev[a].adevice_out) == 1 && isdigit(pa->adev[a].adevice_out[0])) {
345350
out_dev_no[a] = atoi(pa->adev[a].adevice_out);
346351
}
352+
else if (strlen(pa->adev[a].adevice_out) == 2 && isdigit(pa->adev[a].adevice_out[0]) && isdigit(pa->adev[a].adevice_out[1])) {
353+
out_dev_no[a] = atoi(pa->adev[a].adevice_out);
354+
}
347355

348356
if ((UINT)(out_dev_no[a]) == WAVE_MAPPER && strlen(pa->adev[a].adevice_out) >= 1) {
349357
num_devices = waveOutGetNumDevs();

0 commit comments

Comments
 (0)