From da26ffa2299a73047c52f8add84a1b5d772bccae Mon Sep 17 00:00:00 2001 From: spacy51 Date: Sat, 26 Jul 2008 11:55:22 +0000 Subject: [PATCH] FIXED XAudio2 config dialog did not show current device OnInitDialog git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@591 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/win32/XAudio2_Config.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/win32/XAudio2_Config.cpp b/src/win32/XAudio2_Config.cpp index 390b7e95..74a0b3d7 100644 --- a/src/win32/XAudio2_Config.cpp +++ b/src/win32/XAudio2_Config.cpp @@ -137,11 +137,19 @@ 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;