mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 14:37:41 +00:00
Convert custom HeadSpin integer types to standard types from stdint.h
This commit is contained in:
@ -162,8 +162,8 @@ class plSoftSoundNode
|
||||
|
||||
// plAudioSystem //////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Int32 plAudioSystem::fMaxNumSounds = 16;
|
||||
Int32 plAudioSystem::fNumSoundsSlop = 8;
|
||||
int32_t plAudioSystem::fMaxNumSounds = 16;
|
||||
int32_t plAudioSystem::fNumSoundsSlop = 8;
|
||||
|
||||
plAudioSystem::plAudioSystem() :
|
||||
fStartTime(0),
|
||||
@ -512,7 +512,7 @@ void plAudioSystem::SetDistanceModel(int i)
|
||||
// Set the number of active sounds the audio system is allowed to play, based on the priority cutoff
|
||||
void plAudioSystem::SetMaxNumberOfActiveSounds()
|
||||
{
|
||||
UInt16 priorityCutoff = plgAudioSys::GetPriorityCutoff();
|
||||
uint16_t priorityCutoff = plgAudioSys::GetPriorityCutoff();
|
||||
int maxNumSounds = 24;
|
||||
|
||||
// Keep this to a reasonable amount based on the users hardware, since we want the sounds to be played in hardware
|
||||
@ -634,7 +634,7 @@ void plAudioSystem::IUpdateSoftSounds( const hsPoint3 &newPosition )
|
||||
plSoftSoundNode *node, *myNode;
|
||||
hsScalar distSquared, rank;
|
||||
plSoftSoundNode *sortedList = nil;
|
||||
Int32 i;
|
||||
int32_t i;
|
||||
|
||||
plProfile_BeginTiming(SoundSoftUpdate);
|
||||
|
||||
@ -779,7 +779,7 @@ void plAudioSystem::IUpdateSoftSounds( const hsPoint3 &newPosition )
|
||||
/// Notify sound that it really is still enabled
|
||||
sound->UpdateSoftVolume( true );
|
||||
|
||||
UInt32 color = plStatusLog::kGreen;
|
||||
uint32_t color = plStatusLog::kGreen;
|
||||
switch (sound->GetStreamType())
|
||||
{
|
||||
case plSound::kStreamFromDisk: color = plStatusLog::kYellow; break;
|
||||
@ -998,10 +998,10 @@ hsBool plgAudioSys::fEnableEAX = false;
|
||||
hsWindowHndl plgAudioSys::fWnd = nil;
|
||||
hsScalar plgAudioSys::fChannelVolumes[ kNumChannels ] = { 1.f, 1.f, 1.f, 1.f, 1.f, 1.f };
|
||||
hsScalar plgAudioSys::f2D3DBias = 0.75f;
|
||||
UInt32 plgAudioSys::fDebugFlags = 0;
|
||||
uint32_t plgAudioSys::fDebugFlags = 0;
|
||||
hsScalar plgAudioSys::fStreamingBufferSize = 2.f;
|
||||
hsScalar plgAudioSys::fStreamFromRAMCutoff = 10.f;
|
||||
UInt8 plgAudioSys::fPriorityCutoff = 9; // We cut off sounds above this priority
|
||||
uint8_t plgAudioSys::fPriorityCutoff = 9; // We cut off sounds above this priority
|
||||
hsBool plgAudioSys::fEnableExtendedLogs = false;
|
||||
hsScalar plgAudioSys::fGlobalFadeVolume = 1.f;
|
||||
hsBool plgAudioSys::fLogStreamingUpdates = false;
|
||||
|
@ -128,13 +128,13 @@ protected:
|
||||
plSoftSoundNode *fActiveSofts;
|
||||
plStatusLog *fDebugActiveSoundDisplay;
|
||||
|
||||
static Int32 fMaxNumSounds, fNumSoundsSlop; // max number of sounds the engine is allowed to audibly play. Different than fMaxNumSources. That is the max number of sounds the audio card can play
|
||||
static int32_t fMaxNumSounds, fNumSoundsSlop; // max number of sounds the engine is allowed to audibly play. Different than fMaxNumSources. That is the max number of sounds the audio card can play
|
||||
plSoftSoundNode *fCurrDebugSound;
|
||||
hsTArray<plKey> fPendingRegisters;
|
||||
|
||||
hsPoint3 fCurrListenerPos;//, fCommittedListenerPos;
|
||||
hsBool fActive, fUsingEAX, fRestartOnDestruct, fWaitingForShutdown;
|
||||
Int64 fStartTime;
|
||||
int64_t fStartTime;
|
||||
|
||||
hsTArray<hsKeyedObject *> fMyRefs;
|
||||
hsTArray<plEAXListenerMod *> fEAXRegions;
|
||||
@ -154,7 +154,7 @@ protected:
|
||||
void RegisterSoftSound( const plKey soundKey );
|
||||
void UnregisterSoftSound( const plKey soundKey );
|
||||
void IUpdateSoftSounds( const hsPoint3 &newPosition );
|
||||
UInt32 IScaleVolume(float volume);
|
||||
uint32_t IScaleVolume(float volume);
|
||||
void IEnumerateDevices();
|
||||
|
||||
public:
|
||||
@ -214,15 +214,15 @@ public:
|
||||
static void SetGlobalFadeVolume( hsScalar vol );
|
||||
static hsScalar GetGlobalFadeVolume( void ) { return fGlobalFadeVolume; }
|
||||
|
||||
static void SetDebugFlag( UInt32 flag, hsBool set = true ) { if( set ) fDebugFlags |= flag; else fDebugFlags &= ~flag; }
|
||||
static hsBool IsDebugFlagSet( UInt32 flag ) { return fDebugFlags & flag; }
|
||||
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 ClearDebugFlags( void ) { fDebugFlags = 0; }
|
||||
|
||||
static hsScalar GetStreamingBufferSize( void ) { return fStreamingBufferSize; }
|
||||
static void SetStreamingBufferSize( hsScalar size ) { fStreamingBufferSize = size; }
|
||||
|
||||
static UInt8 GetPriorityCutoff( void ) { return fPriorityCutoff; }
|
||||
static void SetPriorityCutoff( UInt8 cut ) { fPriorityCutoff = cut; if(fSys) fSys->SetMaxNumberOfActiveSounds(); }
|
||||
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; }
|
||||
@ -263,10 +263,10 @@ private:
|
||||
static hsBool fDelayedActivate;
|
||||
static hsScalar fChannelVolumes[ kNumChannels ];
|
||||
static hsScalar fGlobalFadeVolume;
|
||||
static UInt32 fDebugFlags;
|
||||
static uint32_t fDebugFlags;
|
||||
static hsBool fEnableEAX;
|
||||
static hsScalar fStreamingBufferSize;
|
||||
static UInt8 fPriorityCutoff;
|
||||
static uint8_t fPriorityCutoff;
|
||||
static hsBool fEnableExtendedLogs;
|
||||
static hsScalar fStreamFromRAMCutoff;
|
||||
static hsScalar f2D3DBias;
|
||||
|
@ -62,14 +62,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include "plStatusLog/plStatusLog.h"
|
||||
|
||||
UInt32 plDSoundBuffer::fNumBuffers = 0;
|
||||
uint32_t plDSoundBuffer::fNumBuffers = 0;
|
||||
plProfile_CreateCounterNoReset( "Playing", "Sound", SoundPlaying );
|
||||
plProfile_CreateCounterNoReset( "Allocated", "Sound", NumAllocated );
|
||||
|
||||
|
||||
//// Constructor/Destructor //////////////////////////////////////////////////
|
||||
|
||||
plDSoundBuffer::plDSoundBuffer( UInt32 size, plWAVHeader &bufferDesc, hsBool enable3D, hsBool isLooping, hsBool tryStatic, bool streaming )
|
||||
plDSoundBuffer::plDSoundBuffer( uint32_t size, plWAVHeader &bufferDesc, hsBool enable3D, hsBool isLooping, hsBool tryStatic, bool streaming )
|
||||
{
|
||||
fLooping = isLooping;
|
||||
fValid = false;
|
||||
@ -100,7 +100,7 @@ plDSoundBuffer::~plDSoundBuffer()
|
||||
|
||||
//// IAllocate ///////////////////////////////////////////////////////////////
|
||||
|
||||
void plDSoundBuffer::IAllocate( UInt32 size, plWAVHeader &bufferDesc, hsBool enable3D, hsBool tryStatic )
|
||||
void plDSoundBuffer::IAllocate( uint32_t size, plWAVHeader &bufferDesc, hsBool enable3D, hsBool tryStatic )
|
||||
{
|
||||
// Create a DSound buffer description
|
||||
fBufferDesc = TRACKED_NEW plWAVHeader;
|
||||
@ -699,28 +699,28 @@ hsBool plDSoundBuffer::IsEAXAccelerated( void ) const
|
||||
return fEAXSource.IsValid();
|
||||
}
|
||||
|
||||
//// BytePosToMSecs //////////////////////////////////////////////////////////
|
||||
//// bytePosToMSecs //////////////////////////////////////////////////////////
|
||||
|
||||
UInt32 plDSoundBuffer::BytePosToMSecs( UInt32 bytePos ) const
|
||||
uint32_t plDSoundBuffer::bytePosToMSecs( uint32_t bytePos ) const
|
||||
{
|
||||
return (UInt32)(bytePos * 1000 / (hsScalar)fBufferDesc->fAvgBytesPerSec);
|
||||
return (uint32_t)(bytePos * 1000 / (hsScalar)fBufferDesc->fAvgBytesPerSec);
|
||||
}
|
||||
|
||||
//// GetBufferBytePos ////////////////////////////////////////////////////////
|
||||
|
||||
UInt32 plDSoundBuffer::GetBufferBytePos( hsScalar timeInSecs ) const
|
||||
uint32_t plDSoundBuffer::GetBufferBytePos( hsScalar timeInSecs ) const
|
||||
{
|
||||
hsAssert( fBufferDesc != nil, "Nil buffer description when calling GetBufferBytePos()" );
|
||||
|
||||
UInt32 byte = (UInt32)( timeInSecs * (hsScalar)fBufferDesc->fNumSamplesPerSec );
|
||||
byte *= fBufferDesc->fBlockAlign;
|
||||
uint32_t uint8_t = (uint32_t)( timeInSecs * (hsScalar)fBufferDesc->fNumSamplesPerSec );
|
||||
uint8_t *= fBufferDesc->fBlockAlign;
|
||||
|
||||
return byte;
|
||||
return uint8_t;
|
||||
}
|
||||
|
||||
//// GetLengthInBytes ////////////////////////////////////////////////////////
|
||||
|
||||
UInt32 plDSoundBuffer::GetLengthInBytes( void ) const
|
||||
uint32_t plDSoundBuffer::GetLengthInBytes( void ) const
|
||||
{
|
||||
return fBufferSize;
|
||||
}
|
||||
@ -734,7 +734,7 @@ void plDSoundBuffer::SetEAXSettings( plEAXSourceSettings *settings, hsBool f
|
||||
|
||||
//// GetBlockAlign ///////////////////////////////////////////////////////////
|
||||
|
||||
UInt8 plDSoundBuffer::GetBlockAlign( void ) const
|
||||
uint8_t plDSoundBuffer::GetBlockAlign( void ) const
|
||||
{
|
||||
return ( fBufferDesc != nil ) ? fBufferDesc->fBlockAlign : 0;
|
||||
}
|
||||
|
@ -68,14 +68,14 @@ class plAudioFileReader;
|
||||
class plDSoundBuffer
|
||||
{
|
||||
public:
|
||||
plDSoundBuffer( UInt32 size, plWAVHeader &bufferDesc, hsBool enable3D, hsBool looping, hsBool tryStatic = false, bool streaming = false );
|
||||
plDSoundBuffer( uint32_t size, plWAVHeader &bufferDesc, hsBool enable3D, hsBool looping, hsBool tryStatic = false, bool streaming = false );
|
||||
~plDSoundBuffer();
|
||||
|
||||
void Play( void );
|
||||
void Stop( void );
|
||||
void Rewind() ;
|
||||
|
||||
UInt32 GetLengthInBytes( void ) const;
|
||||
uint32_t GetLengthInBytes( void ) const;
|
||||
void SetScalarVolume( hsScalar volume ); // Sets the volume, but on a range from 0 to 1
|
||||
|
||||
unsigned GetSource() { return source; }
|
||||
@ -109,13 +109,13 @@ public:
|
||||
|
||||
|
||||
unsigned GetByteOffset();
|
||||
UInt32 GetBufferBytePos( hsScalar timeInSecs ) const;
|
||||
UInt32 BytePosToMSecs( UInt32 bytePos ) const;
|
||||
uint32_t GetBufferBytePos( hsScalar timeInSecs ) const;
|
||||
uint32_t bytePosToMSecs( uint32_t bytePos ) const;
|
||||
|
||||
void SetEAXSettings( plEAXSourceSettings *settings, hsBool force = false );
|
||||
void SetTimeOffsetBytes(unsigned bytes);
|
||||
UInt8 GetBlockAlign( void ) const;
|
||||
static UInt32 GetNumBuffers() { return fNumBuffers; }
|
||||
uint8_t GetBlockAlign( void ) const;
|
||||
static uint32_t GetNumBuffers() { return fNumBuffers; }
|
||||
float GetDefaultMinDistance() { return fDefaultMinDistance; }
|
||||
bool GetAvailableBufferId(unsigned *bufferId);
|
||||
unsigned GetNumQueuedBuffers(){ return fNumQueuedBuffers;} // returns the max number of buffers queued on a source
|
||||
@ -135,13 +135,13 @@ protected:
|
||||
|
||||
BufferType fType;
|
||||
hsBool fValid, fLooping;
|
||||
UInt32 fLockLength;
|
||||
uint32_t fLockLength;
|
||||
void * fLockPtr;
|
||||
|
||||
hsTArray<UInt32> fPosNotifys;
|
||||
hsTArray<uint32_t> fPosNotifys;
|
||||
bool fStreaming;
|
||||
plWAVHeader* fBufferDesc;
|
||||
UInt32 fBufferSize;
|
||||
uint32_t fBufferSize;
|
||||
|
||||
unsigned buffer; // used if this is not a streaming buffer
|
||||
unsigned streamingBuffers[STREAMING_BUFFERS]; // used if this is a streaming buffer
|
||||
@ -152,13 +152,13 @@ protected:
|
||||
|
||||
plEAXSource fEAXSource;
|
||||
|
||||
static UInt32 fNumBuffers;
|
||||
static uint32_t fNumBuffers;
|
||||
static float fDefaultMinDistance;
|
||||
|
||||
unsigned fNumQueuedBuffers;
|
||||
hsScalar fPrevVolume;
|
||||
|
||||
void IAllocate( UInt32 size, plWAVHeader &bufferDesc, hsBool enable3D, hsBool tryStatic );
|
||||
void IAllocate( uint32_t size, plWAVHeader &bufferDesc, hsBool enable3D, hsBool tryStatic );
|
||||
void IRelease( void );
|
||||
int IGetALFormat(unsigned bitsPerSample, unsigned int numChannels);
|
||||
};
|
||||
|
@ -512,7 +512,7 @@ void plEAXSourceSettings::Write( hsStream *s )
|
||||
}
|
||||
}
|
||||
|
||||
void plEAXSourceSettings::SetRoomParams( Int16 room, Int16 roomHF, hsBool roomAuto, hsBool roomHFAuto )
|
||||
void plEAXSourceSettings::SetRoomParams( int16_t room, int16_t roomHF, hsBool roomAuto, hsBool roomHFAuto )
|
||||
{
|
||||
fRoom = room;
|
||||
fRoomHF = roomHF;
|
||||
@ -551,7 +551,7 @@ void plEAXSourceSettings::Enable( hsBool e )
|
||||
}
|
||||
}
|
||||
|
||||
void plEAXSourceSettings::SetOutsideVolHF( Int16 vol )
|
||||
void plEAXSourceSettings::SetOutsideVolHF( int16_t vol )
|
||||
{
|
||||
fOutsideVolHF = vol;
|
||||
fDirtyParams |= kOutsideVolHF;
|
||||
@ -576,7 +576,7 @@ void plEAXSourceSettings::SetOcclusionSoftValue( hsScalar value )
|
||||
}
|
||||
}
|
||||
|
||||
void plEAXSourceSettings::IRecalcSofts( UInt8 whichOnes )
|
||||
void plEAXSourceSettings::IRecalcSofts( uint8_t whichOnes )
|
||||
{
|
||||
hsScalar percent, invPercent;
|
||||
|
||||
@ -585,7 +585,7 @@ void plEAXSourceSettings::IRecalcSofts( UInt8 whichOnes )
|
||||
percent = fOcclusionSoftValue;
|
||||
invPercent = 1.f - percent;
|
||||
|
||||
Int16 occ = (Int16)( ( (float)fSoftStarts.GetOcclusion() * invPercent ) + ( (float)fSoftEnds.GetOcclusion() * percent ) );
|
||||
int16_t occ = (int16_t)( ( (float)fSoftStarts.GetOcclusion() * invPercent ) + ( (float)fSoftEnds.GetOcclusion() * percent ) );
|
||||
hsScalar lfRatio = (hsScalar)( ( fSoftStarts.GetOcclusionLFRatio() * invPercent ) + ( fSoftEnds.GetOcclusionLFRatio() * percent ) );
|
||||
hsScalar roomRatio = (hsScalar)( ( fSoftStarts.GetOcclusionRoomRatio() * invPercent ) + ( fSoftEnds.GetOcclusionRoomRatio() * percent ) );
|
||||
hsScalar directRatio = (hsScalar)( ( fSoftStarts.GetOcclusionDirectRatio() * invPercent ) + ( fSoftEnds.GetOcclusionDirectRatio() * percent ) );
|
||||
@ -623,7 +623,7 @@ void plEAXSourceSoftSettings::Write( hsStream *s )
|
||||
s->WriteLE( fOcclusionDirectRatio );
|
||||
}
|
||||
|
||||
void plEAXSourceSoftSettings::SetOcclusion( Int16 occ, hsScalar lfRatio, hsScalar roomRatio, hsScalar directRatio )
|
||||
void plEAXSourceSoftSettings::SetOcclusion( int16_t occ, hsScalar lfRatio, hsScalar roomRatio, hsScalar directRatio )
|
||||
{
|
||||
fOcclusion = occ;
|
||||
fOcclusionLFRatio = lfRatio;
|
||||
@ -668,7 +668,7 @@ hsBool plEAXSource::IsValid( void ) const
|
||||
|
||||
void plEAXSource::SetFrom( plEAXSourceSettings *settings, unsigned source, hsBool force )
|
||||
{
|
||||
UInt32 dirtyParams;
|
||||
uint32_t dirtyParams;
|
||||
if(source == 0 || !fInit)
|
||||
return;
|
||||
|
||||
|
@ -95,7 +95,7 @@ protected:
|
||||
hsBool fInited;
|
||||
|
||||
// Cache info
|
||||
Int32 fLastModCount;
|
||||
int32_t fLastModCount;
|
||||
hsBool fLastWasEmpty;
|
||||
hsScalar fLastSingleStrength;
|
||||
plEAXListenerMod *fLastBigRegion;
|
||||
@ -110,14 +110,14 @@ class hsStream;
|
||||
class plEAXSourceSoftSettings
|
||||
{
|
||||
public:
|
||||
Int16 fOcclusion;
|
||||
int16_t fOcclusion;
|
||||
hsScalar fOcclusionLFRatio, fOcclusionRoomRatio, fOcclusionDirectRatio;
|
||||
|
||||
void Read( hsStream *s );
|
||||
void Write( hsStream *s );
|
||||
|
||||
void SetOcclusion( Int16 occ, hsScalar lfRatio, hsScalar roomRatio, hsScalar directRatio );
|
||||
Int16 GetOcclusion( void ) const { return fOcclusion; }
|
||||
void SetOcclusion( int16_t occ, hsScalar lfRatio, hsScalar roomRatio, hsScalar directRatio );
|
||||
int16_t GetOcclusion( void ) const { return fOcclusion; }
|
||||
hsScalar GetOcclusionLFRatio( void ) const { return fOcclusionLFRatio; }
|
||||
hsScalar GetOcclusionRoomRatio( void ) const { return fOcclusionRoomRatio; }
|
||||
hsScalar GetOcclusionDirectRatio( void ) const { return fOcclusionDirectRatio; }
|
||||
@ -141,14 +141,14 @@ class plEAXSourceSettings
|
||||
void Enable( hsBool e );
|
||||
hsBool IsEnabled( void ) const { return fEnabled; }
|
||||
|
||||
void SetRoomParams( Int16 room, Int16 roomHF, hsBool roomAuto, hsBool roomHFAuto );
|
||||
Int16 GetRoom( void ) const { return fRoom; }
|
||||
Int16 GetRoomHF( void ) const { return fRoomHF; }
|
||||
void SetRoomParams( int16_t room, int16_t roomHF, hsBool roomAuto, hsBool 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; }
|
||||
|
||||
void SetOutsideVolHF( Int16 vol );
|
||||
Int16 GetOutsideVolHF( void ) const { return fOutsideVolHF; }
|
||||
void SetOutsideVolHF( int16_t vol );
|
||||
int16_t GetOutsideVolHF( void ) const { return fOutsideVolHF; }
|
||||
|
||||
void SetFactors( hsScalar airAbsorption, hsScalar roomRolloff, hsScalar doppler, hsScalar rolloff );
|
||||
hsScalar GetAirAbsorptionFactor( void ) const { return fAirAbsorptionFactor; }
|
||||
@ -171,13 +171,13 @@ class plEAXSourceSettings
|
||||
friend class plEAXSourceSoftSettings;
|
||||
|
||||
hsBool fEnabled;
|
||||
Int16 fRoom, fRoomHF;
|
||||
int16_t fRoom, fRoomHF;
|
||||
hsBool fRoomAuto, fRoomHFAuto;
|
||||
Int16 fOutsideVolHF;
|
||||
int16_t fOutsideVolHF;
|
||||
hsScalar fAirAbsorptionFactor, fRoomRolloffFactor, fDopplerFactor, fRolloffFactor;
|
||||
plEAXSourceSoftSettings fSoftStarts, fSoftEnds, fCurrSoftValues;
|
||||
hsScalar fOcclusionSoftValue;
|
||||
mutable UInt32 fDirtyParams;
|
||||
mutable uint32_t fDirtyParams;
|
||||
|
||||
enum ParamSets
|
||||
{
|
||||
@ -188,7 +188,7 @@ class plEAXSourceSettings
|
||||
kAll = 0xff
|
||||
};
|
||||
|
||||
void IRecalcSofts( UInt8 whichOnes );
|
||||
void IRecalcSofts( uint8_t whichOnes );
|
||||
};
|
||||
|
||||
//// Source Class Definition //////////////////////////////////////////////////
|
||||
|
@ -120,7 +120,7 @@ void plEAXListenerMod::IUnRegister( void )
|
||||
fRegistered = false;
|
||||
}
|
||||
|
||||
hsBool plEAXListenerMod::IEval( double secs, hsScalar del, UInt32 dirty )
|
||||
hsBool plEAXListenerMod::IEval( double secs, hsScalar del, uint32_t dirty )
|
||||
{
|
||||
IRegister();
|
||||
return false;
|
||||
@ -237,7 +237,7 @@ void plEAXListenerMod::Write( hsStream* s, hsResMgr* mgr )
|
||||
}
|
||||
|
||||
|
||||
void plEAXListenerMod::SetFromPreset( UInt32 preset )
|
||||
void plEAXListenerMod::SetFromPreset( uint32_t preset )
|
||||
{
|
||||
#ifdef EAX_SDK_AVAILABLE
|
||||
memcpy( fListenerProps, &REVERB_ORIGINAL_PRESETS[ preset ], sizeof( EAXREVERBPROPERTIES ) );
|
||||
|
@ -78,7 +78,7 @@ public:
|
||||
float GetStrength( void );
|
||||
|
||||
EAXREVERBPROPERTIES * GetListenerProps( void ) { return fListenerProps; }
|
||||
void SetFromPreset( UInt32 preset );
|
||||
void SetFromPreset( uint32_t preset );
|
||||
|
||||
protected:
|
||||
plSoftVolume *fSoftRegion;
|
||||
@ -87,7 +87,7 @@ protected:
|
||||
|
||||
void IRegister( void );
|
||||
void IUnRegister( void );
|
||||
virtual hsBool IEval( double secs, hsScalar del, UInt32 dirty ); // called only by owner object's Eval()
|
||||
virtual hsBool IEval( double secs, hsScalar del, uint32_t dirty ); // called only by owner object's Eval()
|
||||
};
|
||||
|
||||
#endif // _plEAXListenerMod_h
|
||||
|
@ -168,10 +168,10 @@ void plSound::IUpdateDebugPlate( void )
|
||||
}
|
||||
|
||||
fDebugPlate->SetVisible( true );
|
||||
fDebugPlate->AddData( (Int32)( fDesiredVol * 100.f ),
|
||||
(Int32)( fCurrVolume * 100.f ),
|
||||
(Int32)( fSoftVolume * 100.f ),
|
||||
(Int32)( fDistAttenuation * 100.f ) );
|
||||
fDebugPlate->AddData( (int32_t)( fDesiredVol * 100.f ),
|
||||
(int32_t)( fCurrVolume * 100.f ),
|
||||
(int32_t)( fSoftVolume * 100.f ),
|
||||
(int32_t)( fDistAttenuation * 100.f ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -1416,7 +1416,7 @@ void plSound::SetFadeOutEffect( plSound::plFadeParams::Type type, hsScalar lengt
|
||||
fFadeOutParams.fStopWhenDone = true;
|
||||
}
|
||||
|
||||
plDrawableSpans* plSound::CreateProxy(const hsMatrix44& l2w, hsGMaterial* mat, hsTArray<UInt32>& idx, plDrawableSpans* addTo)
|
||||
plDrawableSpans* plSound::CreateProxy(const hsMatrix44& l2w, hsGMaterial* mat, hsTArray<uint32_t>& idx, plDrawableSpans* addTo)
|
||||
{
|
||||
plDrawableSpans* myDraw = addTo;
|
||||
|
||||
@ -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 sendFlags)
|
||||
hsBool plSound::DirtySynchState(const char* sdlName /* kSDLSound */, uint32_t sendFlags)
|
||||
{
|
||||
/*
|
||||
if( sdlName == nil )
|
||||
|
@ -152,7 +152,7 @@ public:
|
||||
hsScalar fLengthInSecs; // Time to take to fade
|
||||
hsScalar fVolStart; // Set one of these two for fade in/out,
|
||||
hsScalar fVolEnd; // the other becomes the current volume
|
||||
UInt8 fType;
|
||||
uint8_t fType;
|
||||
hsBool fStopWhenDone; // Actually stop the sound once the fade is complete
|
||||
hsBool fFadeSoftVol; // Fade the soft volume instead of fCurrVolume
|
||||
|
||||
@ -228,7 +228,7 @@ public:
|
||||
virtual void AddCallbacks(plSoundMsg* pMsg) = 0;
|
||||
virtual void RemoveCallbacks(plSoundMsg* pMsg) = 0;
|
||||
|
||||
virtual UInt8 GetChannelSelect( void ) const { return 0; } // Only defined on Win32Sound right now, should be here tho
|
||||
virtual uint8_t GetChannelSelect( void ) const { return 0; } // Only defined on Win32Sound right now, should be here tho
|
||||
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr);
|
||||
@ -239,21 +239,21 @@ public:
|
||||
virtual void UpdateSoftVolume( hsBool enable, hsBool firstTime = false );
|
||||
|
||||
virtual hsBool MsgReceive( plMessage* pMsg );
|
||||
virtual hsBool DirtySynchState( const char *sdlName = nil, UInt32 sendFlags = 0 ); // call when state has changed
|
||||
virtual hsBool 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, hsScalar *distSquared );
|
||||
|
||||
// Type setting and getting, from the Types enum
|
||||
void SetType( UInt8 type ) { fType = type; }
|
||||
UInt8 GetType( void ) const { return fType; }
|
||||
void SetType( uint8_t type ) { fType = type; }
|
||||
uint8_t GetType( void ) const { return fType; }
|
||||
|
||||
// Priority stuff
|
||||
void SetPriority( UInt8 pri ) { fPriority = pri; }
|
||||
UInt8 GetPriority( void ) const { return fPriority; }
|
||||
void SetPriority( uint8_t pri ) { fPriority = pri; }
|
||||
uint8_t GetPriority( void ) const { return fPriority; }
|
||||
|
||||
// Visualization
|
||||
virtual plDrawableSpans* CreateProxy(const hsMatrix44& l2w, hsGMaterial* mat, hsTArray<UInt32>& idx, plDrawableSpans* addTo);
|
||||
virtual plDrawableSpans* CreateProxy(const hsMatrix44& l2w, hsGMaterial* mat, hsTArray<uint32_t>& idx, plDrawableSpans* addTo);
|
||||
|
||||
// Forced loading/unloading (for when the audio system's LOD just doesn't cut it)
|
||||
virtual void ForceLoad( );
|
||||
@ -295,8 +295,8 @@ protected:
|
||||
double fLength;
|
||||
|
||||
int fProperties;
|
||||
UInt8 fType;
|
||||
UInt8 fPriority;
|
||||
uint8_t fType;
|
||||
uint8_t fPriority;
|
||||
|
||||
hsBool fMuted, fFading, fRegisteredForTime, fPlayOnReactivate, fFreeData;
|
||||
hsBool fNotHighEnoughPriority; // Set whenever the audioSys calls UpdateSoftVolume() with enable=false,
|
||||
@ -395,7 +395,7 @@ class plSoundVolumeApplicator : public plAGApplicator
|
||||
{
|
||||
public:
|
||||
plSoundVolumeApplicator() { }
|
||||
plSoundVolumeApplicator( UInt32 index ) { fIndex = index; }
|
||||
plSoundVolumeApplicator( uint32_t index ) { fIndex = index; }
|
||||
|
||||
CLASSNAME_REGISTER( plSoundVolumeApplicator );
|
||||
GETINTERFACE_ANY( plSoundVolumeApplicator, plAGApplicator );
|
||||
@ -405,7 +405,7 @@ public:
|
||||
virtual void Read( hsStream *s, hsResMgr *mgr );
|
||||
|
||||
protected:
|
||||
UInt32 fIndex;
|
||||
uint32_t fIndex;
|
||||
virtual void IApply( const plAGModifier *mod, double time );
|
||||
};
|
||||
|
||||
|
@ -66,7 +66,7 @@ plSoundEvent::plSoundEvent( Types type, plSound *owner )
|
||||
fCallbackEndingFlags.Reset();
|
||||
}
|
||||
|
||||
plSoundEvent::plSoundEvent( Types type, UInt32 bytePos, plSound *owner )
|
||||
plSoundEvent::plSoundEvent( Types type, uint32_t bytePos, plSound *owner )
|
||||
{
|
||||
fType = type;
|
||||
fBytePosTime = bytePos;
|
||||
@ -165,7 +165,7 @@ void plSoundEvent::SendCallbacks( void )
|
||||
}
|
||||
}
|
||||
|
||||
UInt32 plSoundEvent::GetNumCallbacks( void ) const
|
||||
uint32_t plSoundEvent::GetNumCallbacks( void ) const
|
||||
{
|
||||
return fCallbacks.GetCount();
|
||||
}
|
||||
@ -180,7 +180,7 @@ void plSoundEvent::SetType( Types type )
|
||||
fType = type;
|
||||
}
|
||||
|
||||
UInt32 plSoundEvent::GetTime( void ) const
|
||||
uint32_t plSoundEvent::GetTime( void ) const
|
||||
{
|
||||
return fBytePosTime;
|
||||
}
|
||||
|
@ -69,17 +69,17 @@ public:
|
||||
};
|
||||
|
||||
plSoundEvent( Types type, plSound *owner );
|
||||
plSoundEvent( Types type, UInt32 bytePos, plSound *owner );
|
||||
plSoundEvent( Types type, uint32_t bytePos, plSound *owner );
|
||||
plSoundEvent();
|
||||
~plSoundEvent();
|
||||
|
||||
void AddCallback( plEventCallbackMsg *msg );
|
||||
hsBool RemoveCallback( plEventCallbackMsg *msg );
|
||||
|
||||
UInt32 GetNumCallbacks( void ) const;
|
||||
uint32_t GetNumCallbacks( void ) const;
|
||||
int GetType( void ) const;
|
||||
void SetType( Types type );
|
||||
UInt32 GetTime( void ) const;
|
||||
uint32_t GetTime( void ) const;
|
||||
|
||||
void SendCallbacks( void );
|
||||
|
||||
@ -88,11 +88,11 @@ public:
|
||||
protected:
|
||||
|
||||
Types fType;
|
||||
UInt32 fBytePosTime;
|
||||
uint32_t fBytePosTime;
|
||||
plSound *fOwner;
|
||||
|
||||
hsTArray<plEventCallbackMsg *> fCallbacks;
|
||||
hsTArray<UInt8> fCallbackEndingFlags;
|
||||
hsTArray<uint8_t> fCallbackEndingFlags;
|
||||
};
|
||||
|
||||
|
||||
|
@ -170,7 +170,7 @@ void plVoiceRecorder::SetComplexity(int c)
|
||||
plgDispatch::MsgSend( cMsg );
|
||||
return;
|
||||
}
|
||||
plSpeex::GetInstance()->SetComplexity((UInt8) c);
|
||||
plSpeex::GetInstance()->SetComplexity((uint8_t) c);
|
||||
}
|
||||
|
||||
void plVoiceRecorder::SetENH(hsBool b)
|
||||
@ -286,10 +286,10 @@ void plVoiceRecorder::Update(double time)
|
||||
}
|
||||
else // use the speex voice compression lib
|
||||
{
|
||||
UInt8 *packet = TRACKED_NEW UInt8[totalSamples]; // packet to send encoded data in
|
||||
uint8_t *packet = TRACKED_NEW uint8_t[totalSamples]; // packet to send encoded data in
|
||||
int packedLength = 0; // the size of the packet that will be sent
|
||||
hsRAMStream ram; // ram stream to hold output data from speex
|
||||
UInt8 numFrames = totalSamples / EncoderFrameSize; // number of frames to be encoded
|
||||
uint8_t numFrames = totalSamples / EncoderFrameSize; // number of frames to be encoded
|
||||
|
||||
// encode the data using speex
|
||||
plSpeex::GetInstance()->Encode(buffer, numFrames, &packedLength, &ram);
|
||||
@ -355,14 +355,14 @@ void plVoicePlayer::PlaybackVoiceMessage(void* data, unsigned size, int numFrame
|
||||
memset(nBuff, 0, bufferSize);
|
||||
|
||||
// Decode the encoded voice data using speex
|
||||
if(!plSpeex::GetInstance()->Decode((UInt8 *)data, size, numFramesInBuffer, &numBytes, nBuff))
|
||||
if(!plSpeex::GetInstance()->Decode((uint8_t *)data, size, numFramesInBuffer, &numBytes, nBuff))
|
||||
{
|
||||
delete[] nBuff;
|
||||
return;
|
||||
}
|
||||
|
||||
UInt8* newBuff;
|
||||
newBuff = (UInt8*)nBuff; // Convert to byte data
|
||||
uint8_t* newBuff;
|
||||
newBuff = (uint8_t*)nBuff; // Convert to uint8_t data
|
||||
PlaybackUncompressedVoiceMessage(newBuff, numBytes); // playback uncompressed data
|
||||
delete[] nBuff;
|
||||
}
|
||||
@ -605,8 +605,8 @@ hsBool plSpeex::Encode(short *data, int numFrames, int *packedLength, hsRAMStrea
|
||||
|
||||
short *pData = data; // pointer to input data
|
||||
float *input = TRACKED_NEW float[fFrameSize]; // input to speex - used as am intermediate array since speex requires float data
|
||||
UInt8 frameLength; // number of bytes speex compressed frame to
|
||||
UInt8 *frameData = TRACKED_NEW UInt8[fFrameSize]; // holds one frame of encoded data
|
||||
uint8_t frameLength; // number of bytes speex compressed frame to
|
||||
uint8_t *frameData = TRACKED_NEW uint8_t[fFrameSize]; // holds one frame of encoded data
|
||||
|
||||
// encode data
|
||||
for( int i = 0; i < numFrames; i++ )
|
||||
@ -637,7 +637,7 @@ hsBool plSpeex::Encode(short *data, int numFrames, int *packedLength, hsRAMStrea
|
||||
return true;
|
||||
}
|
||||
|
||||
hsBool plSpeex::Decode(UInt8 *data, int size, int numFrames, int *numOutputBytes, short *out)
|
||||
hsBool plSpeex::Decode(uint8_t *data, int size, int numFrames, int *numOutputBytes, short *out)
|
||||
{
|
||||
if(!fInitialized) return false;
|
||||
*numOutputBytes = 0;
|
||||
@ -647,8 +647,8 @@ hsBool plSpeex::Decode(UInt8 *data, int size, int numFrames, int *numOutputBytes
|
||||
short *pOut = out; // pointer to output short buffer
|
||||
|
||||
// create buffer for input data
|
||||
UInt8 *frameData = TRACKED_NEW UInt8[fFrameSize]; // holds the current frames data to be decoded
|
||||
UInt8 frameLen; // holds the length of the current frame being decoded.
|
||||
uint8_t *frameData = TRACKED_NEW uint8_t[fFrameSize]; // holds the current frames data to be decoded
|
||||
uint8_t frameLen; // holds the length of the current frame being decoded.
|
||||
|
||||
|
||||
// Decode data
|
||||
@ -688,14 +688,14 @@ void plSpeex::VBR(hsBool b)
|
||||
|
||||
|
||||
// Sets the average bit rate
|
||||
void plSpeex::SetABR(UInt32 abr)
|
||||
void plSpeex::SetABR(uint32_t abr)
|
||||
{
|
||||
fAverageBitrate = abr;
|
||||
speex_encoder_ctl(fEncoderState, SPEEX_SET_ABR, &fAverageBitrate);
|
||||
}
|
||||
|
||||
// Sets the quality of encoding
|
||||
void plSpeex::SetQuality(UInt32 quality)
|
||||
void plSpeex::SetQuality(uint32_t quality)
|
||||
{
|
||||
fQuality = quality;
|
||||
speex_encoder_ctl(fEncoderState, SPEEX_SET_QUALITY, &fQuality);
|
||||
@ -707,7 +707,7 @@ void plSpeex::SetENH(hsBool b)
|
||||
speex_decoder_ctl(fDecoderState, SPEEX_SET_ENH, &fENH);
|
||||
}
|
||||
|
||||
void plSpeex::SetComplexity(UInt8 c)
|
||||
void plSpeex::SetComplexity(uint8_t c)
|
||||
{
|
||||
fComplexity = c;
|
||||
speex_encoder_ctl(fEncoderState, SPEEX_SET_COMPLEXITY, &fComplexity);
|
||||
|
@ -97,7 +97,7 @@ public:
|
||||
void SetPosition(const hsPoint3 pos);
|
||||
void SetOrientation(const hsPoint3 pos);
|
||||
|
||||
void SetTalkIcon(int index, UInt32 str){}
|
||||
void SetTalkIcon(int index, uint32_t str){}
|
||||
void ClearTalkIcon(){}
|
||||
plVoiceSound *GetSoundPtr() { return &fSound; }
|
||||
static void Enable(hsBool enable) { fEnabled = enable; }
|
||||
@ -118,7 +118,7 @@ public:
|
||||
void DrawTalkIcon(hsBool b);
|
||||
void DrawDisabledIcon(hsBool b);
|
||||
|
||||
void SetTalkIcon(int index, UInt32 str);
|
||||
void SetTalkIcon(int index, uint32_t str);
|
||||
void ClearTalkIcon();
|
||||
|
||||
static hsBool RecordingEnabled() { return fRecording; }
|
||||
@ -179,17 +179,17 @@ public:
|
||||
hsBool Init(Mode mode);
|
||||
hsBool Shutdown();
|
||||
hsBool Encode(short *data, int numFrames, int *packedLength, hsRAMStream *out);
|
||||
hsBool Decode(UInt8 *data, int size, int numFrames, int *numOutputBytes, short *out);
|
||||
hsBool 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 SetVBR(UInt32 vbr); // Set variable bit rate quality
|
||||
void SetVBR(uint32_t vbr); // Set variable bit rate quality
|
||||
void ABR(hsBool b); // turn average bit rate on/off
|
||||
void SetABR(UInt32 abr); // Set average bit rate quality
|
||||
void SetQuality(UInt32 quality); // Set encoder quality
|
||||
void SetABR(uint32_t abr); // Set average bit rate quality
|
||||
void SetQuality(uint32_t quality); // Set encoder quality
|
||||
hsBool IsUsingVBR() { return fVBR; }
|
||||
int GetQuality() { return fQuality; }
|
||||
void SetENH(hsBool b);
|
||||
void SetComplexity(UInt8 c);
|
||||
void SetComplexity(uint8_t c);
|
||||
|
||||
hsBool Initialized() { return fInitialized; }
|
||||
|
||||
@ -204,7 +204,7 @@ private:
|
||||
int fQuality; // 0-10 speex encode quality
|
||||
hsBool fVBR; // toggle variable bit rate
|
||||
int fAverageBitrate; // n-bits per second
|
||||
UInt8 fComplexity; // 1-10 sets cpu resources allowed for encoder
|
||||
uint8_t fComplexity; // 1-10 sets cpu resources allowed for encoder
|
||||
hsBool fENH; // perceptual enhancement
|
||||
hsBool fInitialized;
|
||||
};
|
||||
|
@ -79,9 +79,9 @@ plWin32GroupedSound::~plWin32GroupedSound()
|
||||
DeActivate();
|
||||
}
|
||||
|
||||
void plWin32GroupedSound::SetPositionArray( UInt16 numSounds, UInt32 *posArray, hsScalar *volumeArray )
|
||||
void plWin32GroupedSound::SetPositionArray( uint16_t numSounds, uint32_t *posArray, hsScalar *volumeArray )
|
||||
{
|
||||
UInt16 i;
|
||||
uint16_t i;
|
||||
|
||||
|
||||
fStartPositions.SetCountAndZero( numSounds );
|
||||
@ -98,7 +98,7 @@ void plWin32GroupedSound::SetPositionArray( UInt16 numSounds, UInt32 *posArra
|
||||
void plWin32GroupedSound::IRead( hsStream *s, hsResMgr *mgr )
|
||||
{
|
||||
plWin32StaticSound::IRead( s, mgr );
|
||||
UInt16 i, n = s->ReadLE16();
|
||||
uint16_t i, n = s->ReadLE16();
|
||||
fStartPositions.SetCountAndZero( n );
|
||||
fVolumes.SetCountAndZero( n );
|
||||
for( i = 0; i < n; i++ )
|
||||
@ -113,7 +113,7 @@ void plWin32GroupedSound::IWrite( hsStream *s, hsResMgr *mgr )
|
||||
plWin32StaticSound::IWrite( s, mgr );
|
||||
|
||||
s->WriteLE16( fStartPositions.GetCount() );
|
||||
UInt16 i;
|
||||
uint16_t i;
|
||||
for( i = 0; i < fStartPositions.GetCount(); i++ )
|
||||
{
|
||||
s->WriteLE32( fStartPositions[ i ] );
|
||||
@ -182,8 +182,8 @@ hsBool plWin32GroupedSound::LoadSound( hsBool is3D )
|
||||
|
||||
// Calculate the maximum size for our buffer. This will be the length of the longest sound we're going to
|
||||
// have to play.
|
||||
UInt16 i;
|
||||
UInt32 maxSoundSize, len;
|
||||
uint16_t i;
|
||||
uint32_t maxSoundSize, len;
|
||||
for( i = 1, maxSoundSize = 0; i < fStartPositions.GetCount(); i++ )
|
||||
{
|
||||
len = fStartPositions[ i ] - fStartPositions[ i - 1 ];
|
||||
@ -195,7 +195,7 @@ hsBool plWin32GroupedSound::LoadSound( hsBool is3D )
|
||||
maxSoundSize = len;
|
||||
|
||||
// Based on that, allocate our buffer
|
||||
UInt32 bufferSize = maxSoundSize - ( maxSoundSize % header.fBlockAlign );
|
||||
uint32_t bufferSize = maxSoundSize - ( maxSoundSize % header.fBlockAlign );
|
||||
|
||||
if( header.fNumChannels > 1 && is3D )
|
||||
{
|
||||
@ -205,8 +205,8 @@ hsBool plWin32GroupedSound::LoadSound( hsBool is3D )
|
||||
header.fAvgBytesPerSec /= header.fNumChannels;
|
||||
header.fNumChannels = 1;
|
||||
}
|
||||
fNumDestChannels = (UInt8)(header.fNumChannels);
|
||||
fNumDestBytesPerSample = (UInt8)(header.fBlockAlign);
|
||||
fNumDestChannels = (uint8_t)(header.fNumChannels);
|
||||
fNumDestBytesPerSample = (uint8_t)(header.fBlockAlign);
|
||||
|
||||
// Create our DSound buffer (or rather, the wrapper around it)
|
||||
fDSoundBuffer = TRACKED_NEW plDSoundBuffer( bufferSize, header, is3D, IsPropertySet( kPropLooping ), true );
|
||||
@ -260,21 +260,21 @@ hsBool plWin32GroupedSound::LoadSound( hsBool is3D )
|
||||
//// GetSoundLength //////////////////////////////////////////////////////////
|
||||
// Gets the length (in seconds) of the given sound index from the group.
|
||||
|
||||
hsScalar plWin32GroupedSound::GetSoundLength( Int16 soundIndex )
|
||||
hsScalar plWin32GroupedSound::GetSoundLength( int16_t soundIndex )
|
||||
{
|
||||
plSoundBuffer *buffer = (plSoundBuffer *)fDataBufferKey->ObjectIsLoaded();
|
||||
if(buffer)
|
||||
{
|
||||
return (hsScalar)IGetSoundByteLength( soundIndex ) / buffer->GetHeader().fAvgBytesPerSec;
|
||||
return (hsScalar)IGetSoundbyteLength( soundIndex ) / buffer->GetHeader().fAvgBytesPerSec;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//// IGetSoundByteLength /////////////////////////////////////////////////////
|
||||
// Byte version of above.
|
||||
//// IGetSoundbyteLength /////////////////////////////////////////////////////
|
||||
// uint8_t version of above.
|
||||
|
||||
UInt32 plWin32GroupedSound::IGetSoundByteLength( Int16 soundIndex )
|
||||
uint32_t plWin32GroupedSound::IGetSoundbyteLength( int16_t soundIndex )
|
||||
{
|
||||
|
||||
if( soundIndex == fStartPositions.GetCount() - 1 )
|
||||
@ -288,10 +288,10 @@ UInt32 plWin32GroupedSound::IGetSoundByteLength( Int16 soundIndex )
|
||||
|
||||
void *plWin32GroupedSound::IGetDataPointer( void ) const
|
||||
{
|
||||
return ( fDataBufferKey->ObjectIsLoaded() ) ? (void *)( (UInt8 *)((plSoundBuffer *)fDataBufferKey->ObjectIsLoaded())->GetData() + fStartPositions[ fCurrentSound ] ) : nil;
|
||||
return ( fDataBufferKey->ObjectIsLoaded() ) ? (void *)( (uint8_t *)((plSoundBuffer *)fDataBufferKey->ObjectIsLoaded())->GetData() + fStartPositions[ fCurrentSound ] ) : nil;
|
||||
}
|
||||
|
||||
UInt32 plWin32GroupedSound::IGetDataLength( void ) const
|
||||
uint32_t plWin32GroupedSound::IGetDataLength( void ) const
|
||||
{
|
||||
return ( fDataBufferKey->ObjectIsLoaded() ) ? fCurrentSoundLength : 0;
|
||||
}
|
||||
@ -300,10 +300,10 @@ UInt32 plWin32GroupedSound::IGetDataLength( void ) const
|
||||
// Fills the DSoundBuffer with data from the current sound from our sound
|
||||
// group, optionally switching what our current sound is.
|
||||
|
||||
void plWin32GroupedSound::IFillCurrentSound( Int16 newCurrent /*= -1*/ )
|
||||
void plWin32GroupedSound::IFillCurrentSound( int16_t newCurrent /*= -1*/ )
|
||||
{
|
||||
//void *dataPtr;
|
||||
//UInt32 dataLength;
|
||||
//uint32_t dataLength;
|
||||
|
||||
if( !fDSoundBuffer && plgAudioSys::Active() )
|
||||
LoadSound( IsPropertySet( kPropIs3DSound ) );
|
||||
@ -315,7 +315,7 @@ void plWin32GroupedSound::IFillCurrentSound( Int16 newCurrent /*= -1*/ )
|
||||
|
||||
if( newCurrent != -1 )
|
||||
{
|
||||
fCurrentSound = (UInt16)newCurrent;
|
||||
fCurrentSound = (uint16_t)newCurrent;
|
||||
|
||||
if( fCurrentSound >= fStartPositions.GetCount() )
|
||||
{
|
||||
@ -326,7 +326,7 @@ void plWin32GroupedSound::IFillCurrentSound( Int16 newCurrent /*= -1*/ )
|
||||
}
|
||||
|
||||
// Set our length based on the current sound
|
||||
fCurrentSoundLength = IGetSoundByteLength( fCurrentSound );
|
||||
fCurrentSoundLength = IGetSoundbyteLength( fCurrentSound );
|
||||
if( fDataBufferKey->ObjectIsLoaded() )
|
||||
SetLength( fCurrentSoundLength / ((plSoundBuffer *)fDataBufferKey->ObjectIsLoaded())->GetHeader().fAvgBytesPerSec );
|
||||
|
||||
@ -343,8 +343,8 @@ void plWin32GroupedSound::IFillCurrentSound( Int16 newCurrent /*= -1*/ )
|
||||
//if( fDataBuffer->GetHeader().fNumChannels == fNumDestChannels )
|
||||
{
|
||||
// Just copy
|
||||
//memcpy( dataPtr, (Byte *)fDataBuffer->GetData() + fStartPositions[ fCurrentSound ], fCurrentSoundLength );
|
||||
//dataPtr = (Byte *)dataPtr + fCurrentSoundLength;
|
||||
//memcpy( dataPtr, (uint8_t *)fDataBuffer->GetData() + fStartPositions[ fCurrentSound ], fCurrentSoundLength );
|
||||
//dataPtr = (uint8_t *)dataPtr + fCurrentSoundLength;
|
||||
//dataLength -= fCurrentSoundLength;
|
||||
}
|
||||
//else
|
||||
@ -353,12 +353,12 @@ void plWin32GroupedSound::IFillCurrentSound( Int16 newCurrent /*= -1*/ )
|
||||
|
||||
/*plProfile_BeginTiming( StaticSwizzleTime );
|
||||
|
||||
plSoundDeswizzler deswiz( (Byte *)fDataBuffer->GetData() + fStartPositions[ fCurrentSound ], fCurrentSoundLength,
|
||||
(UInt8)(fDataBuffer->GetHeader().fNumChannels), fNumDestBytesPerSample );
|
||||
plSoundDeswizzler deswiz( (uint8_t *)fDataBuffer->GetData() + fStartPositions[ fCurrentSound ], fCurrentSoundLength,
|
||||
(uint8_t)(fDataBuffer->GetHeader().fNumChannels), fNumDestBytesPerSample );
|
||||
|
||||
deswiz.Extract( fChannelSelect, dataPtr );
|
||||
|
||||
dataPtr = (Byte *)dataPtr + fCurrentSoundLength / fDataBuffer->GetHeader().fNumChannels;
|
||||
dataPtr = (uint8_t *)dataPtr + fCurrentSoundLength / fDataBuffer->GetHeader().fNumChannels;
|
||||
dataLength -= fCurrentSoundLength / fDataBuffer->GetHeader().fNumChannels;
|
||||
|
||||
plProfile_EndTiming( StaticSwizzleTime );*/
|
||||
|
@ -70,30 +70,30 @@ public:
|
||||
|
||||
virtual hsBool LoadSound( hsBool is3D );
|
||||
virtual hsBool MsgReceive( plMessage *pMsg );
|
||||
void SetPositionArray( UInt16 numSounds, UInt32 *posArray, hsScalar *volumeArray );
|
||||
hsScalar GetSoundLength( Int16 soundIndex );
|
||||
void SetPositionArray( uint16_t numSounds, uint32_t *posArray, hsScalar *volumeArray );
|
||||
hsScalar GetSoundLength( int16_t soundIndex );
|
||||
virtual double GetLength() { return GetSoundLength( fCurrentSound ); }
|
||||
|
||||
protected:
|
||||
UInt16 fCurrentSound;
|
||||
UInt32 fCurrentSoundLength;
|
||||
hsTArray<UInt32> fStartPositions; // In bytes
|
||||
uint16_t fCurrentSound;
|
||||
uint32_t fCurrentSoundLength;
|
||||
hsTArray<uint32_t> fStartPositions; // In bytes
|
||||
hsTArray<hsScalar> fVolumes;
|
||||
|
||||
// Some extra handy info for us
|
||||
UInt8 fNumDestChannels, fNumDestBytesPerSample;
|
||||
uint8_t fNumDestChannels, fNumDestBytesPerSample;
|
||||
|
||||
virtual void IDerivedActuallyPlay( void );
|
||||
|
||||
virtual void IRead( hsStream *s, hsResMgr *mgr );
|
||||
virtual void IWrite( hsStream *s, hsResMgr *mgr );
|
||||
|
||||
UInt32 IGetSoundByteLength( Int16 soundIndex );
|
||||
void IFillCurrentSound( Int16 newCurrent = -1 );
|
||||
uint32_t IGetSoundbyteLength( int16_t soundIndex );
|
||||
void IFillCurrentSound( int16_t newCurrent = -1 );
|
||||
|
||||
// Abstracting a few things here for the incidentalMgr
|
||||
virtual void * IGetDataPointer( void ) const;
|
||||
virtual UInt32 IGetDataLength( void ) const;
|
||||
virtual uint32_t IGetDataLength( void ) const;
|
||||
};
|
||||
|
||||
#endif //plWin32GroupedSound_h
|
||||
|
@ -134,7 +134,7 @@ void plWin32Sound::IActuallyPlay( void )
|
||||
{
|
||||
// If we can't load (for ex., if audio is off), then we act like we played and then stopped
|
||||
// really fast. Thus, we need to send *all* of our callbacks off immediately and then Stop().
|
||||
UInt32 i;
|
||||
uint32_t i;
|
||||
for( i = 0; i < fSoundEvents.GetCount(); i++ )
|
||||
{
|
||||
fSoundEvents[ i ]->SendCallbacks();
|
||||
@ -290,7 +290,7 @@ void plWin32Sound::ISetActualVolume(const float volume)
|
||||
fAwaitingPosition = true;
|
||||
}
|
||||
}
|
||||
IUpdateDebugPlate(); // Byte me.
|
||||
IUpdateDebugPlate(); // uint8_t me.
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
@ -327,7 +327,7 @@ void plWin32Sound::IAddCallback( plEventCallbackMsg *pMsg )
|
||||
|
||||
if( type == plSoundEvent::kTime )
|
||||
{
|
||||
UInt32 byteTime = ( fDSoundBuffer != nil ) ? fDSoundBuffer->GetBufferBytePos( pMsg->fEventTime ) : 0;
|
||||
uint32_t byteTime = ( fDSoundBuffer != nil ) ? fDSoundBuffer->GetBufferBytePos( pMsg->fEventTime ) : 0;
|
||||
|
||||
event = IFindEvent( type, byteTime );
|
||||
|
||||
@ -378,7 +378,7 @@ void plWin32Sound::IRemoveCallback( plEventCallbackMsg *pMsg )
|
||||
}
|
||||
}
|
||||
|
||||
plSoundEvent *plWin32Sound::IFindEvent( plSoundEvent::Types type, UInt32 bytePos )
|
||||
plSoundEvent *plWin32Sound::IFindEvent( plSoundEvent::Types type, uint32_t bytePos )
|
||||
{
|
||||
for(int i = 0; i < fSoundEvents.GetCount(); ++i )
|
||||
{
|
||||
|
@ -93,8 +93,8 @@ public:
|
||||
};
|
||||
|
||||
// Selects a channel source from a multi-channel (stereo) file. Ignored if source is mono
|
||||
void SetChannelSelect( ChannelSelect source ) { fChannelSelect = (UInt8)source; }
|
||||
virtual UInt8 GetChannelSelect( void ) const { return fChannelSelect; }
|
||||
void SetChannelSelect( ChannelSelect source ) { fChannelSelect = (uint8_t)source; }
|
||||
virtual uint8_t GetChannelSelect( void ) const { return fChannelSelect; }
|
||||
|
||||
protected:
|
||||
|
||||
@ -103,11 +103,11 @@ protected:
|
||||
hsBool fFailed;
|
||||
hsBool fPositionInited, fAwaitingPosition;
|
||||
hsBool fReallyPlaying;
|
||||
UInt32 fTotalBytes;
|
||||
uint32_t fTotalBytes;
|
||||
|
||||
hsBool fWasPlaying;
|
||||
|
||||
UInt8 fChannelSelect; // For selecting a mono channel from a stereo file
|
||||
uint8_t fChannelSelect; // For selecting a mono channel from a stereo file
|
||||
|
||||
hsTArray<plSoundEvent *> fSoundEvents;
|
||||
|
||||
@ -125,7 +125,7 @@ protected:
|
||||
|
||||
virtual void IAddCallback( plEventCallbackMsg *pMsg );
|
||||
virtual void IRemoveCallback( plEventCallbackMsg *pMsg );
|
||||
plSoundEvent *IFindEvent( plSoundEvent::Types type, UInt32 bytePos = 0 );
|
||||
plSoundEvent *IFindEvent( plSoundEvent::Types type, uint32_t bytePos = 0 );
|
||||
|
||||
virtual void IRead( hsStream *s, hsResMgr *mgr );
|
||||
virtual void IWrite( hsStream *s, hsResMgr *mgr );
|
||||
|
@ -133,7 +133,7 @@ hsBool plWin32StaticSound::LoadSound( hsBool is3D )
|
||||
fFailed = true;
|
||||
return false;
|
||||
}
|
||||
UInt32 bufferSize = buffer->GetDataLength();
|
||||
uint32_t bufferSize = buffer->GetDataLength();
|
||||
|
||||
if( header.fNumChannels > 1 && is3D )
|
||||
{
|
||||
|
@ -273,7 +273,7 @@ hsBool plWin32StreamingSound::LoadSound( hsBool is3D )
|
||||
SetProperty( kPropIs3DSound, is3D );
|
||||
|
||||
plWAVHeader header = fDataStream->GetHeader();
|
||||
UInt32 bufferSize = (UInt32)(fBufferLengthInSecs * header.fAvgBytesPerSec);
|
||||
uint32_t bufferSize = (uint32_t)(fBufferLengthInSecs * header.fAvgBytesPerSec);
|
||||
|
||||
// Debug flag #2
|
||||
if( is3D && fChannelSelect == 0 && header.fNumChannels > 1 && plgAudioSys::IsDebugFlagSet( plgAudioSys::kDisableLeftSelect ) )
|
||||
@ -310,7 +310,7 @@ hsBool plWin32StreamingSound::LoadSound( hsBool is3D )
|
||||
return false;
|
||||
}
|
||||
|
||||
fTotalBytes = (UInt32)bufferSize;
|
||||
fTotalBytes = (uint32_t)bufferSize;
|
||||
plProfile_NewMem(MemSounds, fTotalBytes);
|
||||
|
||||
plSoundBuffer *buffer = (plSoundBuffer *)fDataBufferKey->ObjectIsLoaded();
|
||||
@ -369,8 +369,8 @@ hsBool plWin32StreamingSound::LoadSound( hsBool is3D )
|
||||
// Set up our deswizzler, if necessary
|
||||
delete fDeswizzler;
|
||||
if( fDataStream->GetHeader().fNumChannels != header.fNumChannels )
|
||||
fDeswizzler = TRACKED_NEW plSoundDeswizzler( (UInt32)(fBufferLengthInSecs * fDataStream->GetHeader().fAvgBytesPerSec),
|
||||
(UInt8)(fDataStream->GetHeader().fNumChannels),
|
||||
fDeswizzler = TRACKED_NEW plSoundDeswizzler( (uint32_t)(fBufferLengthInSecs * fDataStream->GetHeader().fAvgBytesPerSec),
|
||||
(uint8_t)(fDataStream->GetHeader().fNumChannels),
|
||||
header.fBitsPerSample / 8 );
|
||||
else
|
||||
fDeswizzler = nil;
|
||||
@ -475,7 +475,7 @@ unsigned plWin32StreamingSound::GetByteOffset()
|
||||
float plWin32StreamingSound::GetActualTimeSec()
|
||||
{
|
||||
if(fDataStream && fDSoundBuffer)
|
||||
return fDSoundBuffer->BytePosToMSecs(fDataStream->NumBytesLeft()) / 1000.0f;
|
||||
return fDSoundBuffer->bytePosToMSecs(fDataStream->NumBytesLeft()) / 1000.0f;
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ protected:
|
||||
hsScalar fTimeAtBufferStart;
|
||||
plAudioFileReader *fDataStream;
|
||||
hsScalar fBufferLengthInSecs;
|
||||
UInt8 fBlankBufferFillCounter;
|
||||
uint8_t fBlankBufferFillCounter;
|
||||
plSoundDeswizzler *fDeswizzler;
|
||||
char fSrcFilename[ 256 ];
|
||||
StreamType fStreamType;
|
||||
|
Reference in New Issue
Block a user