diff --git a/Sources/Plasma/PubUtilLib/plAudio/plWin32Sound.cpp b/Sources/Plasma/PubUtilLib/plAudio/plWin32Sound.cpp index baa0589b..cd61403f 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plWin32Sound.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plWin32Sound.cpp @@ -39,11 +39,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ -#if HS_BUILD_FOR_WIN32 -# include -#else -# include -#endif #include "HeadSpin.h" #include "hsGeometry3.h" #include "hsTimer.h" @@ -64,6 +59,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plPipeline/plPlates.h" #include "plStatusLog/plStatusLog.h" +#if HS_BUILD_FOR_WIN32 +# include +#else +# include +#endif + plProfile_CreateMemCounter("Sounds", "Memory", MemSounds); plProfile_Extern(SoundPlaying); diff --git a/Sources/Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp b/Sources/Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp index 3d1fe3e6..3e01bb80 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp @@ -39,11 +39,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ -#if HS_BUILD_FOR_WIN32 -# include -#else -# include -#endif #include "HeadSpin.h" #include "hsTimer.h" #include "hsGeometry3.h" @@ -63,6 +58,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnMessage/plEventCallbackMsg.h" #include "plStatusLog/plStatusLog.h" +#if HS_BUILD_FOR_WIN32 +# include +#else +# include +#endif + #define STREAMING_UPDATE_MS 200 plProfile_Extern(MemSounds); diff --git a/Sources/Plasma/PubUtilLib/plAudio/plWinMicLevel.cpp b/Sources/Plasma/PubUtilLib/plAudio/plWinMicLevel.cpp index 04471048..9eaabeb2 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plWinMicLevel.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plWinMicLevel.cpp @@ -51,11 +51,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // ////////////////////////////////////////////////////////////////////////////// -#if HS_BUILD_FOR_WIN32 #include "hsTypes.h" #include "plWinMicLevel.h" #include "hsWindows.h" + +#if HS_BUILD_FOR_WIN32 #include @@ -81,7 +82,7 @@ MIXERLINE *IGetLineByType( DWORD type ); MIXERLINE *IGetLineByID( DWORD id ); MIXERCONTROL *IGetControlByType( MIXERLINE *line, DWORD type ); MIXERLINE *IGetMixerSubLineByType( MIXERCONTROL *mux, DWORD type ); - +#endif //// The Publics ///////////////////////////////////////////////////////////// @@ -90,11 +91,15 @@ hsScalar plWinMicLevel::GetLevel( void ) if( !CanSetLevel() ) return -1; +#if HS_BUILD_FOR_WIN32 DWORD rawValue; if( !IGetControlValue( rawValue ) ) return -1; return (hsScalar)( rawValue - sMinValue ) / (hsScalar)( sMaxValue - sMinValue ); +#else + return -1; +#endif } void plWinMicLevel::SetLevel( hsScalar level ) @@ -102,9 +107,11 @@ void plWinMicLevel::SetLevel( hsScalar level ) if( !CanSetLevel() ) return; +#if HS_BUILD_FOR_WIN32 DWORD rawValue = (DWORD)(( level * ( sMaxValue - sMinValue ) ) + sMinValue); ISetControlValue( rawValue ); +#endif } hsBool plWinMicLevel::CanSetLevel( void ) @@ -112,7 +119,11 @@ hsBool plWinMicLevel::CanSetLevel( void ) // Just to init plWinMicLevel &instance = IGetInstance(); +#if HS_BUILD_FOR_WIN32 return ( sMixerHandle != nil ) ? true : false; +#else + return false; +#endif } @@ -126,6 +137,7 @@ plWinMicLevel &plWinMicLevel::IGetInstance( void ) plWinMicLevel::plWinMicLevel() { +#if HS_BUILD_FOR_WIN32 sMixerHandle = nil; memset( &sMixerCaps, 0, sizeof( sMixerCaps ) ); @@ -159,6 +171,7 @@ plWinMicLevel::plWinMicLevel() return; } } +#endif } plWinMicLevel::~plWinMicLevel() @@ -168,12 +181,15 @@ plWinMicLevel::~plWinMicLevel() void plWinMicLevel::IShutdown( void ) { +#if HS_BUILD_FOR_WIN32 if( sMixerHandle != nil ) ::mixerClose( sMixerHandle ); sMixerHandle = nil; +#endif } +#if HS_BUILD_FOR_WIN32 //// IGetMuxMicVolumeControl ///////////////////////////////////////////////// // Tries to get the volume control of the microphone subline of the MUX or // mixer control of the WaveIn destination line of the audio system (whew!) diff --git a/Sources/Plasma/PubUtilLib/plAudio/plWinMicLevel.h b/Sources/Plasma/PubUtilLib/plAudio/plWinMicLevel.h index 043cf04a..bd7baec9 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plWinMicLevel.h +++ b/Sources/Plasma/PubUtilLib/plAudio/plWinMicLevel.h @@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef _plWinMicLevel_h #define _plWinMicLevel_h -#if HS_BUILD_FOR_WIN32 ////////////////////////////////////////////////////////////////////////////// // // // plWinMicLevel - Annoying class to deal with the annoying problem of // @@ -77,6 +76,5 @@ protected: static plWinMicLevel &IGetInstance( void ); void IShutdown( void ); }; -#endif // HS_BUILD_FOR_WIN32 #endif // _plWinMicLevel_h