22 #ifndef SCUMM_HE_MIXER_HE_H 23 #define SCUMM_HE_MIXER_HE_H 25 #include "scumm/he/sound_he.h" 26 #include "scumm/he/intern_he.h" 27 #include "scumm/resource.h" 29 #include "common/util.h" 30 #include "common/file.h" 31 #include "common/debug.h" 32 #include "common/memstream.h" 35 #include "audio/audiostream.h" 36 #include "audio/decoders/raw.h" 44 #define CHANNEL_EMPTY_FLAGS (0 << 0) 45 #define CHANNEL_ACTIVE (1 << 0) 46 #define CHANNEL_FINISHED (1 << 1) 47 #define CHANNEL_LOOPING (1 << 2) 48 #define CHANNEL_LAST_CHUNK (1 << 3) 49 #define CHANNEL_SPOOLING (1 << 4) 50 #define CHANNEL_CALLBACK_EARLY (1 << 7) 51 #define CHANNEL_SOFT_REMIX (1 << 8) 53 #define MIXER_MAX_CHANNELS 8 54 #define MIXER_PCM_CHUNK_SIZE 4096 55 #define MIXER_MAX_QUEUED_STREAMS 8 56 #define MIXER_DEFAULT_SAMPLE_RATE 11025 57 #define MIXER_SPOOL_CHUNK_SIZE (8 * 1024) 59 #define MILES_MAX_CHANNELS 8 60 #define MILES_PCM_CHUNK_SIZE 4096u 61 #define MILES_IMA_ADPCM_PER_FRAME_CHUNKS_NUM 4u 62 #define MILES_MAX_QUEUED_STREAMS 16 64 struct HESoundModifiers;
65 struct HESpoolingMusicItem;
66 class ScummEngine_v60he;
79 bool loopFlag =
false;
81 uint32 dataLength = 0;
82 uint32 curDataPos = 0;
83 uint32 dataOffset = 0;
91 bool _audioHandleActive =
false;
92 uint32 _lastPlayPosition;
98 uint16 _blockAlign = 0;
99 uint16 _numChannels = 1;
100 uint16 _bitsPerSample = 8;
101 uint16 _dataFormat = 1;
103 bool _isUsingStreamOverride =
false;
114 void clearChannelData();
115 void closeFileHandle();
116 void serviceStream();
117 byte getOutputFlags();
124 bool _useMilesSoundSystem =
false;
125 bool _mixerPaused =
false;
141 int endSampleAdjustment = 0;
142 uint32 lastReadPosition = 0;
143 uint32 initialSpoolingFileOffset = 0;
144 uint32 sampleLen = 0;
145 uint32 dataOffset = 0;
147 bool callbackOnNextFrame =
false;
148 bool isUsingStreamOverride =
false;
149 byte *residualData =
nullptr;
159 bool initSoftMixerSubSystem();
160 void deinitSoftMixerSubSystem();
161 bool stopChannel(
int channel);
162 void stopAllChannels();
163 bool pauseMixerSubSystem(
bool paused);
165 bool changeChannelVolume(
int channel,
int volume,
bool soft);
166 bool startChannelNew(
167 int channel,
int globType,
int globNum, uint32 soundData, uint32 offset,
168 int sampleLen,
int frequency,
int bitsPerSample,
int sampleChannels,
171 int channel,
int globType,
int globNum, uint32 sampleDataOffset,
172 int sampleLen,
int frequency,
int volume,
int callbackId, int32 flags, ...);
173 bool startSpoolingChannel(
174 int channel,
int song,
Common::File &spoolingFile,
int sampleLen,
int frequency,
175 int volume,
int callbackID, int32 flags);
177 bool audioOverrideExists(
int globNum,
bool justGetInfo,
181 int32 matchOffsetToSongId(int32 offset);
184 bool isMilesActive();
185 void milesStartSpoolingChannel(
int channel,
const char *filename,
long offset,
int flags,
HESoundModifiers modifiers);
186 bool milesStartChannel(
187 int channel,
int globType,
int globNum, uint32 sound_data, uint32 offset,
188 int sampleLen,
int bitsPerSample,
int sampleChannels,
189 int frequency,
HESoundModifiers modifiers,
int callbackID, uint32 flags, ...);
190 bool milesStopChannel(
int channel);
191 void milesStopAllSounds();
192 void milesModifySound(
int channel,
int offset,
HESoundModifiers modifiers,
int flags);
193 void milesStopAndCallback(
int channel,
int messageId);
194 void milesFeedMixer();
195 void milesServiceAllStreams();
196 bool milesPauseMixerSubSystem(
bool paused);
197 byte *milesGetAudioDataFromResource(
int globType,
int globNum, uint32 dataOffset, uint16 &compType, uint16 &blockAlign, uint32 &dataSize);
200 bool mixerInitMyMixerSubSystem();
201 void mixerFeedMixer();
202 bool mixerIsMixerDisabled();
203 bool mixerStopChannel(
int channel);
204 bool mixerStopAllSounds();
205 bool mixerChangeChannelVolume(
int channel,
int volume,
bool soft);
206 bool mixerPauseMixerSubSystem(
bool paused);
207 bool mixerStartChannel(
208 int channel,
int globType,
int globNum, uint32 sampleDataOffset,
209 int sampleLen,
int frequency,
int volume,
int callbackID, uint32 flags, ...);
210 bool mixerStartSpoolingChannel(
211 int channel,
int song,
Common::File &sampleFileIOHandle,
int sampleLen,
int frequency,
212 int volume,
int callbackID, uint32 flags);
213 byte mixerGetOutputFlags(
bool is3DOMusic =
false);
Definition: audiostream.h:212
Definition: intern_he.h:52
Definition: mixer_he.h:74
Definition: mixer_he.h:120
Definition: sound_he.h:109
Definition: audiostream.h:370
Definition: mixer_he.h:68
Definition: mixer_he.h:131
Definition: mixer_he.h:76
Definition: sound_he.h:136