From: <man...@us...> - 2013-10-20 08:22:06
|
Revision: 2942 http://sourceforge.net/p/modplug/code/2942 Author: manxorist Date: 2013-10-20 08:21:58 +0000 (Sun, 20 Oct 2013) Log Message: ----------- [Ref] sounddev: Split API name from device name. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/sounddev/SoundDevice.h trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp trunk/OpenMPT/sounddev/SoundDeviceDirectSound.cpp trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp trunk/OpenMPT/sounddev/SoundDeviceWaveout.cpp Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-10-20 05:47:53 UTC (rev 2941) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-10-20 08:21:58 UTC (rev 2942) @@ -224,12 +224,16 @@ } { - mpt::String::Copy(s, mpt::String::Encode(it->name, mpt::CharsetLocale)); + std::string name = mpt::String::Encode(it->name, mpt::CharsetLocale); cbi.mask = CBEIF_IMAGE | CBEIF_LPARAM | CBEIF_TEXT | CBEIF_SELECTEDIMAGE | CBEIF_OVERLAY; cbi.iItem = iItem; cbi.cchTextMax = 0; switch(it->id.GetType()) { + case SNDDEV_WAVEOUT: + case SNDDEV_PORTAUDIO_WMME: + cbi.iImage = IMAGE_WAVEOUT; + break; case SNDDEV_DSOUND: case SNDDEV_PORTAUDIO_DS: cbi.iImage = IMAGE_DIRECTX; @@ -238,13 +242,22 @@ case SNDDEV_PORTAUDIO_ASIO: cbi.iImage = IMAGE_ASIO; break; + case SNDDEV_PORTAUDIO_WASAPI: + case SNDDEV_PORTAUDIO_WDMKS: + cbi.iImage = IMAGE_WAVEOUT; + // No image available for now, + // prepend API name to name. + name = mpt::String::Encode(it->apiName, mpt::CharsetLocale) + " - " + name; + break; default: cbi.iImage = IMAGE_WAVEOUT; + break; } cbi.iSelectedImage = cbi.iImage; cbi.iOverlay = cbi.iImage; cbi.iIndent = 0; cbi.lParam = it->id.GetIdRaw(); + mpt::String::Copy(s, name); cbi.pszText = s; int pos = m_CbnDevice.InsertItem(&cbi); if(cbi.lParam == m_nSoundDevice.GetIdRaw()) Modified: trunk/OpenMPT/sounddev/SoundDevice.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.h 2013-10-20 05:47:53 UTC (rev 2941) +++ trunk/OpenMPT/sounddev/SoundDevice.h 2013-10-20 08:21:58 UTC (rev 2942) @@ -285,11 +285,13 @@ { SoundDeviceID id; std::wstring name; + std::wstring apiName; std::wstring internalID; SoundDeviceInfo() { } - SoundDeviceInfo(SoundDeviceID id, const std::wstring &name, const std::wstring &internalID = std::wstring()) + SoundDeviceInfo(SoundDeviceID id, const std::wstring &name, const std::wstring &apiName, const std::wstring &internalID = std::wstring()) : id(id) , name(name) + , apiName(apiName) , internalID(internalID) { return; Modified: trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp 2013-10-20 05:47:53 UTC (rev 2941) +++ trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp 2013-10-20 08:21:58 UTC (rev 2942) @@ -134,7 +134,7 @@ if(SoundDeviceIndexIsValid(devices.size())) { // everything ok - devices.push_back(SoundDeviceInfo(SoundDeviceID(SNDDEV_ASIO, static_cast<SoundDeviceIndex>(devices.size())), mpt::String::Decode(description, mpt::CharsetLocale), internalID)); + devices.push_back(SoundDeviceInfo(SoundDeviceID(SNDDEV_ASIO, static_cast<SoundDeviceIndex>(devices.size())), mpt::String::Decode(description, mpt::CharsetLocale), L"ASIO", internalID)); } } Modified: trunk/OpenMPT/sounddev/SoundDeviceDirectSound.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceDirectSound.cpp 2013-10-20 05:47:53 UTC (rev 2941) +++ trunk/OpenMPT/sounddev/SoundDeviceDirectSound.cpp 2013-10-20 08:21:58 UTC (rev 2942) @@ -73,6 +73,7 @@ SoundDeviceInfo info; info.id = SoundDeviceID(SNDDEV_DSOUND, static_cast<SoundDeviceIndex>(devices.size())); info.name = lpstrDescription; + info.apiName = L"DirectSound"; if(lpGuid) { info.internalID = GuidToString(*lpGuid); Modified: trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp 2013-10-20 05:47:53 UTC (rev 2941) +++ trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp 2013-10-20 08:21:58 UTC (rev 2942) @@ -322,12 +322,12 @@ return false; result.id = SoundDeviceID(HostApiToSndDevType(hostapi), index); result.name = mpt::String::Decode( - mpt::String::Format("%s - %s%s", - HostApiToString(Pa_GetDeviceInfo(dev)->hostApi).c_str(), + mpt::String::Format("%s%s", Pa_GetDeviceInfo(dev)->name, Pa_GetHostApiInfo(Pa_GetDeviceInfo(dev)->hostApi)->defaultOutputDevice == (PaDeviceIndex)dev ? " (Default)" : "" ), mpt::CharsetUTF8); + result.apiName = mpt::String::Decode(HostApiToString(Pa_GetDeviceInfo(dev)->hostApi).c_str(), mpt::CharsetUTF8); return true; } Modified: trunk/OpenMPT/sounddev/SoundDeviceWaveout.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceWaveout.cpp 2013-10-20 05:47:53 UTC (rev 2941) +++ trunk/OpenMPT/sounddev/SoundDeviceWaveout.cpp 2013-10-20 08:21:58 UTC (rev 2942) @@ -235,6 +235,7 @@ } SoundDeviceInfo info; info.id = SoundDeviceID(SNDDEV_WAVEOUT, static_cast<SoundDeviceIndex>(index)); + info.apiName = L"WaveOut"; if(index == 0) { info.name = L"Auto (Wave Mapper)"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |