ScummVM API documentation
ll_sound.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 WATCHMAKER_LL_SOUND_H
23 #define WATCHMAKER_LL_SOUND_H
24 
25 #include "watchmaker/types.h"
26 
27 namespace Watchmaker {
28 
29 typedef float sF32;
30 typedef unsigned int sU32;
31 typedef signed int sS32;
32 typedef unsigned short sU16;
33 
34 #define SOUND_NAME_LEN 100
35 
36 #define SOUND_SPEECH 32
37 
38 struct sV3F {
39  sF32 x, y, z;
40 };
41 
42 struct sEnvironment {
43  sS32 lIndex; // room index (for retrieval)
44  sS32 lRoom; // room effect level at low frequencies
45  sS32 lRoomHF; // room effect high-frequency level re. low frequency level
46  sF32 flRoomRolloffFactor; // like DS3D flRolloffFactor but for room effect
47  sF32 flDecayTime; // reverberation decay time at low frequencies
48  sF32 flDecayHFRatio; // high-frequency to low-frequency decay time ratio
49  sS32 lReflections; // early reflections level relative to room effect
50  sF32 flReflectionsDelay; // initial reflection delay time
51  sS32 lReverb; // late reverberation level relative to room effect
52  sF32 flReverbDelay; // late reverberation delay time relative to initial reflection
53  sU32 dwEnvironment; // sets all listener properties ****
54  sF32 flEnvironmentSize; // environment size in meters
55  sF32 flEnvironmentDiffusion; // environment diffusion
56  sF32 flAirAbsorptionHF; // change in level per meter at 5 kHz
57  sU32 dwFlags; // modifies the behavior of properties
58 };
59 
60 struct sSound {
61  char name[SOUND_NAME_LEN];
62  sS32 lIndex;
63  sU32 dwLooped;
64  sF32 flMaxDistance; // servono fl
65  sF32 flMinDistance; // servono fl
66  sV3F v3flPosition; // meshlink
67  sV3F v3flConeOrientation; // angolo con (0,0,-1)
68  sU32 dwConeInsideAngle; // servono int
69  sU32 dwConeOutsideAngle; // servono int
70  sS32 dwConeOutsideVolume; // servono int (negativo)
71  sU32 dwFlags; // flags
72 };
73 
74 struct sListener {
75  sF32 flDistanceFactor; // non serve
76  sV3F v3flFrontOrientation; // vettore front camera
77  sV3F v3flTopOrientation; // vettore alto camera
78  sV3F v3flPosition; // quella della telecamera
79  sF32 flRolloff; // non serve
80 };
81 
82 bool sSetListener(sListener *NewListener);
83 bool sStartSound(sSound *CurSound, bool Reload);
84 bool sStopSound(int32 index);
85 bool sStopAllSounds();
86 bool sIsPlaying(sS32 lIndex);
87 
88 bool mInitMusicSystem();
89 bool mCloseMusicSystem();
90 bool mLoadMusic(const char *FileName);
91 bool mPlayMusic(const char *FileName);
92 bool mStopMusic();
93 bool mRestoreMixerVolume();
94 
95 bool mSetAllVolume(unsigned char Volume);
96 bool sSetAllSoundsVolume(unsigned char Vol);
97 bool sSetAllSpeechVolume(unsigned char Vol);
98 bool sStartSoundDiffuse(sSound *CurSound);
99 
100 } // End of namespace Watchmaker
101 
102 #endif // WATCHMAKER_LL_SOUND_H
Definition: 2d_stuff.h:30
Definition: ll_sound.h:38
Definition: ll_sound.h:60
Definition: ll_sound.h:74
Definition: ll_sound.h:42