From: <man...@us...> - 2014-12-24 09:27:03
|
Revision: 4674 http://sourceforge.net/p/modplug/code/4674 Author: manxorist Date: 2014-12-24 09:26:47 +0000 (Wed, 24 Dec 2014) Log Message: ----------- [Ref] SoundDevice::StopMode does not directly influence the behaviour of a sound device. Instead, it determines how the devices get used by the tracker. Rename it to SoundDeviceStopMode and move it from sounddev/SoundDevice.h to mptrack/TrackerSettings.h . Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/sounddev/SoundDevice.h Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2014-12-23 19:11:09 UTC (rev 4673) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2014-12-24 09:26:47 UTC (rev 4674) @@ -1201,7 +1201,7 @@ m_NotifyTimer = 0; } ResetNotificationBuffer(); - if(!gpSoundDevice->GetDeviceCaps().CanKeepDeviceRunning || TrackerSettings::Instance().m_SoundSettingsStopMode == SoundDevice::StopModeClosed) + if(!gpSoundDevice->GetDeviceCaps().CanKeepDeviceRunning || TrackerSettings::Instance().m_SoundSettingsStopMode == SoundDeviceStopModeClosed) { audioCloseDevice(); } @@ -1649,8 +1649,8 @@ } -BOOL CMainFrame::SetupSoundCard(SoundDevice::Settings deviceSettings, SoundDevice::Identifier deviceIdentifier, SoundDevice::StopMode stoppedMode, bool forceReset) -//----------------------------------------------------------------------------------------------------------------------------------------------------------------- +BOOL CMainFrame::SetupSoundCard(SoundDevice::Settings deviceSettings, SoundDevice::Identifier deviceIdentifier, SoundDeviceStopMode stoppedMode, bool forceReset) +//--------------------------------------------------------------------------------------------------------------------------------------------------------------- { MPT_TRACE(); if(forceReset @@ -1672,13 +1672,13 @@ TrackerSettings::Instance().m_SoundSettingsStopMode = stoppedMode; switch(stoppedMode) { - case SoundDevice::StopModeClosed: + case SoundDeviceStopModeClosed: deviceSettings.KeepDeviceRunning = true; break; - case SoundDevice::StopModeStopped: + case SoundDeviceStopModeStopped: deviceSettings.KeepDeviceRunning = false; break; - case SoundDevice::StopModePlaying: + case SoundDeviceStopModePlaying: deviceSettings.KeepDeviceRunning = true; break; } Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2014-12-23 19:11:09 UTC (rev 4673) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2014-12-24 09:26:47 UTC (rev 4674) @@ -512,7 +512,7 @@ void IdleHandlerSounddevice(); BOOL ResetSoundCard(); - BOOL SetupSoundCard(SoundDevice::Settings deviceSettings, SoundDevice::Identifier deviceIdentifier, SoundDevice::StopMode stoppedMode, bool forceReset = false); + BOOL SetupSoundCard(SoundDevice::Settings deviceSettings, SoundDevice::Identifier deviceIdentifier, SoundDeviceStopMode stoppedMode, bool forceReset = false); BOOL SetupMiscOptions(); BOOL SetupPlayer(); Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2014-12-23 19:11:09 UTC (rev 4673) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2014-12-24 09:26:47 UTC (rev 4674) @@ -870,7 +870,7 @@ m_Settings.ChannelMapping = SoundDevice::ChannelMapping(); } } - CMainFrame::GetMainFrame()->SetupSoundCard(m_Settings, m_CurrentDeviceInfo.GetIdentifier(), (SoundDevice::StopMode)m_CbnStoppedMode.GetCurSel()); + CMainFrame::GetMainFrame()->SetupSoundCard(m_Settings, m_CurrentDeviceInfo.GetIdentifier(), (SoundDeviceStopMode)m_CbnStoppedMode.GetCurSel()); SetDevice(m_CurrentDeviceInfo.GetIdentifier(), true); // Poll changed ASIO sample format and channel names UpdateDevice(); UpdateStatistics(); Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-23 19:11:09 UTC (rev 4673) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-24 09:26:47 UTC (rev 4674) @@ -171,7 +171,7 @@ , m_SoundSampleRates(conf, "Sound Settings", "SampleRates", GetDefaultSampleRates()) , m_MorePortaudio(conf, "Sound Settings", "MorePortaudio", false) , m_SoundSettingsOpenDeviceAtStartup(conf, "Sound Settings", "OpenDeviceAtStartup", false) - , m_SoundSettingsStopMode(conf, "Sound Settings", "StopMode", SoundDevice::StopModeClosed) + , m_SoundSettingsStopMode(conf, "Sound Settings", "StopMode", SoundDeviceStopModeClosed) , m_SoundDeviceSettingsUseOldDefaults(false) , m_SoundDeviceID_DEPRECATED(SoundDevice::ID()) , m_SoundDeviceIdentifier(conf, "Sound Settings", "Device", SoundDevice::Identifier()) @@ -390,10 +390,10 @@ { if(conf.Read<bool>("Sound Settings", "KeepDeviceOpen", false)) { - m_SoundSettingsStopMode = SoundDevice::StopModePlaying; + m_SoundSettingsStopMode = SoundDeviceStopModePlaying; } else { - m_SoundSettingsStopMode = SoundDevice::StopModeStopped; + m_SoundSettingsStopMode = SoundDeviceStopModeStopped; } } if(storedVersion < MAKE_VERSION_NUMERIC(1,22,07,04)) Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2014-12-23 19:11:09 UTC (rev 4673) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2014-12-24 09:26:47 UTC (rev 4674) @@ -310,13 +310,20 @@ return dfFLAC; } -template<> inline SettingValue ToSettingValue(const SoundDevice::StopMode &val) +enum SoundDeviceStopMode { + SoundDeviceStopModeClosed = 0, + SoundDeviceStopModeStopped = 1, + SoundDeviceStopModePlaying = 2, +}; + +template<> inline SettingValue ToSettingValue(const SoundDeviceStopMode &val) +{ return SettingValue(static_cast<int32>(val)); } -template<> inline SoundDevice::StopMode FromSettingValue(const SettingValue &val) +template<> inline SoundDeviceStopMode FromSettingValue(const SettingValue &val) { - return static_cast<SoundDevice::StopMode>(static_cast<int32>(val)); + return static_cast<SoundDeviceStopMode>(static_cast<int32>(val)); } @@ -376,7 +383,7 @@ Setting<std::vector<uint32> > m_SoundSampleRates; Setting<bool> m_MorePortaudio; Setting<bool> m_SoundSettingsOpenDeviceAtStartup; - Setting<SoundDevice::StopMode> m_SoundSettingsStopMode; + Setting<SoundDeviceStopMode> m_SoundSettingsStopMode; bool m_SoundDeviceSettingsUseOldDefaults; SoundDevice::ID m_SoundDeviceID_DEPRECATED; Modified: trunk/OpenMPT/sounddev/SoundDevice.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.h 2014-12-23 19:11:09 UTC (rev 4673) +++ trunk/OpenMPT/sounddev/SoundDevice.h 2014-12-24 09:26:47 UTC (rev 4674) @@ -285,14 +285,6 @@ }; -enum StopMode -{ - StopModeClosed = 0, - StopModeStopped = 1, - StopModePlaying = 2, -}; - - struct Settings { HWND hWnd; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |