FIXED XAudio2 config dialog did not show current device OnInitDialog

This commit is contained in:
spacy51 2008-07-26 11:55:22 +00:00
parent 160759bcb6
commit e4c1506dc5
1 changed files with 11 additions and 3 deletions

View File

@ -137,11 +137,19 @@ BOOL XAudio2_Config::OnInitDialog()
} }
} }
} }
if( m_combo_dev.GetCount() > 0 ) {
if( m_selected_device_index < (UINT32)(m_combo_dev.GetCount()) ) { // select the currently configured device {
m_combo_dev.SetCurSel( m_selected_device_index ); int count = m_combo_dev.GetCount();
if( count > 0 ) {
for( int i = 0; i < count; i++ ) {
if( m_combo_dev.GetItemData( i ) == m_selected_device_index ) {
m_combo_dev.SetCurSel( i );
break;
}
} }
} }
// }
} }
xa->Release(); xa->Release();
xa = NULL; xa = NULL;