27 #ifndef SCUMM_HE_MIXER_HE_H 28 #define SCUMM_HE_MIXER_HE_H 30 #include "scumm/he/sound_he.h" 31 #include "scumm/he/intern_he.h" 32 #include "scumm/resource.h" 34 #include "common/util.h" 35 #include "common/file.h" 36 #include "common/debug.h" 37 #include "common/memstream.h" 40 #include "audio/audiostream.h" 41 #include "audio/decoders/raw.h" 49 #define CHANNEL_EMPTY_FLAGS (0 << 0) 50 #define CHANNEL_ACTIVE (1 << 0) 51 #define CHANNEL_FINISHED (1 << 1) 52 #define CHANNEL_LOOPING (1 << 2) 53 #define CHANNEL_LAST_CHUNK (1 << 3) 54 #define CHANNEL_SPOOLING (1 << 4) 55 #define CHANNEL_CALLBACK_EARLY (1 << 7) 56 #define CHANNEL_SOFT_REMIX (1 << 8) 58 #define MIXER_MAX_CHANNELS 8 59 #define MIXER_PCM_CHUNK_SIZE 4096 60 #define MIXER_MAX_QUEUED_STREAMS 8 61 #define MIXER_DEFAULT_SAMPLE_RATE 11025 62 #define MIXER_SPOOL_CHUNK_SIZE (8 * 1024) 64 #define MILES_MAX_CHANNELS 8 65 #define MILES_PCM_CHUNK_SIZE 4096u 66 #define MILES_IMA_ADPCM_PER_FRAME_CHUNKS_NUM 4u 67 #define MILES_MAX_QUEUED_STREAMS 16 69 struct HESoundModifiers;
70 struct HESpoolingMusicItem;
71 class ScummEngine_v60he;
84 bool loopFlag =
false;
86 uint32 dataLength = 0;
87 uint32 curDataPos = 0;
88 uint32 dataOffset = 0;
96 bool _audioHandleActive =
false;
97 uint32 _lastPlayPosition;
103 uint16 _blockAlign = 0;
104 uint16 _numChannels = 1;
105 uint16 _bitsPerSample = 8;
106 uint16 _dataFormat = 1;
108 bool _isUsingStreamOverride =
false;
119 void clearChannelData();
120 void closeFileHandle();
121 void serviceStream();
122 byte getOutputFlags();
129 bool _useMilesSoundSystem =
false;
130 bool _mixerPaused =
false;
146 int endSampleAdjustment = 0;
147 uint32 lastReadPosition = 0;
148 uint32 initialSpoolingFileOffset = 0;
149 uint32 sampleLen = 0;
150 uint32 dataOffset = 0;
152 bool callbackOnNextFrame =
false;
153 bool isUsingStreamOverride =
false;
154 byte *residualData =
nullptr;
164 bool initSoftMixerSubSystem();
165 void deinitSoftMixerSubSystem();
166 bool stopChannel(
int channel);
167 void stopAllChannels();
168 bool pauseMixerSubSystem(
bool paused);
170 bool changeChannelVolume(
int channel,
int volume,
bool soft);
171 bool startChannelNew(
172 int channel,
int globType,
int globNum, uint32 soundData, uint32 offset,
173 int sampleLen,
int frequency,
int bitsPerSample,
int sampleChannels,
176 int channel,
int globType,
int globNum, uint32 sampleDataOffset,
177 int sampleLen,
int frequency,
int volume,
int callbackId, int32 flags, ...);
178 bool startSpoolingChannel(
179 int channel,
int song,
Common::File &spoolingFile,
int sampleLen,
int frequency,
180 int volume,
int callbackID, int32 flags);
182 bool audioOverrideExists(
int globNum,
bool justGetInfo,
186 int32 matchOffsetToSongId(int32 offset);
189 bool isMilesActive();
190 void milesStartSpoolingChannel(
int channel,
const char *filename,
long offset,
int flags,
HESoundModifiers modifiers);
191 bool milesStartChannel(
192 int channel,
int globType,
int globNum, uint32 sound_data, uint32 offset,
193 int sampleLen,
int bitsPerSample,
int sampleChannels,
194 int frequency,
HESoundModifiers modifiers,
int callbackID, uint32 flags, ...);
195 bool milesStopChannel(
int channel);
196 void milesStopAllSounds();
197 void milesModifySound(
int channel,
int offset,
HESoundModifiers modifiers,
int flags);
198 void milesStopAndCallback(
int channel,
int messageId);
199 void milesFeedMixer();
200 void milesServiceAllStreams();
201 bool milesPauseMixerSubSystem(
bool paused);
202 byte *milesGetAudioDataFromResource(
int globType,
int globNum, uint32 dataOffset, uint16 &compType, uint16 &blockAlign, uint32 &dataSize);
205 bool mixerInitMyMixerSubSystem();
206 void mixerFeedMixer();
207 bool mixerIsMixerDisabled();
208 bool mixerStopChannel(
int channel);
209 bool mixerStopAllSounds();
210 bool mixerChangeChannelVolume(
int channel,
int volume,
bool soft);
211 bool mixerPauseMixerSubSystem(
bool paused);
212 bool mixerStartChannel(
213 int channel,
int globType,
int globNum, uint32 sampleDataOffset,
214 int sampleLen,
int frequency,
int volume,
int callbackID, uint32 flags, ...);
215 bool mixerStartSpoolingChannel(
216 int channel,
int song,
Common::File &sampleFileIOHandle,
int sampleLen,
int frequency,
217 int volume,
int callbackID, uint32 flags);
218 byte mixerGetOutputFlags(
bool is3DOMusic =
false);
Definition: audiostream.h:212
Definition: intern_he.h:52
Definition: mixer_he.h:79
Definition: mixer_he.h:125
Definition: sound_he.h:109
Definition: audiostream.h:370
Definition: mixer_he.h:73
Definition: mixer_he.h:136
Definition: mixer_he.h:81
Definition: sound_he.h:136