diff options
author | Paweł Kołodziejski | 2006-12-06 19:27:02 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2006-12-06 19:27:02 +0000 |
commit | 1d3ca2e40908ababd16fe8b1c9070198f9b75c82 (patch) | |
tree | 3c38e45040b1bbd97694b6eaf0ea4dec6f460753 /engines/agi/sound.h | |
parent | 1a85adfa833e78d4460e89ff5db1c6bc8688b048 (diff) | |
download | scummvm-rg350-1d3ca2e40908ababd16fe8b1c9070198f9b75c82.tar.gz scummvm-rg350-1d3ca2e40908ababd16fe8b1c9070198f9b75c82.tar.bz2 scummvm-rg350-1d3ca2e40908ababd16fe8b1c9070198f9b75c82.zip |
first phase of objectisation of agi engine
svn-id: r24808
Diffstat (limited to 'engines/agi/sound.h')
-rw-r--r-- | engines/agi/sound.h | 68 |
1 files changed, 30 insertions, 38 deletions
diff --git a/engines/agi/sound.h b/engines/agi/sound.h index ac7afaafe4..90420ac673 100644 --- a/engines/agi/sound.h +++ b/engines/agi/sound.h @@ -25,7 +25,11 @@ #ifndef AGI_SOUND_H #define AGI_SOUND_H -#include "agi/agi.h" +#include "sound/audiostream.h" + +namespace Audio { +class Mixer; +} // End of namespace Audio namespace Agi { @@ -46,15 +50,6 @@ namespace Agi { #define NUM_CHANNELS 7 /**< number of sound channels */ /** - * AGI engine sound driver structure. - */ -struct sound_driver { - char *description; - int (*init) (int16 * buffer); - void (*deinit) (void); -}; - -/** * AGI sound resource structure. */ struct agi_sound { @@ -102,38 +97,18 @@ struct channel_info { uint32 env; }; -void decode_sound(int); -void unload_sound(int); -void play_sound(void); -int init_sound(void); -void deinit_sound(void); -void start_sound(int, int); -void stop_sound(void); -uint32 mix_sound(void); -int load_instruments(char *fname); - -extern struct sound_driver *snd; - -#endif /* AGI_SOUND_H */ - -} // End of namespace Agi +class AgiEngine; -#include "sound/audiostream.h" +class SoundMgr : public Audio::AudioStream { + AgiEngine *_vm; -namespace Audio { -class Mixer; -} // End of namespace Audio - -namespace Agi { - -class AGIMusic : public Audio::AudioStream { public: - AGIMusic(Audio::Mixer * pMixer); - ~AGIMusic(void); + SoundMgr(AgiEngine *agi, Audio::Mixer *pMixer); + ~SoundMgr(); virtual void setVolume(uint8 volume); // AudioStream API - int readBuffer(int16 * buffer, const int numSamples) { + int readBuffer(int16 *buffer, const int numSamples) { premixerCall(buffer, numSamples / 2); return numSamples; } @@ -152,10 +127,27 @@ public: } private: - Audio::Mixer * _mixer; + Audio::Mixer *_mixer; uint32 _sampleRate; - void premixerCall(int16 * buf, uint len); + void premixerCall(int16 *buf, uint len); + +public: + + void decode_sound(int); + void unload_sound(int); + void play_sound(); + int init_sound(); + void deinit_sound(); + void start_sound(int, int); + void stop_sound(); + void stop_note(int i); + void play_note(int i, int freq, int vol); + void play_agi_sound(); + uint32 mix_sound(); + int load_instruments(char *fname); }; } // End of namespace Agi + +#endif /* AGI_SOUND_H */ |