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 {$INCLUDE ../shared/a_modes.inc}
18 interface
22 type
23 // a WAV loader that just uses SDL_LoadWAV
26 public
33 private
41 public
47 implementation
49 uses
50 {$IFDEF USE_SDL}
52 {$ELSE}
53 SDL2,
54 {$ENDIF}
57 (* TWAVLoaderFactory *)
60 var
62 begin
64 begin
66 exit;
69 Result := ((P+0)^ = Ord('R')) and ((P+1)^ = Ord('I')) and ((P+2)^ = Ord('F')) and ((P+3)^ = Ord('F'));
73 begin
74 // TODO: ehhh
79 begin
83 (* TWAVLoader *)
84 function ConvertSound (var buf: PUInt8; var len: UInt32; var format: UInt16; rate: cint; chan: UInt8): Boolean;
86 begin
92 {$IFDEF USE_SDL2}
95 {$ENDIF}
99 begin
102 begin
103 {$IFDEF USE_SDL2}
105 {$ELSE}
107 {$ENDIF}
112 format := tformat
113 end
114 end
118 var
122 begin
124 {$IFDEF USE_SDL2}
126 {$ELSE}
128 {$ENDIF}
129 begin
132 begin
134 begin
136 {$IFDEF USE_SDL2}
138 {$ELSE}
140 {$ENDIF}
145 end
146 end
147 else
148 begin
150 end
151 end
155 var
157 begin
168 var
170 begin
173 begin
177 end
178 else
179 begin
189 begin
194 begin
200 var
203 begin
208 begin
222 begin
230 initialization