This commit is contained in:
parent
76f10e2299
commit
06ec0fdcd6
4 changed files with 471 additions and 252 deletions
|
@ -33,8 +33,8 @@
|
|||
// This is a bit messy, but makes sure that you can't easily pass the wrong IDs to the xm functions
|
||||
// ( ..something scares me about this way of doing it tho :)
|
||||
typedef enum {NO_SAMPLE=-1} xmSampleId;
|
||||
typedef enum {NO_SONG=-1} xmSongId;
|
||||
typedef enum {NOT_PLAYING=-1} xmPlayingSongId;
|
||||
typedef enum {NO_SONG=-1} xmModId;
|
||||
typedef enum {NOT_PLAYING=-1} xmPlayingId;
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -46,23 +46,24 @@ class CXMPlaySound
|
|||
public:
|
||||
void initialise();
|
||||
void shutdown();
|
||||
void think();
|
||||
|
||||
xmSampleId loadSamples(FileEquate _vhFe,FileEquate _vbFe);
|
||||
xmSongId loadSongData(FileEquate _songFe);
|
||||
void dumpSamples(xmSampleId _sampleId);
|
||||
void dumpSongData(xmSongId _songId);
|
||||
xmSampleId loadSampleData(FileEquate _vhFe,FileEquate _vbFe);
|
||||
xmModId loadModData(FileEquate _songFe);
|
||||
void dumpSampleData(xmSampleId _sampleId);
|
||||
void dumpModData(xmModId _songId);
|
||||
|
||||
void setStereo(int _stereo);
|
||||
|
||||
void setVolume(xmPlayingSongId _songId,unsigned char _volume);
|
||||
void setPanning(xmPlayingSongId _songId,char _pan);
|
||||
void setVolume(xmPlayingId _songId,unsigned char _volume);
|
||||
void setPanning(xmPlayingId _songId,char _pan);
|
||||
|
||||
xmPlayingSongId playSong(xmSampleId _sampleId,xmSongId _songId,int _baseChannel);
|
||||
void stopSong(xmPlayingSongId _songId);
|
||||
|
||||
xmPlayingSongId playSfx(xmSampleId _sampleId,xmSongId _songId,int _baseChannel,int _sfxPattern,int _playMask=-1);
|
||||
int isSfxActive(xmPlayingSongId _id);
|
||||
xmPlayingId playSong(xmSampleId _sampleId,xmModId _songId,int _channelCount);
|
||||
xmPlayingId playSfx(xmSampleId _sampleId,xmModId _songId,int _sfxPattern,int _playMask,u8 _priority);
|
||||
xmPlayingId playLoopingSfx(xmSampleId _sampleId,xmModId _songId,int _soundId,u8 _priority,int _pitch=0x400);
|
||||
|
||||
void unlockPlayingId(xmPlayingId _playingId);
|
||||
void stopPlayingId(xmPlayingId _playingId);
|
||||
|
||||
|
||||
private:
|
||||
|
@ -70,12 +71,36 @@ private:
|
|||
{
|
||||
MAX_XM_HEADERS=8,
|
||||
MAX_SONG_HEADERS=24,
|
||||
|
||||
NUM_SPU_CHANNELS=24,
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SILENT,
|
||||
SONG,
|
||||
SFX,
|
||||
LOOPINGSFX,
|
||||
} CHANNELUSETYPE;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CHANNELUSETYPE m_useType;
|
||||
xmPlayingId m_playingId; // extern id
|
||||
u8 m_internalId;
|
||||
u8 m_priority;
|
||||
u8 m_locked;
|
||||
} spuChannelUse;
|
||||
|
||||
xmPlayingId getNextSparePlayingId();
|
||||
int findSpareChannels(int _channelCount,int _priority);
|
||||
void markChannelsAsActive(int _baseChannel,int _channelCount,CHANNELUSETYPE _useType,xmPlayingId _playingId,int _internalId,u8 _priority);
|
||||
|
||||
void defragSpuMemory();
|
||||
|
||||
unsigned char *s_fhPtr[MAX_XM_HEADERS];
|
||||
unsigned char *s_songPtr[MAX_SONG_HEADERS];
|
||||
unsigned char *m_fhPtr[MAX_XM_HEADERS];
|
||||
unsigned char *m_songPtr[MAX_SONG_HEADERS];
|
||||
spuChannelUse m_spuChannelUse[NUM_SPU_CHANNELS];
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue