From: <man...@us...> - 2013-11-17 18:20:02
|
Revision: 3252 http://sourceforge.net/p/modplug/code/3252 Author: manxorist Date: 2013-11-17 18:19:54 +0000 (Sun, 17 Nov 2013) Log Message: ----------- [Ref] sounddev: Pass the ASIO base channel through the regular SoundDeviceSettings struct instead of using a global variable. Modified Paths: -------------- trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/sounddev/SoundDevice.h trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp trunk/OpenMPT/sounddev/SoundDeviceASIO.h Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2013-11-17 17:34:53 UTC (rev 3251) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2013-11-17 18:19:54 UTC (rev 3252) @@ -160,6 +160,7 @@ , m_SampleFormat(conf, "Sound Settings", "BitsPerSample", SoundDeviceSettings().sampleFormat) , m_SoundDeviceExclusiveMode(conf, "Sound Settings", "ExclusiveMode", SoundDeviceSettings().ExclusiveMode) , m_SoundDeviceBoostThreadPriority(conf, "Sound Settings", "BoostThreadPriority", SoundDeviceSettings().BoostThreadPriority) + , m_SoundDeviceBaseChannel(conf, "Sound Settings", "ASIOBaseChannel", SoundDeviceSettings().BaseChannel) , MixerMaxChannels(conf, "Sound Settings", "MixChannels", MixerSettings().m_nMaxMixChannels) , MixerDSPMask(conf, "Sound Settings", "Quality", MixerSettings().DSPMask) , MixerFlags(conf, "Sound Settings", "SoundSetup", MixerSettings().MixerFlags) @@ -375,9 +376,6 @@ conf.Remove(MixerVolumeRampSamples_DEPRECATED.GetPath()); } Limit(ResamplerCutoffPercent, 0, 100); -#ifndef NO_ASIO - CASIODevice::baseChannel = conf.Read<int32>("Sound Settings", "ASIOBaseChannel", CASIODevice::baseChannel); -#endif // NO_ASIO // Misc if(defaultModType == MOD_TYPE_NONE) @@ -466,6 +464,7 @@ settings.sampleFormat = m_SampleFormat; settings.ExclusiveMode = m_SoundDeviceExclusiveMode; settings.BoostThreadPriority = m_SoundDeviceBoostThreadPriority; + settings.BaseChannel = m_SoundDeviceBaseChannel; return settings; } @@ -479,6 +478,7 @@ m_SampleFormat = settings.sampleFormat; m_SoundDeviceExclusiveMode = settings.ExclusiveMode; m_SoundDeviceBoostThreadPriority = settings.BoostThreadPriority; + m_SoundDeviceBaseChannel = settings.BaseChannel; } Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2013-11-17 17:34:53 UTC (rev 3251) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2013-11-17 18:19:54 UTC (rev 3252) @@ -276,6 +276,7 @@ Setting<SampleFormat> m_SampleFormat; Setting<bool> m_SoundDeviceExclusiveMode; Setting<bool> m_SoundDeviceBoostThreadPriority; + Setting<uint32> m_SoundDeviceBaseChannel; SoundDeviceSettings GetSoundDeviceSettings() const; void SetSoundDeviceSettings(const SoundDeviceSettings &settings); Modified: trunk/OpenMPT/sounddev/SoundDevice.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.h 2013-11-17 17:34:53 UTC (rev 3251) +++ trunk/OpenMPT/sounddev/SoundDevice.h 2013-11-17 18:19:54 UTC (rev 3252) @@ -151,6 +151,7 @@ SampleFormat sampleFormat; bool ExclusiveMode; // Use hardware buffers directly bool BoostThreadPriority; // Boost thread priority for glitch-free audio rendering + uint32 BaseChannel; SoundDeviceSettings() : hWnd(NULL) , LatencyMS(100) @@ -160,6 +161,7 @@ , sampleFormat(SampleFormatInt16) , ExclusiveMode(false) , BoostThreadPriority(true) + , BaseChannel(0) { return; } @@ -174,6 +176,7 @@ && sampleFormat == cmp.sampleFormat && ExclusiveMode == cmp.ExclusiveMode && BoostThreadPriority == cmp.BoostThreadPriority + && BaseChannel == cmp.BaseChannel ; } bool operator != (const SoundDeviceSettings &cmp) const Modified: trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp 2013-11-17 17:34:53 UTC (rev 3251) +++ trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp 2013-11-17 18:19:54 UTC (rev 3252) @@ -37,8 +37,6 @@ CASIODevice *CASIODevice::gpCurrentAsio = nullptr; -int CASIODevice::baseChannel = 0; - static DWORD g_dwBuffer = 0; static int g_asio_startcount = 0; @@ -192,7 +190,7 @@ ich, m_ChannelInfo[ich].isActive, m_ChannelInfo[ich].channelGroup, m_ChannelInfo[ich].type, m_ChannelInfo[ich].name); #endif m_BufferInfo[ich].isInput = ASIOFalse; - m_BufferInfo[ich].channelNum = ich + CASIODevice::baseChannel; // map MPT channel i to ASIO channel i + m_BufferInfo[ich].channelNum = ich + m_Settings.BaseChannel; // map MPT channel i to ASIO channel i m_BufferInfo[ich].buffers[0] = NULL; m_BufferInfo[ich].buffers[1] = NULL; m_Float = false; Modified: trunk/OpenMPT/sounddev/SoundDeviceASIO.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceASIO.h 2013-11-17 17:34:53 UTC (rev 3251) +++ trunk/OpenMPT/sounddev/SoundDeviceASIO.h 2013-11-17 18:19:54 UTC (rev 3252) @@ -49,9 +49,6 @@ void SetRenderSilence(bool silence, bool wait=false); public: - static int baseChannel; - -public: CASIODevice(SoundDeviceID id, const std::wstring &internalID); ~CASIODevice(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |