1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Obliterate hsBool

This commit is contained in:
2012-07-11 01:28:00 -04:00
parent 5f78b33db4
commit a709e17069
1041 changed files with 7889 additions and 8070 deletions

View File

@ -68,7 +68,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//////////////////////////////////////////////////////////////////////////////
plAudioCaps plAudioCapsDetector::fCaps;
hsBool plAudioCapsDetector::fGotCaps = false;
bool plAudioCapsDetector::fGotCaps = false;
plStatusLog *plAudioCapsDetector::fLog = nil;
@ -83,7 +83,7 @@ plAudioCapsDetector::~plAudioCapsDetector()
//// Detect //////////////////////////////////////////////////////////////////
// Our big function that does all of our work
plAudioCaps &plAudioCapsDetector::Detect( hsBool logIt, hsBool init )
plAudioCaps &plAudioCapsDetector::Detect( bool logIt, bool init )
{
// If we already have the device capabilities, just return them
if(fGotCaps) return fCaps;
@ -158,10 +158,10 @@ plAudioCaps &plAudioCapsDetector::Detect( hsBool logIt, hsBool init )
// init code above as a way of trying to make sure this line here will
// succeed as often as possible.
hsBool plAudioCapsDetector::IDetectEAX( )
bool plAudioCapsDetector::IDetectEAX( )
{
#ifdef EAX_SDK_AVAILABLE
hsBool gotSupport = true;
bool gotSupport = true;
if(!alIsExtensionPresent((ALchar *)"EAX4.0")) // is eax 4 supported
{

View File

@ -68,15 +68,15 @@ public:
fMaxNumSources = 0;
}
hsBool IsAvailable( void ) const { return fIsAvailable; }
hsBool IsEAXAvailable( void ) const { return fEAXAvailable; }
hsBool UsingEAXUnified( void ) const { return fEAXUnified; }
bool IsAvailable( void ) const { return fIsAvailable; }
bool IsEAXAvailable( void ) const { return fEAXAvailable; }
bool UsingEAXUnified( void ) const { return fEAXUnified; }
unsigned GetMaxNumVoices() { return fMaxNumSources; }
protected:
friend class plAudioCapsDetector;
hsBool fIsAvailable, fEAXAvailable, fEAXUnified;
bool fIsAvailable, fEAXAvailable, fEAXUnified;
unsigned fMaxNumSources;
};
@ -86,14 +86,14 @@ public:
plAudioCapsDetector();
virtual ~plAudioCapsDetector();
static plAudioCaps &Detect( hsBool log = false, hsBool init = false );
static plAudioCaps &Detect( bool log = false, bool init = false );
protected:
static plStatusLog *fLog;
static plAudioCaps fCaps;
static hsBool fGotCaps;
static bool fGotCaps;
static hsBool IDetectEAX( );
static bool IDetectEAX( );
};
#endif //_plAudioCaps_h

View File

@ -225,7 +225,7 @@ void plAudioSystem::IEnumerateDevices()
// filter out any devices that aren't openal 1.1 compliant
if(major > 1 || (major == 1 && minor >= 1))
{
hsBool supportsEAX = false;
bool supportsEAX = false;
#ifdef EAX_SDK_AVAILABLE
if(alIsExtensionPresent((ALchar *)"EAX4.0") || alIsExtensionPresent((ALchar *) "EAX4.0Emulated"))
{
@ -264,10 +264,10 @@ void plAudioSystem::IEnumerateDevices()
}
//// Init ////////////////////////////////////////////////////////////////////
hsBool plAudioSystem::Init( hsWindowHndl hWnd )
bool plAudioSystem::Init( hsWindowHndl hWnd )
{
plgAudioSys::fRestarting = false;
static hsBool firstTimeInit = true;
static bool firstTimeInit = true;
plStatusLog::AddLineS( "audio.log", plStatusLog::kBlue, "ASYS: -- Init --" );
fMaxNumSources = 0;
@ -277,7 +277,7 @@ hsBool plAudioSystem::Init( hsWindowHndl hWnd )
// Set the maximum number of sounds based on priority cutoff slider
SetMaxNumberOfActiveSounds();
const char *deviceName = plgAudioSys::fDeviceName.c_str();
hsBool useDefaultDevice = true;
bool useDefaultDevice = true;
if(firstTimeInit)
{
@ -483,7 +483,7 @@ const char *plAudioSystem::GetAudioDeviceName(int index)
return fDeviceList[index].GetDeviceName();
}
hsBool plAudioSystem::SupportsEAX(const char *deviceName)
bool plAudioSystem::SupportsEAX(const char *deviceName)
{
for(DeviceIter i = fDeviceList.begin(); i != fDeviceList.end(); i++)
{
@ -547,7 +547,7 @@ void plAudioSystem::SetListenerOrientation(const hsVector3 view, const hsVector3
alListenerfv(AL_ORIENTATION, orientation);
}
void plAudioSystem::SetActive( hsBool b )
void plAudioSystem::SetActive( bool b )
{
fActive = b;
if( fActive )
@ -876,7 +876,7 @@ void plAudioSystem::SetFadeLength(float lengthSec)
fFadeLength = lengthSec;
}
hsBool plAudioSystem::MsgReceive(plMessage* msg)
bool plAudioSystem::MsgReceive(plMessage* msg)
{
if(plTimeMsg *time = plTimeMsg::ConvertNoRef( msg ) )
{
@ -989,12 +989,12 @@ hsBool plAudioSystem::MsgReceive(plMessage* msg)
// plgAudioSystem //////////////////////////////////////////////////////////////////////
plAudioSystem* plgAudioSys::fSys = nil;
hsBool plgAudioSys::fInit = false;
hsBool plgAudioSys::fActive = false;
hsBool plgAudioSys::fUseHardware = false;
hsBool plgAudioSys::fMuted = true;
hsBool plgAudioSys::fDelayedActivate = false;
hsBool plgAudioSys::fEnableEAX = false;
bool plgAudioSys::fInit = false;
bool plgAudioSys::fActive = false;
bool plgAudioSys::fUseHardware = false;
bool plgAudioSys::fMuted = true;
bool plgAudioSys::fDelayedActivate = false;
bool plgAudioSys::fEnableEAX = false;
hsWindowHndl plgAudioSys::fWnd = nil;
float plgAudioSys::fChannelVolumes[ kNumChannels ] = { 1.f, 1.f, 1.f, 1.f, 1.f, 1.f };
float plgAudioSys::f2D3DBias = 0.75f;
@ -1002,12 +1002,12 @@ uint32_t plgAudioSys::fDebugFlags = 0;
float plgAudioSys::fStreamingBufferSize = 2.f;
float plgAudioSys::fStreamFromRAMCutoff = 10.f;
uint8_t plgAudioSys::fPriorityCutoff = 9; // We cut off sounds above this priority
hsBool plgAudioSys::fEnableExtendedLogs = false;
bool plgAudioSys::fEnableExtendedLogs = false;
float plgAudioSys::fGlobalFadeVolume = 1.f;
hsBool plgAudioSys::fLogStreamingUpdates = false;
bool plgAudioSys::fLogStreamingUpdates = false;
std::string plgAudioSys::fDeviceName;
hsBool plgAudioSys::fRestarting = false;
hsBool plgAudioSys::fMutedStateChange = false;
bool plgAudioSys::fRestarting = false;
bool plgAudioSys::fMutedStateChange = false;
void plgAudioSys::Init(hsWindowHndl hWnd)
{
@ -1024,12 +1024,12 @@ void plgAudioSys::Init(hsWindowHndl hWnd)
Activate( true );
}
void plgAudioSys::SetActive(hsBool b)
void plgAudioSys::SetActive(bool b)
{
fActive = b;
}
void plgAudioSys::SetMuted( hsBool b )
void plgAudioSys::SetMuted( bool b )
{
fMuted = b;
fMutedStateChange = true;
@ -1040,14 +1040,14 @@ void plgAudioSys::SetMuted( hsBool b )
SetGlobalFadeVolume(1.0);
}
void plgAudioSys::SetUseHardware(hsBool b)
void plgAudioSys::SetUseHardware(bool b)
{
fUseHardware = b;
if( fActive )
Restart();
}
void plgAudioSys::EnableEAX( hsBool b )
void plgAudioSys::EnableEAX( bool b )
{
fEnableEAX = b;
if( fActive )
@ -1127,7 +1127,7 @@ void plgAudioSys::Shutdown()
}
}
void plgAudioSys::Activate(hsBool b)
void plgAudioSys::Activate(bool b)
{
if( fSys == nil )
{
@ -1210,7 +1210,7 @@ float plgAudioSys::Get2D3Dbias()
return f2D3DBias;
}
void plgAudioSys::SetDeviceName(const char *device, hsBool restart /* = false */)
void plgAudioSys::SetDeviceName(const char *device, bool restart /* = false */)
{
fDeviceName = device;
if(restart)
@ -1242,7 +1242,7 @@ ALCdevice *plgAudioSys::GetCaptureDevice()
return nil;
}
hsBool plgAudioSys::SupportsEAX(const char *deviceName)
bool plgAudioSys::SupportsEAX(const char *deviceName)
{
if(fSys)
{

View File

@ -65,17 +65,17 @@ typedef struct ALCcontext_struct ALCcontext;
class DeviceDescriptor
{
public:
DeviceDescriptor(const char *name, hsBool supportsEAX):
DeviceDescriptor(const char *name, bool supportsEAX):
fDeviceName(name),
fSupportsEAX(supportsEAX)
{
}
const char *GetDeviceName() { return fDeviceName.c_str();}
hsBool SupportsEAX() { return fSupportsEAX; }
bool SupportsEAX() { return fSupportsEAX; }
private:
std::string fDeviceName;
hsBool fSupportsEAX;
bool fSupportsEAX;
};
class plAudioSystem : public hsKeyedObject
@ -93,10 +93,10 @@ public:
kRefEAXRegion
};
hsBool Init(hsWindowHndl hWnd);
bool Init(hsWindowHndl hWnd);
void Shutdown();
void SetActive( hsBool b );
void SetActive( bool b );
void SetListenerPos(const hsPoint3 pos);
void SetListenerVelocity(const hsVector3 vel);
@ -104,7 +104,7 @@ public:
void SetMaxNumberOfActiveSounds(); // sets the max number of active sounds based on the priority cutoff
void SetDistanceModel(int i);
virtual hsBool MsgReceive(plMessage* msg);
virtual bool MsgReceive(plMessage* msg);
double GetTime();
void NextDebugSound( void );
@ -112,7 +112,7 @@ public:
int GetNumAudioDevices();
const char *GetAudioDeviceName(int index);
hsBool SupportsEAX(const char *deviceName);
bool SupportsEAX(const char *deviceName);
void SetFadeLength(float lengthSec);
@ -133,16 +133,16 @@ protected:
hsTArray<plKey> fPendingRegisters;
hsPoint3 fCurrListenerPos;//, fCommittedListenerPos;
hsBool fActive, fUsingEAX, fRestartOnDestruct, fWaitingForShutdown;
bool fActive, fUsingEAX, fRestartOnDestruct, fWaitingForShutdown;
int64_t fStartTime;
hsTArray<hsKeyedObject *> fMyRefs;
hsTArray<plEAXListenerMod *> fEAXRegions;
hsPoint3 fLastPos;
hsBool fAvatarPosSet; // used for listener stuff
bool fAvatarPosSet; // used for listener stuff
hsBool fDisplayNumBuffers;
bool fDisplayNumBuffers;
std::vector<DeviceDescriptor> fDeviceList; // list of openal device names
@ -158,7 +158,7 @@ protected:
void IEnumerateDevices();
public:
hsBool fListenerInit;
bool fListenerInit;
};
class plgAudioSys
@ -189,19 +189,19 @@ public:
kHardwarePlusEAX,
};
static void Init(hsWindowHndl hWnd);
static hsBool Hardware() { return fUseHardware; }
static void SetUseHardware(hsBool b);
static void SetActive(hsBool b);
static void SetMuted( hsBool b );
static void EnableEAX( hsBool b );
static hsBool Active() { return fInit; }
static bool Hardware() { return fUseHardware; }
static void SetUseHardware(bool b);
static void SetActive(bool b);
static void SetMuted( bool b );
static void EnableEAX( bool b );
static bool Active() { return fInit; }
static void Shutdown();
static void Activate(hsBool b);
static hsBool IsMuted( void ) { return fMuted; }
static void Activate(bool b);
static bool IsMuted( void ) { return fMuted; }
static hsWindowHndl hWnd() { return fWnd; }
static plAudioSystem* Sys() { return fSys; }
static void Restart( void );
static hsBool UsingEAX( void ) { return fSys->fUsingEAX; }
static bool UsingEAX( void ) { return fSys->fUsingEAX; }
static void NextDebugSound( void );
@ -214,8 +214,8 @@ public:
static void SetGlobalFadeVolume( float vol );
static float GetGlobalFadeVolume( void ) { return fGlobalFadeVolume; }
static void SetDebugFlag( uint32_t flag, hsBool set = true ) { if( set ) fDebugFlags |= flag; else fDebugFlags &= ~flag; }
static hsBool IsDebugFlagSet( uint32_t flag ) { return fDebugFlags & flag; }
static void SetDebugFlag( uint32_t flag, bool set = true ) { if( set ) fDebugFlags |= flag; else fDebugFlags &= ~flag; }
static bool IsDebugFlagSet( uint32_t flag ) { return fDebugFlags & flag; }
static void ClearDebugFlags( void ) { fDebugFlags = 0; }
static float GetStreamingBufferSize( void ) { return fStreamingBufferSize; }
@ -224,8 +224,8 @@ public:
static uint8_t GetPriorityCutoff( void ) { return fPriorityCutoff; }
static void SetPriorityCutoff( uint8_t cut ) { fPriorityCutoff = cut; if(fSys) fSys->SetMaxNumberOfActiveSounds(); }
static hsBool AreExtendedLogsEnabled( void ) { return fEnableExtendedLogs; }
static void EnableExtendedLogs( hsBool e ) { fEnableExtendedLogs = e; }
static bool AreExtendedLogsEnabled( void ) { return fEnableExtendedLogs; }
static void EnableExtendedLogs( bool e ) { fEnableExtendedLogs = e; }
static float GetStreamFromRAMCutoff( void ) { return fStreamFromRAMCutoff; }
static void SetStreamFromRAMCutoff( float c ) { fStreamFromRAMCutoff = c; }
@ -234,46 +234,46 @@ public:
static void SetListenerVelocity(const hsVector3 vel);
static void SetListenerOrientation(const hsVector3 view, const hsVector3 up);
static void ShowNumBuffers(hsBool b) { if(fSys) fSys->fDisplayNumBuffers = b; }
static void ShowNumBuffers(bool b) { if(fSys) fSys->fDisplayNumBuffers = b; }
static void SetAudioMode(AudioMode mode);
static int GetAudioMode();
static hsBool LogStreamingUpdates() { return fLogStreamingUpdates; }
static void SetLogStreamingUpdates(hsBool logUpdates) { fLogStreamingUpdates = logUpdates; }
static void SetDeviceName(const char *device, hsBool restart = false);
static bool LogStreamingUpdates() { return fLogStreamingUpdates; }
static void SetLogStreamingUpdates(bool logUpdates) { fLogStreamingUpdates = logUpdates; }
static void SetDeviceName(const char *device, bool restart = false);
static const char *GetDeviceName() { return fDeviceName.c_str(); }
static int GetNumAudioDevices();
static const char *GetAudioDeviceName(int index);
static ALCdevice *GetCaptureDevice();
static hsBool SupportsEAX(const char *deviceName);
static bool SupportsEAX(const char *deviceName);
static void RegisterSoftSound( const plKey soundKey );
static void UnregisterSoftSound( const plKey soundKey );
static hsBool IsRestarting() {return fRestarting;}
static bool IsRestarting() {return fRestarting;}
private:
friend class plAudioSystem;
static plAudioSystem* fSys;
static hsBool fInit;
static hsBool fActive;
static hsBool fMuted;
static bool fInit;
static bool fActive;
static bool fMuted;
static hsWindowHndl fWnd;
static hsBool fUseHardware;
static hsBool fDelayedActivate;
static bool fUseHardware;
static bool fDelayedActivate;
static float fChannelVolumes[ kNumChannels ];
static float fGlobalFadeVolume;
static uint32_t fDebugFlags;
static hsBool fEnableEAX;
static bool fEnableEAX;
static float fStreamingBufferSize;
static uint8_t fPriorityCutoff;
static hsBool fEnableExtendedLogs;
static bool fEnableExtendedLogs;
static float fStreamFromRAMCutoff;
static float f2D3DBias;
static hsBool fLogStreamingUpdates;
static bool fLogStreamingUpdates;
static std::string fDeviceName;
static hsBool fRestarting;
static hsBool fMutedStateChange;
static bool fRestarting;
static bool fMutedStateChange;
};

View File

@ -69,7 +69,7 @@ plProfile_CreateCounterNoReset( "Allocated", "Sound", NumAllocated );
//// Constructor/Destructor //////////////////////////////////////////////////
plDSoundBuffer::plDSoundBuffer( uint32_t size, plWAVHeader &bufferDesc, hsBool enable3D, hsBool isLooping, hsBool tryStatic, bool streaming )
plDSoundBuffer::plDSoundBuffer( uint32_t size, plWAVHeader &bufferDesc, bool enable3D, bool isLooping, bool tryStatic, bool streaming )
{
fLooping = isLooping;
fValid = false;
@ -100,7 +100,7 @@ plDSoundBuffer::~plDSoundBuffer()
//// IAllocate ///////////////////////////////////////////////////////////////
void plDSoundBuffer::IAllocate( uint32_t size, plWAVHeader &bufferDesc, hsBool enable3D, hsBool tryStatic )
void plDSoundBuffer::IAllocate( uint32_t size, plWAVHeader &bufferDesc, bool enable3D, bool tryStatic )
{
// Create a DSound buffer description
fBufferDesc = new plWAVHeader;
@ -404,7 +404,7 @@ bool plDSoundBuffer::StreamingFillBuffer(plAudioFileReader *stream)
ALuint bufferId;
unsigned char data[STREAM_BUFFER_SIZE];
int buffersProcessed = BuffersProcessed();
hsBool finished = false;
bool finished = false;
for(int i = 0; i < buffersProcessed; i++)
{
@ -574,7 +574,7 @@ bool plDSoundBuffer::VoiceFillBuffer(void *data, unsigned bytes, unsigned buffer
//// SetLooping //////////////////////////////////////////////////////////////
void plDSoundBuffer::SetLooping( hsBool loop )
void plDSoundBuffer::SetLooping( bool loop )
{
fLooping = loop;
}
@ -684,7 +684,7 @@ void plDSoundBuffer::Rewind()
//// IsPlaying ///////////////////////////////////////////////////////////////
hsBool plDSoundBuffer::IsPlaying( void )
bool plDSoundBuffer::IsPlaying( void )
{
ALint state = AL_STOPPED;
alGetSourcei(source, AL_SOURCE_STATE, &state);
@ -694,7 +694,7 @@ hsBool plDSoundBuffer::IsPlaying( void )
//// IsEAXAccelerated ////////////////////////////////////////////////////////
hsBool plDSoundBuffer::IsEAXAccelerated( void ) const
bool plDSoundBuffer::IsEAXAccelerated( void ) const
{
return fEAXSource.IsValid();
}
@ -727,7 +727,7 @@ uint32_t plDSoundBuffer::GetLengthInBytes( void ) const
//// SetEAXSettings //////////////////////////////////////////////////////////
void plDSoundBuffer::SetEAXSettings( plEAXSourceSettings *settings, hsBool force )
void plDSoundBuffer::SetEAXSettings( plEAXSourceSettings *settings, bool force )
{
fEAXSource.SetFrom( settings, source, force );
}

View File

@ -68,7 +68,7 @@ class plAudioFileReader;
class plDSoundBuffer
{
public:
plDSoundBuffer( uint32_t size, plWAVHeader &bufferDesc, hsBool enable3D, hsBool looping, hsBool tryStatic = false, bool streaming = false );
plDSoundBuffer( uint32_t size, plWAVHeader &bufferDesc, bool enable3D, bool looping, bool tryStatic = false, bool streaming = false );
~plDSoundBuffer();
void Play( void );
@ -86,14 +86,14 @@ public:
void SetConeOrientation(float x, float y, float z);
void SetConeOutsideVolume(int vol);
void SetLooping( hsBool loop );
void SetLooping( bool loop );
void SetMinDistance( int dist);
void SetMaxDistance( int dist );
hsBool IsValid( void ) const { return fValid; }
hsBool IsPlaying( void );
hsBool IsLooping( void ) const { return fLooping; }
hsBool IsEAXAccelerated( void ) const;
bool IsValid( void ) const { return fValid; }
bool IsPlaying( void );
bool IsLooping( void ) const { return fLooping; }
bool IsEAXAccelerated( void ) const;
bool FillBuffer(void *data, unsigned bytes, plWAVHeader *header);
@ -112,7 +112,7 @@ public:
uint32_t GetBufferBytePos( float timeInSecs ) const;
uint32_t bytePosToMSecs( uint32_t bytePos ) const;
void SetEAXSettings( plEAXSourceSettings *settings, hsBool force = false );
void SetEAXSettings( plEAXSourceSettings *settings, bool force = false );
void SetTimeOffsetBytes(unsigned bytes);
uint8_t GetBlockAlign( void ) const;
static uint32_t GetNumBuffers() { return fNumBuffers; }
@ -134,7 +134,7 @@ protected:
};
BufferType fType;
hsBool fValid, fLooping;
bool fValid, fLooping;
uint32_t fLockLength;
void * fLockPtr;
@ -158,7 +158,7 @@ protected:
unsigned fNumQueuedBuffers;
float fPrevVolume;
void IAllocate( uint32_t size, plWAVHeader &bufferDesc, hsBool enable3D, hsBool tryStatic );
void IAllocate( uint32_t size, plWAVHeader &bufferDesc, bool enable3D, bool tryStatic );
void IRelease( void );
int IGetALFormat(unsigned bitsPerSample, unsigned int numChannels);
};

View File

@ -106,7 +106,7 @@ plEAXListener::~plEAXListener()
//// Init ////////////////////////////////////////////////////////////////////
hsBool plEAXListener::Init( void )
bool plEAXListener::Init( void )
{
#ifdef EAX_SDK_AVAILABLE
if( fInited )
@ -229,7 +229,7 @@ void plEAXListener::IRelease( void )
//// IFail ///////////////////////////////////////////////////////////////////
void plEAXListener::IFail( hsBool major )
void plEAXListener::IFail( bool major )
{
plStatusLog::AddLineS( "audio.log", plStatusLog::kRed,
"ERROR in plEAXListener: Could not set global eax params");
@ -238,7 +238,7 @@ void plEAXListener::IFail( hsBool major )
IRelease();
}
void plEAXListener::IFail( const char *msg, hsBool major )
void plEAXListener::IFail( const char *msg, bool major )
{
plStatusLog::AddLineS( "audio.log", plStatusLog::kRed,
"ERROR in plEAXListener: %s", msg );
@ -296,13 +296,13 @@ void plEAXListener::ProcessMods( hsTArray<plEAXListenerMod *> &modArray )
#ifdef EAX_SDK_AVAILABLE
int i;
float totalStrength;
hsBool firstOne;
bool firstOne;
plEAXListenerMod *thisBigRegion = nil;
EAXLISTENERPROPERTIES finalProps;
static int oldTime = timeGetTime(); // Get starting time
int newTime;
hsBool bMorphing = false;
bool bMorphing = false;
static plStatusLog *myLog = nil;
@ -512,7 +512,7 @@ void plEAXSourceSettings::Write( hsStream *s )
}
}
void plEAXSourceSettings::SetRoomParams( int16_t room, int16_t roomHF, hsBool roomAuto, hsBool roomHFAuto )
void plEAXSourceSettings::SetRoomParams( int16_t room, int16_t roomHF, bool roomAuto, bool roomHFAuto )
{
fRoom = room;
fRoomHF = roomHF;
@ -521,7 +521,7 @@ void plEAXSourceSettings::SetRoomParams( int16_t room, int16_t roomHF, hsBool
fDirtyParams |= kRoom;
}
void plEAXSourceSettings::Enable( hsBool e )
void plEAXSourceSettings::Enable( bool e )
{
fEnabled = e;
if( !e )
@ -659,14 +659,14 @@ void plEAXSource::Release( void )
fInit = false;
}
hsBool plEAXSource::IsValid( void ) const
bool plEAXSource::IsValid( void ) const
{
return true;
}
//// SetFrom /////////////////////////////////////////////////////////////////
void plEAXSource::SetFrom( plEAXSourceSettings *settings, unsigned source, hsBool force )
void plEAXSource::SetFrom( plEAXSourceSettings *settings, unsigned source, bool force )
{
uint32_t dirtyParams;
if(source == 0 || !fInit)

View File

@ -75,7 +75,7 @@ public:
~plEAXListener();
static plEAXListener &GetInstance( void );
hsBool Init( void );
bool Init( void );
void Shutdown( void );
bool SetGlobalEAXProperty(GUID guid, unsigned long ulProperty, void *pData, unsigned long ulDataSize );
@ -86,17 +86,17 @@ public:
protected:
plEAXListener();
void IFail( hsBool major );
void IFail( const char *msg, hsBool major );
void IFail( bool major );
void IFail( const char *msg, bool major );
void IRelease( void );
void IMuteProperties( EAXREVERBPROPERTIES *props, float percent );
hsBool fInited;
bool fInited;
// Cache info
int32_t fLastModCount;
hsBool fLastWasEmpty;
bool fLastWasEmpty;
float fLastSingleStrength;
plEAXListenerMod *fLastBigRegion;
@ -138,14 +138,14 @@ class plEAXSourceSettings
void Read( hsStream *s );
void Write( hsStream *s );
void Enable( hsBool e );
hsBool IsEnabled( void ) const { return fEnabled; }
void Enable( bool e );
bool IsEnabled( void ) const { return fEnabled; }
void SetRoomParams( int16_t room, int16_t roomHF, hsBool roomAuto, hsBool roomHFAuto );
void SetRoomParams( int16_t room, int16_t roomHF, bool roomAuto, bool roomHFAuto );
int16_t GetRoom( void ) const { return fRoom; }
int16_t GetRoomHF( void ) const { return fRoomHF; }
hsBool GetRoomAuto( void ) const { return fRoomAuto; }
hsBool GetRoomHFAuto( void ) const { return fRoomHFAuto; }
bool GetRoomAuto( void ) const { return fRoomAuto; }
bool GetRoomHFAuto( void ) const { return fRoomHFAuto; }
void SetOutsideVolHF( int16_t vol );
int16_t GetOutsideVolHF( void ) const { return fOutsideVolHF; }
@ -170,9 +170,9 @@ class plEAXSourceSettings
friend class plEAXSource;
friend class plEAXSourceSoftSettings;
hsBool fEnabled;
bool fEnabled;
int16_t fRoom, fRoomHF;
hsBool fRoomAuto, fRoomHFAuto;
bool fRoomAuto, fRoomHFAuto;
int16_t fOutsideVolHF;
float fAirAbsorptionFactor, fRoomRolloffFactor, fDopplerFactor, fRolloffFactor;
plEAXSourceSoftSettings fSoftStarts, fSoftEnds, fCurrSoftValues;
@ -204,13 +204,13 @@ public:
void Init( plDSoundBuffer *parent );
void Release( void );
hsBool IsValid( void ) const;
bool IsValid( void ) const;
bool SetSourceEAXProperty(unsigned source, GUID guid, unsigned long ulProperty, void *pData, unsigned long ulDataSize);
bool GetSourceEAXProperty(unsigned source, GUID guid, unsigned long ulProperty, void *pData, unsigned long ulDataSize);
void SetFrom( plEAXSourceSettings *settings, unsigned source, hsBool force = false );
void SetFrom( plEAXSourceSettings *settings, unsigned source, bool force = false );
private:
hsBool fInit;
bool fInit;
};
#endif //_plEAXEffects_h

View File

@ -120,13 +120,13 @@ void plEAXListenerMod::IUnRegister( void )
fRegistered = false;
}
hsBool plEAXListenerMod::IEval( double secs, float del, uint32_t dirty )
bool plEAXListenerMod::IEval( double secs, float del, uint32_t dirty )
{
IRegister();
return false;
}
hsBool plEAXListenerMod::MsgReceive( plMessage* pMsg )
bool plEAXListenerMod::MsgReceive( plMessage* pMsg )
{
plGenRefMsg *refMsg = plGenRefMsg::ConvertNoRef( pMsg );
if( refMsg != nil )

View File

@ -72,7 +72,7 @@ public:
kRefSoftRegion = 0,
};
virtual hsBool MsgReceive( plMessage* pMsg );
virtual bool MsgReceive( plMessage* pMsg );
virtual void Read( hsStream* s, hsResMgr* mgr );
virtual void Write( hsStream* s, hsResMgr* mgr );
float GetStrength( void );
@ -83,11 +83,11 @@ public:
protected:
plSoftVolume *fSoftRegion;
EAXREVERBPROPERTIES *fListenerProps;
hsBool fRegistered, fGetsMessages;
bool fRegistered, fGetsMessages;
void IRegister( void );
void IUnRegister( void );
virtual hsBool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
virtual bool IEval( double secs, float del, uint32_t dirty ); // called only by owner object's Eval()
};
#endif // _plEAXListenerMod_h

View File

@ -75,8 +75,8 @@ plProfile_CreateAsynchTimer( "Sound Load Time", "Sound", SoundLoadTime );
plGraphPlate *plSound::fDebugPlate = nil;
plSound *plSound::fCurrDebugPlateSound = nil;
hsBool plSound::fLoadOnDemandFlag = true;
hsBool plSound::fLoadFromDiskOnDemand = true;
bool plSound::fLoadOnDemandFlag = true;
bool plSound::fLoadFromDiskOnDemand = true;
unsigned plSound::fIncidentalsPlaying = 0;
plSound::plSound() :
@ -128,7 +128,7 @@ plSound::~plSound()
plProfile_Dec( SoundNumLoaded );
}
void plSound::IPrintDbgMessage( const char *msg, hsBool isError )
void plSound::IPrintDbgMessage( const char *msg, bool isError )
{
static plStatusLog *ourLog = nil;
@ -468,7 +468,7 @@ void plSound::RefreshVolume( void )
this->ISetActualVolume( fCurrVolume );
}
void plSound::SetMuted( hsBool muted )
void plSound::SetMuted( bool muted )
{
if( muted != fMuted )
{
@ -605,7 +605,7 @@ void plSound::IStartFade( plFadeParams *params, float offsetIntoFade )
}
}
void plSound::IStopFade( hsBool shuttingDown, hsBool SetVolEnd)
void plSound::IStopFade( bool shuttingDown, bool SetVolEnd)
{
if( fCurrFadeParams != nil )
{
@ -643,7 +643,7 @@ void plSound::IStopFade( hsBool shuttingDown, hsBool SetVolEnd)
}
}
hsBool plSound::MsgReceive( plMessage* pMsg )
bool plSound::MsgReceive( plMessage* pMsg )
{
plTimeMsg *time = plTimeMsg::ConvertNoRef( pMsg );
if( time != nil )
@ -839,7 +839,7 @@ void plSound::IUnloadDataBuffer( void )
/////////////////////////////////////////////////////////////////////////
// calling preload will cause the sound to play once loaded
plSoundBuffer::ELoadReturnVal plSound::IPreLoadBuffer( hsBool playWhenLoaded, hsBool isIncidental /* = false */ )
plSoundBuffer::ELoadReturnVal plSound::IPreLoadBuffer( bool playWhenLoaded, bool isIncidental /* = false */ )
{
if(!ILoadDataBuffer())
{
@ -924,7 +924,7 @@ void plSound::ISetSoftOcclusionRegion( plSoftVolume *region )
/////////////////////////////////////////////////////////////////////////
// This function calculates our new softVolume value. Used both to update the
// said value and so the audio system can rank us in importance.
float plSound::CalcSoftVolume( hsBool enable, float distToListenerSquared )
float plSound::CalcSoftVolume( bool enable, float distToListenerSquared )
{
// Do distance-based attenuation ourselves
#if MCN_HACK_OUR_ATTEN
@ -1025,7 +1025,7 @@ float plSound::GetVolumeRank( void )
// Tests to see whether, if we try to play this sound now, it'll actually
// be able to play. Takes into account whether the sound is within range
// of the listener and the current soft region value.
hsBool plSound::IWillBeAbleToPlay( void )
bool plSound::IWillBeAbleToPlay( void )
{
if( fSoftVolume == 0.f )
return false;
@ -1036,7 +1036,7 @@ hsBool plSound::IWillBeAbleToPlay( void )
/////////////////////////////////////////////////////////////////////////
// Tests to see whether this sound is within range of the position given,
// ignoring soft volumes.
hsBool plSound::IsWithinRange( const hsPoint3 &listenerPos, float *distSquared )
bool plSound::IsWithinRange( const hsPoint3 &listenerPos, float *distSquared )
{
if( !IsPropertySet( plSound::kPropIs3DSound ) )
{
@ -1071,7 +1071,7 @@ hsBool plSound::IsWithinRange( const hsPoint3 &listenerPos, float *distSquared )
// Note: if we KNOW we're disabling this sound (out of range), Calc() doesn't
// have to be called at all, and we can simply call this function with
// enable = false.
void plSound::UpdateSoftVolume( hsBool enable, hsBool firstTime )
void plSound::UpdateSoftVolume( bool enable, bool firstTime )
{
fNotHighEnoughPriority = !enable;
@ -1146,7 +1146,7 @@ float plSound::IAttenuateActualVolume( float volume ) const
return volume;
}
void plSound::Activate(hsBool forcePlay)
void plSound::Activate(bool forcePlay)
{
// Our actual state...
fActive = true;
@ -1352,8 +1352,8 @@ void plSound::plFadeParams::Read( hsStream *s )
s->ReadLE( &fVolEnd );
s->ReadLE( &fType );
s->ReadLE( &fCurrTime );
s->ReadLE( &fStopWhenDone );
s->ReadLE( &fFadeSoftVol );
fStopWhenDone = s->ReadBOOL();
fFadeSoftVol = s->ReadBOOL();
}
void plSound::plFadeParams::Write( hsStream *s )
@ -1363,8 +1363,8 @@ void plSound::plFadeParams::Write( hsStream *s )
s->WriteLE( fVolEnd );
s->WriteLE( fType );
s->WriteLE( fCurrTime );
s->WriteLE( fStopWhenDone );
s->WriteLE( fFadeSoftVol );
s->WriteBOOL( fStopWhenDone );
s->WriteBOOL( fFadeSoftVol );
}
float plSound::plFadeParams::InterpValue( void )
@ -1480,7 +1480,7 @@ plDrawableSpans* plSound::CreateProxy(const hsMatrix44& l2w, hsGMaterial* mat, h
// call when state has changed
hsBool plSound::DirtySynchState(const char* sdlName /* kSDLSound */, uint32_t sendFlags)
bool plSound::DirtySynchState(const char* sdlName /* kSDLSound */, uint32_t sendFlags)
{
/*
if( sdlName == nil )

View File

@ -152,9 +152,9 @@ public:
float fLengthInSecs; // Time to take to fade
float fVolStart; // Set one of these two for fade in/out,
float fVolEnd; // the other becomes the current volume
uint8_t fType;
hsBool fStopWhenDone; // Actually stop the sound once the fade is complete
hsBool fFadeSoftVol; // Fade the soft volume instead of fCurrVolume
uint8_t fType;
bool fStopWhenDone; // Actually stop the sound once the fade is complete
bool fFadeSoftVol; // Fade the soft volume instead of fCurrVolume
plFadeParams() { fLengthInSecs = 0.f; fCurrTime = -1.f; fStopWhenDone = false; fFadeSoftVol = false; fVolStart = fVolEnd = 0.f; fType = kLinear; }
@ -174,7 +174,7 @@ public:
float fCurrTime; // -1 if we aren't active, else it's how far we're into the animation
};
virtual hsBool LoadSound( hsBool is3D ) = 0;
virtual bool LoadSound( bool is3D ) = 0;
float GetVirtualStartTime( void ) const { return (float)fVirtualStartTime; }
virtual void Play();
@ -190,14 +190,14 @@ public:
virtual void SetVolume(const float volume);
virtual float GetVolume(void) const { return fCurrVolume; }
float GetMaxVolume() { return fMaxVolume; }
virtual hsBool IsPlaying() { return fPlaying; }
virtual bool IsPlaying() { return fPlaying; }
void SetTime(double t);
virtual double GetTime( void ) { return 0.f; }
virtual void Activate(hsBool forcePlay = false);
virtual void Activate(bool forcePlay = false);
virtual void DeActivate();
virtual void SetLength(double l) { fLength = l; }
virtual void SetMuted( hsBool muted );
virtual hsBool IsMuted( void ) { return fMuted; }
virtual void SetMuted( bool muted );
virtual bool IsMuted( void ) { return fMuted; }
void Disable() { fDistAttenuation = 0; }
virtual plSoundMsg* GetStatus(plSoundMsg* pMsg){return NULL;}
virtual void SetConeOrientation(float x, float y, float z);
@ -216,8 +216,8 @@ public:
const char * GetFileName( void ) const;
virtual double GetLength();
void SetProperty( Property prop, hsBool on ) { if( on ) fProperties |= prop; else fProperties &= ~prop; }
hsBool IsPropertySet( Property prop ) const { return ( fProperties & prop ) ? true : false; }
void SetProperty( Property prop, bool on ) { if( on ) fProperties |= prop; else fProperties &= ~prop; }
bool IsPropertySet( Property prop ) const { return ( fProperties & prop ) ? true : false; }
virtual void RefreshVolume( void );
@ -235,14 +235,14 @@ public:
virtual void SetFadeInEffect( plFadeParams::Type type, float length );
virtual void SetFadeOutEffect( plFadeParams::Type type, float length );
virtual float CalcSoftVolume( hsBool enable, float distToListenerSquared );
virtual void UpdateSoftVolume( hsBool enable, hsBool firstTime = false );
virtual float CalcSoftVolume( bool enable, float distToListenerSquared );
virtual void UpdateSoftVolume( bool enable, bool firstTime = false );
virtual hsBool MsgReceive( plMessage* pMsg );
virtual hsBool DirtySynchState( const char *sdlName = nil, uint32_t sendFlags = 0 ); // call when state has changed
virtual bool MsgReceive( plMessage* pMsg );
virtual bool DirtySynchState( const char *sdlName = nil, uint32_t sendFlags = 0 ); // call when state has changed
// Tests whether this sound is within range of the given position, not counting soft regions
hsBool IsWithinRange( const hsPoint3 &listenerPos, float *distSquared );
bool IsWithinRange( const hsPoint3 &listenerPos, float *distSquared );
// Type setting and getting, from the Types enum
void SetType( uint8_t type ) { fType = type; }
@ -269,8 +269,8 @@ public:
float GetVolumeRank( void );
void ForceUnregisterFromAudioSys( void );
static void SetLoadOnDemand( hsBool activate ) { fLoadOnDemandFlag = activate; }
static void SetLoadFromDiskOnDemand( hsBool activate ) { fLoadFromDiskOnDemand = activate; }
static void SetLoadOnDemand( bool activate ) { fLoadOnDemandFlag = activate; }
static void SetLoadFromDiskOnDemand( bool activate ) { fLoadFromDiskOnDemand = activate; }
const plEAXSourceSettings &GetEAXSettings( void ) const { return fEAXSettings; }
plEAXSourceSettings &GetEAXSettings( void ) { return fEAXSettings; }
@ -279,8 +279,8 @@ public:
protected:
hsBool fPlaying;
hsBool fActive;
bool fPlaying;
bool fActive;
double fTime;
int fMaxFalloff;
int fMinFalloff;
@ -298,15 +298,15 @@ protected:
uint8_t fType;
uint8_t fPriority;
hsBool fMuted, fFading, fRegisteredForTime, fPlayOnReactivate, fFreeData;
hsBool fNotHighEnoughPriority; // Set whenever the audioSys calls UpdateSoftVolume() with enable=false,
bool fMuted, fFading, fRegisteredForTime, fPlayOnReactivate, fFreeData;
bool fNotHighEnoughPriority; // Set whenever the audioSys calls UpdateSoftVolume() with enable=false,
// thus indicating that we slipped off the top 16 most wanted list.
// Do these need to be synched values? They weren't before...
hsVector3 fConeOrientation;
hsPoint3 f3DPosition;
hsVector3 f3DVelocity;
hsBool fPlayWhenLoaded;
bool fPlayWhenLoaded;
double fSynchedStartTimeSec;
@ -315,7 +315,7 @@ protected:
// EAX Settings storage here
plEAXSourceSettings fEAXSettings;
hsBool fQueued;
bool fQueued;
plFadeParams fFadeInParams, fFadeOutParams;
plFadeParams fCoolSoftVolumeTrickParams;
@ -325,45 +325,45 @@ protected:
float fSoftVolume;
float fDistAttenuation, fDistToListenerSquared;
double fVirtualStartTime;
hsBool fRegistered;
bool fRegistered;
static unsigned fIncidentalsPlaying;
plSoftVolume *fSoftOcclusionRegion;
plSoundBuffer *fDataBuffer; // Not always around
hsBool fDataBufferLoaded;
bool fDataBufferLoaded;
plKey fDataBufferKey; // Always around
static plGraphPlate *fDebugPlate;
static plSound *fCurrDebugPlateSound;
static hsBool fLoadOnDemandFlag, fLoadFromDiskOnDemand;
hsBool fLoading;
static bool fLoadOnDemandFlag, fLoadFromDiskOnDemand;
bool fLoading;
void IUpdateDebugPlate( void );
void IPrintDbgMessage( const char *msg, hsBool isErr = false );
void IPrintDbgMessage( const char *msg, bool isErr = false );
virtual void ISetActualVolume(const float v) = 0;
virtual void IActuallyStop( void );
virtual hsBool IActuallyPlaying( void ) = 0;
virtual bool IActuallyPlaying( void ) = 0;
virtual void IActuallyPlay( void ) = 0;
virtual void IFreeBuffers( void ) = 0;
//NOTE: if isIncidental is true the entire sound will be loaded.
virtual plSoundBuffer::ELoadReturnVal IPreLoadBuffer( hsBool playWhenLoaded, hsBool isIncidental = false );
virtual plSoundBuffer::ELoadReturnVal IPreLoadBuffer( bool playWhenLoaded, bool isIncidental = false );
virtual void ISetActualTime( double t ) = 0;
virtual hsBool IActuallyLoaded( void ) = 0;
virtual void IRefreshEAXSettings( hsBool force = false ) = 0;
virtual bool IActuallyLoaded( void ) = 0;
virtual void IRefreshEAXSettings( bool force = false ) = 0;
virtual float IGetChannelVolume( void ) const;
void ISynchToStartTime( void );
void ISynchedPlay( double virtualStartTime );
void IStartFade( plFadeParams *params, float offsetIntoFade = 0.f );
void IStopFade( hsBool shuttingDown = false, hsBool SetVolEnd = true);
void IStopFade( bool shuttingDown = false, bool SetVolEnd = true);
hsBool IWillBeAbleToPlay( void );
bool IWillBeAbleToPlay( void );
void ISetSoftRegion( plSoftVolume *region );
float IAttenuateActualVolume( float volume ) const;

View File

@ -100,7 +100,7 @@ void plSoundEvent::AddCallback( plEventCallbackMsg *msg )
fCallbackEndingFlags.Append( 0 );
}
hsBool plSoundEvent::RemoveCallback( plEventCallbackMsg *msg )
bool plSoundEvent::RemoveCallback( plEventCallbackMsg *msg )
{
int idx = fCallbacks.Find( msg );
if( idx != fCallbacks.kMissingIndex )

View File

@ -74,7 +74,7 @@ public:
~plSoundEvent();
void AddCallback( plEventCallbackMsg *msg );
hsBool RemoveCallback( plEventCallbackMsg *msg );
bool RemoveCallback( plEventCallbackMsg *msg );
uint32_t GetNumCallbacks( void ) const;
int GetType( void ) const;

View File

@ -70,14 +70,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define VOICE_STOP_MS 2000
#define MAX_DATA_SIZE 1024 * 4 // 4 KB
hsBool plVoiceRecorder::fCompress = true;
hsBool plVoiceRecorder::fRecording = true;
hsBool plVoiceRecorder::fNetVoice = false;
bool plVoiceRecorder::fCompress = true;
bool plVoiceRecorder::fRecording = true;
bool plVoiceRecorder::fNetVoice = false;
short plVoiceRecorder::fSampleRate = FREQUENCY;
float plVoiceRecorder::fRecordThreshhold = 200.0f;
hsBool plVoiceRecorder::fShowIcons = true;
hsBool plVoiceRecorder::fMicAlwaysOpen = false;
hsBool plVoicePlayer::fEnabled = true;
bool plVoiceRecorder::fShowIcons = true;
bool plVoiceRecorder::fMicAlwaysOpen = false;
bool plVoicePlayer::fEnabled = true;
plVoiceRecorder::plVoiceRecorder()
{
@ -171,12 +171,12 @@ void plVoiceRecorder::SetComplexity(int c)
plSpeex::GetInstance()->SetComplexity((uint8_t) c);
}
void plVoiceRecorder::SetENH(hsBool b)
void plVoiceRecorder::SetENH(bool b)
{
plSpeex::GetInstance()->SetENH(b);
}
void plVoiceRecorder::SetMikeOpen(hsBool b)
void plVoiceRecorder::SetMikeOpen(bool b)
{
ALCdevice *device = plgAudioSys::GetCaptureDevice();
if (fRecording && device)
@ -198,7 +198,7 @@ void plVoiceRecorder::SetMikeOpen(hsBool b)
}
}
void plVoiceRecorder::DrawDisabledIcon(hsBool b)
void plVoiceRecorder::DrawDisabledIcon(bool b)
{
if (!fDisabledIcon)
{
@ -217,7 +217,7 @@ void plVoiceRecorder::DrawDisabledIcon(hsBool b)
fDisabledIcon->SetVisible(b);
}
void plVoiceRecorder::DrawTalkIcon(hsBool b)
void plVoiceRecorder::DrawTalkIcon(bool b)
{
if (!fTalkIcon)
{
@ -417,7 +417,7 @@ plVoiceSound::~plVoiceSound()
{
}
hsBool plVoiceSound::LoadSound( hsBool is3D )
bool plVoiceSound::LoadSound( bool is3D )
{
if( fFailed )
return false;
@ -538,7 +538,7 @@ plSpeex::~plSpeex()
fBits = nil;
}
hsBool plSpeex::Init(Mode mode)
bool plSpeex::Init(Mode mode)
{
int enh = 1;
@ -571,7 +571,7 @@ hsBool plSpeex::Init(Mode mode)
return true;
}
hsBool plSpeex::Shutdown()
bool plSpeex::Shutdown()
{
//shutdown speex
if(fDecoderState)
@ -596,7 +596,7 @@ hsBool plSpeex::Shutdown()
return true;
}
hsBool plSpeex::Encode(short *data, int numFrames, int *packedLength, hsRAMStream *out)
bool plSpeex::Encode(short *data, int numFrames, int *packedLength, hsRAMStream *out)
{
*packedLength = 0;
@ -634,7 +634,7 @@ hsBool plSpeex::Encode(short *data, int numFrames, int *packedLength, hsRAMStrea
return true;
}
hsBool plSpeex::Decode(uint8_t *data, int size, int numFrames, int *numOutputBytes, short *out)
bool plSpeex::Decode(uint8_t *data, int size, int numFrames, int *numOutputBytes, short *out)
{
if(!fInitialized) return false;
*numOutputBytes = 0;
@ -677,7 +677,7 @@ hsBool plSpeex::Decode(uint8_t *data, int size, int numFrames, int *numOutputByt
}
// Sets variable bit rate on/off
void plSpeex::VBR(hsBool b)
void plSpeex::VBR(bool b)
{
fVBR = b;
speex_encoder_ctl(fEncoderState, SPEEX_SET_VBR, &fVBR);
@ -698,7 +698,7 @@ void plSpeex::SetQuality(uint32_t quality)
speex_encoder_ctl(fEncoderState, SPEEX_SET_QUALITY, &fQuality);
}
void plSpeex::SetENH(hsBool b)
void plSpeex::SetENH(bool b)
{
fENH = b;
speex_decoder_ctl(fDecoderState, SPEEX_SET_ENH, &fENH);

View File

@ -68,7 +68,7 @@ class plVoiceSound : public plWin32Sound
public:
plVoiceSound();
~plVoiceSound();
hsBool LoadSound( hsBool is3D );
bool LoadSound( bool is3D );
void AddVoiceData(void *data, unsigned bytes);
void Update();
void Play();
@ -100,11 +100,11 @@ public:
void SetTalkIcon(int index, uint32_t str){}
void ClearTalkIcon(){}
plVoiceSound *GetSoundPtr() { return &fSound; }
static void Enable(hsBool enable) { fEnabled = enable; }
static void Enable(bool enable) { fEnabled = enable; }
private:
plVoiceSound fSound;
static hsBool fEnabled;
static bool fEnabled;
};
class plVoiceRecorder
@ -114,21 +114,21 @@ public:
~plVoiceRecorder();
void Update(double time);
void SetMikeOpen(hsBool b);
void DrawTalkIcon(hsBool b);
void DrawDisabledIcon(hsBool b);
void SetMikeOpen(bool b);
void DrawTalkIcon(bool b);
void DrawDisabledIcon(bool b);
void SetTalkIcon(int index, uint32_t str);
void ClearTalkIcon();
static hsBool RecordingEnabled() { return fRecording; }
static hsBool NetVoiceEnabled() { return fNetVoice; }
static hsBool CompressionEnabled() { return fCompress; }
static void EnablePushToTalk(hsBool b) { fMicAlwaysOpen = !b; }
static void EnableIcons(hsBool b) { fShowIcons = b; }
static void EnableRecording(hsBool b) { fRecording = b; }
static void EnableNetVoice(hsBool b) { fNetVoice = b; }
static void EnableCompression(hsBool b) { fCompress = b; }
static bool RecordingEnabled() { return fRecording; }
static bool NetVoiceEnabled() { return fNetVoice; }
static bool CompressionEnabled() { return fCompress; }
static void EnablePushToTalk(bool b) { fMicAlwaysOpen = !b; }
static void EnableIcons(bool b) { fShowIcons = b; }
static void EnableRecording(bool b) { fRecording = b; }
static void EnableNetVoice(bool b) { fNetVoice = b; }
static void EnableCompression(bool b) { fCompress = b; }
static void SetSampleRate(short s) { fSampleRate = s; }
static void SetSquelch(float f) { fRecordThreshhold = f; }
@ -139,18 +139,18 @@ public:
static void SetMode(int mode); // sets nb or wb mode
static void SetVBR(bool vbr);
static void SetComplexity(int c);
static void SetENH(hsBool b);
static void SetENH(bool b);
static short GetSampleRate() { return fSampleRate; }
private:
hsBool fMikeOpen;
hsBool fMikeJustClosed;
static hsBool fMicAlwaysOpen;
static hsBool fShowIcons;
static hsBool fCompress;
static hsBool fNetVoice;
static hsBool fRecording;
bool fMikeOpen;
bool fMikeJustClosed;
static bool fMicAlwaysOpen;
static bool fShowIcons;
static bool fCompress;
static bool fNetVoice;
static bool fRecording;
static short fSampleRate;
plPlate* fDisabledIcon;
plPlate* fTalkIcon;
@ -176,37 +176,37 @@ public:
return &instance;
}
hsBool Init(Mode mode);
hsBool Shutdown();
hsBool Encode(short *data, int numFrames, int *packedLength, hsRAMStream *out);
hsBool Decode(uint8_t *data, int size, int numFrames, int *numOutputBytes, short *out);
bool Init(Mode mode);
bool Shutdown();
bool Encode(short *data, int numFrames, int *packedLength, hsRAMStream *out);
bool Decode(uint8_t *data, int size, int numFrames, int *numOutputBytes, short *out);
int GetFrameSize() { return fFrameSize; }
void VBR(hsBool b); // turn variable bit rate on/off
void VBR(bool b); // turn variable bit rate on/off
void SetVBR(uint32_t vbr); // Set variable bit rate quality
void ABR(hsBool b); // turn average bit rate on/off
void ABR(bool b); // turn average bit rate on/off
void SetABR(uint32_t abr); // Set average bit rate quality
void SetQuality(uint32_t quality); // Set encoder quality
hsBool IsUsingVBR() { return fVBR; }
bool IsUsingVBR() { return fVBR; }
int GetQuality() { return fQuality; }
void SetENH(hsBool b);
void SetENH(bool b);
void SetComplexity(uint8_t c);
hsBool Initialized() { return fInitialized; }
bool Initialized() { return fInitialized; }
private:
plSpeex();
SpeexBits* fBits; // main speex structure
hsBool fBitsInit;
bool fBitsInit;
void* fEncoderState;
void* fDecoderState;
int fSampleRate;
int fFrameSize; // frame size from speex - 160 for nb
int fQuality; // 0-10 speex encode quality
hsBool fVBR; // toggle variable bit rate
bool fVBR; // toggle variable bit rate
int fAverageBitrate; // n-bits per second
uint8_t fComplexity; // 1-10 sets cpu resources allowed for encoder
hsBool fENH; // perceptual enhancement
hsBool fInitialized;
bool fENH; // perceptual enhancement
bool fInitialized;
};
#endif //plVoiceChat_h

View File

@ -123,7 +123,7 @@ void plWin32GroupedSound::IWrite( hsStream *s, hsResMgr *mgr )
//// LoadSound ///////////////////////////////////////////////////////////////
hsBool plWin32GroupedSound::LoadSound( hsBool is3D )
bool plWin32GroupedSound::LoadSound( bool is3D )
{
if( fFailed )
return false;
@ -387,7 +387,7 @@ void plWin32GroupedSound::IDerivedActuallyPlay( void )
event->SendCallbacks();
}
hsBool plWin32GroupedSound::MsgReceive( plMessage* pMsg )
bool plWin32GroupedSound::MsgReceive( plMessage* pMsg )
{
plSoundMsg *soundMsg = plSoundMsg::ConvertNoRef( pMsg );
if( soundMsg != nil && soundMsg->Cmd( plSoundMsg::kSelectFromGroup ) )

View File

@ -68,8 +68,8 @@ public:
CLASSNAME_REGISTER( plWin32GroupedSound );
GETINTERFACE_ANY( plWin32GroupedSound, plWin32StaticSound );
virtual hsBool LoadSound( hsBool is3D );
virtual hsBool MsgReceive( plMessage *pMsg );
virtual bool LoadSound( bool is3D );
virtual bool MsgReceive( plMessage *pMsg );
void SetPositionArray( uint16_t numSounds, uint32_t *posArray, float *volumeArray );
float GetSoundLength( int16_t soundIndex );
virtual double GetLength() { return GetSoundLength( fCurrentSound ); }

View File

@ -83,7 +83,7 @@ plWin32Sound::~plWin32Sound()
{
}
void plWin32Sound::Activate( hsBool forcePlay )
void plWin32Sound::Activate( bool forcePlay )
{
if( fFailed )
return;
@ -314,7 +314,7 @@ void plWin32Sound::IRefreshParams( void )
plSound::IRefreshParams();
}
void plWin32Sound::IRefreshEAXSettings( hsBool force )
void plWin32Sound::IRefreshEAXSettings( bool force )
{
if( fDSoundBuffer != nil )
fDSoundBuffer->SetEAXSettings( &GetEAXSettings(), force );
@ -404,7 +404,7 @@ void plWin32Sound::AddCallbacks(plSoundMsg* pSoundMsg)
IAddCallback( pSoundMsg->GetEventCallback( i ) );
}
hsBool plWin32Sound::MsgReceive( plMessage* pMsg )
bool plWin32Sound::MsgReceive( plMessage* pMsg )
{
plEventCallbackMsg *e = plEventCallbackMsg::ConvertNoRef( pMsg );
if( e != nil )

View File

@ -68,14 +68,14 @@ public:
CLASSNAME_REGISTER( plWin32Sound );
GETINTERFACE_ANY( plWin32Sound, plSound );
virtual void Activate(hsBool forcePlay = false);
virtual void Activate(bool forcePlay = false);
virtual void DeActivate();
virtual void AddCallbacks(plSoundMsg* pMsg);
virtual void RemoveCallbacks(plSoundMsg* pMsg);
virtual plSoundMsg* GetStatus(plSoundMsg* pMsg);
virtual hsBool MsgReceive(plMessage* pMsg);
virtual bool MsgReceive(plMessage* pMsg);
virtual void Update();
virtual void SetMin(const int m); // sets minimum falloff distance
@ -100,12 +100,12 @@ protected:
plDSoundBuffer * fDSoundBuffer;
hsBool fFailed;
hsBool fPositionInited, fAwaitingPosition;
hsBool fReallyPlaying;
bool fFailed;
bool fPositionInited, fAwaitingPosition;
bool fReallyPlaying;
uint32_t fTotalBytes;
hsBool fWasPlaying;
bool fWasPlaying;
uint8_t fChannelSelect; // For selecting a mono channel from a stereo file
@ -113,10 +113,10 @@ protected:
virtual void ISetActualVolume(const float v);
virtual void IActuallyStop( void );
virtual hsBool IActuallyPlaying( void ) { return fReallyPlaying; }
virtual bool IActuallyPlaying( void ) { return fReallyPlaying; }
virtual void IActuallyPlay( void );
virtual void IFreeBuffers( void );
virtual hsBool IActuallyLoaded( void ) { return ( fDSoundBuffer != nil ) ? true : false; }
virtual bool IActuallyLoaded( void ) { return ( fDSoundBuffer != nil ) ? true : false; }
// Override to make sure the buffer is available before the base class is called
virtual void IRefreshParams( void );
@ -130,7 +130,7 @@ protected:
virtual void IRead( hsStream *s, hsResMgr *mgr );
virtual void IWrite( hsStream *s, hsResMgr *mgr );
virtual void IRefreshEAXSettings( hsBool force = false );
virtual void IRefreshEAXSettings( bool force = false );
};
#endif //plWin32Sound_h

View File

@ -72,7 +72,7 @@ plWin32StaticSound::~plWin32StaticSound()
IUnloadDataBuffer();
}
void plWin32StaticSound::Activate( hsBool forcePlay )
void plWin32StaticSound::Activate( bool forcePlay )
{
plWin32Sound::Activate( forcePlay );
}
@ -82,7 +82,7 @@ void plWin32StaticSound::DeActivate()
plWin32Sound::DeActivate();
}
hsBool plWin32StaticSound::LoadSound( hsBool is3D )
bool plWin32StaticSound::LoadSound( bool is3D )
{
if (fFailed)
return false;
@ -143,7 +143,7 @@ hsBool plWin32StaticSound::LoadSound( hsBool is3D )
header.fNumChannels = 1;
}
hsBool tryStatic = true;
bool tryStatic = true;
// If we want FX, we can't use a static voice, but EAX doesn't fit under that limitation :)
if( 0 )
tryStatic = false;
@ -250,7 +250,7 @@ void plWin32StaticSound::ISetActualTime(double t)
}
}
hsBool plWin32StaticSound::MsgReceive( plMessage* pMsg )
bool plWin32StaticSound::MsgReceive( plMessage* pMsg )
{
return plWin32Sound::MsgReceive( pMsg );
}
@ -295,7 +295,7 @@ void plWin32LinkSound::Write(hsStream* s, hsResMgr* mgr)
plWin32StaticSound::Write(s, mgr);
}
hsBool plWin32LinkSound::MsgReceive( plMessage* pMsg )
bool plWin32LinkSound::MsgReceive( plMessage* pMsg )
{
plLinkEffectBCMsg *msg = plLinkEffectBCMsg::ConvertNoRef( pMsg );
if( msg != nil && !msg->HasLinkFlag(plLinkEffectBCMsg::kMute))

View File

@ -59,15 +59,15 @@ public:
CLASSNAME_REGISTER( plWin32StaticSound );
GETINTERFACE_ANY( plWin32StaticSound, plWin32Sound );
virtual void Activate( hsBool forcePlay = false );
virtual void Activate( bool forcePlay = false );
virtual void DeActivate();
virtual hsBool LoadSound( hsBool is3D );
virtual bool LoadSound( bool is3D );
virtual void Update();
virtual hsBool MsgReceive(plMessage* pMsg);
virtual bool MsgReceive(plMessage* pMsg);
virtual void SetStartPos(unsigned bytes){}
protected:
hsBool fRegisteredOnThread;
bool fRegisteredOnThread;
virtual void IDerivedActuallyPlay( void );
virtual void ISetActualTime( double t );
@ -90,7 +90,7 @@ public:
virtual void Read(hsStream* s, hsResMgr* mgr);
virtual void Write(hsStream* s, hsResMgr* mgr);
virtual hsBool MsgReceive(plMessage* pMsg);
virtual bool MsgReceive(plMessage* pMsg);
};
#endif //plWin32StaticSound_h

View File

@ -113,11 +113,11 @@ void plWin32StreamingSound::SetFilename(const char *filename, bool isCompressed)
//////////////////////////////////////////////////////////////
// Override, 'cause we don't want to actually LOAD the sound for streaming,
// just make sure it's decompressed and such and ready to stream.
plSoundBuffer::ELoadReturnVal plWin32StreamingSound::IPreLoadBuffer( hsBool playWhenLoaded, hsBool isIncidental /* = false */ )
plSoundBuffer::ELoadReturnVal plWin32StreamingSound::IPreLoadBuffer( bool playWhenLoaded, bool isIncidental /* = false */ )
{
if(fPlayWhenStopped)
return plSoundBuffer::kPending;
hsBool sfxPath = fNewFilename.size() ? false : true;
bool sfxPath = fNewFilename.size() ? false : true;
if( fDataStream != nil && fNewFilename.size() == 0)
return plSoundBuffer::kSuccess; // Already loaded
@ -240,7 +240,7 @@ void plWin32StreamingSound::IFreeBuffers( void )
// first half of our buffer. We'll fill the rest of the buffer as we get
// notifications for such.
hsBool plWin32StreamingSound::LoadSound( hsBool is3D )
bool plWin32StreamingSound::LoadSound( bool is3D )
{
if( fFailed )
return false;
@ -494,7 +494,7 @@ void plWin32StreamingSound::ISetActualTime( double t )
// fStartTimeSec = t;
}
hsBool plWin32StreamingSound::MsgReceive( plMessage* pMsg )
bool plWin32StreamingSound::MsgReceive( plMessage* pMsg )
{
return plWin32Sound::MsgReceive( pMsg );
}

View File

@ -60,14 +60,14 @@ public:
GETINTERFACE_ANY( plWin32StreamingSound, plWin32Sound );
virtual void DeActivate();
virtual hsBool LoadSound( hsBool is3D );
virtual bool LoadSound( bool is3D );
virtual float GetActualTimeSec();
virtual unsigned GetByteOffset();
virtual StreamType GetStreamType() const { return fStreamType; }
virtual void SetFilename(const char *filename, bool isCompressed);
virtual void Update(); // temp
void StreamUpdate();
virtual hsBool MsgReceive( plMessage *pMsg );
virtual bool MsgReceive( plMessage *pMsg );
protected:
float fTimeAtBufferStart;
@ -80,7 +80,7 @@ protected:
bool fIsCompressed; // this applies only to the new sound file specified in fNewFilename, so we can play both ogg's and wav's
std::string fNewFilename; // allow the filename to be changed so we can play from a different source.
// ultimately this filename will be given to fDataBuffer, but since it's not always around we'll store it here
hsBool fStopping;
bool fStopping;
double fLastStreamingUpdate;
bool fPlayWhenStopped;
@ -98,7 +98,7 @@ protected:
virtual void IFreeBuffers( void );
void IStreamUpdate();
virtual plSoundBuffer::ELoadReturnVal IPreLoadBuffer( hsBool playWhenLoaded, hsBool isIncidental = false );
virtual plSoundBuffer::ELoadReturnVal IPreLoadBuffer( bool playWhenLoaded, bool isIncidental = false );
};
#endif //plWin32StreamingSound_h

View File

@ -72,11 +72,11 @@ DWORD sVolControlID = 0;
//// Local Static Helpers ////////////////////////////////////////////////////
hsBool IGetMuxMicVolumeControl( void );
hsBool IGetBaseMicVolumeControl( void );
bool IGetMuxMicVolumeControl( void );
bool IGetBaseMicVolumeControl( void );
hsBool IGetControlValue( DWORD &value );
hsBool ISetControlValue( DWORD value );
bool IGetControlValue( DWORD &value );
bool ISetControlValue( DWORD value );
MIXERLINE *IGetLineByType( DWORD type );
MIXERLINE *IGetLineByID( DWORD id );
@ -114,7 +114,7 @@ void plWinMicLevel::SetLevel( float level )
#endif
}
hsBool plWinMicLevel::CanSetLevel( void )
bool plWinMicLevel::CanSetLevel( void )
{
// Just to init
plWinMicLevel &instance = IGetInstance();
@ -196,7 +196,7 @@ void plWinMicLevel::IShutdown( void )
// Note: testing indcates that this works but the direct SRC_MICROPHONE
// doesn't, hence we try this one first.
hsBool IGetMuxMicVolumeControl( void )
bool IGetMuxMicVolumeControl( void )
{
if( sMixerHandle == nil )
return false;
@ -238,7 +238,7 @@ hsBool IGetMuxMicVolumeControl( void )
// Tries to get the volume control of the mic-in line. See
// IGetMuxMicVolumeControl for why we don't do this one first.
hsBool IGetBaseMicVolumeControl( void )
bool IGetBaseMicVolumeControl( void )
{
if( sMixerHandle == nil )
return false;
@ -267,7 +267,7 @@ hsBool IGetBaseMicVolumeControl( void )
//// IGetControlValue ////////////////////////////////////////////////////////
// Gets the raw value of the current volume control.
hsBool IGetControlValue( DWORD &value )
bool IGetControlValue( DWORD &value )
{
if( sMixerHandle == nil )
return false;
@ -292,7 +292,7 @@ hsBool IGetControlValue( DWORD &value )
//// ISetControlValue ////////////////////////////////////////////////////////
// Sets the raw value of the current volume control.
hsBool ISetControlValue( DWORD value )
bool ISetControlValue( DWORD value )
{
if( sMixerHandle == nil )
return false;

View File

@ -69,7 +69,7 @@ public:
static void SetLevel( float level );
// Returns whether we can set the level
static hsBool CanSetLevel( void );
static bool CanSetLevel( void );
protected:
plWinMicLevel(); // Protected constructor for IGetInstance. Just to init some stuff