1 (* Copyright (C) Doom 2D: Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 *)
15 interface
17 uses
18 {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
19 SysUtils;
21 type
22 TSoundRec = record
23 nRefs: Integer;
24 end;
26 TBasicSound = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
27 private
28 protected
29 FMusic: Boolean;
30 FPosition: DWORD;
31 function RawPlay(Pan: Single; Volume: Single; aPos: DWORD): Boolean;
32 public
33 constructor Create;
34 destructor Destroy; override;
35 procedure SetID (ID: DWORD);
36 procedure FreeSound;
37 function IsPlaying (): Boolean;
38 procedure Stop;
39 function IsPaused (): Boolean;
40 procedure Pause (Enable: Boolean);
41 function GetVolume (): Single;
42 procedure SetVolume (Volume: Single);
43 function GetPan (): Single;
44 procedure SetPan (Pan: Single);
45 function IsMuted (): Boolean;
46 procedure Mute (Enable: Boolean);
47 function GetPosition (): DWORD;
48 procedure SetPosition (aPos: DWORD);
49 procedure SetPriority (priority: Integer);
50 end;
52 const
53 NO_SOUND_ID = DWORD(-1);
55 function e_InitSoundSystem (NoOutput: Boolean = False): Boolean;
57 function e_LoadSound (FileName: string; var ID: DWORD; isMusic: Boolean; ForceNoLoop: Boolean = False): Boolean;
58 function e_LoadSoundMem (pData: Pointer; Length: Integer; var ID: DWORD; isMusic: Boolean; ForceNoLoop: Boolean = False): Boolean;
60 function e_PlaySound (ID: DWORD): Integer;
61 function e_PlaySoundPan (ID: DWORD; Pan: Single): Integer;
62 function e_PlaySoundVolume (ID: DWORD; Volume: Single): Integer;
63 function e_PlaySoundPanVolume (ID: DWORD; Pan, Volume: Single): Integer;
65 procedure e_ModifyChannelsVolumes (SoundMod: Single; setMode: Boolean);
66 procedure e_MuteChannels (Enable: Boolean);
67 procedure e_StopChannels;
69 procedure e_DeleteSound (ID: DWORD);
70 procedure e_RemoveAllSounds;
71 procedure e_ReleaseSoundSystem;
72 procedure e_SoundUpdate;
74 var
75 e_SoundsArray: array of TSoundRec = nil;
77 implementation
79 function e_InitSoundSystem(NoOutput: Boolean = False): Boolean;
80 begin
81 result := false
82 end;
84 function e_LoadSound(FileName: String; var ID: DWORD; isMusic: Boolean; ForceNoLoop: Boolean = False): Boolean;
85 begin
86 ID := NO_SOUND_ID;
87 result := true
88 end;
90 function e_LoadSoundMem(pData: Pointer; Length: Integer; var ID: DWORD; isMusic: Boolean; ForceNoLoop: Boolean = False): Boolean;
91 begin
92 ID := NO_SOUND_ID;
93 result := true
94 end;
96 function e_PlaySound (ID: DWORD): Integer;
97 begin
98 Result := -1
99 end;
101 function e_PlaySoundPan(ID: DWORD; Pan: Single): Integer;
102 begin
103 result := -1
104 end;
106 function e_PlaySoundVolume(ID: DWORD; Volume: Single): Integer;
107 begin
108 result := -1
109 end;
111 function e_PlaySoundPanVolume(ID: DWORD; Pan, Volume: Single): Integer;
112 begin
113 result := -1
114 end;
116 procedure e_DeleteSound(ID: DWORD);
117 begin
118 end;
120 procedure e_ModifyChannelsVolumes(SoundMod: Single; setMode: Boolean);
121 begin
122 end;
124 procedure e_MuteChannels(Enable: Boolean);
125 begin
126 end;
128 procedure e_StopChannels();
129 begin
130 end;
132 procedure e_RemoveAllSounds();
133 begin
134 end;
136 procedure e_ReleaseSoundSystem();
137 begin
138 end;
140 procedure e_SoundUpdate();
141 begin
142 end;
144 (* --------- TBasicSound --------- *)
146 constructor TBasicSound.Create;
147 begin
148 end;
150 destructor TBasicSound.Destroy;
151 begin
152 inherited;
153 end;
155 procedure TBasicSound.FreeSound;
156 begin
157 end;
159 function TBasicSound.RawPlay (Pan: Single; Volume: Single; aPos: DWORD): Boolean;
160 begin
161 result := false
162 end;
164 procedure TBasicSound.SetID (ID: DWORD);
165 begin
166 end;
168 function TBasicSound.IsPlaying (): Boolean;
169 begin
170 result := false
171 end;
173 procedure TBasicSound.Stop;
174 begin
175 end;
177 function TBasicSound.IsPaused (): Boolean;
178 begin
179 result := false
180 end;
182 procedure TBasicSound.Pause (Enable: Boolean);
183 begin
184 end;
186 function TBasicSound.GetVolume (): Single;
187 begin
188 result := 0.0
189 end;
191 procedure TBasicSound.SetVolume (Volume: Single);
192 begin
193 end;
195 function TBasicSound.GetPan (): Single;
196 begin
197 result := 1.0
198 end;
200 procedure TBasicSound.SetPan (Pan: Single);
201 begin
202 end;
204 function TBasicSound.IsMuted (): Boolean;
205 begin
206 result := false
207 end;
209 procedure TBasicSound.Mute (Enable: Boolean);
210 begin
211 end;
213 function TBasicSound.GetPosition (): DWORD;
214 begin
215 result := 0
216 end;
218 procedure TBasicSound.SetPosition (aPos: DWORD);
219 begin
220 end;
222 procedure TBasicSound.SetPriority(priority: Integer);
223 begin
224 end;
226 end.