From 590c82b0402632ada23504a0c5673f7ad4588639 Mon Sep 17 00:00:00 2001 From: wb2osz Date: Sun, 12 Nov 2017 19:46:47 -0500 Subject: [PATCH] Issue 116 - Recognize two digit number, as well as single digit number, for Windows audio device number in configuration file ADEVICE. --- audio_win.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/audio_win.c b/audio_win.c index 5cbb39b..c96a00a 100644 --- a/audio_win.c +++ b/audio_win.c @@ -313,10 +313,15 @@ int audio_open (struct audio_s *pa) /* Does config file have a number? */ /* If so, it is an index into list of devices. */ + /* Originally only a single digit was recognized. */ + /* v 1.5 also recognizes two digits. (Issue 116) */ if (strlen(pa->adev[a].adevice_in) == 1 && isdigit(pa->adev[a].adevice_in[0])) { in_dev_no[a] = atoi(pa->adev[a].adevice_in); } + else if (strlen(pa->adev[a].adevice_in) == 2 && isdigit(pa->adev[a].adevice_in[0]) && isdigit(pa->adev[a].adevice_in[1])) { + in_dev_no[a] = atoi(pa->adev[a].adevice_in); + } /* Otherwise, does it have search string? */ @@ -344,6 +349,9 @@ int audio_open (struct audio_s *pa) if (strlen(pa->adev[a].adevice_out) == 1 && isdigit(pa->adev[a].adevice_out[0])) { out_dev_no[a] = atoi(pa->adev[a].adevice_out); } + else if (strlen(pa->adev[a].adevice_out) == 2 && isdigit(pa->adev[a].adevice_out[0]) && isdigit(pa->adev[a].adevice_out[1])) { + out_dev_no[a] = atoi(pa->adev[a].adevice_out); + } if ((UINT)(out_dev_no[a]) == WAVE_MAPPER && strlen(pa->adev[a].adevice_out) >= 1) { num_devices = waveOutGetNumDevs();