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,12 +137,20 @@ BOOL XAudio2_Config::OnInitDialog()
}
}
}
if( m_combo_dev.GetCount() > 0 ) {
if( m_selected_device_index < (UINT32)(m_combo_dev.GetCount()) ) {
m_combo_dev.SetCurSel( m_selected_device_index );
// select the currently configured device {
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 = NULL;
}