Browse Source

Merge pull request #77 from dpogue/linux

Clean up for Linux
Adam Johnson 13 years ago
parent
commit
e9d8708275
  1. 5
      Sources/Plasma/CoreLib/hsStringTokenizer.h
  2. 58
      Sources/Plasma/PubUtilLib/plAudio/plAudioCaps.cpp
  3. 1
      Sources/Plasma/PubUtilLib/plAudio/plAudioCaps.h
  4. 2
      Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt
  5. 11
      Sources/Plasma/PubUtilLib/plUUID/plUUID_Unix.cpp

5
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 <wchar.h>
#include <wctype.h>
#endif
class hsStringTokenizer
{
private:

58
Sources/Plasma/PubUtilLib/plAudio/plAudioCaps.cpp

@ -40,7 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <eaxlegacy.h>
#endif
#include <iostream>
#include <DShow.h>
#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
}
}

1
Sources/Plasma/PubUtilLib/plAudio/plAudioCaps.h

@ -78,7 +78,6 @@ protected:
static hsBool fGotCaps;
static hsBool IDetectEAX( );
static void EnumerateAudioDevices();
};
#endif //_plAudioCaps_h

2
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

11
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
#endif

Loading…
Cancel
Save