From: <man...@us...> - 2013-12-02 15:49:17
|
Revision: 3350 http://sourceforge.net/p/modplug/code/3350 Author: manxorist Date: 2013-12-02 15:49:11 +0000 (Mon, 02 Dec 2013) Log Message: ----------- [Mod] ASIO: Make the device-playing-while-stopped behaviour optional and default to actually stopping the device. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-12-02 15:04:47 UTC (rev 3349) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-12-02 15:49:11 UTC (rev 3350) @@ -526,6 +526,9 @@ if(m_CurrentDeviceInfo.id.GetType() == SNDDEV_DSOUND) { GetDlgItem(IDC_CHECK4)->SetWindowText("Use primary buffer"); + } else if(m_CurrentDeviceInfo.id.GetType() == SNDDEV_ASIO) + { + GetDlgItem(IDC_CHECK4)->SetWindowText("Keep device running"); } else { GetDlgItem(IDC_CHECK4)->SetWindowText("Use device exclusively"); Modified: trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp 2013-12-02 15:04:47 UTC (rev 3349) +++ trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp 2013-12-02 15:49:11 UTC (rev 3350) @@ -500,10 +500,13 @@ { ALWAYS_ASSERT_WARN_MESSAGE(!CriticalSection::IsLocked(), "AudioCriticalSection locked while starting ASIO"); - if(m_DeviceRunning) + if(m_Settings.ExclusiveMode) { - SetRenderSilence(false, true); - return true; + if(m_DeviceRunning) + { + SetRenderSilence(false, true); + return true; + } } SetRenderSilence(false); @@ -526,7 +529,23 @@ { ALWAYS_ASSERT_WARN_MESSAGE(!CriticalSection::IsLocked(), "AudioCriticalSection locked while stopping ASIO"); - SetRenderSilence(true, true); + if(m_Settings.ExclusiveMode) + { + SetRenderSilence(true, true); + return; + } + + m_DeviceRunning = false; + try + { + asioCall(stop()); + } catch(...) + { + // continue + } + m_TotalFramesWritten = 0; + SetRenderSilence(false); + } @@ -1173,7 +1192,7 @@ caps.CanUpdateInterval = false; caps.CanSampleFormat = false; - caps.CanExclusiveMode = false; + caps.CanExclusiveMode = true; caps.CanBoostThreadPriority = false; caps.CanUseHardwareTiming = true; caps.CanChannelMapping = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |