diff options
author | Max Horn | 2007-08-19 20:48:11 +0000 |
---|---|---|
committer | Max Horn | 2007-08-19 20:48:11 +0000 |
commit | 5b711795d06d9f8dc2dada2e6e41e25a625de502 (patch) | |
tree | 18b164504ddb101a3a8782c9c80719170d07ac3b /engines/agi/sound.h | |
parent | 07586c378e42dcfa3d1024c19f9e8b3997bbd5c6 (diff) | |
download | scummvm-rg350-5b711795d06d9f8dc2dada2e6e41e25a625de502.tar.gz scummvm-rg350-5b711795d06d9f8dc2dada2e6e41e25a625de502.tar.bz2 scummvm-rg350-5b711795d06d9f8dc2dada2e6e41e25a625de502.zip |
Some cleanup / const correctness / OOfication
svn-id: r28671
Diffstat (limited to 'engines/agi/sound.h')
-rw-r--r-- | engines/agi/sound.h | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/engines/agi/sound.h b/engines/agi/sound.h index 5d6b423053..60be253d40 100644 --- a/engines/agi/sound.h +++ b/engines/agi/sound.h @@ -199,26 +199,34 @@ struct IIgsChannelInfo { bool end; ///< Has the playing ended? }; + enum AgiSoundType { + // FIXME: Fingolfin wonders: Why are bitmasks used here, when those + // types seem to be mutually exclusive? + AGI_SOUND_SAMPLE = 0x0001, + AGI_SOUND_MIDI = 0x0002, + AGI_SOUND_4CHN = 0x0008 + }; + enum AgiSoundFlags { + AGI_SOUND_LOOP = 0x0001, + AGI_SOUND_ENVELOPE = 0x0002 + }; + enum AgiSoundEnv { + AGI_SOUND_ENV_ATTACK = 3, + AGI_SOUND_ENV_DECAY = 2, + AGI_SOUND_ENV_SUSTAIN = 1, + AGI_SOUND_ENV_RELEASE = 0 + }; /** * AGI engine sound channel structure. */ struct ChannelInfo { -#define AGI_SOUND_SAMPLE 0x0001 -#define AGI_SOUND_MIDI 0x0002 -#define AGI_SOUND_4CHN 0x0008 - uint32 type; + AgiSoundType type; const uint8 *ptr; // Pointer to the AgiNote data - int16 *ins; + const int16 *ins; int32 size; uint32 phase; -#define AGI_SOUND_LOOP 0x0001 -#define AGI_SOUND_ENVELOPE 0x0002 - uint32 flags; -#define AGI_SOUND_ENV_ATTACK 3 -#define AGI_SOUND_ENV_DECAY 2 -#define AGI_SOUND_ENV_SUSTAIN 1 -#define AGI_SOUND_ENV_RELEASE 0 - uint32 adsr; + uint32 flags; // ORs values from AgiSoundFlags + AgiSoundEnv adsr; int32 timer; uint32 end; uint32 freq; @@ -343,6 +351,16 @@ private: Audio::SoundHandle _soundHandle; uint32 _sampleRate; + bool _playing; + ChannelInfo _chn[NUM_CHANNELS]; + IIgsChannelInfo _IIgsChannel; + int _endflag; + int _playingSound; + uint8 _env; + + int16 *_sndBuffer; + const int16 *_waveform; + void premixerCall(int16 *buf, uint len); public: |