From: <man...@us...> - 2014-09-29 06:39:02
|
Revision: 4320 http://sourceforge.net/p/modplug/code/4320 Author: manxorist Date: 2014-09-29 06:38:49 +0000 (Mon, 29 Sep 2014) Log Message: ----------- [Fix] Soundcard settings: Fix crash when opening settings dialog if the current device is unavailable (broke in r4306). [Fix] Soundcard settings: Only initialize soundcard settings page if the page got actually selected. Revision Links: -------------- http://sourceforge.net/p/modplug/code/4306 Modified Paths: -------------- trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/Mpdlgs.h Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2014-09-28 09:22:57 UTC (rev 4319) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2014-09-29 06:38:49 UTC (rev 4320) @@ -152,26 +152,9 @@ COptionsSoundcard::COptionsSoundcard(SoundDevice::ID dev) //------------------------------------------------------- : CPropertyPage(IDD_OPTIONS_SOUNDCARD) - , m_CurrentDeviceInfo(theApp.GetSoundDevicesManager()->FindDeviceInfo(dev)) - , m_CurrentDeviceCaps(theApp.GetSoundDevicesManager()->GetDeviceCaps(dev, CMainFrame::GetMainFrame()->gpSoundDevice)) - , m_CurrentDeviceDynamicCaps(theApp.GetSoundDevicesManager()->GetDeviceDynamicCaps(dev, TrackerSettings::Instance().GetSampleRates(), CMainFrame::GetMainFrame(), CMainFrame::GetMainFrame()->gpSoundDevice, true)) - , m_Settings(TrackerSettings::Instance().GetSoundDeviceSettings(dev)) + , m_InitialDevice(dev) { - if(theApp.GetSoundDevicesManager()->IsDeviceUnavailable(dev)) - { - Reporting::Information("Device not availble. Reverting to default device."); - // if the device is unavailable, use the default device - SoundDevice::ID newdev = theApp.GetSoundDevicesManager()->FindDeviceInfoBestMatch(std::wstring()).id; - if(newdev != dev) - { - Reporting::Information("Device not availble. Reverting to default device."); - SetDevice(newdev); - UpdateEverything(); - } else - { - Reporting::Warning("Device not availble."); - } - } + return; } @@ -221,6 +204,7 @@ //------------------------------------ { CPropertyPage::OnInitDialog(); + SetDevice(m_InitialDevice, true); UpdateEverything(); return TRUE; } Modified: trunk/OpenMPT/mptrack/Mpdlgs.h =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.h 2014-09-28 09:22:57 UTC (rev 4319) +++ trunk/OpenMPT/mptrack/Mpdlgs.h 2014-09-29 06:38:49 UTC (rev 4320) @@ -32,6 +32,8 @@ CStatic m_StaticChannelMapping[NUM_CHANNELCOMBOBOXES]; CComboBox m_CbnChannelMapping[NUM_CHANNELCOMBOBOXES]; + SoundDevice::ID m_InitialDevice; + void SetDevice(SoundDevice::ID dev, bool forceReload=false); SoundDevice::Info m_CurrentDeviceInfo; SoundDevice::Caps m_CurrentDeviceCaps; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |