32 #define SOUND_EMU_NONE 0 33 #define SOUND_EMU_PC 1 34 #define SOUND_EMU_PCJR 2 35 #define SOUND_EMU_MAC 3 36 #define SOUND_EMU_AMIGA 4 37 #define SOUND_EMU_APPLE2GS 5 38 #define SOUND_EMU_COCO3 6 39 #define SOUND_EMU_MIDI 7 50 void read(
const uint8 *ptr) {
51 duration = READ_LE_UINT16(ptr);
52 uint16 freqByte0 = *(ptr + 2);
53 uint16 freqByte1 = *(ptr + 3);
55 freqDiv = ((freqByte0 & 0x3F) << 4) | (freqByte1 & 0x0F);
56 attenuation = *(ptr + 4) & 0x0F;
67 AGI_SOUND_SAMPLE = 0x0001,
68 AGI_SOUND_MIDI = 0x0002,
69 AGI_SOUND_4CHN = 0x0008
79 virtual void play(
int resnum) = 0;
80 virtual void stop() = 0;
95 AgiSound() : _isPlaying(
false), _isValid(
false) {}
97 virtual void play() { _isPlaying =
true; }
98 virtual void stop() { _isPlaying =
false; }
99 virtual bool isPlaying() {
return _isPlaying; }
100 virtual uint16 type() = 0;
110 static AgiSound *createFromRawResource(uint8 *data, uint32 len,
int resnum,
int soundemu);
119 PCjrSound(uint8 *data, uint32 len,
int resnum);
121 uint16 type()
override {
return _type; }
122 const uint8 *getVoicePointer(uint voiceNum);
123 uint8 *getData() {
return _data; }
124 uint32 getLength() {
return _len; }
137 void setVolume(uint8 volume);
139 void unloadSound(
int);
140 void startSound(
int,
int);
143 void soundIsFinished();
uint8 * _data
Raw sound resource data.
Definition: sound.h:126
uint32 _len
Length of the raw sound resource.
Definition: sound.h:127
bool _isPlaying
Is the sound playing?
Definition: sound.h:113
bool _isValid
Is this a valid sound object?
Definition: sound.h:114
uint16 _type
Sound resource type.
Definition: sound.h:128
uint8 attenuation
Note volume attenuation (4-bit)
Definition: sound.h:47
uint16 duration
Note duration.
Definition: sound.h:45
void read(const uint8 *ptr)
Definition: sound.h:50
AgiSoundEmuType
Definition: sound.h:66
uint16 freqDiv
Note frequency divisor (10-bit)
Definition: sound.h:46