ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
global_audio.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef AGS_ENGINE_AC_GLOBAL_AUDIO_H
23 #define AGS_ENGINE_AC_GLOBAL_AUDIO_H
24 
25 #include "ags/engine/ac/speech.h"
26 
27 namespace AGS3 {
28 
29 void StopAmbientSound(int channel);
30 void PlayAmbientSound(int channel, int sndnum, int vol, int x, int y);
31 int IsChannelPlaying(int chan);
32 int IsSoundPlaying();
33 // returns -1 on failure, channel number on success
34 int PlaySoundEx(int val1, int channel);
35 void StopAllSounds(int evenAmbient);
36 
37 void PlayMusicResetQueue(int newmus);
38 void SeekMIDIPosition(int position);
39 int GetMIDIPosition();
40 int IsMusicPlaying();
41 int PlayMusicQueued(int musnum);
42 void scr_StopMusic();
43 void SeekMODPattern(int patnum);
44 void SeekMP3PosMillis(int posn);
45 int GetMP3PosMillis();
46 void SetMusicVolume(int newvol);
47 void SetMusicMasterVolume(int newvol);
48 void SetSoundVolume(int newvol);
49 void SetChannelVolume(int chan, int newvol);
50 void SetDigitalMasterVolume(int newvol);
51 int GetCurrentMusic();
52 void SetMusicRepeat(int loopflag);
53 void PlayMP3File(const char *filename);
54 void PlaySilentMIDI(int mnum);
55 
56 void SetSpeechVolume(int newvol);
57 void SetVoiceMode(int newmod);
58 int GetVoiceMode();
59 int IsVoxAvailable();
60 int IsMusicVoxAvailable();
61 
62 struct CharacterInfo;
63 struct ScriptAudioChannel;
64 // Starts voice-over playback and returns audio channel it is played on;
65 // as_speech flag determines whether engine should apply speech-related logic
66 // as well, such as temporary volume reduction.
67 ScriptAudioChannel *PlayVoiceClip(CharacterInfo *ch, int sndid, bool as_speech);
68 
69 //=============================================================================
70 // Play voice-over for the active blocking speech and initialize relevant data
71 bool play_voice_speech(int charid, int sndid);
72 // Play voice-over clip in non-blocking manner
73 bool play_voice_nonblocking(int charid, int sndid, bool as_speech);
74 // Stop voice-over for the active speech and reset relevant data
75 void stop_voice_speech();
76 // Stop non-blocking voice-over and revert audio volumes if necessary
77 void stop_voice_nonblocking();
78 
79 } // namespace AGS3
80 
81 #endif
Definition: ags.h:40