DEADSOFTWARE

0d944b69a13eb5e332ff9a2bd8fda20d735f08c8
[d2df-sdl.git] / src / wrappers / sdl2 / SDL2_mixer.pas
1 {$INCLUDE ../shared/a_modes.inc}
2 {$SCOPEDENUMS OFF}
3 unit SDL2_mixer;
5 interface
7 uses SDL2;
9 const
10 MIX_INIT_FLAC = $00000001;
11 MIX_INIT_MOD = $00000002;
12 MIX_INIT_MODPLUG = $00000004;
13 MIX_INIT_MP3 = $00000008;
14 MIX_INIT_OGG = $00000010;
15 MIX_INIT_FLUIDSYNTH = $00000020;
17 MIX_DEFAULT_FREQUENCY = 22050;
18 MIX_DEFAULT_CHANNELS = 2;
19 MIX_MAX_VOLUME = 128;
21 {$IFDEF FPC}
22 {$IF DEFINED(ENDIAN_LITTLE)}
23 MIX_DEFAULT_FORMAT = AUDIO_S16LSB;
24 {$ELSEIF DEFINED(ENDIAN_BIG)}
25 MIX_DEFAULT_FORMAT = AUDIO_S16MSB;
26 {$ELSE}
27 {$FATAL Unable to determine endianness.}
28 {$IFEND}
29 {$ENDIF}
31 type
32 PMix_Chunk = ^TMix_Chunk;
33 TMix_Chunk = record
34 allocated: Integer;
35 abuf: PUInt8;
36 alen: UInt32;
37 volume: UInt8;
38 end;
40 PMix_Music = ^TMix_Music;
41 TMix_Music = record end;
43 TMix_Fading = (MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN);
45 TMix_MusicType = (MUS_NONE,
46 MUS_CMD,
47 MUS_WAV,
48 MUS_MOD,
49 MUS_MID,
50 MUS_OGG,
51 MUS_MP3,
52 MUS_MP3_MAD,
53 MUS_FLAC,
54 MUS_MODPLUG);
56 TMix_Channel_Finished = procedure(channel: Integer); cdecl;
58 (** procedures **)
60 function Mix_GetMusicType(music: TMix_Music): TMix_MusicType;
61 function Mix_Init(flags: Integer): Integer;
62 function Mix_OpenAudio(frequency: Integer; format: UInt16; channels: Integer; chunksize: Integer): Integer;
63 function Mix_GetError: PAnsiChar;
64 function Mix_QuerySpec(frequency: PInt; format: PUInt16; channels: PInt): Integer;
65 function Mix_GetNumChunkDecoders: Integer;
66 function Mix_GetChunkDecoder(index: Integer): PAnsiChar;
67 function Mix_GetNumMusicDecoders: Integer;
68 function Mix_GetMusicDecoder(index: Integer): PAnsiChar;
69 function Mix_AllocateChannels(numchans: Integer): Integer;
70 procedure Mix_ChannelFinished(channel_finished: TMix_Channel_Finished);
71 function Mix_LoadMUS(_file: PAnsiChar): PMix_Music;
72 function Mix_LoadMUS_RW(src: PSDL_RWops; freesrc: Integer): PMix_Music;
73 function Mix_LoadWAV(_file: PAnsiChar): PMix_Chunk;
74 function Mix_LoadWAV_RW(src: PSDL_RWops; freesrc: Integer): PMix_Chunk;
76 function Mix_PlayChannel(channel: Integer; chunk: PMix_Chunk; loops: Integer): Integer;
77 function Mix_Volume(channel: Integer; volume: Integer): Integer;
78 function Mix_HaltMusic: Integer;
79 function Mix_PlayMusic(music: PMix_Music; loops: Integer): Integer;
80 function Mix_SetPanning(channel: Integer; left: UInt8; right: UInt8): Integer;
81 procedure Mix_FreeChunk(chunk: PMix_Chunk);
82 procedure Mix_FreeMusic(music: PMix_Music);
84 function Mix_VolumeMusic(volume: Integer): Integer;
85 function Mix_HaltChannel(channel: Integer): Integer;
86 procedure Mix_CloseAudio;
87 function Mix_PlayingMusic: Integer;
88 function Mix_Paused(channel: Integer): Integer;
89 procedure Mix_Pause(channel: Integer);
90 procedure Mix_Resume(channel: Integer);
92 procedure Mix_PauseMusic;
93 function Mix_PausedMusic: Integer;
94 procedure Mix_ResumeMusic;
96 implementation
98 function Mix_GetMusicType(music: TMix_Music): TMix_MusicType;
99 begin
100 result := TMix_MusicType.MUS_NONE
101 end;
103 function Mix_Init(flags: Integer): Integer;
104 begin
105 result := 0
106 end;
108 function Mix_OpenAudio(frequency: Integer; format: UInt16; channels: Integer; chunksize: Integer): Integer;
109 begin
110 result := 0
111 end;
113 function Mix_GetError: PAnsiChar;
114 begin
115 result := ''
116 end;
118 function Mix_QuerySpec(frequency: PInt; format: PUInt16; channels: PInt): Integer;
119 begin
120 result := 0
121 end;
123 function Mix_GetNumChunkDecoders: Integer;
124 begin
125 result := 0
126 end;
128 function Mix_GetChunkDecoder(index: Integer): PAnsiChar;
129 begin
130 result := ''
131 end;
133 function Mix_GetNumMusicDecoders: Integer;
134 begin
135 result := 0
136 end;
138 function Mix_GetMusicDecoder(index: Integer): PAnsiChar;
139 begin
140 result := ''
141 end;
143 function Mix_AllocateChannels(numchans: Integer): Integer;
144 begin
145 result := 0
146 end;
148 procedure Mix_ChannelFinished(channel_finished: TMix_Channel_Finished);
149 begin
150 end;
152 function Mix_LoadMUS(_file: PAnsiChar): PMix_Music;
153 begin
154 result := nil
155 end;
157 function Mix_LoadMUS_RW(src: PSDL_RWops; freesrc: Integer): PMix_Music;
158 begin
159 result := nil
160 end;
162 function Mix_LoadWAV(_file: PAnsiChar): PMix_Chunk;
163 begin
164 Result := Mix_LoadWAV_RW(SDL_RWFromFile(_file, 'rb'), 1);
165 end;
167 function Mix_LoadWAV_RW(src: PSDL_RWops; freesrc: Integer): PMix_Chunk;
168 begin
169 result := nil
170 end;
172 function Mix_PlayChannel(channel: Integer; chunk: PMix_Chunk; loops: Integer): Integer;
173 begin
174 result := 0
175 end;
177 function Mix_Volume(channel: Integer; volume: Integer): Integer;
178 begin
179 result := 0
180 end;
182 function Mix_HaltMusic: Integer;
183 begin
184 result := 0
185 end;
187 function Mix_PlayMusic(music: PMix_Music; loops: Integer): Integer;
188 begin
189 result := 0
190 end;
192 function Mix_SetPanning(channel: Integer; left: UInt8; right: UInt8): Integer;
193 begin
194 result := 0
195 end;
197 procedure Mix_FreeChunk(chunk: PMix_Chunk);
198 begin
199 end;
201 procedure Mix_FreeMusic(music: PMix_Music);
202 begin
203 end;
205 function Mix_VolumeMusic(volume: Integer): Integer;
206 begin
207 result := 0
208 end;
210 function Mix_HaltChannel(channel: Integer): Integer;
211 begin
212 result := 0
213 end;
215 procedure Mix_CloseAudio;
216 begin
217 end;
219 function Mix_PlayingMusic: Integer;
220 begin
221 result := 0
222 end;
224 function Mix_Paused(channel: Integer): Integer;
225 begin
226 result := 0
227 end;
229 procedure Mix_Pause(channel: Integer);
230 begin
231 end;
233 procedure Mix_Resume(channel: Integer);
234 begin
235 end;
237 procedure Mix_PauseMusic;
238 begin
239 end;
241 function Mix_PausedMusic: Integer;
242 begin
243 result := 0
244 end;
246 procedure Mix_ResumeMusic;
247 begin
248 end;
250 end.