Index: audacity-src-1.3.12-beta/src/prefs/DevicePrefs.cpp =================================================================== --- audacity-src-1.3.12-beta.orig/src/prefs/DevicePrefs.cpp +++ audacity-src-1.3.12-beta/src/prefs/DevicePrefs.cpp @@ -193,6 +193,16 @@ void DevicePrefs::OnHost(wxCommandEvent wxArrayString playnames; wxArrayString recordnames; + int playDeviceNum = -1; // use device name from gPrefs + if ( mPlayDevice == wxT("") ) { + playDeviceNum = Pa_GetDefaultOutputDevice(); + } + int recDeviceNum = -1; // use device name from gPrefs + if ( mRecordDevice == wxT("") ) { + recDeviceNum = Pa_GetDefaultInputDevice(); + } + + int devindex; /* temp variable to hold the numeric ID of each device in turn */ for (int i = 0; i < nDevices; i++) { @@ -205,7 +215,10 @@ void DevicePrefs::OnHost(wxCommandEvent if (info->maxOutputChannels > 0) { playnames.Add(name); devindex = mPlay->Append(name, (void *) info); - if (device == mPlayDevice) { /* if this is the default device, select it */ + if (playDeviceNum == i) { + mPlay->SetSelection(index); + } + else if (device == mPlayDevice) { mPlay->SetSelection(devindex); } } @@ -213,7 +226,10 @@ void DevicePrefs::OnHost(wxCommandEvent if (info->maxInputChannels > 0) { recordnames.Add(name); devindex = mRecord->Append(name, (void *) info); - if (device == mRecordDevice) { + if (recDeviceNum == i) { + mRecord->SetSelection(index); + } + else if (device == mRecordDevice) { mRecord->SetSelection(devindex); } }