From: <man...@us...> - 2015-05-23 11:19:45
|
Revision: 5142 http://sourceforge.net/p/modplug/code/5142 Author: manxorist Date: 2015-05-23 11:19:36 +0000 (Sat, 23 May 2015) Log Message: ----------- [Ref] sounddev: Split sound device base class from the interface header into its own file. Modified Paths: -------------- trunk/OpenMPT/build/vs2008/OpenMPT.vcproj trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters trunk/OpenMPT/sounddev/SoundDevice.cpp trunk/OpenMPT/sounddev/SoundDevice.h trunk/OpenMPT/sounddev/SoundDeviceASIO.h trunk/OpenMPT/sounddev/SoundDeviceDirectSound.h trunk/OpenMPT/sounddev/SoundDeviceManager.cpp trunk/OpenMPT/sounddev/SoundDevicePortAudio.h trunk/OpenMPT/sounddev/SoundDeviceUtilities.h trunk/OpenMPT/sounddev/SoundDeviceWaveout.h Added Paths: ----------- trunk/OpenMPT/sounddev/SoundDeviceBase.cpp trunk/OpenMPT/sounddev/SoundDeviceBase.h Modified: trunk/OpenMPT/build/vs2008/OpenMPT.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/OpenMPT.vcproj 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/build/vs2008/OpenMPT.vcproj 2015-05-23 11:19:36 UTC (rev 5142) @@ -1492,6 +1492,14 @@ > </File> <File + RelativePath="..\..\sounddev\SoundDeviceBase.cpp" + > + </File> + <File + RelativePath="..\..\sounddev\SoundDeviceBase.h" + > + </File> + <File RelativePath="..\..\sounddev\SoundDeviceDirectSound.cpp" > </File> Modified: trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj 2015-05-23 11:19:36 UTC (rev 5142) @@ -457,6 +457,7 @@ <ClInclude Include="..\..\pluginBridge\BridgeWrapper.h" /> <ClInclude Include="..\..\sounddev\SoundDevice.h" /> <ClInclude Include="..\..\sounddev\SoundDeviceASIO.h" /> + <ClInclude Include="..\..\sounddev\SoundDeviceBase.h" /> <ClInclude Include="..\..\sounddev\SoundDeviceDirectSound.h" /> <ClInclude Include="..\..\sounddev\SoundDeviceManager.h" /> <ClInclude Include="..\..\sounddev\SoundDevicePortAudio.h" /> @@ -630,6 +631,7 @@ <ClCompile Include="..\..\pluginBridge\BridgeWrapper.cpp" /> <ClCompile Include="..\..\sounddev\SoundDevice.cpp" /> <ClCompile Include="..\..\sounddev\SoundDeviceASIO.cpp" /> + <ClCompile Include="..\..\sounddev\SoundDeviceBase.cpp" /> <ClCompile Include="..\..\sounddev\SoundDeviceDirectSound.cpp" /> <ClCompile Include="..\..\sounddev\SoundDeviceManager.cpp" /> <ClCompile Include="..\..\sounddev\SoundDevicePortAudio.cpp" /> Modified: trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters 2015-05-23 11:19:36 UTC (rev 5142) @@ -368,6 +368,9 @@ <ClInclude Include="..\..\sounddev\SoundDeviceASIO.h"> <Filter>sounddev</Filter> </ClInclude> + <ClInclude Include="..\..\sounddev\SoundDeviceBase.h"> + <Filter>sounddev</Filter> + </ClInclude> <ClInclude Include="..\..\sounddev\SoundDeviceDirectSound.h"> <Filter>sounddev</Filter> </ClInclude> @@ -862,6 +865,9 @@ <ClCompile Include="..\..\sounddev\SoundDeviceASIO.cpp"> <Filter>sounddev</Filter> </ClCompile> + <ClCompile Include="..\..\sounddev\SoundDeviceBase.cpp"> + <Filter>sounddev</Filter> + </ClCompile> <ClCompile Include="..\..\sounddev\SoundDeviceDirectSound.cpp"> <Filter>sounddev</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj 2015-05-23 11:19:36 UTC (rev 5142) @@ -463,6 +463,7 @@ <ClInclude Include="..\..\pluginBridge\BridgeWrapper.h" /> <ClInclude Include="..\..\sounddev\SoundDevice.h" /> <ClInclude Include="..\..\sounddev\SoundDeviceASIO.h" /> + <ClInclude Include="..\..\sounddev\SoundDeviceBase.h" /> <ClInclude Include="..\..\sounddev\SoundDeviceDirectSound.h" /> <ClInclude Include="..\..\sounddev\SoundDeviceManager.h" /> <ClInclude Include="..\..\sounddev\SoundDevicePortAudio.h" /> @@ -636,6 +637,7 @@ <ClCompile Include="..\..\pluginBridge\BridgeWrapper.cpp" /> <ClCompile Include="..\..\sounddev\SoundDevice.cpp" /> <ClCompile Include="..\..\sounddev\SoundDeviceASIO.cpp" /> + <ClCompile Include="..\..\sounddev\SoundDeviceBase.cpp" /> <ClCompile Include="..\..\sounddev\SoundDeviceDirectSound.cpp" /> <ClCompile Include="..\..\sounddev\SoundDeviceManager.cpp" /> <ClCompile Include="..\..\sounddev\SoundDevicePortAudio.cpp" /> Modified: trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters 2015-05-23 11:19:36 UTC (rev 5142) @@ -368,6 +368,9 @@ <ClInclude Include="..\..\sounddev\SoundDeviceASIO.h"> <Filter>sounddev</Filter> </ClInclude> + <ClInclude Include="..\..\sounddev\SoundDeviceBase.h"> + <Filter>sounddev</Filter> + </ClInclude> <ClInclude Include="..\..\sounddev\SoundDeviceDirectSound.h"> <Filter>sounddev</Filter> </ClInclude> @@ -862,6 +865,9 @@ <ClCompile Include="..\..\sounddev\SoundDeviceASIO.cpp"> <Filter>sounddev</Filter> </ClCompile> + <ClCompile Include="..\..\sounddev\SoundDeviceBase.cpp"> + <Filter>sounddev</Filter> + </ClCompile> <ClCompile Include="..\..\sounddev\SoundDeviceDirectSound.cpp"> <Filter>sounddev</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj 2015-05-23 11:19:36 UTC (rev 5142) @@ -464,6 +464,7 @@ <ClInclude Include="..\..\pluginBridge\BridgeWrapper.h" /> <ClInclude Include="..\..\sounddev\SoundDevice.h" /> <ClInclude Include="..\..\sounddev\SoundDeviceASIO.h" /> + <ClInclude Include="..\..\sounddev\SoundDeviceBase.h" /> <ClInclude Include="..\..\sounddev\SoundDeviceDirectSound.h" /> <ClInclude Include="..\..\sounddev\SoundDeviceManager.h" /> <ClInclude Include="..\..\sounddev\SoundDevicePortAudio.h" /> @@ -637,6 +638,7 @@ <ClCompile Include="..\..\pluginBridge\BridgeWrapper.cpp" /> <ClCompile Include="..\..\sounddev\SoundDevice.cpp" /> <ClCompile Include="..\..\sounddev\SoundDeviceASIO.cpp" /> + <ClCompile Include="..\..\sounddev\SoundDeviceBase.cpp" /> <ClCompile Include="..\..\sounddev\SoundDeviceDirectSound.cpp" /> <ClCompile Include="..\..\sounddev\SoundDeviceManager.cpp" /> <ClCompile Include="..\..\sounddev\SoundDevicePortAudio.cpp" /> Modified: trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters 2015-05-23 11:19:36 UTC (rev 5142) @@ -368,6 +368,9 @@ <ClInclude Include="..\..\sounddev\SoundDeviceASIO.h"> <Filter>sounddev</Filter> </ClInclude> + <ClInclude Include="..\..\sounddev\SoundDeviceBase.h"> + <Filter>sounddev</Filter> + </ClInclude> <ClInclude Include="..\..\sounddev\SoundDeviceDirectSound.h"> <Filter>sounddev</Filter> </ClInclude> @@ -862,6 +865,9 @@ <ClCompile Include="..\..\sounddev\SoundDeviceASIO.cpp"> <Filter>sounddev</Filter> </ClCompile> + <ClCompile Include="..\..\sounddev\SoundDeviceBase.cpp"> + <Filter>sounddev</Filter> + </ClCompile> <ClCompile Include="..\..\sounddev\SoundDeviceDirectSound.cpp"> <Filter>sounddev</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj 2015-05-23 11:19:36 UTC (rev 5142) @@ -464,6 +464,7 @@ <ClInclude Include="..\..\pluginBridge\BridgeWrapper.h" /> <ClInclude Include="..\..\sounddev\SoundDevice.h" /> <ClInclude Include="..\..\sounddev\SoundDeviceASIO.h" /> + <ClInclude Include="..\..\sounddev\SoundDeviceBase.h" /> <ClInclude Include="..\..\sounddev\SoundDeviceDirectSound.h" /> <ClInclude Include="..\..\sounddev\SoundDeviceManager.h" /> <ClInclude Include="..\..\sounddev\SoundDevicePortAudio.h" /> @@ -637,6 +638,7 @@ <ClCompile Include="..\..\pluginBridge\BridgeWrapper.cpp" /> <ClCompile Include="..\..\sounddev\SoundDevice.cpp" /> <ClCompile Include="..\..\sounddev\SoundDeviceASIO.cpp" /> + <ClCompile Include="..\..\sounddev\SoundDeviceBase.cpp" /> <ClCompile Include="..\..\sounddev\SoundDeviceDirectSound.cpp" /> <ClCompile Include="..\..\sounddev\SoundDeviceManager.cpp" /> <ClCompile Include="..\..\sounddev\SoundDevicePortAudio.cpp" /> Modified: trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters 2015-05-23 11:19:36 UTC (rev 5142) @@ -368,6 +368,9 @@ <ClInclude Include="..\..\sounddev\SoundDeviceASIO.h"> <Filter>sounddev</Filter> </ClInclude> + <ClInclude Include="..\..\sounddev\SoundDeviceBase.h"> + <Filter>sounddev</Filter> + </ClInclude> <ClInclude Include="..\..\sounddev\SoundDeviceDirectSound.h"> <Filter>sounddev</Filter> </ClInclude> @@ -862,6 +865,9 @@ <ClCompile Include="..\..\sounddev\SoundDeviceASIO.cpp"> <Filter>sounddev</Filter> </ClCompile> + <ClCompile Include="..\..\sounddev\SoundDeviceBase.cpp"> + <Filter>sounddev</Filter> + </ClCompile> <ClCompile Include="..\..\sounddev\SoundDeviceDirectSound.cpp"> <Filter>sounddev</Filter> </ClCompile> Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2015-05-23 11:19:36 UTC (rev 5142) @@ -768,6 +768,10 @@ > </File> <File + RelativePath="..\sounddev\SoundDeviceBase.cpp" + > + </File> + <File RelativePath="..\sounddev\SoundDeviceASIO.cpp" > </File> @@ -1506,6 +1510,10 @@ > </File> <File + RelativePath="..\sounddev\SoundDeviceBase.h" + > + </File> + <File RelativePath="..\sounddev\SoundDeviceASIO.h" > </File> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2015-05-23 11:19:36 UTC (rev 5142) @@ -739,6 +739,7 @@ <ClCompile Include="..\pluginBridge\BridgeWrapper.cpp" /> <ClCompile Include="..\sounddev\SoundDevice.cpp" /> <ClCompile Include="..\sounddev\SoundDeviceASIO.cpp" /> + <ClCompile Include="..\sounddev\SoundDeviceBase.cpp" /> <ClCompile Include="..\sounddev\SoundDeviceDirectSound.cpp" /> <ClCompile Include="..\sounddev\SoundDeviceManager.cpp" /> <ClCompile Include="..\sounddev\SoundDevicePortAudio.cpp" /> @@ -968,6 +969,7 @@ <ClInclude Include="..\pluginBridge\BridgeWrapper.h" /> <ClInclude Include="..\sounddev\SoundDevice.h" /> <ClInclude Include="..\sounddev\SoundDeviceASIO.h" /> + <ClInclude Include="..\sounddev\SoundDeviceBase.h" /> <ClInclude Include="..\sounddev\SoundDeviceDirectSound.h" /> <ClInclude Include="..\sounddev\SoundDeviceManager.h" /> <ClInclude Include="..\sounddev\SoundDevicePortAudio.h" /> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2015-05-23 11:19:36 UTC (rev 5142) @@ -550,6 +550,9 @@ <ClCompile Include="..\soundlib\Load_plm.cpp"> <Filter>Source Files\soundlib\Module Loaders</Filter> </ClCompile> + <ClCompile Include="..\sounddev\SoundDeviceBase.cpp"> + <Filter>Source Files\sounddev</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\soundlib\Loaders.h"> @@ -1080,6 +1083,9 @@ <ClInclude Include="..\soundlib\plugins\OpCodes.h"> <Filter>Header Files\soundlib\plugins</Filter> </ClInclude> + <ClInclude Include="..\sounddev\SoundDeviceBase.h"> + <Filter>Header Files\sounddev</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="res\bitmap1.bmp"> Modified: trunk/OpenMPT/sounddev/SoundDevice.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.cpp 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/sounddev/SoundDevice.cpp 2015-05-23 11:19:36 UTC (rev 5142) @@ -1,7 +1,7 @@ /* * SoundDevice.cpp * --------------- - * Purpose: Actual sound device driver classes. + * Purpose: Sound device interfaces. * Notes : (currently none) * Authors: Olivier Lapicque * OpenMPT Devs @@ -14,7 +14,6 @@ #include "SoundDevice.h" #include "../common/misc_util.h" -#include "../common/StringFixer.h" #include <map> @@ -25,6 +24,18 @@ namespace SoundDevice { +SoundDevice::Type ParseType(const SoundDevice::Identifier &identifier) +//-------------------------------------------------------------------- +{ + std::vector<mpt::ustring> tmp = mpt::String::Split<mpt::ustring>(identifier, MPT_USTRING("_")); + if(tmp.size() == 0) + { + return SoundDevice::Type(); + } + return tmp[0]; +} + + ChannelMapping::ChannelMapping(uint32 numHostChannels) //---------------------------------------------------- { @@ -102,306 +113,6 @@ } -Base::Base(SoundDevice::Info info) -//-------------------------------- - : m_Source(nullptr) - , m_MessageReceiver(nullptr) - , m_Info(info) -{ - MPT_TRACE(); - - m_DeviceUnavailableOnOpen = false; - - m_IsPlaying = false; - m_StreamPositionRenderFrames = 0; - m_StreamPositionOutputFrames = 0; - - m_RequestFlags.store(0); -} - - -Base::~Base() -//----------- -{ - MPT_TRACE(); - return; -} - - -SoundDevice::DynamicCaps Base::GetDeviceDynamicCaps(const std::vector<uint32> &baseSampleRates) -//--------------------------------------------------------------------------------------------- -{ - MPT_TRACE(); - SoundDevice::DynamicCaps result; - result.supportedSampleRates = baseSampleRates; - return result; -} - - -bool Base::Init(const SoundDevice::AppInfo &appInfo) -//-------------------------------------------------- -{ - MPT_TRACE(); - if(IsInited()) - { - return true; - } - m_AppInfo = appInfo; - m_Caps = InternalGetDeviceCaps(); - return m_Caps.Available; -} - - -bool Base::Open(const SoundDevice::Settings &settings) -//---------------------------------------------------- -{ - MPT_TRACE(); - if(IsOpen()) - { - Close(); - } - m_Settings = settings; - if(m_Settings.Latency == 0.0) m_Settings.Latency = m_Caps.DefaultSettings.Latency; - if(m_Settings.UpdateInterval == 0.0) m_Settings.UpdateInterval = m_Caps.DefaultSettings.UpdateInterval; - m_Settings.Latency = Clamp(m_Settings.Latency, m_Caps.LatencyMin, m_Caps.LatencyMax); - m_Settings.UpdateInterval = Clamp(m_Settings.UpdateInterval, m_Caps.UpdateIntervalMin, m_Caps.UpdateIntervalMax); - m_Flags = SoundDevice::Flags(); - m_DeviceUnavailableOnOpen = false; - m_RequestFlags.store(0); - return InternalOpen(); -} - - -bool Base::Close() -//---------------- -{ - MPT_TRACE(); - if(!IsOpen()) return true; - Stop(); - bool result = InternalClose(); - m_RequestFlags.store(0); - return result; -} - - -uint64 Base::SourceGetReferenceClockNowNanoseconds() const -//-------------------------------------------------------- -{ - MPT_TRACE(); - if(!m_Source) - { - return 0; - } - return m_Source->SoundSourceGetReferenceClockNowNanoseconds(); -} - - -void Base::SourceNotifyPreStart() -//------------------------------- -{ - MPT_TRACE(); - if(m_Source) - { - m_Source->SoundSourcePreStartCallback(); - } -} - - -void Base::SourceNotifyPostStop() -//------------------------------- -{ - MPT_TRACE(); - if(m_Source) - { - m_Source->SoundSourcePostStopCallback(); - } -} - - -bool Base::SourceIsLockedByCurrentThread() const -//---------------------------------------------- -{ - MPT_TRACE(); - if(!m_Source) - { - return false; - } - return m_Source->SoundSourceIsLockedByCurrentThread(); -} - - -void Base::SourceFillAudioBufferLocked() -//-------------------------------------- -{ - MPT_TRACE(); - if(m_Source) - { - ISource::Guard lock(*m_Source); - InternalFillAudioBuffer(); - } -} - - -void Base::SourceAudioPreRead(std::size_t numFrames, std::size_t framesLatency) -//----------------------------------------------------------------------------- -{ - MPT_TRACE(); - if(!InternalHasTimeInfo()) - { - SoundDevice::TimeInfo timeInfo; - if(InternalHasGetStreamPosition()) - { - timeInfo.SyncPointStreamFrames = InternalHasGetStreamPosition(); - timeInfo.SyncPointSystemTimestamp = SourceGetReferenceClockNowNanoseconds(); - timeInfo.Speed = 1.0; - } else - { - timeInfo.SyncPointStreamFrames = m_StreamPositionRenderFrames + numFrames; - timeInfo.SyncPointSystemTimestamp = SourceGetReferenceClockNowNanoseconds() + Util::Round<int64>(GetEffectiveBufferAttributes().Latency * 1000000000.0); - timeInfo.Speed = 1.0; - } - timeInfo.RenderStreamPositionBefore = StreamPositionFromFrames(m_StreamPositionRenderFrames); - timeInfo.RenderStreamPositionAfter = StreamPositionFromFrames(m_StreamPositionRenderFrames + numFrames); - SetTimeInfo(timeInfo); - } - m_StreamPositionRenderFrames += numFrames; - if(!InternalHasGetStreamPosition() && !InternalHasTimeInfo()) - { - Util::lock_guard<Util::mutex> lock(m_StreamPositionMutex); - m_StreamPositionOutputFrames = m_StreamPositionRenderFrames - framesLatency; - } else - { - // unused, no locking - m_StreamPositionOutputFrames = 0; - } -} - - -void Base::SourceAudioRead(void *buffer, const void *inputBuffer, std::size_t numFrames) -//-------------------------------------------------------------------------------------- -{ - MPT_TRACE(); - if(numFrames <= 0) - { - return; - } - m_Source->SoundSourceRead(m_Settings, m_Flags, GetEffectiveBufferAttributes(), m_TimeInfo, numFrames, buffer, inputBuffer); -} - - -void Base::SourceAudioDone() -//-------------------------- -{ - MPT_TRACE(); - m_Source->SoundSourceDone(m_Settings, m_Flags, GetEffectiveBufferAttributes(), m_TimeInfo); -} - - -void Base::SendDeviceMessage(LogLevel level, const mpt::ustring &str) -//------------------------------------------------------------------- -{ - MPT_TRACE(); - Log(level, str); - if(m_MessageReceiver) - { - m_MessageReceiver->SoundDeviceMessage(level, str); - } -} - - -bool Base::Start() -//---------------- -{ - MPT_TRACE(); - if(!IsOpen()) return false; - if(!IsPlaying()) - { - m_StreamPositionRenderFrames = 0; - { - Util::lock_guard<Util::mutex> lock(m_StreamPositionMutex); - m_StreamPositionOutputFrames = 0; - } - SourceNotifyPreStart(); - m_RequestFlags.fetch_and((~RequestFlagRestart).as_bits()); - if(!InternalStart()) - { - SourceNotifyPostStop(); - return false; - } - m_IsPlaying = true; - } - return true; -} - - -void Base::Stop(bool force) -//------------------------- -{ - MPT_TRACE(); - if(!IsOpen()) return; - if(IsPlaying()) - { - if(force) - { - InternalStopForce(); - } else - { - InternalStop(); - } - m_RequestFlags.fetch_and((~RequestFlagRestart).as_bits()); - SourceNotifyPostStop(); - m_IsPlaying = false; - { - Util::lock_guard<Util::mutex> lock(m_StreamPositionMutex); - m_StreamPositionOutputFrames = 0; - } - m_StreamPositionRenderFrames = 0; - } -} - - -SoundDevice::StreamPosition Base::GetStreamPosition() const -//--------------------------------------------------------- -{ - MPT_TRACE(); - if(!IsOpen()) - { - return StreamPosition(); - } - int64 frames = 0; - if(InternalHasGetStreamPosition()) - { - frames = InternalGetStreamPositionFrames(); - } else if(InternalHasTimeInfo()) - { - const uint64 now = SourceGetReferenceClockNowNanoseconds(); - const SoundDevice::TimeInfo timeInfo = GetTimeInfo(); - frames = Util::Round<int64>( - timeInfo.SyncPointStreamFrames + ( - static_cast<double>(static_cast<int64>(now - timeInfo.SyncPointSystemTimestamp)) * timeInfo.Speed * m_Settings.Samplerate * (1.0 / (1000.0 * 1000.0)) - ) - ); - } else - { - Util::lock_guard<Util::mutex> lock(m_StreamPositionMutex); - frames = m_StreamPositionOutputFrames; - } - return StreamPositionFromFrames(frames); -} - - -SoundDevice::Statistics Base::GetStatistics() const -//------------------------------------------------- -{ - MPT_TRACE(); - SoundDevice::Statistics result; - result.InstantaneousLatency = m_Settings.Latency; - result.LastUpdateInterval = m_Settings.UpdateInterval; - result.text = mpt::ustring(); - return result; -} - - } // namespace SoundDevice Modified: trunk/OpenMPT/sounddev/SoundDevice.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.h 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/sounddev/SoundDevice.h 2015-05-23 11:19:36 UTC (rev 5142) @@ -1,7 +1,7 @@ /* * SoundDevice.h * ------------- - * Purpose: Sound device interface class. + * Purpose: Sound device interfaces. * Notes : (currently none) * Authors: Olivier Lapicque * OpenMPT Devs @@ -11,10 +11,7 @@ #pragma once -#include "../common/mutex.h" -#include "../common/misc_util.h" #include "../common/FlagSet.h" -#include "../common/mptAtomic.h" #include "../soundlib/SampleFormat.h" #include <vector> @@ -503,137 +500,6 @@ }; -//======== -class Base -//======== - : public IBase -{ - -private: - - SoundDevice::ISource *m_Source; - SoundDevice::IMessageReceiver *m_MessageReceiver; - - const SoundDevice::Info m_Info; - -private: - - SoundDevice::Caps m_Caps; - -protected: - - SoundDevice::AppInfo m_AppInfo; - SoundDevice::Settings m_Settings; - SoundDevice::Flags m_Flags; - bool m_DeviceUnavailableOnOpen; - -private: - - bool m_IsPlaying; - - SoundDevice::TimeInfo m_TimeInfo; - - int64 m_StreamPositionRenderFrames; // only updated or read in audio CALLBACK or when device is stopped. requires no further locking - - mutable Util::mutex m_StreamPositionMutex; - int64 m_StreamPositionOutputFrames; - - mpt::atomic_uint32_t m_RequestFlags; - -protected: - - SoundDevice::Type GetDeviceType() const { return m_Info.type; } - mpt::ustring GetDeviceInternalID() const { return m_Info.internalID; } - SoundDevice::Identifier GetDeviceIdentifier() const { return m_Info.GetIdentifier(); } - - virtual void InternalFillAudioBuffer() = 0; - - uint64 SourceGetReferenceClockNowNanoseconds() const; - void SourceNotifyPreStart(); - void SourceNotifyPostStop(); - bool SourceIsLockedByCurrentThread() const; - void SourceFillAudioBufferLocked(); - void SourceAudioPreRead(std::size_t numFrames, std::size_t framesLatency); - void SourceAudioRead(void *buffer, const void *inputBuffer, std::size_t numFrames); - void SourceAudioDone(); - - void RequestClose() { m_RequestFlags.fetch_or(RequestFlagClose); } - void RequestReset() { m_RequestFlags.fetch_or(RequestFlagReset); } - void RequestRestart() { m_RequestFlags.fetch_or(RequestFlagRestart); } - - void SendDeviceMessage(LogLevel level, const mpt::ustring &str); - -protected: - - void SetTimeInfo(SoundDevice::TimeInfo timeInfo) { m_TimeInfo = timeInfo; } - - SoundDevice::StreamPosition StreamPositionFromFrames(int64 frames) const { return SoundDevice::StreamPosition(frames, static_cast<double>(frames) / static_cast<double>(m_Settings.Samplerate)); } - - virtual bool InternalHasTimeInfo() const { return false; } - - virtual bool InternalHasGetStreamPosition() const { return false; } - virtual int64 InternalGetStreamPositionFrames() const { return 0; } - - virtual bool InternalIsOpen() const = 0; - - virtual bool InternalOpen() = 0; - virtual bool InternalStart() = 0; - virtual void InternalStop() = 0; - virtual void InternalStopForce() { InternalStop(); } - virtual bool InternalClose() = 0; - - virtual SoundDevice::Caps InternalGetDeviceCaps() = 0; - - virtual SoundDevice::BufferAttributes InternalGetEffectiveBufferAttributes() const = 0; - -protected: - - Base(SoundDevice::Info info); - -public: - - virtual ~Base(); - - void SetSource(SoundDevice::ISource *source) { m_Source = source; } - void SetMessageReceiver(SoundDevice::IMessageReceiver *receiver) { m_MessageReceiver = receiver; } - - SoundDevice::Info GetDeviceInfo() const { return m_Info; } - - SoundDevice::Caps GetDeviceCaps() const { return m_Caps; } - virtual SoundDevice::DynamicCaps GetDeviceDynamicCaps(const std::vector<uint32> &baseSampleRates); - - bool Init(const SoundDevice::AppInfo &appInfo); - bool Open(const SoundDevice::Settings &settings); - bool Close(); - bool Start(); - void Stop(bool force = false); - - FlagSet<RequestFlags> GetRequestFlags() const { return FlagSet<RequestFlags>(m_RequestFlags.load()); } - - bool IsInited() const { return m_Caps.Available; } - bool IsOpen() const { return IsInited() && InternalIsOpen(); } - bool IsAvailable() const { return m_Caps.Available && !m_DeviceUnavailableOnOpen; } - bool IsPlaying() const { return m_IsPlaying; } - - virtual bool OnIdle() { return false; } - - SoundDevice::Settings GetSettings() const { return m_Settings; } - SampleFormat GetActualSampleFormat() const { return IsOpen() ? m_Settings.sampleFormat : SampleFormatInvalid; } - SoundDevice::BufferAttributes GetEffectiveBufferAttributes() const { return (IsOpen() && IsPlaying()) ? InternalGetEffectiveBufferAttributes() : SoundDevice::BufferAttributes(); } - - SoundDevice::TimeInfo GetTimeInfo() const { return m_TimeInfo; } - SoundDevice::StreamPosition GetStreamPosition() const; - - virtual bool DebugIsFragileDevice() const { return false; } - virtual bool DebugInRealtimeCallback() const { return false; } - - virtual SoundDevice::Statistics GetStatistics() const; - - virtual bool OpenDriverSettings() { return false; }; - -}; - - namespace Legacy { typedef uint16 ID; @@ -646,8 +512,10 @@ static const SoundDevice::Legacy::ID TypePORTAUDIO_WDMKS = 4; static const SoundDevice::Legacy::ID TypePORTAUDIO_WMME = 5; static const SoundDevice::Legacy::ID TypePORTAUDIO_DS = 6; +#ifndef NO_DSOUND mpt::ustring GetDirectSoundDefaultDeviceIdentifierPre_1_25_00_04(); mpt::ustring GetDirectSoundDefaultDeviceIdentifier_1_25_00_04(); +#endif // NO_DSOUND } Modified: trunk/OpenMPT/sounddev/SoundDeviceASIO.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceASIO.h 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/sounddev/SoundDeviceASIO.h 2015-05-23 11:19:36 UTC (rev 5142) @@ -11,7 +11,7 @@ #pragma once -#include "SoundDevice.h" +#include "SoundDeviceBase.h" #include "../common/ComponentManager.h" Copied: trunk/OpenMPT/sounddev/SoundDeviceBase.cpp (from rev 5134, trunk/OpenMPT/sounddev/SoundDevice.cpp) =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceBase.cpp (rev 0) +++ trunk/OpenMPT/sounddev/SoundDeviceBase.cpp 2015-05-23 11:19:36 UTC (rev 5142) @@ -0,0 +1,326 @@ +/* + * SoundDeviceBase.cpp + * ------------------- + * Purpose: Sound device drivers base class. + * Notes : (currently none) + * Authors: Olivier Lapicque + * OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#include "stdafx.h" + +#include "SoundDeviceBase.h" + + +OPENMPT_NAMESPACE_BEGIN + + +namespace SoundDevice { + + +Base::Base(SoundDevice::Info info) +//-------------------------------- + : m_Source(nullptr) + , m_MessageReceiver(nullptr) + , m_Info(info) +{ + MPT_TRACE(); + + m_DeviceUnavailableOnOpen = false; + + m_IsPlaying = false; + m_StreamPositionRenderFrames = 0; + m_StreamPositionOutputFrames = 0; + + m_RequestFlags.store(0); +} + + +Base::~Base() +//----------- +{ + MPT_TRACE(); + return; +} + + +SoundDevice::DynamicCaps Base::GetDeviceDynamicCaps(const std::vector<uint32> &baseSampleRates) +//--------------------------------------------------------------------------------------------- +{ + MPT_TRACE(); + SoundDevice::DynamicCaps result; + result.supportedSampleRates = baseSampleRates; + return result; +} + + +bool Base::Init(const SoundDevice::AppInfo &appInfo) +//-------------------------------------------------- +{ + MPT_TRACE(); + if(IsInited()) + { + return true; + } + m_AppInfo = appInfo; + m_Caps = InternalGetDeviceCaps(); + return m_Caps.Available; +} + + +bool Base::Open(const SoundDevice::Settings &settings) +//---------------------------------------------------- +{ + MPT_TRACE(); + if(IsOpen()) + { + Close(); + } + m_Settings = settings; + if(m_Settings.Latency == 0.0) m_Settings.Latency = m_Caps.DefaultSettings.Latency; + if(m_Settings.UpdateInterval == 0.0) m_Settings.UpdateInterval = m_Caps.DefaultSettings.UpdateInterval; + m_Settings.Latency = Clamp(m_Settings.Latency, m_Caps.LatencyMin, m_Caps.LatencyMax); + m_Settings.UpdateInterval = Clamp(m_Settings.UpdateInterval, m_Caps.UpdateIntervalMin, m_Caps.UpdateIntervalMax); + m_Flags = SoundDevice::Flags(); + m_DeviceUnavailableOnOpen = false; + m_RequestFlags.store(0); + return InternalOpen(); +} + + +bool Base::Close() +//---------------- +{ + MPT_TRACE(); + if(!IsOpen()) return true; + Stop(); + bool result = InternalClose(); + m_RequestFlags.store(0); + return result; +} + + +uint64 Base::SourceGetReferenceClockNowNanoseconds() const +//-------------------------------------------------------- +{ + MPT_TRACE(); + if(!m_Source) + { + return 0; + } + return m_Source->SoundSourceGetReferenceClockNowNanoseconds(); +} + + +void Base::SourceNotifyPreStart() +//------------------------------- +{ + MPT_TRACE(); + if(m_Source) + { + m_Source->SoundSourcePreStartCallback(); + } +} + + +void Base::SourceNotifyPostStop() +//------------------------------- +{ + MPT_TRACE(); + if(m_Source) + { + m_Source->SoundSourcePostStopCallback(); + } +} + + +bool Base::SourceIsLockedByCurrentThread() const +//---------------------------------------------- +{ + MPT_TRACE(); + if(!m_Source) + { + return false; + } + return m_Source->SoundSourceIsLockedByCurrentThread(); +} + + +void Base::SourceFillAudioBufferLocked() +//-------------------------------------- +{ + MPT_TRACE(); + if(m_Source) + { + ISource::Guard lock(*m_Source); + InternalFillAudioBuffer(); + } +} + + +void Base::SourceAudioPreRead(std::size_t numFrames, std::size_t framesLatency) +//----------------------------------------------------------------------------- +{ + MPT_TRACE(); + if(!InternalHasTimeInfo()) + { + SoundDevice::TimeInfo timeInfo; + if(InternalHasGetStreamPosition()) + { + timeInfo.SyncPointStreamFrames = InternalHasGetStreamPosition(); + timeInfo.SyncPointSystemTimestamp = SourceGetReferenceClockNowNanoseconds(); + timeInfo.Speed = 1.0; + } else + { + timeInfo.SyncPointStreamFrames = m_StreamPositionRenderFrames + numFrames; + timeInfo.SyncPointSystemTimestamp = SourceGetReferenceClockNowNanoseconds() + Util::Round<int64>(GetEffectiveBufferAttributes().Latency * 1000000000.0); + timeInfo.Speed = 1.0; + } + timeInfo.RenderStreamPositionBefore = StreamPositionFromFrames(m_StreamPositionRenderFrames); + timeInfo.RenderStreamPositionAfter = StreamPositionFromFrames(m_StreamPositionRenderFrames + numFrames); + SetTimeInfo(timeInfo); + } + m_StreamPositionRenderFrames += numFrames; + if(!InternalHasGetStreamPosition() && !InternalHasTimeInfo()) + { + Util::lock_guard<Util::mutex> lock(m_StreamPositionMutex); + m_StreamPositionOutputFrames = m_StreamPositionRenderFrames - framesLatency; + } else + { + // unused, no locking + m_StreamPositionOutputFrames = 0; + } +} + + +void Base::SourceAudioRead(void *buffer, const void *inputBuffer, std::size_t numFrames) +//-------------------------------------------------------------------------------------- +{ + MPT_TRACE(); + if(numFrames <= 0) + { + return; + } + m_Source->SoundSourceRead(m_Settings, m_Flags, GetEffectiveBufferAttributes(), m_TimeInfo, numFrames, buffer, inputBuffer); +} + + +void Base::SourceAudioDone() +//-------------------------- +{ + MPT_TRACE(); + m_Source->SoundSourceDone(m_Settings, m_Flags, GetEffectiveBufferAttributes(), m_TimeInfo); +} + + +void Base::SendDeviceMessage(LogLevel level, const mpt::ustring &str) +//------------------------------------------------------------------- +{ + MPT_TRACE(); + Log(level, str); + if(m_MessageReceiver) + { + m_MessageReceiver->SoundDeviceMessage(level, str); + } +} + + +bool Base::Start() +//---------------- +{ + MPT_TRACE(); + if(!IsOpen()) return false; + if(!IsPlaying()) + { + m_StreamPositionRenderFrames = 0; + { + Util::lock_guard<Util::mutex> lock(m_StreamPositionMutex); + m_StreamPositionOutputFrames = 0; + } + SourceNotifyPreStart(); + m_RequestFlags.fetch_and((~RequestFlagRestart).as_bits()); + if(!InternalStart()) + { + SourceNotifyPostStop(); + return false; + } + m_IsPlaying = true; + } + return true; +} + + +void Base::Stop(bool force) +//------------------------- +{ + MPT_TRACE(); + if(!IsOpen()) return; + if(IsPlaying()) + { + if(force) + { + InternalStopForce(); + } else + { + InternalStop(); + } + m_RequestFlags.fetch_and((~RequestFlagRestart).as_bits()); + SourceNotifyPostStop(); + m_IsPlaying = false; + { + Util::lock_guard<Util::mutex> lock(m_StreamPositionMutex); + m_StreamPositionOutputFrames = 0; + } + m_StreamPositionRenderFrames = 0; + } +} + + +SoundDevice::StreamPosition Base::GetStreamPosition() const +//--------------------------------------------------------- +{ + MPT_TRACE(); + if(!IsOpen()) + { + return StreamPosition(); + } + int64 frames = 0; + if(InternalHasGetStreamPosition()) + { + frames = InternalGetStreamPositionFrames(); + } else if(InternalHasTimeInfo()) + { + const uint64 now = SourceGetReferenceClockNowNanoseconds(); + const SoundDevice::TimeInfo timeInfo = GetTimeInfo(); + frames = Util::Round<int64>( + timeInfo.SyncPointStreamFrames + ( + static_cast<double>(static_cast<int64>(now - timeInfo.SyncPointSystemTimestamp)) * timeInfo.Speed * m_Settings.Samplerate * (1.0 / (1000.0 * 1000.0)) + ) + ); + } else + { + Util::lock_guard<Util::mutex> lock(m_StreamPositionMutex); + frames = m_StreamPositionOutputFrames; + } + return StreamPositionFromFrames(frames); +} + + +SoundDevice::Statistics Base::GetStatistics() const +//------------------------------------------------- +{ + MPT_TRACE(); + SoundDevice::Statistics result; + result.InstantaneousLatency = m_Settings.Latency; + result.LastUpdateInterval = m_Settings.UpdateInterval; + result.text = mpt::ustring(); + return result; +} + + +} // namespace SoundDevice + + +OPENMPT_NAMESPACE_END Copied: trunk/OpenMPT/sounddev/SoundDeviceBase.h (from rev 5134, trunk/OpenMPT/sounddev/SoundDevice.h) =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceBase.h (rev 0) +++ trunk/OpenMPT/sounddev/SoundDeviceBase.h 2015-05-23 11:19:36 UTC (rev 5142) @@ -0,0 +1,163 @@ +/* + * SoundDeviceBase.h + * ----------------- + * Purpose: Sound device drivers base class. + * Notes : (currently none) + * Authors: Olivier Lapicque + * OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#pragma once + +#include "SoundDevice.h" + +#include "../common/mutex.h" +#include "../common/misc_util.h" +#include "../common/mptAtomic.h" + +#include <vector> + + +OPENMPT_NAMESPACE_BEGIN + + +namespace SoundDevice { + + +//======== +class Base +//======== + : public IBase +{ + +private: + + SoundDevice::ISource *m_Source; + SoundDevice::IMessageReceiver *m_MessageReceiver; + + const SoundDevice::Info m_Info; + +private: + + SoundDevice::Caps m_Caps; + +protected: + + SoundDevice::AppInfo m_AppInfo; + SoundDevice::Settings m_Settings; + SoundDevice::Flags m_Flags; + bool m_DeviceUnavailableOnOpen; + +private: + + bool m_IsPlaying; + + SoundDevice::TimeInfo m_TimeInfo; + + int64 m_StreamPositionRenderFrames; // only updated or read in audio CALLBACK or when device is stopped. requires no further locking + + mutable Util::mutex m_StreamPositionMutex; + int64 m_StreamPositionOutputFrames; + + mpt::atomic_uint32_t m_RequestFlags; + +protected: + + SoundDevice::Type GetDeviceType() const { return m_Info.type; } + mpt::ustring GetDeviceInternalID() const { return m_Info.internalID; } + SoundDevice::Identifier GetDeviceIdentifier() const { return m_Info.GetIdentifier(); } + + virtual void InternalFillAudioBuffer() = 0; + + uint64 SourceGetReferenceClockNowNanoseconds() const; + void SourceNotifyPreStart(); + void SourceNotifyPostStop(); + bool SourceIsLockedByCurrentThread() const; + void SourceFillAudioBufferLocked(); + void SourceAudioPreRead(std::size_t numFrames, std::size_t framesLatency); + void SourceAudioRead(void *buffer, const void *inputBuffer, std::size_t numFrames); + void SourceAudioDone(); + + void RequestClose() { m_RequestFlags.fetch_or(RequestFlagClose); } + void RequestReset() { m_RequestFlags.fetch_or(RequestFlagReset); } + void RequestRestart() { m_RequestFlags.fetch_or(RequestFlagRestart); } + + void SendDeviceMessage(LogLevel level, const mpt::ustring &str); + +protected: + + void SetTimeInfo(SoundDevice::TimeInfo timeInfo) { m_TimeInfo = timeInfo; } + + SoundDevice::StreamPosition StreamPositionFromFrames(int64 frames) const { return SoundDevice::StreamPosition(frames, static_cast<double>(frames) / static_cast<double>(m_Settings.Samplerate)); } + + virtual bool InternalHasTimeInfo() const { return false; } + + virtual bool InternalHasGetStreamPosition() const { return false; } + virtual int64 InternalGetStreamPositionFrames() const { return 0; } + + virtual bool InternalIsOpen() const = 0; + + virtual bool InternalOpen() = 0; + virtual bool InternalStart() = 0; + virtual void InternalStop() = 0; + virtual void InternalStopForce() { InternalStop(); } + virtual bool InternalClose() = 0; + + virtual SoundDevice::Caps InternalGetDeviceCaps() = 0; + + virtual SoundDevice::BufferAttributes InternalGetEffectiveBufferAttributes() const = 0; + +protected: + + Base(SoundDevice::Info info); + +public: + + virtual ~Base(); + + void SetSource(SoundDevice::ISource *source) { m_Source = source; } + void SetMessageReceiver(SoundDevice::IMessageReceiver *receiver) { m_MessageReceiver = receiver; } + + SoundDevice::Info GetDeviceInfo() const { return m_Info; } + + SoundDevice::Caps GetDeviceCaps() const { return m_Caps; } + virtual SoundDevice::DynamicCaps GetDeviceDynamicCaps(const std::vector<uint32> &baseSampleRates); + + bool Init(const SoundDevice::AppInfo &appInfo); + bool Open(const SoundDevice::Settings &settings); + bool Close(); + bool Start(); + void Stop(bool force = false); + + FlagSet<RequestFlags> GetRequestFlags() const { return FlagSet<RequestFlags>(m_RequestFlags.load()); } + + bool IsInited() const { return m_Caps.Available; } + bool IsOpen() const { return IsInited() && InternalIsOpen(); } + bool IsAvailable() const { return m_Caps.Available && !m_DeviceUnavailableOnOpen; } + bool IsPlaying() const { return m_IsPlaying; } + + virtual bool OnIdle() { return false; } + + SoundDevice::Settings GetSettings() const { return m_Settings; } + SampleFormat GetActualSampleFormat() const { return IsOpen() ? m_Settings.sampleFormat : SampleFormatInvalid; } + SoundDevice::BufferAttributes GetEffectiveBufferAttributes() const { return (IsOpen() && IsPlaying()) ? InternalGetEffectiveBufferAttributes() : SoundDevice::BufferAttributes(); } + + SoundDevice::TimeInfo GetTimeInfo() const { return m_TimeInfo; } + SoundDevice::StreamPosition GetStreamPosition() const; + + virtual bool DebugIsFragileDevice() const { return false; } + virtual bool DebugInRealtimeCallback() const { return false; } + + virtual SoundDevice::Statistics GetStatistics() const; + + virtual bool OpenDriverSettings() { return false; }; + +}; + + +} // namespace SoundDevice + + +OPENMPT_NAMESPACE_END Modified: trunk/OpenMPT/sounddev/SoundDeviceDirectSound.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceDirectSound.h 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/sounddev/SoundDeviceDirectSound.h 2015-05-23 11:19:36 UTC (rev 5142) @@ -11,7 +11,7 @@ #pragma once -#include "SoundDevice.h" +#include "SoundDeviceBase.h" #include "SoundDeviceUtilities.h" #include "../common/ComponentManager.h" Modified: trunk/OpenMPT/sounddev/SoundDeviceManager.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceManager.cpp 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/sounddev/SoundDeviceManager.cpp 2015-05-23 11:19:36 UTC (rev 5142) @@ -209,18 +209,6 @@ } -SoundDevice::Type ParseType(const SoundDevice::Identifier &identifier) -//-------------------------------------------------------------------- -{ - std::vector<mpt::ustring> tmp = mpt::String::Split<mpt::ustring>(identifier, MPT_USTRING("_")); - if(tmp.size() == 0) - { - return SoundDevice::Type(); - } - return tmp[0]; -} - - SoundDevice::Info Manager::FindDeviceInfoBestMatch(SoundDevice::Identifier identifier, bool preferSameType) //--------------------------------------------------------------------------------------------------------- { Modified: trunk/OpenMPT/sounddev/SoundDevicePortAudio.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDevicePortAudio.h 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/sounddev/SoundDevicePortAudio.h 2015-05-23 11:19:36 UTC (rev 5142) @@ -10,7 +10,7 @@ #pragma once -#include "SoundDevice.h" +#include "SoundDeviceBase.h" #include "../common/ComponentManager.h" Modified: trunk/OpenMPT/sounddev/SoundDeviceUtilities.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceUtilities.h 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/sounddev/SoundDeviceUtilities.h 2015-05-23 11:19:36 UTC (rev 5142) @@ -11,7 +11,7 @@ #pragma once -#include "SoundDevice.h" +#include "SoundDeviceBase.h" #include "../common/misc_util.h" Modified: trunk/OpenMPT/sounddev/SoundDeviceWaveout.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceWaveout.h 2015-05-23 11:08:28 UTC (rev 5141) +++ trunk/OpenMPT/sounddev/SoundDeviceWaveout.h 2015-05-23 11:19:36 UTC (rev 5142) @@ -11,7 +11,7 @@ #pragma once -#include "SoundDevice.h" +#include "SoundDeviceBase.h" #include "SoundDeviceUtilities.h" #include "../common/ComponentManager.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |