From 77bd6397ae026d5d4ffab496142a76d7a9335495 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 6 Aug 2011 13:38:11 -0700 Subject: [PATCH 1/3] wchar includes for hsStringTokenizer. --- Sources/Plasma/CoreLib/hsStringTokenizer.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/Plasma/CoreLib/hsStringTokenizer.h b/Sources/Plasma/CoreLib/hsStringTokenizer.h index ae93a324..c562eb4c 100644 --- a/Sources/Plasma/CoreLib/hsStringTokenizer.h +++ b/Sources/Plasma/CoreLib/hsStringTokenizer.h @@ -29,6 +29,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" +#ifndef HS_BUILD_FOR_WIN32 +#include +#include +#endif + class hsStringTokenizer { private: From a668ebe68b4dc0bf9995957b97de83dd6c0cc372 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 6 Aug 2011 14:41:10 -0700 Subject: [PATCH 2/3] Make plUUID work in *nix. --- Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt | 2 ++ Sources/Plasma/PubUtilLib/plUUID/plUUID_Unix.cpp | 11 ++--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt index 905ab2ac..99eaca4c 100644 --- a/Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt @@ -8,6 +8,8 @@ set(plUUID_SOURCES if(WIN32) set(plUUID_SOURCES ${plUUID_SOURCES} plUUID_Win32.cpp) +else(WIN32) + set(plUUID_SOURCES ${plUUID_SOURCES} plUUID_Unix.cpp) endif(WIN32) set(plUUID_HEADERS diff --git a/Sources/Plasma/PubUtilLib/plUUID/plUUID_Unix.cpp b/Sources/Plasma/PubUtilLib/plUUID/plUUID_Unix.cpp index a709bbfd..b3e83b5b 100644 --- a/Sources/Plasma/PubUtilLib/plUUID/plUUID_Unix.cpp +++ b/Sources/Plasma/PubUtilLib/plUUID/plUUID_Unix.cpp @@ -90,7 +90,7 @@ bool plUUID::FromString( const char * str ) return true; } -bool plUUID::ToString( std::string & out ) const +bool plUUID::ToStdString( std::string & out ) const { uuid_t g; plUUIDHelper::CopyToNative( g, this ); @@ -100,13 +100,6 @@ bool plUUID::ToString( std::string & out ) const return true; } -std::string plUUID::ToString() const -{ - std::string str; - plUUID::ToString( str ); - return str; -} - // static plUUID plUUID::Generate() { @@ -125,4 +118,4 @@ void _preventLNK4221WarningStub() { } -#endif \ No newline at end of file +#endif From b50b505a67a78fa2060bea4705e789b1f802f172 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 27 Aug 2011 22:41:35 -0700 Subject: [PATCH 3/3] Remove some of DShow-dependent in AudioCaps. This code was used to loop over all the audio devices and print their names to a log file. No other initialization or parameter setting was done. I'm quite sure the world will continue to operate without device names printed out to an encrypted log file. ;) --- .../Plasma/PubUtilLib/plAudio/plAudioCaps.cpp | 58 +------------------ .../Plasma/PubUtilLib/plAudio/plAudioCaps.h | 1 - 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAudio/plAudioCaps.cpp b/Sources/Plasma/PubUtilLib/plAudio/plAudioCaps.cpp index 18e1bcd0..d510279a 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plAudioCaps.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plAudioCaps.cpp @@ -40,7 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #endif #include -#include #include "plStatusLog/plStatusLog.h" @@ -97,8 +96,6 @@ plAudioCaps &plAudioCapsDetector::Detect( hsBool logIt, hsBool init ) } } - EnumerateAudioDevices(); - if( logIt ) fLog = plStatusLogMgr::GetInstance().CreateStatusLog( 30, "audioCaps.log" ); else @@ -138,59 +135,6 @@ plAudioCaps &plAudioCapsDetector::Detect( hsBool logIt, hsBool init ) return fCaps; } -void plAudioCapsDetector::EnumerateAudioDevices() -{ - ICreateDevEnum *pDevEnum; - IEnumMoniker *pEnumMon; - IMoniker *pMoniker; - ULONG cFetched; - HRESULT hr; - char audioCardName[MAX_AUDIOCARD_NAME]; - short *pShort; - - // Enumerate audio devices - hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, (void **)&pDevEnum); - if(SUCCEEDED(hr)) - { - hr = pDevEnum->CreateClassEnumerator(CLSID_AudioRendererCategory, &pEnumMon, 0); - if(SUCCEEDED(hr)) - { - while(pEnumMon->Next(1, &pMoniker, &cFetched) == S_OK) - { - if(pMoniker) - { - IPropertyBag *pPropBag; - hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void **)&pPropBag); - if(SUCCEEDED(hr)) - { - VARIANT varName; - VariantInit(&varName); - hr = pPropBag->Read(L"FriendlyName", &varName, 0); - memset(audioCardName, 0, MAX_AUDIOCARD_NAME); - pShort = varName.piVal; - - // copy from wide character array to char array - for(int i = 0; *pShort != 0 && i < MAX_AUDIOCARD_NAME; pShort++, i++) - { - audioCardName[i] = (char)*pShort; - } - - if(SUCCEEDED(hr)) - { - plStatusLog::AddLineS("audiocaps.log", audioCardName ); - } - VariantClear(&varName); - pPropBag->Release(); - } - pMoniker->Release(); - } - } - pEnumMon->Release(); - } - pDevEnum->Release(); - } -} - //// IDetectEAX ////////////////////////////////////////////////////////////// // Attempt to actually init the EAX listener.Note that we can potentially do // this even if we didn't load the EAX Unified driver (we could just be @@ -225,4 +169,4 @@ hsBool plAudioCapsDetector::IDetectEAX( ) kLogMe 0xff00ff00, "EAX disabled in this build"); return false; #endif -} \ No newline at end of file +} diff --git a/Sources/Plasma/PubUtilLib/plAudio/plAudioCaps.h b/Sources/Plasma/PubUtilLib/plAudio/plAudioCaps.h index 52f3d10b..44b58999 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plAudioCaps.h +++ b/Sources/Plasma/PubUtilLib/plAudio/plAudioCaps.h @@ -78,7 +78,6 @@ protected: static hsBool fGotCaps; static hsBool IDetectEAX( ); - static void EnumerateAudioDevices(); }; #endif //_plAudioCaps_h