22 #ifndef LASTEXPRESS_SOUND_H 23 #define LASTEXPRESS_SOUND_H 25 #include "lastexpress/shared.h" 27 #include "common/str.h" 29 #include "audio/mixer.h" 30 #include "audio/audiostream.h" 35 class QueuingAudioStream;
42 class LastExpressEngine;
59 void mix(
Slot *slot, int16 *outBuf);
61 void mixChannels(
int numChannels, int16 *buffer);
63 int playSoundFile(
const char *sndName,
int typeFlags,
int character,
int delay);
65 void startSteam(
int cityIndex);
68 void raiseAmbient(
int level,
int delay);
69 void levelAmbient(
int delay);
70 Slot *findSlotWho(int32 character);
71 Slot *findSlotName(
char *name);
72 void ambientAI(
int id);
75 void killAllExcept(
int tag1,
int tag2,
int tag3,
int tag4,
int tag5,
int tag6,
int tag7);
77 void destroyAllSound();
78 void loadSoundInfo(
CVCRFile *file,
bool skipSoundLoading);
79 void addSlot(
Slot *entry);
80 void removeSlot(
Slot *entry);
83 int getMasterVolume();
84 void setMasterVolume(
int volume);
87 void soundDriverInit();
88 void soundDriverCopyBuffersToDevice();
89 int soundDriverGetVolume();
90 void soundDriverSetVolume(
int volume);
91 int32 getSoundDriverTicks();
92 void setSoundDriverTicks(int32 value);
93 int32 getSoundDriver30HzCounter();
94 int32 getSoundDriverFlags();
95 void addSoundDriverFlags(int32 flags);
96 void removeSoundDriverFlags(int32 flags);
97 bool isCopyingDataToSoundDriver();
105 int32 _sound30HzCounter = 0;
106 Slot *_soundCache =
nullptr;
107 int32 _curSoundSlotTag = kSoundTagFirstNormal;
108 int32 _soundDriverFlags = kSoundDriverInitState;
109 Slot *_soundSlotChannels[6];
110 int32 _numActiveChannels = 0;
111 bool _scanAnySoundLoopingSection =
false;
112 int32 _soundSlotAmbientFlag = 0;
113 int32 _soundAmbientFadeLevel = 0;
114 int32 _soundAmbientFadeTime = 0;
115 int32 _soundCacheCount = 0;
116 int32 _loopingSoundDuration = 0;
117 int32 _inSoundThreadFunction = 0;
118 bool _copyingDataToSoundDriver =
false;
119 int16 _soundChannelsMixBuffers[6][1470];
120 int16 _soundMixBuffer[1470];
121 bool _soundEngineToggle =
false;
122 int32 _soundDriverTicks = 0;
123 int32 _soundDriverVolume = 0;
124 uint32 _maxQueuedStreams = 0;
126 const char *_cities[17] = {
150 #endif // LASTEXPRESS_SOUND_H Definition: cvcrfile.h:61
Definition: lastexpress.h:523
Definition: graphics.h:64
Definition: audiostream.h:370