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:
@ -76,14 +76,14 @@ public:
|
||||
virtual uint32_t GetDataSize( void ) = 0;
|
||||
virtual float GetLengthInSecs( void ) = 0;
|
||||
|
||||
virtual hsBool SetPosition( uint32_t numBytes ) = 0;
|
||||
virtual hsBool Read( uint32_t numBytes, void *buffer ) = 0;
|
||||
virtual bool SetPosition( uint32_t numBytes ) = 0;
|
||||
virtual bool Read( uint32_t numBytes, void *buffer ) = 0;
|
||||
virtual uint32_t NumBytesLeft( void ) = 0;
|
||||
|
||||
virtual hsBool OpenForWriting( const char *path, plWAVHeader &header ) { return false; }
|
||||
virtual bool OpenForWriting( const char *path, plWAVHeader &header ) { return false; }
|
||||
virtual uint32_t Write( uint32_t bytes, void *buffer ) { return 0; }
|
||||
|
||||
virtual hsBool IsValid( void ) = 0;
|
||||
virtual bool IsValid( void ) = 0;
|
||||
|
||||
static plAudioFileReader* CreateReader(const char* path, plAudioCore::ChannelSelect whichChan = plAudioCore::kAll, StreamType type = kStreamWAV);
|
||||
static plAudioFileReader* CreateWriter(const char* path, plWAVHeader& header);
|
||||
|
@ -141,7 +141,7 @@ float plBufferedFileReader::GetLengthInSecs( void )
|
||||
return (float)fBufferSize / (float)fHeader.fAvgBytesPerSec;
|
||||
}
|
||||
|
||||
hsBool plBufferedFileReader::SetPosition( uint32_t numBytes )
|
||||
bool plBufferedFileReader::SetPosition( uint32_t numBytes )
|
||||
{
|
||||
hsAssert( IsValid(), "SetPosition() called on an invalid RAM buffer" );
|
||||
|
||||
@ -155,12 +155,12 @@ hsBool plBufferedFileReader::SetPosition( uint32_t numBytes )
|
||||
return true;
|
||||
}
|
||||
|
||||
hsBool plBufferedFileReader::Read( uint32_t numBytes, void *buffer )
|
||||
bool plBufferedFileReader::Read( uint32_t numBytes, void *buffer )
|
||||
{
|
||||
hsAssert( IsValid(), "Read() called on an invalid RAM buffer" );
|
||||
|
||||
|
||||
hsBool valid = true;
|
||||
bool valid = true;
|
||||
|
||||
if( fCursor + numBytes > fBufferSize )
|
||||
{
|
||||
|
@ -66,10 +66,10 @@ public:
|
||||
virtual void Close( void );
|
||||
virtual uint32_t GetDataSize( void ) { return fBufferSize; }
|
||||
virtual float GetLengthInSecs( void );
|
||||
virtual hsBool SetPosition( uint32_t numBytes );
|
||||
virtual hsBool Read( uint32_t numBytes, void *buffer );
|
||||
virtual bool SetPosition( uint32_t numBytes );
|
||||
virtual bool Read( uint32_t numBytes, void *buffer );
|
||||
virtual uint32_t NumBytesLeft( void );
|
||||
virtual hsBool IsValid( void ) { return ( fBuffer != nil ) ? true : false; }
|
||||
virtual bool IsValid( void ) { return ( fBuffer != nil ) ? true : false; }
|
||||
|
||||
protected:
|
||||
uint32_t fBufferSize;
|
||||
|
@ -131,7 +131,7 @@ float plCachedFileReader::GetLengthInSecs()
|
||||
return (float)fDataLength / (float)fHeader.fAvgBytesPerSec;
|
||||
}
|
||||
|
||||
hsBool plCachedFileReader::SetPosition(uint32_t numBytes)
|
||||
bool plCachedFileReader::SetPosition(uint32_t numBytes)
|
||||
{
|
||||
hsAssert(IsValid(), "SetPosition() called on an invalid cache file");
|
||||
|
||||
@ -142,7 +142,7 @@ hsBool plCachedFileReader::SetPosition(uint32_t numBytes)
|
||||
return !fseek(fFileHandle, sizeof(plWAVHeader) + fCurPosition, SEEK_SET);
|
||||
}
|
||||
|
||||
hsBool plCachedFileReader::Read(uint32_t numBytes, void *buffer)
|
||||
bool plCachedFileReader::Read(uint32_t numBytes, void *buffer)
|
||||
{
|
||||
hsAssert(IsValid(), "Read() called on an invalid cache file");
|
||||
|
||||
@ -162,7 +162,7 @@ uint32_t plCachedFileReader::NumBytesLeft()
|
||||
return fDataLength - fCurPosition;
|
||||
}
|
||||
|
||||
hsBool plCachedFileReader::OpenForWriting(const char *path, plWAVHeader &header)
|
||||
bool plCachedFileReader::OpenForWriting(const char *path, plWAVHeader &header)
|
||||
{
|
||||
hsAssert(path != nil, "Invalid path specified in plCachedFileReader");
|
||||
|
||||
|
@ -71,14 +71,14 @@ public:
|
||||
virtual uint32_t GetDataSize();
|
||||
virtual float GetLengthInSecs();
|
||||
|
||||
virtual hsBool SetPosition(uint32_t numBytes);
|
||||
virtual hsBool Read(uint32_t numBytes, void *buffer);
|
||||
virtual bool SetPosition(uint32_t numBytes);
|
||||
virtual bool Read(uint32_t numBytes, void *buffer);
|
||||
virtual uint32_t NumBytesLeft();
|
||||
|
||||
virtual hsBool OpenForWriting(const char *path, plWAVHeader &header);
|
||||
virtual bool OpenForWriting(const char *path, plWAVHeader &header);
|
||||
virtual uint32_t Write(uint32_t bytes, void *buffer);
|
||||
|
||||
virtual hsBool IsValid() { return fFileHandle != nil; }
|
||||
virtual bool IsValid() { return fFileHandle != nil; }
|
||||
|
||||
protected:
|
||||
enum
|
||||
|
@ -265,7 +265,7 @@ float plFastWAV::GetLengthInSecs( void )
|
||||
return (float)( fDataSize / fChannelAdjust ) / (float)fHeader.fAvgBytesPerSec;
|
||||
}
|
||||
|
||||
hsBool plFastWAV::SetPosition( uint32_t numBytes )
|
||||
bool plFastWAV::SetPosition( uint32_t numBytes )
|
||||
{
|
||||
hsAssert( IsValid(), "GetHeader() called on an invalid WAV file" );
|
||||
|
||||
@ -277,7 +277,7 @@ hsBool plFastWAV::SetPosition( uint32_t numBytes )
|
||||
return ( fseek( fFileHandle, fDataStartPos + fCurrDataPos, SEEK_SET ) == 0 ) ? true : false;
|
||||
}
|
||||
|
||||
hsBool plFastWAV::Read( uint32_t numBytes, void *buffer )
|
||||
bool plFastWAV::Read( uint32_t numBytes, void *buffer )
|
||||
{
|
||||
hsAssert( IsValid(), "GetHeader() called on an invalid WAV file" );
|
||||
|
||||
|
@ -71,11 +71,11 @@ public:
|
||||
virtual uint32_t GetDataSize( void ) { return fDataSize / fChannelAdjust; }
|
||||
virtual float GetLengthInSecs( void );
|
||||
|
||||
virtual hsBool SetPosition( uint32_t numBytes );
|
||||
virtual hsBool Read( uint32_t numBytes, void *buffer );
|
||||
virtual bool SetPosition( uint32_t numBytes );
|
||||
virtual bool Read( uint32_t numBytes, void *buffer );
|
||||
virtual uint32_t NumBytesLeft( void );
|
||||
|
||||
virtual hsBool IsValid( void ) { return ( fFileHandle != nil ) ? true : false; }
|
||||
virtual bool IsValid( void ) { return ( fFileHandle != nil ) ? true : false; }
|
||||
|
||||
protected:
|
||||
enum
|
||||
|
@ -227,7 +227,7 @@ float plOGGCodec::GetLengthInSecs( void )
|
||||
return (float)ov_time_total( fOggFile, -1 );
|
||||
}
|
||||
|
||||
hsBool plOGGCodec::SetPosition( uint32_t numBytes )
|
||||
bool plOGGCodec::SetPosition( uint32_t numBytes )
|
||||
{
|
||||
hsAssert( IsValid(), "GetHeader() called on an invalid OGG file" );
|
||||
|
||||
@ -263,7 +263,7 @@ hsBool plOGGCodec::SetPosition( uint32_t numBytes )
|
||||
return true;
|
||||
}
|
||||
|
||||
hsBool plOGGCodec::Read( uint32_t numBytes, void *buffer )
|
||||
bool plOGGCodec::Read( uint32_t numBytes, void *buffer )
|
||||
{
|
||||
hsAssert( IsValid(), "GetHeader() called on an invalid OGG file" );
|
||||
// plNetClientApp::StaticDebugMsg("Ogg Read, t=%f, start", hsTimer::GetSeconds());
|
||||
|
@ -80,14 +80,14 @@ public:
|
||||
virtual uint32_t GetDataSize( void ) { return fDataSize / fChannelAdjust; }
|
||||
virtual float GetLengthInSecs( void );
|
||||
|
||||
virtual hsBool SetPosition( uint32_t numBytes );
|
||||
virtual hsBool Read( uint32_t numBytes, void *buffer );
|
||||
virtual bool SetPosition( uint32_t numBytes );
|
||||
virtual bool Read( uint32_t numBytes, void *buffer );
|
||||
virtual uint32_t NumBytesLeft( void );
|
||||
|
||||
virtual hsBool IsValid( void ) { return ( fOggFile != nil ) ? true : false; }
|
||||
virtual bool IsValid( void ) { return ( fOggFile != nil ) ? true : false; }
|
||||
|
||||
static void SetDecodeFormat( DecodeFormat f ) { fDecodeFormat = f; }
|
||||
static void SetDecodeFlag( uint8_t flag, hsBool on ) { if( on ) fDecodeFlags |= flag; else fDecodeFlags &= ~flag; }
|
||||
static void SetDecodeFlag( uint8_t flag, bool on ) { if( on ) fDecodeFlags |= flag; else fDecodeFlags &= ~flag; }
|
||||
static uint8_t GetDecodeFlags( void ) { return fDecodeFlags; }
|
||||
void ResetWaveHeaderRef() { fCurHeaderPos = 0; }
|
||||
void BuildActualWaveHeader();
|
||||
|
@ -71,7 +71,7 @@ static void GetFullPath( const char filename[], char *destStr )
|
||||
// Makes sure the sound is ready to load without any extra processing (like
|
||||
// decompression or the like), then opens a reader for it.
|
||||
// fullpath tells the function whether to append 'sfx' to the path or not (we don't want to do this if were providing the full path)
|
||||
static plAudioFileReader *CreateReader( hsBool fullpath, const char filename[], plAudioFileReader::StreamType type, plAudioCore::ChannelSelect channel )
|
||||
static plAudioFileReader *CreateReader( bool fullpath, const char filename[], plAudioFileReader::StreamType type, plAudioCore::ChannelSelect channel )
|
||||
{
|
||||
char path[512];
|
||||
if(fullpath) GetFullPath(filename, path);
|
||||
@ -507,7 +507,7 @@ plSoundBuffer::ELoadReturnVal plSoundBuffer::EnsureInternal()
|
||||
}
|
||||
|
||||
//// IGrabHeaderInfo /////////////////////////////////////////////////////////
|
||||
hsBool plSoundBuffer::IGrabHeaderInfo( void )
|
||||
bool plSoundBuffer::IGrabHeaderInfo( void )
|
||||
{
|
||||
static char path[ 512 ];
|
||||
|
||||
@ -543,7 +543,7 @@ hsBool plSoundBuffer::IGrabHeaderInfo( void )
|
||||
// Makes sure the sound is ready to load without any extra processing (like
|
||||
// decompression or the like), then opens a reader for it.
|
||||
// fullpath tells the function whether to append 'sfx' to the path or not (we don't want to do this if were providing the full path)
|
||||
plAudioFileReader *plSoundBuffer::IGetReader( hsBool fullpath )
|
||||
plAudioFileReader *plSoundBuffer::IGetReader( bool fullpath )
|
||||
{
|
||||
char path[512];
|
||||
if(fullpath) IGetFullPath(path);
|
||||
|
@ -97,12 +97,12 @@ public:
|
||||
void SetDataLength(unsigned length) { fDataLength = length; }
|
||||
void *GetData( void ) const { return fData; }
|
||||
const char *GetFileName( void ) const { return fFileName; }
|
||||
hsBool IsValid( void ) const { return fValid; }
|
||||
bool IsValid( void ) const { return fValid; }
|
||||
float GetDataLengthInSecs( void ) const;
|
||||
|
||||
void SetFileName( const char *name );
|
||||
hsBool HasFlag( uint32_t flag ) { return ( fFlags & flag ) ? true : false; }
|
||||
void SetFlag( uint32_t flag, hsBool yes = true ) { if( yes ) fFlags |= flag; else fFlags &= ~flag; }
|
||||
bool HasFlag( uint32_t flag ) { return ( fFlags & flag ) ? true : false; }
|
||||
void SetFlag( uint32_t flag, bool yes = true ) { if( yes ) fFlags |= flag; else fFlags &= ~flag; }
|
||||
|
||||
// Must be called until return value is kSuccess. starts an asynchronous load first time called. returns kSuccess when finished.
|
||||
ELoadReturnVal AsyncLoad( plAudioFileReader::StreamType type, unsigned length = 0 );
|
||||
@ -133,12 +133,12 @@ protected:
|
||||
|
||||
void IInitBuffer();
|
||||
|
||||
hsBool IGrabHeaderInfo( void );
|
||||
bool IGrabHeaderInfo( void );
|
||||
void IAddBuffers( void *base, void *toAdd, uint32_t lengthInBytes, uint8_t bitsPerSample );
|
||||
void IGetFullPath( char *destStr );
|
||||
|
||||
uint32_t fFlags;
|
||||
hsBool fValid;
|
||||
bool fValid;
|
||||
uint32_t fDataRead;
|
||||
char *fFileName;
|
||||
|
||||
@ -154,7 +154,7 @@ protected:
|
||||
plAudioFileReader::StreamType fStreamType;
|
||||
|
||||
// for plugins only
|
||||
plAudioFileReader *IGetReader( hsBool fullpath );
|
||||
plAudioFileReader *IGetReader( bool fullpath );
|
||||
};
|
||||
|
||||
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
protected:
|
||||
uint8_t *fData;
|
||||
uint32_t fNumSamples, fSampleSize, fStride;
|
||||
hsBool fOwnsData;
|
||||
bool fOwnsData;
|
||||
};
|
||||
|
||||
#endif //_plSoundDeswizzler_h
|
||||
|
@ -950,7 +950,7 @@ CWaveFile::CWaveFile( const char *path, plAudioCore::ChannelSelect whichChan )
|
||||
// Just a stub--do nothing
|
||||
}
|
||||
|
||||
hsBool CWaveFile::OpenForWriting( const char *path, plWAVHeader &header )
|
||||
bool CWaveFile::OpenForWriting( const char *path, plWAVHeader &header )
|
||||
{
|
||||
fHeader = header;
|
||||
|
||||
@ -991,13 +991,13 @@ float CWaveFile::GetLengthInSecs( void )
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
hsBool CWaveFile::SetPosition( uint32_t numBytes )
|
||||
bool CWaveFile::SetPosition( uint32_t numBytes )
|
||||
{
|
||||
hsAssert( false, "Unsupported" );
|
||||
return false;
|
||||
}
|
||||
|
||||
hsBool CWaveFile::Read( uint32_t numBytes, void *buffer )
|
||||
bool CWaveFile::Read( uint32_t numBytes, void *buffer )
|
||||
{
|
||||
hsAssert( false, "Unsupported" );
|
||||
return false;
|
||||
@ -1016,7 +1016,7 @@ uint32_t CWaveFile::Write( uint32_t bytes, void *buffer )
|
||||
return (uint32_t)written;
|
||||
}
|
||||
|
||||
hsBool CWaveFile::IsValid( void )
|
||||
bool CWaveFile::IsValid( void )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -93,18 +93,18 @@ public:
|
||||
|
||||
// Overloads for plAudioFileReader
|
||||
CWaveFile( const char *path, plAudioCore::ChannelSelect whichChan );
|
||||
virtual hsBool OpenForWriting( const char *path, plWAVHeader &header );
|
||||
virtual bool OpenForWriting( const char *path, plWAVHeader &header );
|
||||
virtual plWAVHeader &GetHeader( void );
|
||||
virtual void Close( void );
|
||||
virtual uint32_t GetDataSize( void );
|
||||
virtual float GetLengthInSecs( void );
|
||||
|
||||
virtual hsBool SetPosition( uint32_t numBytes );
|
||||
virtual hsBool Read( uint32_t numBytes, void *buffer );
|
||||
virtual bool SetPosition( uint32_t numBytes );
|
||||
virtual bool Read( uint32_t numBytes, void *buffer );
|
||||
virtual uint32_t NumBytesLeft( void );
|
||||
virtual uint32_t Write( uint32_t bytes, void *buffer );
|
||||
|
||||
virtual hsBool IsValid( void );
|
||||
virtual bool IsValid( void );
|
||||
WAVEFORMATEX* m_pwfx; // Pointer to WAVEFORMATEX structure
|
||||
HMMIO m_hmmio; // MM I/O handle for the WAVE
|
||||
MMCKINFO m_ck; // Multimedia RIFF chunk
|
||||
|
Reference in New Issue
Block a user