cleanup
This commit is contained in:
+24
-17
@@ -1,3 +1,5 @@
|
|||||||
|
/* RageSound - High-level sound object. */
|
||||||
|
|
||||||
#ifndef RAGE_SOUND_H
|
#ifndef RAGE_SOUND_H
|
||||||
#define RAGE_SOUND_H
|
#define RAGE_SOUND_H
|
||||||
|
|
||||||
@@ -56,9 +58,11 @@ struct RageSoundParams
|
|||||||
* supported, it'll start immediately. */
|
* supported, it'll start immediately. */
|
||||||
RageTimer StartTime;
|
RageTimer StartTime;
|
||||||
|
|
||||||
/* M_STOP (default) stops the sound at the end.
|
/*
|
||||||
|
* M_STOP (default) stops the sound at the end.
|
||||||
* M_LOOP restarts.
|
* M_LOOP restarts.
|
||||||
* M_CONTINUE feeds silence, which is useful to continue timing longer than the actual sound. */
|
* M_CONTINUE feeds silence, which is useful to continue timing longer than the actual sound.
|
||||||
|
*/
|
||||||
enum StopMode_t {
|
enum StopMode_t {
|
||||||
M_STOP, /* stop when finished */
|
M_STOP, /* stop when finished */
|
||||||
M_LOOP, /* loop */
|
M_LOOP, /* loop */
|
||||||
@@ -75,19 +79,21 @@ public:
|
|||||||
RageSound( const RageSound &cpy );
|
RageSound( const RageSound &cpy );
|
||||||
RageSound &operator=( const RageSound &cpy );
|
RageSound &operator=( const RageSound &cpy );
|
||||||
|
|
||||||
/* If cache == true, we'll preload the entire file into memory if
|
/*
|
||||||
* it's small enough. If this is done, a large number of copies of the
|
* If bPrecache == true, we'll preload the entire file into memory if
|
||||||
* sound can be played without much performance penalty. This is useful
|
* small enough. If this is done, a large number of copies of the sound
|
||||||
* for BM (keyed sounds), and for rapidly-repeating sound effects, such
|
* can be played without much performance penalty. This is useful for
|
||||||
* as the music wheel.
|
* efficiently playing keyed sounds, and for rapidly-repeating sound
|
||||||
|
* effects, such as the music wheel.
|
||||||
*
|
*
|
||||||
* If cache == false, we'll never preload the file (always stream
|
* If cache == false, we'll always stream the sound on demand, which
|
||||||
* it). This makes loads much faster.
|
* makes loads much faster.
|
||||||
*
|
*
|
||||||
* If the file failed to load, false is returned, Error() is set
|
* If the file failed to load, false is returned, Error() is set
|
||||||
* and a null sample will be loaded. (This makes failed loads nonfatal;
|
* and a null sample will be loaded. This makes failed loads nonfatal;
|
||||||
* they can be ignored most of the time, so we continue to work if a file
|
* they can be ignored most of the time, so we continue to work if a file
|
||||||
* is broken or missing.) */
|
* is broken or missing.
|
||||||
|
*/
|
||||||
bool Load( CString sFile, bool bPrecache );
|
bool Load( CString sFile, bool bPrecache );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -181,12 +187,13 @@ private:
|
|||||||
static void RateChange( char *pBuf, int &iCount, int iInputSpeed, int iOutputSpeed, int iChannels );
|
static void RateChange( char *pBuf, int &iCount, int iInputSpeed, int iOutputSpeed, int iChannels );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* Called only by the sound drivers: */
|
/* These functions are called only by sound drivers. */
|
||||||
/* This function should return the number of bytes actually put into buffer.
|
|
||||||
* If less than size is returned, it signals the stream to stop; once it's
|
/* Returns the number of bytes actually put into pBuffer. If less than iSize is
|
||||||
* flushed, SoundStopped will be called. Until then, SOUNDMAN->GetPosition
|
* returned, it signals the stream to stop; once it's flushed, SoundStopped will
|
||||||
* can still be called (the sound is still playing). */
|
* be called. Until then, SOUNDMAN->GetPosition can still be called; the sound
|
||||||
int GetPCM( char *buffer, int size, int64_t frameno );
|
* is still playing. */
|
||||||
|
int GetPCM( char *pBuffer, int iSize, int64_t iFrameno );
|
||||||
bool GetDataToPlay( int16_t *pBuffer, int iSize, int &iPosition, int &iBytesRead );
|
bool GetDataToPlay( int16_t *pBuffer, int iSize, int &iPosition, int &iBytesRead );
|
||||||
void CommitPlayingPosition( int64_t iFrameno, int iPosition, int iBytesRead );
|
void CommitPlayingPosition( int64_t iFrameno, int iPosition, int iBytesRead );
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user