2010-04-19 00:23:31 +02:00
|
|
|
Index: audacity-src-1.3.12-beta/src/prefs/DevicePrefs.cpp
|
2009-11-16 17:58:30 +01:00
|
|
|
===================================================================
|
2010-04-19 00:23:31 +02:00
|
|
|
--- 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
|
2009-07-29 01:37:30 +02:00
|
|
|
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();
|
|
|
|
+ }
|
|
|
|
+
|
2009-11-16 17:58:30 +01:00
|
|
|
+
|
|
|
|
int devindex; /* temp variable to hold the numeric ID of each device in turn */
|
|
|
|
|
2009-07-29 01:37:30 +02:00
|
|
|
for (int i = 0; i < nDevices; i++) {
|
2010-04-19 00:23:31 +02:00
|
|
|
@@ -205,7 +215,10 @@ void DevicePrefs::OnHost(wxCommandEvent
|
2009-07-29 01:37:30 +02:00
|
|
|
if (info->maxOutputChannels > 0) {
|
|
|
|
playnames.Add(name);
|
2009-11-16 17:58:30 +01:00
|
|
|
devindex = mPlay->Append(name, (void *) info);
|
|
|
|
- if (device == mPlayDevice) { /* if this is the default device, select it */
|
2009-07-29 01:37:30 +02:00
|
|
|
+ if (playDeviceNum == i) {
|
|
|
|
+ mPlay->SetSelection(index);
|
|
|
|
+ }
|
|
|
|
+ else if (device == mPlayDevice) {
|
2009-11-16 17:58:30 +01:00
|
|
|
mPlay->SetSelection(devindex);
|
2009-07-29 01:37:30 +02:00
|
|
|
}
|
|
|
|
}
|
2010-04-19 00:23:31 +02:00
|
|
|
@@ -213,7 +226,10 @@ void DevicePrefs::OnHost(wxCommandEvent
|
2009-07-29 01:37:30 +02:00
|
|
|
if (info->maxInputChannels > 0) {
|
|
|
|
recordnames.Add(name);
|
2009-11-16 17:58:30 +01:00
|
|
|
devindex = mRecord->Append(name, (void *) info);
|
2009-07-29 01:37:30 +02:00
|
|
|
- if (device == mRecordDevice) {
|
|
|
|
+ if (recDeviceNum == i) {
|
|
|
|
+ mRecord->SetSelection(index);
|
|
|
|
+ }
|
|
|
|
+ else if (device == mRecordDevice) {
|
2009-11-16 17:58:30 +01:00
|
|
|
mRecord->SetSelection(devindex);
|
2009-07-29 01:37:30 +02:00
|
|
|
}
|
|
|
|
}
|