mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-19 03:39:08 +00:00
Fixes for HS_BUILD_FOR_WIN32 in plAudio.
This commit is contained in:
@ -39,11 +39,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#if HS_BUILD_FOR_WIN32
|
|
||||||
# include <direct.h>
|
|
||||||
#else
|
|
||||||
# include <unistd.h>
|
|
||||||
#endif
|
|
||||||
#include "HeadSpin.h"
|
#include "HeadSpin.h"
|
||||||
#include "hsGeometry3.h"
|
#include "hsGeometry3.h"
|
||||||
#include "hsTimer.h"
|
#include "hsTimer.h"
|
||||||
@ -64,6 +59,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
#include "plPipeline/plPlates.h"
|
#include "plPipeline/plPlates.h"
|
||||||
#include "plStatusLog/plStatusLog.h"
|
#include "plStatusLog/plStatusLog.h"
|
||||||
|
|
||||||
|
#if HS_BUILD_FOR_WIN32
|
||||||
|
# include <direct.h>
|
||||||
|
#else
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
plProfile_CreateMemCounter("Sounds", "Memory", MemSounds);
|
plProfile_CreateMemCounter("Sounds", "Memory", MemSounds);
|
||||||
plProfile_Extern(SoundPlaying);
|
plProfile_Extern(SoundPlaying);
|
||||||
|
|
||||||
|
@ -39,11 +39,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
Mead, WA 99021
|
Mead, WA 99021
|
||||||
|
|
||||||
*==LICENSE==*/
|
*==LICENSE==*/
|
||||||
#if HS_BUILD_FOR_WIN32
|
|
||||||
# include <direct.h>
|
|
||||||
#else
|
|
||||||
# include <unistd.h>
|
|
||||||
#endif
|
|
||||||
#include "HeadSpin.h"
|
#include "HeadSpin.h"
|
||||||
#include "hsTimer.h"
|
#include "hsTimer.h"
|
||||||
#include "hsGeometry3.h"
|
#include "hsGeometry3.h"
|
||||||
@ -63,6 +58,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
#include "pnMessage/plEventCallbackMsg.h"
|
#include "pnMessage/plEventCallbackMsg.h"
|
||||||
#include "plStatusLog/plStatusLog.h"
|
#include "plStatusLog/plStatusLog.h"
|
||||||
|
|
||||||
|
#if HS_BUILD_FOR_WIN32
|
||||||
|
# include <direct.h>
|
||||||
|
#else
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define STREAMING_UPDATE_MS 200
|
#define STREAMING_UPDATE_MS 200
|
||||||
|
|
||||||
plProfile_Extern(MemSounds);
|
plProfile_Extern(MemSounds);
|
||||||
|
@ -51,11 +51,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
// //
|
// //
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#if HS_BUILD_FOR_WIN32
|
|
||||||
|
|
||||||
#include "hsTypes.h"
|
#include "hsTypes.h"
|
||||||
#include "plWinMicLevel.h"
|
#include "plWinMicLevel.h"
|
||||||
#include "hsWindows.h"
|
#include "hsWindows.h"
|
||||||
|
|
||||||
|
#if HS_BUILD_FOR_WIN32
|
||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
|
|
||||||
|
|
||||||
@ -81,7 +82,7 @@ MIXERLINE *IGetLineByType( DWORD type );
|
|||||||
MIXERLINE *IGetLineByID( DWORD id );
|
MIXERLINE *IGetLineByID( DWORD id );
|
||||||
MIXERCONTROL *IGetControlByType( MIXERLINE *line, DWORD type );
|
MIXERCONTROL *IGetControlByType( MIXERLINE *line, DWORD type );
|
||||||
MIXERLINE *IGetMixerSubLineByType( MIXERCONTROL *mux, DWORD type );
|
MIXERLINE *IGetMixerSubLineByType( MIXERCONTROL *mux, DWORD type );
|
||||||
|
#endif
|
||||||
|
|
||||||
//// The Publics /////////////////////////////////////////////////////////////
|
//// The Publics /////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@ -90,11 +91,15 @@ hsScalar plWinMicLevel::GetLevel( void )
|
|||||||
if( !CanSetLevel() )
|
if( !CanSetLevel() )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
#if HS_BUILD_FOR_WIN32
|
||||||
DWORD rawValue;
|
DWORD rawValue;
|
||||||
if( !IGetControlValue( rawValue ) )
|
if( !IGetControlValue( rawValue ) )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return (hsScalar)( rawValue - sMinValue ) / (hsScalar)( sMaxValue - sMinValue );
|
return (hsScalar)( rawValue - sMinValue ) / (hsScalar)( sMaxValue - sMinValue );
|
||||||
|
#else
|
||||||
|
return -1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void plWinMicLevel::SetLevel( hsScalar level )
|
void plWinMicLevel::SetLevel( hsScalar level )
|
||||||
@ -102,9 +107,11 @@ void plWinMicLevel::SetLevel( hsScalar level )
|
|||||||
if( !CanSetLevel() )
|
if( !CanSetLevel() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#if HS_BUILD_FOR_WIN32
|
||||||
DWORD rawValue = (DWORD)(( level * ( sMaxValue - sMinValue ) ) + sMinValue);
|
DWORD rawValue = (DWORD)(( level * ( sMaxValue - sMinValue ) ) + sMinValue);
|
||||||
|
|
||||||
ISetControlValue( rawValue );
|
ISetControlValue( rawValue );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
hsBool plWinMicLevel::CanSetLevel( void )
|
hsBool plWinMicLevel::CanSetLevel( void )
|
||||||
@ -112,7 +119,11 @@ hsBool plWinMicLevel::CanSetLevel( void )
|
|||||||
// Just to init
|
// Just to init
|
||||||
plWinMicLevel &instance = IGetInstance();
|
plWinMicLevel &instance = IGetInstance();
|
||||||
|
|
||||||
|
#if HS_BUILD_FOR_WIN32
|
||||||
return ( sMixerHandle != nil ) ? true : false;
|
return ( sMixerHandle != nil ) ? true : false;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -126,6 +137,7 @@ plWinMicLevel &plWinMicLevel::IGetInstance( void )
|
|||||||
|
|
||||||
plWinMicLevel::plWinMicLevel()
|
plWinMicLevel::plWinMicLevel()
|
||||||
{
|
{
|
||||||
|
#if HS_BUILD_FOR_WIN32
|
||||||
sMixerHandle = nil;
|
sMixerHandle = nil;
|
||||||
memset( &sMixerCaps, 0, sizeof( sMixerCaps ) );
|
memset( &sMixerCaps, 0, sizeof( sMixerCaps ) );
|
||||||
|
|
||||||
@ -159,6 +171,7 @@ plWinMicLevel::plWinMicLevel()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
plWinMicLevel::~plWinMicLevel()
|
plWinMicLevel::~plWinMicLevel()
|
||||||
@ -168,12 +181,15 @@ plWinMicLevel::~plWinMicLevel()
|
|||||||
|
|
||||||
void plWinMicLevel::IShutdown( void )
|
void plWinMicLevel::IShutdown( void )
|
||||||
{
|
{
|
||||||
|
#if HS_BUILD_FOR_WIN32
|
||||||
if( sMixerHandle != nil )
|
if( sMixerHandle != nil )
|
||||||
::mixerClose( sMixerHandle );
|
::mixerClose( sMixerHandle );
|
||||||
|
|
||||||
sMixerHandle = nil;
|
sMixerHandle = nil;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HS_BUILD_FOR_WIN32
|
||||||
//// IGetMuxMicVolumeControl /////////////////////////////////////////////////
|
//// IGetMuxMicVolumeControl /////////////////////////////////////////////////
|
||||||
// Tries to get the volume control of the microphone subline of the MUX or
|
// 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!)
|
// mixer control of the WaveIn destination line of the audio system (whew!)
|
||||||
|
@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
#ifndef _plWinMicLevel_h
|
#ifndef _plWinMicLevel_h
|
||||||
#define _plWinMicLevel_h
|
#define _plWinMicLevel_h
|
||||||
|
|
||||||
#if HS_BUILD_FOR_WIN32
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
// //
|
// //
|
||||||
// plWinMicLevel - Annoying class to deal with the annoying problem of //
|
// plWinMicLevel - Annoying class to deal with the annoying problem of //
|
||||||
@ -77,6 +76,5 @@ protected:
|
|||||||
static plWinMicLevel &IGetInstance( void );
|
static plWinMicLevel &IGetInstance( void );
|
||||||
void IShutdown( void );
|
void IShutdown( void );
|
||||||
};
|
};
|
||||||
#endif // HS_BUILD_FOR_WIN32
|
|
||||||
|
|
||||||
#endif // _plWinMicLevel_h
|
#endif // _plWinMicLevel_h
|
||||||
|
Reference in New Issue
Block a user