sdl2-bindings 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +145 -134
- data/LICENSE.txt +0 -0
- data/README.md +108 -86
- data/lib/sdl2.rb +131 -131
- data/lib/sdl2_audio.rb +265 -261
- data/lib/sdl2_blendmode.rb +72 -72
- data/lib/sdl2_clipboard.rb +56 -56
- data/lib/sdl2_cpuinfo.rb +137 -129
- data/lib/sdl2_error.rb +71 -71
- data/lib/sdl2_events.rb +575 -564
- data/lib/sdl2_filesystem.rb +52 -52
- data/lib/sdl2_framerate.rb +74 -74
- data/lib/sdl2_gamecontroller.rb +345 -329
- data/lib/sdl2_gesture.rb +61 -61
- data/lib/sdl2_gfxPrimitives.rb +283 -283
- data/lib/sdl2_guid.rb +58 -0
- data/lib/sdl2_haptic.rb +301 -301
- data/lib/sdl2_hidapi.rb +139 -139
- data/lib/sdl2_hints.rb +240 -221
- data/lib/sdl2_image.rb +296 -296
- data/lib/sdl2_imageFilter.rb +164 -164
- data/lib/sdl2_joystick.rb +332 -294
- data/lib/sdl2_keyboard.rb +129 -125
- data/lib/sdl2_keycode.rb +311 -307
- data/lib/sdl2_log.rb +131 -131
- data/lib/sdl2_main.rb +74 -74
- data/lib/sdl2_messagebox.rb +102 -102
- data/lib/sdl2_misc.rb +48 -48
- data/lib/sdl2_mixer.rb +464 -464
- data/lib/sdl2_mouse.rb +136 -136
- data/lib/sdl2_pixels.rb +240 -240
- data/lib/sdl2_platform.rb +48 -48
- data/lib/sdl2_power.rb +54 -54
- data/lib/sdl2_rect.rb +145 -145
- data/lib/sdl2_render.rb +408 -408
- data/lib/sdl2_rotozoom.rb +76 -76
- data/lib/sdl2_rwops.rb +242 -242
- data/lib/sdl2_scancode.rb +293 -289
- data/lib/sdl2_sensor.rb +115 -115
- data/lib/sdl2_shape.rb +83 -83
- data/lib/sdl2_sound.rb +154 -154
- data/lib/sdl2_stdinc.rb +572 -548
- data/lib/sdl2_surface.rb +229 -229
- data/lib/sdl2_syswm.rb +160 -160
- data/lib/sdl2_timer.rb +74 -74
- data/lib/sdl2_touch.rb +86 -86
- data/lib/sdl2_ttf.rb +414 -414
- data/lib/sdl2_version.rb +67 -67
- data/lib/sdl2_video.rb +549 -540
- data/lib/sdl2_vulkan.rb +72 -72
- metadata +4 -3
data/lib/sdl2_mixer.rb
CHANGED
@@ -1,464 +1,464 @@
|
|
1
|
-
# Ruby-SDL2 : Yet another SDL2 wrapper for Ruby
|
2
|
-
#
|
3
|
-
# * https://github.com/vaiorabbit/sdl2-bindings
|
4
|
-
#
|
5
|
-
# [NOTICE] This is an automatically generated file.
|
6
|
-
|
7
|
-
require 'ffi'
|
8
|
-
|
9
|
-
module SDL
|
10
|
-
extend FFI::Library
|
11
|
-
# Define/Macro
|
12
|
-
|
13
|
-
MIXER_MAJOR_VERSION = 2
|
14
|
-
MIXER_MINOR_VERSION = 6
|
15
|
-
MIXER_PATCHLEVEL =
|
16
|
-
MIX_CHANNELS = 8
|
17
|
-
MIX_DEFAULT_FREQUENCY = 44100
|
18
|
-
MIX_DEFAULT_FORMAT = AUDIO_S16LSB
|
19
|
-
MIX_DEFAULT_CHANNELS = 2
|
20
|
-
MIX_MAX_VOLUME = MIX_MAXVOLUME
|
21
|
-
MIX_CHANNEL_POST = -2
|
22
|
-
MIX_EFFECTSMAXSPEED = "MIX_EFFECTSMAXSPEED"
|
23
|
-
|
24
|
-
# Enum
|
25
|
-
|
26
|
-
MIX_INIT_FLAC = 1
|
27
|
-
MIX_INIT_MOD = 2
|
28
|
-
MIX_INIT_MP3 = 8
|
29
|
-
MIX_INIT_OGG = 16
|
30
|
-
MIX_INIT_MID = 32
|
31
|
-
MIX_INIT_OPUS = 64
|
32
|
-
MIX_NO_FADING = 0
|
33
|
-
MIX_FADING_OUT = 1
|
34
|
-
MIX_FADING_IN = 2
|
35
|
-
MUS_NONE = 0
|
36
|
-
MUS_CMD = 1
|
37
|
-
MUS_WAV = 2
|
38
|
-
MUS_MOD = 3
|
39
|
-
MUS_MID = 4
|
40
|
-
MUS_OGG = 5
|
41
|
-
MUS_MP3 = 6
|
42
|
-
MUS_MP3_MAD_UNUSED = 7
|
43
|
-
MUS_FLAC = 8
|
44
|
-
MUS_MODPLUG_UNUSED = 9
|
45
|
-
MUS_OPUS = 10
|
46
|
-
|
47
|
-
# Typedef
|
48
|
-
|
49
|
-
typedef :int, :MIX_InitFlags
|
50
|
-
typedef :int, :Mix_Fading
|
51
|
-
typedef :int, :Mix_MusicType
|
52
|
-
callback :Mix_EffectFunc_t, [:int, :pointer, :int, :pointer], :void
|
53
|
-
callback :Mix_EffectDone_t, [:int, :pointer], :void
|
54
|
-
|
55
|
-
# Struct
|
56
|
-
|
57
|
-
class Mix_Chunk < FFI::Struct
|
58
|
-
layout(
|
59
|
-
:allocated, :int,
|
60
|
-
:abuf, :pointer,
|
61
|
-
:alen, :uint,
|
62
|
-
:volume, :uchar,
|
63
|
-
)
|
64
|
-
end
|
65
|
-
|
66
|
-
|
67
|
-
# Function
|
68
|
-
|
69
|
-
def self.setup_mixer_symbols(output_error = false)
|
70
|
-
symbols = [
|
71
|
-
:Mix_Linked_Version,
|
72
|
-
:Mix_Init,
|
73
|
-
:Mix_Quit,
|
74
|
-
:Mix_OpenAudio,
|
75
|
-
:Mix_OpenAudioDevice,
|
76
|
-
:Mix_QuerySpec,
|
77
|
-
:Mix_AllocateChannels,
|
78
|
-
:Mix_LoadWAV_RW,
|
79
|
-
:Mix_LoadWAV,
|
80
|
-
:Mix_LoadMUS,
|
81
|
-
:Mix_LoadMUS_RW,
|
82
|
-
:Mix_LoadMUSType_RW,
|
83
|
-
:Mix_QuickLoad_WAV,
|
84
|
-
:Mix_QuickLoad_RAW,
|
85
|
-
:Mix_FreeChunk,
|
86
|
-
:Mix_FreeMusic,
|
87
|
-
:Mix_GetNumChunkDecoders,
|
88
|
-
:Mix_GetChunkDecoder,
|
89
|
-
:Mix_HasChunkDecoder,
|
90
|
-
:Mix_GetNumMusicDecoders,
|
91
|
-
:Mix_GetMusicDecoder,
|
92
|
-
:Mix_HasMusicDecoder,
|
93
|
-
:Mix_GetMusicType,
|
94
|
-
:Mix_GetMusicTitle,
|
95
|
-
:Mix_GetMusicTitleTag,
|
96
|
-
:Mix_GetMusicArtistTag,
|
97
|
-
:Mix_GetMusicAlbumTag,
|
98
|
-
:Mix_GetMusicCopyrightTag,
|
99
|
-
:Mix_SetPostMix,
|
100
|
-
:Mix_HookMusic,
|
101
|
-
:Mix_HookMusicFinished,
|
102
|
-
:Mix_GetMusicHookData,
|
103
|
-
:Mix_ChannelFinished,
|
104
|
-
:Mix_RegisterEffect,
|
105
|
-
:Mix_UnregisterEffect,
|
106
|
-
:Mix_UnregisterAllEffects,
|
107
|
-
:Mix_SetPanning,
|
108
|
-
:Mix_SetPosition,
|
109
|
-
:Mix_SetDistance,
|
110
|
-
:Mix_SetReverseStereo,
|
111
|
-
:Mix_ReserveChannels,
|
112
|
-
:Mix_GroupChannel,
|
113
|
-
:Mix_GroupChannels,
|
114
|
-
:Mix_GroupAvailable,
|
115
|
-
:Mix_GroupCount,
|
116
|
-
:Mix_GroupOldest,
|
117
|
-
:Mix_GroupNewer,
|
118
|
-
:Mix_PlayChannel,
|
119
|
-
:Mix_PlayChannelTimed,
|
120
|
-
:Mix_PlayMusic,
|
121
|
-
:Mix_FadeInMusic,
|
122
|
-
:Mix_FadeInMusicPos,
|
123
|
-
:Mix_FadeInChannel,
|
124
|
-
:Mix_FadeInChannelTimed,
|
125
|
-
:Mix_Volume,
|
126
|
-
:Mix_VolumeChunk,
|
127
|
-
:Mix_VolumeMusic,
|
128
|
-
:Mix_GetMusicVolume,
|
129
|
-
:Mix_MasterVolume,
|
130
|
-
:Mix_HaltChannel,
|
131
|
-
:Mix_HaltGroup,
|
132
|
-
:Mix_HaltMusic,
|
133
|
-
:Mix_ExpireChannel,
|
134
|
-
:Mix_FadeOutChannel,
|
135
|
-
:Mix_FadeOutGroup,
|
136
|
-
:Mix_FadeOutMusic,
|
137
|
-
:Mix_FadingMusic,
|
138
|
-
:Mix_FadingChannel,
|
139
|
-
:Mix_Pause,
|
140
|
-
:Mix_Resume,
|
141
|
-
:Mix_Paused,
|
142
|
-
:Mix_PauseMusic,
|
143
|
-
:Mix_ResumeMusic,
|
144
|
-
:Mix_RewindMusic,
|
145
|
-
:Mix_PausedMusic,
|
146
|
-
:Mix_ModMusicJumpToOrder,
|
147
|
-
:Mix_SetMusicPosition,
|
148
|
-
:Mix_GetMusicPosition,
|
149
|
-
:Mix_MusicDuration,
|
150
|
-
:Mix_GetMusicLoopStartTime,
|
151
|
-
:Mix_GetMusicLoopEndTime,
|
152
|
-
:Mix_GetMusicLoopLengthTime,
|
153
|
-
:Mix_Playing,
|
154
|
-
:Mix_PlayingMusic,
|
155
|
-
:Mix_SetMusicCMD,
|
156
|
-
:Mix_SetSynchroValue,
|
157
|
-
:Mix_GetSynchroValue,
|
158
|
-
:Mix_SetSoundFonts,
|
159
|
-
:Mix_GetSoundFonts,
|
160
|
-
:Mix_EachSoundFont,
|
161
|
-
:Mix_SetTimidityCfg,
|
162
|
-
:Mix_GetTimidityCfg,
|
163
|
-
:Mix_GetChunk,
|
164
|
-
:Mix_CloseAudio,
|
165
|
-
]
|
166
|
-
apis = {
|
167
|
-
:Mix_Linked_Version => :Mix_Linked_Version,
|
168
|
-
:Mix_Init => :Mix_Init,
|
169
|
-
:Mix_Quit => :Mix_Quit,
|
170
|
-
:Mix_OpenAudio => :Mix_OpenAudio,
|
171
|
-
:Mix_OpenAudioDevice => :Mix_OpenAudioDevice,
|
172
|
-
:Mix_QuerySpec => :Mix_QuerySpec,
|
173
|
-
:Mix_AllocateChannels => :Mix_AllocateChannels,
|
174
|
-
:Mix_LoadWAV_RW => :Mix_LoadWAV_RW,
|
175
|
-
:Mix_LoadWAV => :Mix_LoadWAV,
|
176
|
-
:Mix_LoadMUS => :Mix_LoadMUS,
|
177
|
-
:Mix_LoadMUS_RW => :Mix_LoadMUS_RW,
|
178
|
-
:Mix_LoadMUSType_RW => :Mix_LoadMUSType_RW,
|
179
|
-
:Mix_QuickLoad_WAV => :Mix_QuickLoad_WAV,
|
180
|
-
:Mix_QuickLoad_RAW => :Mix_QuickLoad_RAW,
|
181
|
-
:Mix_FreeChunk => :Mix_FreeChunk,
|
182
|
-
:Mix_FreeMusic => :Mix_FreeMusic,
|
183
|
-
:Mix_GetNumChunkDecoders => :Mix_GetNumChunkDecoders,
|
184
|
-
:Mix_GetChunkDecoder => :Mix_GetChunkDecoder,
|
185
|
-
:Mix_HasChunkDecoder => :Mix_HasChunkDecoder,
|
186
|
-
:Mix_GetNumMusicDecoders => :Mix_GetNumMusicDecoders,
|
187
|
-
:Mix_GetMusicDecoder => :Mix_GetMusicDecoder,
|
188
|
-
:Mix_HasMusicDecoder => :Mix_HasMusicDecoder,
|
189
|
-
:Mix_GetMusicType => :Mix_GetMusicType,
|
190
|
-
:Mix_GetMusicTitle => :Mix_GetMusicTitle,
|
191
|
-
:Mix_GetMusicTitleTag => :Mix_GetMusicTitleTag,
|
192
|
-
:Mix_GetMusicArtistTag => :Mix_GetMusicArtistTag,
|
193
|
-
:Mix_GetMusicAlbumTag => :Mix_GetMusicAlbumTag,
|
194
|
-
:Mix_GetMusicCopyrightTag => :Mix_GetMusicCopyrightTag,
|
195
|
-
:Mix_SetPostMix => :Mix_SetPostMix,
|
196
|
-
:Mix_HookMusic => :Mix_HookMusic,
|
197
|
-
:Mix_HookMusicFinished => :Mix_HookMusicFinished,
|
198
|
-
:Mix_GetMusicHookData => :Mix_GetMusicHookData,
|
199
|
-
:Mix_ChannelFinished => :Mix_ChannelFinished,
|
200
|
-
:Mix_RegisterEffect => :Mix_RegisterEffect,
|
201
|
-
:Mix_UnregisterEffect => :Mix_UnregisterEffect,
|
202
|
-
:Mix_UnregisterAllEffects => :Mix_UnregisterAllEffects,
|
203
|
-
:Mix_SetPanning => :Mix_SetPanning,
|
204
|
-
:Mix_SetPosition => :Mix_SetPosition,
|
205
|
-
:Mix_SetDistance => :Mix_SetDistance,
|
206
|
-
:Mix_SetReverseStereo => :Mix_SetReverseStereo,
|
207
|
-
:Mix_ReserveChannels => :Mix_ReserveChannels,
|
208
|
-
:Mix_GroupChannel => :Mix_GroupChannel,
|
209
|
-
:Mix_GroupChannels => :Mix_GroupChannels,
|
210
|
-
:Mix_GroupAvailable => :Mix_GroupAvailable,
|
211
|
-
:Mix_GroupCount => :Mix_GroupCount,
|
212
|
-
:Mix_GroupOldest => :Mix_GroupOldest,
|
213
|
-
:Mix_GroupNewer => :Mix_GroupNewer,
|
214
|
-
:Mix_PlayChannel => :Mix_PlayChannel,
|
215
|
-
:Mix_PlayChannelTimed => :Mix_PlayChannelTimed,
|
216
|
-
:Mix_PlayMusic => :Mix_PlayMusic,
|
217
|
-
:Mix_FadeInMusic => :Mix_FadeInMusic,
|
218
|
-
:Mix_FadeInMusicPos => :Mix_FadeInMusicPos,
|
219
|
-
:Mix_FadeInChannel => :Mix_FadeInChannel,
|
220
|
-
:Mix_FadeInChannelTimed => :Mix_FadeInChannelTimed,
|
221
|
-
:Mix_Volume => :Mix_Volume,
|
222
|
-
:Mix_VolumeChunk => :Mix_VolumeChunk,
|
223
|
-
:Mix_VolumeMusic => :Mix_VolumeMusic,
|
224
|
-
:Mix_GetMusicVolume => :Mix_GetMusicVolume,
|
225
|
-
:Mix_MasterVolume => :Mix_MasterVolume,
|
226
|
-
:Mix_HaltChannel => :Mix_HaltChannel,
|
227
|
-
:Mix_HaltGroup => :Mix_HaltGroup,
|
228
|
-
:Mix_HaltMusic => :Mix_HaltMusic,
|
229
|
-
:Mix_ExpireChannel => :Mix_ExpireChannel,
|
230
|
-
:Mix_FadeOutChannel => :Mix_FadeOutChannel,
|
231
|
-
:Mix_FadeOutGroup => :Mix_FadeOutGroup,
|
232
|
-
:Mix_FadeOutMusic => :Mix_FadeOutMusic,
|
233
|
-
:Mix_FadingMusic => :Mix_FadingMusic,
|
234
|
-
:Mix_FadingChannel => :Mix_FadingChannel,
|
235
|
-
:Mix_Pause => :Mix_Pause,
|
236
|
-
:Mix_Resume => :Mix_Resume,
|
237
|
-
:Mix_Paused => :Mix_Paused,
|
238
|
-
:Mix_PauseMusic => :Mix_PauseMusic,
|
239
|
-
:Mix_ResumeMusic => :Mix_ResumeMusic,
|
240
|
-
:Mix_RewindMusic => :Mix_RewindMusic,
|
241
|
-
:Mix_PausedMusic => :Mix_PausedMusic,
|
242
|
-
:Mix_ModMusicJumpToOrder => :Mix_ModMusicJumpToOrder,
|
243
|
-
:Mix_SetMusicPosition => :Mix_SetMusicPosition,
|
244
|
-
:Mix_GetMusicPosition => :Mix_GetMusicPosition,
|
245
|
-
:Mix_MusicDuration => :Mix_MusicDuration,
|
246
|
-
:Mix_GetMusicLoopStartTime => :Mix_GetMusicLoopStartTime,
|
247
|
-
:Mix_GetMusicLoopEndTime => :Mix_GetMusicLoopEndTime,
|
248
|
-
:Mix_GetMusicLoopLengthTime => :Mix_GetMusicLoopLengthTime,
|
249
|
-
:Mix_Playing => :Mix_Playing,
|
250
|
-
:Mix_PlayingMusic => :Mix_PlayingMusic,
|
251
|
-
:Mix_SetMusicCMD => :Mix_SetMusicCMD,
|
252
|
-
:Mix_SetSynchroValue => :Mix_SetSynchroValue,
|
253
|
-
:Mix_GetSynchroValue => :Mix_GetSynchroValue,
|
254
|
-
:Mix_SetSoundFonts => :Mix_SetSoundFonts,
|
255
|
-
:Mix_GetSoundFonts => :Mix_GetSoundFonts,
|
256
|
-
:Mix_EachSoundFont => :Mix_EachSoundFont,
|
257
|
-
:Mix_SetTimidityCfg => :Mix_SetTimidityCfg,
|
258
|
-
:Mix_GetTimidityCfg => :Mix_GetTimidityCfg,
|
259
|
-
:Mix_GetChunk => :Mix_GetChunk,
|
260
|
-
:Mix_CloseAudio => :Mix_CloseAudio,
|
261
|
-
}
|
262
|
-
args = {
|
263
|
-
:Mix_Linked_Version => [],
|
264
|
-
:Mix_Init => [:int],
|
265
|
-
:Mix_Quit => [],
|
266
|
-
:Mix_OpenAudio => [:int, :ushort, :int, :int],
|
267
|
-
:Mix_OpenAudioDevice => [:int, :ushort, :int, :int, :pointer, :int],
|
268
|
-
:Mix_QuerySpec => [:pointer, :pointer, :pointer],
|
269
|
-
:Mix_AllocateChannels => [:int],
|
270
|
-
:Mix_LoadWAV_RW => [:pointer, :int],
|
271
|
-
:Mix_LoadWAV => [:pointer],
|
272
|
-
:Mix_LoadMUS => [:pointer],
|
273
|
-
:Mix_LoadMUS_RW => [:pointer, :int],
|
274
|
-
:Mix_LoadMUSType_RW => [:pointer, :int, :int],
|
275
|
-
:Mix_QuickLoad_WAV => [:pointer],
|
276
|
-
:Mix_QuickLoad_RAW => [:pointer, :uint],
|
277
|
-
:Mix_FreeChunk => [:pointer],
|
278
|
-
:Mix_FreeMusic => [:pointer],
|
279
|
-
:Mix_GetNumChunkDecoders => [],
|
280
|
-
:Mix_GetChunkDecoder => [:int],
|
281
|
-
:Mix_HasChunkDecoder => [:pointer],
|
282
|
-
:Mix_GetNumMusicDecoders => [],
|
283
|
-
:Mix_GetMusicDecoder => [:int],
|
284
|
-
:Mix_HasMusicDecoder => [:pointer],
|
285
|
-
:Mix_GetMusicType => [:pointer],
|
286
|
-
:Mix_GetMusicTitle => [:pointer],
|
287
|
-
:Mix_GetMusicTitleTag => [:pointer],
|
288
|
-
:Mix_GetMusicArtistTag => [:pointer],
|
289
|
-
:Mix_GetMusicAlbumTag => [:pointer],
|
290
|
-
:Mix_GetMusicCopyrightTag => [:pointer],
|
291
|
-
:Mix_SetPostMix => [:pointer, :pointer],
|
292
|
-
:Mix_HookMusic => [:pointer, :pointer],
|
293
|
-
:Mix_HookMusicFinished => [:pointer],
|
294
|
-
:Mix_GetMusicHookData => [],
|
295
|
-
:Mix_ChannelFinished => [:pointer],
|
296
|
-
:Mix_RegisterEffect => [:int, :Mix_EffectFunc_t, :Mix_EffectDone_t, :pointer],
|
297
|
-
:Mix_UnregisterEffect => [:int, :Mix_EffectFunc_t],
|
298
|
-
:Mix_UnregisterAllEffects => [:int],
|
299
|
-
:Mix_SetPanning => [:int, :uchar, :uchar],
|
300
|
-
:Mix_SetPosition => [:int, :short, :uchar],
|
301
|
-
:Mix_SetDistance => [:int, :uchar],
|
302
|
-
:Mix_SetReverseStereo => [:int, :int],
|
303
|
-
:Mix_ReserveChannels => [:int],
|
304
|
-
:Mix_GroupChannel => [:int, :int],
|
305
|
-
:Mix_GroupChannels => [:int, :int, :int],
|
306
|
-
:Mix_GroupAvailable => [:int],
|
307
|
-
:Mix_GroupCount => [:int],
|
308
|
-
:Mix_GroupOldest => [:int],
|
309
|
-
:Mix_GroupNewer => [:int],
|
310
|
-
:Mix_PlayChannel => [:int, :pointer, :int],
|
311
|
-
:Mix_PlayChannelTimed => [:int, :pointer, :int, :int],
|
312
|
-
:Mix_PlayMusic => [:pointer, :int],
|
313
|
-
:Mix_FadeInMusic => [:pointer, :int, :int],
|
314
|
-
:Mix_FadeInMusicPos => [:pointer, :int, :int, :double],
|
315
|
-
:Mix_FadeInChannel => [:int, :pointer, :int, :int],
|
316
|
-
:Mix_FadeInChannelTimed => [:int, :pointer, :int, :int, :int],
|
317
|
-
:Mix_Volume => [:int, :int],
|
318
|
-
:Mix_VolumeChunk => [:pointer, :int],
|
319
|
-
:Mix_VolumeMusic => [:int],
|
320
|
-
:Mix_GetMusicVolume => [:pointer],
|
321
|
-
:Mix_MasterVolume => [:int],
|
322
|
-
:Mix_HaltChannel => [:int],
|
323
|
-
:Mix_HaltGroup => [:int],
|
324
|
-
:Mix_HaltMusic => [],
|
325
|
-
:Mix_ExpireChannel => [:int, :int],
|
326
|
-
:Mix_FadeOutChannel => [:int, :int],
|
327
|
-
:Mix_FadeOutGroup => [:int, :int],
|
328
|
-
:Mix_FadeOutMusic => [:int],
|
329
|
-
:Mix_FadingMusic => [],
|
330
|
-
:Mix_FadingChannel => [:int],
|
331
|
-
:Mix_Pause => [:int],
|
332
|
-
:Mix_Resume => [:int],
|
333
|
-
:Mix_Paused => [:int],
|
334
|
-
:Mix_PauseMusic => [],
|
335
|
-
:Mix_ResumeMusic => [],
|
336
|
-
:Mix_RewindMusic => [],
|
337
|
-
:Mix_PausedMusic => [],
|
338
|
-
:Mix_ModMusicJumpToOrder => [:int],
|
339
|
-
:Mix_SetMusicPosition => [:double],
|
340
|
-
:Mix_GetMusicPosition => [:pointer],
|
341
|
-
:Mix_MusicDuration => [:pointer],
|
342
|
-
:Mix_GetMusicLoopStartTime => [:pointer],
|
343
|
-
:Mix_GetMusicLoopEndTime => [:pointer],
|
344
|
-
:Mix_GetMusicLoopLengthTime => [:pointer],
|
345
|
-
:Mix_Playing => [:int],
|
346
|
-
:Mix_PlayingMusic => [],
|
347
|
-
:Mix_SetMusicCMD => [:pointer],
|
348
|
-
:Mix_SetSynchroValue => [:int],
|
349
|
-
:Mix_GetSynchroValue => [],
|
350
|
-
:Mix_SetSoundFonts => [:pointer],
|
351
|
-
:Mix_GetSoundFonts => [],
|
352
|
-
:Mix_EachSoundFont => [:pointer, :pointer],
|
353
|
-
:Mix_SetTimidityCfg => [:pointer],
|
354
|
-
:Mix_GetTimidityCfg => [],
|
355
|
-
:Mix_GetChunk => [:int],
|
356
|
-
:Mix_CloseAudio => [],
|
357
|
-
}
|
358
|
-
retvals = {
|
359
|
-
:Mix_Linked_Version => :pointer,
|
360
|
-
:Mix_Init => :int,
|
361
|
-
:Mix_Quit => :void,
|
362
|
-
:Mix_OpenAudio => :int,
|
363
|
-
:Mix_OpenAudioDevice => :int,
|
364
|
-
:Mix_QuerySpec => :int,
|
365
|
-
:Mix_AllocateChannels => :int,
|
366
|
-
:Mix_LoadWAV_RW => :pointer,
|
367
|
-
:Mix_LoadWAV => :pointer,
|
368
|
-
:Mix_LoadMUS => :pointer,
|
369
|
-
:Mix_LoadMUS_RW => :pointer,
|
370
|
-
:Mix_LoadMUSType_RW => :pointer,
|
371
|
-
:Mix_QuickLoad_WAV => :pointer,
|
372
|
-
:Mix_QuickLoad_RAW => :pointer,
|
373
|
-
:Mix_FreeChunk => :void,
|
374
|
-
:Mix_FreeMusic => :void,
|
375
|
-
:Mix_GetNumChunkDecoders => :int,
|
376
|
-
:Mix_GetChunkDecoder => :pointer,
|
377
|
-
:Mix_HasChunkDecoder => :int,
|
378
|
-
:Mix_GetNumMusicDecoders => :int,
|
379
|
-
:Mix_GetMusicDecoder => :pointer,
|
380
|
-
:Mix_HasMusicDecoder => :int,
|
381
|
-
:Mix_GetMusicType => :int,
|
382
|
-
:Mix_GetMusicTitle => :pointer,
|
383
|
-
:Mix_GetMusicTitleTag => :pointer,
|
384
|
-
:Mix_GetMusicArtistTag => :pointer,
|
385
|
-
:Mix_GetMusicAlbumTag => :pointer,
|
386
|
-
:Mix_GetMusicCopyrightTag => :pointer,
|
387
|
-
:Mix_SetPostMix => :void,
|
388
|
-
:Mix_HookMusic => :void,
|
389
|
-
:Mix_HookMusicFinished => :void,
|
390
|
-
:Mix_GetMusicHookData => :pointer,
|
391
|
-
:Mix_ChannelFinished => :void,
|
392
|
-
:Mix_RegisterEffect => :int,
|
393
|
-
:Mix_UnregisterEffect => :int,
|
394
|
-
:Mix_UnregisterAllEffects => :int,
|
395
|
-
:Mix_SetPanning => :int,
|
396
|
-
:Mix_SetPosition => :int,
|
397
|
-
:Mix_SetDistance => :int,
|
398
|
-
:Mix_SetReverseStereo => :int,
|
399
|
-
:Mix_ReserveChannels => :int,
|
400
|
-
:Mix_GroupChannel => :int,
|
401
|
-
:Mix_GroupChannels => :int,
|
402
|
-
:Mix_GroupAvailable => :int,
|
403
|
-
:Mix_GroupCount => :int,
|
404
|
-
:Mix_GroupOldest => :int,
|
405
|
-
:Mix_GroupNewer => :int,
|
406
|
-
:Mix_PlayChannel => :int,
|
407
|
-
:Mix_PlayChannelTimed => :int,
|
408
|
-
:Mix_PlayMusic => :int,
|
409
|
-
:Mix_FadeInMusic => :int,
|
410
|
-
:Mix_FadeInMusicPos => :int,
|
411
|
-
:Mix_FadeInChannel => :int,
|
412
|
-
:Mix_FadeInChannelTimed => :int,
|
413
|
-
:Mix_Volume => :int,
|
414
|
-
:Mix_VolumeChunk => :int,
|
415
|
-
:Mix_VolumeMusic => :int,
|
416
|
-
:Mix_GetMusicVolume => :int,
|
417
|
-
:Mix_MasterVolume => :int,
|
418
|
-
:Mix_HaltChannel => :int,
|
419
|
-
:Mix_HaltGroup => :int,
|
420
|
-
:Mix_HaltMusic => :int,
|
421
|
-
:Mix_ExpireChannel => :int,
|
422
|
-
:Mix_FadeOutChannel => :int,
|
423
|
-
:Mix_FadeOutGroup => :int,
|
424
|
-
:Mix_FadeOutMusic => :int,
|
425
|
-
:Mix_FadingMusic => :int,
|
426
|
-
:Mix_FadingChannel => :int,
|
427
|
-
:Mix_Pause => :void,
|
428
|
-
:Mix_Resume => :void,
|
429
|
-
:Mix_Paused => :int,
|
430
|
-
:Mix_PauseMusic => :void,
|
431
|
-
:Mix_ResumeMusic => :void,
|
432
|
-
:Mix_RewindMusic => :void,
|
433
|
-
:Mix_PausedMusic => :int,
|
434
|
-
:Mix_ModMusicJumpToOrder => :int,
|
435
|
-
:Mix_SetMusicPosition => :int,
|
436
|
-
:Mix_GetMusicPosition => :double,
|
437
|
-
:Mix_MusicDuration => :double,
|
438
|
-
:Mix_GetMusicLoopStartTime => :double,
|
439
|
-
:Mix_GetMusicLoopEndTime => :double,
|
440
|
-
:Mix_GetMusicLoopLengthTime => :double,
|
441
|
-
:Mix_Playing => :int,
|
442
|
-
:Mix_PlayingMusic => :int,
|
443
|
-
:Mix_SetMusicCMD => :int,
|
444
|
-
:Mix_SetSynchroValue => :int,
|
445
|
-
:Mix_GetSynchroValue => :int,
|
446
|
-
:Mix_SetSoundFonts => :int,
|
447
|
-
:Mix_GetSoundFonts => :pointer,
|
448
|
-
:Mix_EachSoundFont => :int,
|
449
|
-
:Mix_SetTimidityCfg => :int,
|
450
|
-
:Mix_GetTimidityCfg => :pointer,
|
451
|
-
:Mix_GetChunk => :pointer,
|
452
|
-
:Mix_CloseAudio => :void,
|
453
|
-
}
|
454
|
-
symbols.each do |sym|
|
455
|
-
begin
|
456
|
-
attach_function apis[sym], sym, args[sym], retvals[sym]
|
457
|
-
rescue FFI::NotFoundError => error
|
458
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
459
|
-
end
|
460
|
-
end
|
461
|
-
end
|
462
|
-
|
463
|
-
end
|
464
|
-
|
1
|
+
# Ruby-SDL2 : Yet another SDL2 wrapper for Ruby
|
2
|
+
#
|
3
|
+
# * https://github.com/vaiorabbit/sdl2-bindings
|
4
|
+
#
|
5
|
+
# [NOTICE] This is an automatically generated file.
|
6
|
+
|
7
|
+
require 'ffi'
|
8
|
+
|
9
|
+
module SDL
|
10
|
+
extend FFI::Library
|
11
|
+
# Define/Macro
|
12
|
+
|
13
|
+
MIXER_MAJOR_VERSION = 2
|
14
|
+
MIXER_MINOR_VERSION = 6
|
15
|
+
MIXER_PATCHLEVEL = 2
|
16
|
+
MIX_CHANNELS = 8
|
17
|
+
MIX_DEFAULT_FREQUENCY = 44100
|
18
|
+
MIX_DEFAULT_FORMAT = AUDIO_S16LSB
|
19
|
+
MIX_DEFAULT_CHANNELS = 2
|
20
|
+
MIX_MAX_VOLUME = MIX_MAXVOLUME
|
21
|
+
MIX_CHANNEL_POST = -2
|
22
|
+
MIX_EFFECTSMAXSPEED = "MIX_EFFECTSMAXSPEED"
|
23
|
+
|
24
|
+
# Enum
|
25
|
+
|
26
|
+
MIX_INIT_FLAC = 1
|
27
|
+
MIX_INIT_MOD = 2
|
28
|
+
MIX_INIT_MP3 = 8
|
29
|
+
MIX_INIT_OGG = 16
|
30
|
+
MIX_INIT_MID = 32
|
31
|
+
MIX_INIT_OPUS = 64
|
32
|
+
MIX_NO_FADING = 0
|
33
|
+
MIX_FADING_OUT = 1
|
34
|
+
MIX_FADING_IN = 2
|
35
|
+
MUS_NONE = 0
|
36
|
+
MUS_CMD = 1
|
37
|
+
MUS_WAV = 2
|
38
|
+
MUS_MOD = 3
|
39
|
+
MUS_MID = 4
|
40
|
+
MUS_OGG = 5
|
41
|
+
MUS_MP3 = 6
|
42
|
+
MUS_MP3_MAD_UNUSED = 7
|
43
|
+
MUS_FLAC = 8
|
44
|
+
MUS_MODPLUG_UNUSED = 9
|
45
|
+
MUS_OPUS = 10
|
46
|
+
|
47
|
+
# Typedef
|
48
|
+
|
49
|
+
typedef :int, :MIX_InitFlags
|
50
|
+
typedef :int, :Mix_Fading
|
51
|
+
typedef :int, :Mix_MusicType
|
52
|
+
callback :Mix_EffectFunc_t, [:int, :pointer, :int, :pointer], :void
|
53
|
+
callback :Mix_EffectDone_t, [:int, :pointer], :void
|
54
|
+
|
55
|
+
# Struct
|
56
|
+
|
57
|
+
class Mix_Chunk < FFI::Struct
|
58
|
+
layout(
|
59
|
+
:allocated, :int,
|
60
|
+
:abuf, :pointer,
|
61
|
+
:alen, :uint,
|
62
|
+
:volume, :uchar,
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
# Function
|
68
|
+
|
69
|
+
def self.setup_mixer_symbols(output_error = false)
|
70
|
+
symbols = [
|
71
|
+
:Mix_Linked_Version,
|
72
|
+
:Mix_Init,
|
73
|
+
:Mix_Quit,
|
74
|
+
:Mix_OpenAudio,
|
75
|
+
:Mix_OpenAudioDevice,
|
76
|
+
:Mix_QuerySpec,
|
77
|
+
:Mix_AllocateChannels,
|
78
|
+
:Mix_LoadWAV_RW,
|
79
|
+
:Mix_LoadWAV,
|
80
|
+
:Mix_LoadMUS,
|
81
|
+
:Mix_LoadMUS_RW,
|
82
|
+
:Mix_LoadMUSType_RW,
|
83
|
+
:Mix_QuickLoad_WAV,
|
84
|
+
:Mix_QuickLoad_RAW,
|
85
|
+
:Mix_FreeChunk,
|
86
|
+
:Mix_FreeMusic,
|
87
|
+
:Mix_GetNumChunkDecoders,
|
88
|
+
:Mix_GetChunkDecoder,
|
89
|
+
:Mix_HasChunkDecoder,
|
90
|
+
:Mix_GetNumMusicDecoders,
|
91
|
+
:Mix_GetMusicDecoder,
|
92
|
+
:Mix_HasMusicDecoder,
|
93
|
+
:Mix_GetMusicType,
|
94
|
+
:Mix_GetMusicTitle,
|
95
|
+
:Mix_GetMusicTitleTag,
|
96
|
+
:Mix_GetMusicArtistTag,
|
97
|
+
:Mix_GetMusicAlbumTag,
|
98
|
+
:Mix_GetMusicCopyrightTag,
|
99
|
+
:Mix_SetPostMix,
|
100
|
+
:Mix_HookMusic,
|
101
|
+
:Mix_HookMusicFinished,
|
102
|
+
:Mix_GetMusicHookData,
|
103
|
+
:Mix_ChannelFinished,
|
104
|
+
:Mix_RegisterEffect,
|
105
|
+
:Mix_UnregisterEffect,
|
106
|
+
:Mix_UnregisterAllEffects,
|
107
|
+
:Mix_SetPanning,
|
108
|
+
:Mix_SetPosition,
|
109
|
+
:Mix_SetDistance,
|
110
|
+
:Mix_SetReverseStereo,
|
111
|
+
:Mix_ReserveChannels,
|
112
|
+
:Mix_GroupChannel,
|
113
|
+
:Mix_GroupChannels,
|
114
|
+
:Mix_GroupAvailable,
|
115
|
+
:Mix_GroupCount,
|
116
|
+
:Mix_GroupOldest,
|
117
|
+
:Mix_GroupNewer,
|
118
|
+
:Mix_PlayChannel,
|
119
|
+
:Mix_PlayChannelTimed,
|
120
|
+
:Mix_PlayMusic,
|
121
|
+
:Mix_FadeInMusic,
|
122
|
+
:Mix_FadeInMusicPos,
|
123
|
+
:Mix_FadeInChannel,
|
124
|
+
:Mix_FadeInChannelTimed,
|
125
|
+
:Mix_Volume,
|
126
|
+
:Mix_VolumeChunk,
|
127
|
+
:Mix_VolumeMusic,
|
128
|
+
:Mix_GetMusicVolume,
|
129
|
+
:Mix_MasterVolume,
|
130
|
+
:Mix_HaltChannel,
|
131
|
+
:Mix_HaltGroup,
|
132
|
+
:Mix_HaltMusic,
|
133
|
+
:Mix_ExpireChannel,
|
134
|
+
:Mix_FadeOutChannel,
|
135
|
+
:Mix_FadeOutGroup,
|
136
|
+
:Mix_FadeOutMusic,
|
137
|
+
:Mix_FadingMusic,
|
138
|
+
:Mix_FadingChannel,
|
139
|
+
:Mix_Pause,
|
140
|
+
:Mix_Resume,
|
141
|
+
:Mix_Paused,
|
142
|
+
:Mix_PauseMusic,
|
143
|
+
:Mix_ResumeMusic,
|
144
|
+
:Mix_RewindMusic,
|
145
|
+
:Mix_PausedMusic,
|
146
|
+
:Mix_ModMusicJumpToOrder,
|
147
|
+
:Mix_SetMusicPosition,
|
148
|
+
:Mix_GetMusicPosition,
|
149
|
+
:Mix_MusicDuration,
|
150
|
+
:Mix_GetMusicLoopStartTime,
|
151
|
+
:Mix_GetMusicLoopEndTime,
|
152
|
+
:Mix_GetMusicLoopLengthTime,
|
153
|
+
:Mix_Playing,
|
154
|
+
:Mix_PlayingMusic,
|
155
|
+
:Mix_SetMusicCMD,
|
156
|
+
:Mix_SetSynchroValue,
|
157
|
+
:Mix_GetSynchroValue,
|
158
|
+
:Mix_SetSoundFonts,
|
159
|
+
:Mix_GetSoundFonts,
|
160
|
+
:Mix_EachSoundFont,
|
161
|
+
:Mix_SetTimidityCfg,
|
162
|
+
:Mix_GetTimidityCfg,
|
163
|
+
:Mix_GetChunk,
|
164
|
+
:Mix_CloseAudio,
|
165
|
+
]
|
166
|
+
apis = {
|
167
|
+
:Mix_Linked_Version => :Mix_Linked_Version,
|
168
|
+
:Mix_Init => :Mix_Init,
|
169
|
+
:Mix_Quit => :Mix_Quit,
|
170
|
+
:Mix_OpenAudio => :Mix_OpenAudio,
|
171
|
+
:Mix_OpenAudioDevice => :Mix_OpenAudioDevice,
|
172
|
+
:Mix_QuerySpec => :Mix_QuerySpec,
|
173
|
+
:Mix_AllocateChannels => :Mix_AllocateChannels,
|
174
|
+
:Mix_LoadWAV_RW => :Mix_LoadWAV_RW,
|
175
|
+
:Mix_LoadWAV => :Mix_LoadWAV,
|
176
|
+
:Mix_LoadMUS => :Mix_LoadMUS,
|
177
|
+
:Mix_LoadMUS_RW => :Mix_LoadMUS_RW,
|
178
|
+
:Mix_LoadMUSType_RW => :Mix_LoadMUSType_RW,
|
179
|
+
:Mix_QuickLoad_WAV => :Mix_QuickLoad_WAV,
|
180
|
+
:Mix_QuickLoad_RAW => :Mix_QuickLoad_RAW,
|
181
|
+
:Mix_FreeChunk => :Mix_FreeChunk,
|
182
|
+
:Mix_FreeMusic => :Mix_FreeMusic,
|
183
|
+
:Mix_GetNumChunkDecoders => :Mix_GetNumChunkDecoders,
|
184
|
+
:Mix_GetChunkDecoder => :Mix_GetChunkDecoder,
|
185
|
+
:Mix_HasChunkDecoder => :Mix_HasChunkDecoder,
|
186
|
+
:Mix_GetNumMusicDecoders => :Mix_GetNumMusicDecoders,
|
187
|
+
:Mix_GetMusicDecoder => :Mix_GetMusicDecoder,
|
188
|
+
:Mix_HasMusicDecoder => :Mix_HasMusicDecoder,
|
189
|
+
:Mix_GetMusicType => :Mix_GetMusicType,
|
190
|
+
:Mix_GetMusicTitle => :Mix_GetMusicTitle,
|
191
|
+
:Mix_GetMusicTitleTag => :Mix_GetMusicTitleTag,
|
192
|
+
:Mix_GetMusicArtistTag => :Mix_GetMusicArtistTag,
|
193
|
+
:Mix_GetMusicAlbumTag => :Mix_GetMusicAlbumTag,
|
194
|
+
:Mix_GetMusicCopyrightTag => :Mix_GetMusicCopyrightTag,
|
195
|
+
:Mix_SetPostMix => :Mix_SetPostMix,
|
196
|
+
:Mix_HookMusic => :Mix_HookMusic,
|
197
|
+
:Mix_HookMusicFinished => :Mix_HookMusicFinished,
|
198
|
+
:Mix_GetMusicHookData => :Mix_GetMusicHookData,
|
199
|
+
:Mix_ChannelFinished => :Mix_ChannelFinished,
|
200
|
+
:Mix_RegisterEffect => :Mix_RegisterEffect,
|
201
|
+
:Mix_UnregisterEffect => :Mix_UnregisterEffect,
|
202
|
+
:Mix_UnregisterAllEffects => :Mix_UnregisterAllEffects,
|
203
|
+
:Mix_SetPanning => :Mix_SetPanning,
|
204
|
+
:Mix_SetPosition => :Mix_SetPosition,
|
205
|
+
:Mix_SetDistance => :Mix_SetDistance,
|
206
|
+
:Mix_SetReverseStereo => :Mix_SetReverseStereo,
|
207
|
+
:Mix_ReserveChannels => :Mix_ReserveChannels,
|
208
|
+
:Mix_GroupChannel => :Mix_GroupChannel,
|
209
|
+
:Mix_GroupChannels => :Mix_GroupChannels,
|
210
|
+
:Mix_GroupAvailable => :Mix_GroupAvailable,
|
211
|
+
:Mix_GroupCount => :Mix_GroupCount,
|
212
|
+
:Mix_GroupOldest => :Mix_GroupOldest,
|
213
|
+
:Mix_GroupNewer => :Mix_GroupNewer,
|
214
|
+
:Mix_PlayChannel => :Mix_PlayChannel,
|
215
|
+
:Mix_PlayChannelTimed => :Mix_PlayChannelTimed,
|
216
|
+
:Mix_PlayMusic => :Mix_PlayMusic,
|
217
|
+
:Mix_FadeInMusic => :Mix_FadeInMusic,
|
218
|
+
:Mix_FadeInMusicPos => :Mix_FadeInMusicPos,
|
219
|
+
:Mix_FadeInChannel => :Mix_FadeInChannel,
|
220
|
+
:Mix_FadeInChannelTimed => :Mix_FadeInChannelTimed,
|
221
|
+
:Mix_Volume => :Mix_Volume,
|
222
|
+
:Mix_VolumeChunk => :Mix_VolumeChunk,
|
223
|
+
:Mix_VolumeMusic => :Mix_VolumeMusic,
|
224
|
+
:Mix_GetMusicVolume => :Mix_GetMusicVolume,
|
225
|
+
:Mix_MasterVolume => :Mix_MasterVolume,
|
226
|
+
:Mix_HaltChannel => :Mix_HaltChannel,
|
227
|
+
:Mix_HaltGroup => :Mix_HaltGroup,
|
228
|
+
:Mix_HaltMusic => :Mix_HaltMusic,
|
229
|
+
:Mix_ExpireChannel => :Mix_ExpireChannel,
|
230
|
+
:Mix_FadeOutChannel => :Mix_FadeOutChannel,
|
231
|
+
:Mix_FadeOutGroup => :Mix_FadeOutGroup,
|
232
|
+
:Mix_FadeOutMusic => :Mix_FadeOutMusic,
|
233
|
+
:Mix_FadingMusic => :Mix_FadingMusic,
|
234
|
+
:Mix_FadingChannel => :Mix_FadingChannel,
|
235
|
+
:Mix_Pause => :Mix_Pause,
|
236
|
+
:Mix_Resume => :Mix_Resume,
|
237
|
+
:Mix_Paused => :Mix_Paused,
|
238
|
+
:Mix_PauseMusic => :Mix_PauseMusic,
|
239
|
+
:Mix_ResumeMusic => :Mix_ResumeMusic,
|
240
|
+
:Mix_RewindMusic => :Mix_RewindMusic,
|
241
|
+
:Mix_PausedMusic => :Mix_PausedMusic,
|
242
|
+
:Mix_ModMusicJumpToOrder => :Mix_ModMusicJumpToOrder,
|
243
|
+
:Mix_SetMusicPosition => :Mix_SetMusicPosition,
|
244
|
+
:Mix_GetMusicPosition => :Mix_GetMusicPosition,
|
245
|
+
:Mix_MusicDuration => :Mix_MusicDuration,
|
246
|
+
:Mix_GetMusicLoopStartTime => :Mix_GetMusicLoopStartTime,
|
247
|
+
:Mix_GetMusicLoopEndTime => :Mix_GetMusicLoopEndTime,
|
248
|
+
:Mix_GetMusicLoopLengthTime => :Mix_GetMusicLoopLengthTime,
|
249
|
+
:Mix_Playing => :Mix_Playing,
|
250
|
+
:Mix_PlayingMusic => :Mix_PlayingMusic,
|
251
|
+
:Mix_SetMusicCMD => :Mix_SetMusicCMD,
|
252
|
+
:Mix_SetSynchroValue => :Mix_SetSynchroValue,
|
253
|
+
:Mix_GetSynchroValue => :Mix_GetSynchroValue,
|
254
|
+
:Mix_SetSoundFonts => :Mix_SetSoundFonts,
|
255
|
+
:Mix_GetSoundFonts => :Mix_GetSoundFonts,
|
256
|
+
:Mix_EachSoundFont => :Mix_EachSoundFont,
|
257
|
+
:Mix_SetTimidityCfg => :Mix_SetTimidityCfg,
|
258
|
+
:Mix_GetTimidityCfg => :Mix_GetTimidityCfg,
|
259
|
+
:Mix_GetChunk => :Mix_GetChunk,
|
260
|
+
:Mix_CloseAudio => :Mix_CloseAudio,
|
261
|
+
}
|
262
|
+
args = {
|
263
|
+
:Mix_Linked_Version => [],
|
264
|
+
:Mix_Init => [:int],
|
265
|
+
:Mix_Quit => [],
|
266
|
+
:Mix_OpenAudio => [:int, :ushort, :int, :int],
|
267
|
+
:Mix_OpenAudioDevice => [:int, :ushort, :int, :int, :pointer, :int],
|
268
|
+
:Mix_QuerySpec => [:pointer, :pointer, :pointer],
|
269
|
+
:Mix_AllocateChannels => [:int],
|
270
|
+
:Mix_LoadWAV_RW => [:pointer, :int],
|
271
|
+
:Mix_LoadWAV => [:pointer],
|
272
|
+
:Mix_LoadMUS => [:pointer],
|
273
|
+
:Mix_LoadMUS_RW => [:pointer, :int],
|
274
|
+
:Mix_LoadMUSType_RW => [:pointer, :int, :int],
|
275
|
+
:Mix_QuickLoad_WAV => [:pointer],
|
276
|
+
:Mix_QuickLoad_RAW => [:pointer, :uint],
|
277
|
+
:Mix_FreeChunk => [:pointer],
|
278
|
+
:Mix_FreeMusic => [:pointer],
|
279
|
+
:Mix_GetNumChunkDecoders => [],
|
280
|
+
:Mix_GetChunkDecoder => [:int],
|
281
|
+
:Mix_HasChunkDecoder => [:pointer],
|
282
|
+
:Mix_GetNumMusicDecoders => [],
|
283
|
+
:Mix_GetMusicDecoder => [:int],
|
284
|
+
:Mix_HasMusicDecoder => [:pointer],
|
285
|
+
:Mix_GetMusicType => [:pointer],
|
286
|
+
:Mix_GetMusicTitle => [:pointer],
|
287
|
+
:Mix_GetMusicTitleTag => [:pointer],
|
288
|
+
:Mix_GetMusicArtistTag => [:pointer],
|
289
|
+
:Mix_GetMusicAlbumTag => [:pointer],
|
290
|
+
:Mix_GetMusicCopyrightTag => [:pointer],
|
291
|
+
:Mix_SetPostMix => [:pointer, :pointer],
|
292
|
+
:Mix_HookMusic => [:pointer, :pointer],
|
293
|
+
:Mix_HookMusicFinished => [:pointer],
|
294
|
+
:Mix_GetMusicHookData => [],
|
295
|
+
:Mix_ChannelFinished => [:pointer],
|
296
|
+
:Mix_RegisterEffect => [:int, :Mix_EffectFunc_t, :Mix_EffectDone_t, :pointer],
|
297
|
+
:Mix_UnregisterEffect => [:int, :Mix_EffectFunc_t],
|
298
|
+
:Mix_UnregisterAllEffects => [:int],
|
299
|
+
:Mix_SetPanning => [:int, :uchar, :uchar],
|
300
|
+
:Mix_SetPosition => [:int, :short, :uchar],
|
301
|
+
:Mix_SetDistance => [:int, :uchar],
|
302
|
+
:Mix_SetReverseStereo => [:int, :int],
|
303
|
+
:Mix_ReserveChannels => [:int],
|
304
|
+
:Mix_GroupChannel => [:int, :int],
|
305
|
+
:Mix_GroupChannels => [:int, :int, :int],
|
306
|
+
:Mix_GroupAvailable => [:int],
|
307
|
+
:Mix_GroupCount => [:int],
|
308
|
+
:Mix_GroupOldest => [:int],
|
309
|
+
:Mix_GroupNewer => [:int],
|
310
|
+
:Mix_PlayChannel => [:int, :pointer, :int],
|
311
|
+
:Mix_PlayChannelTimed => [:int, :pointer, :int, :int],
|
312
|
+
:Mix_PlayMusic => [:pointer, :int],
|
313
|
+
:Mix_FadeInMusic => [:pointer, :int, :int],
|
314
|
+
:Mix_FadeInMusicPos => [:pointer, :int, :int, :double],
|
315
|
+
:Mix_FadeInChannel => [:int, :pointer, :int, :int],
|
316
|
+
:Mix_FadeInChannelTimed => [:int, :pointer, :int, :int, :int],
|
317
|
+
:Mix_Volume => [:int, :int],
|
318
|
+
:Mix_VolumeChunk => [:pointer, :int],
|
319
|
+
:Mix_VolumeMusic => [:int],
|
320
|
+
:Mix_GetMusicVolume => [:pointer],
|
321
|
+
:Mix_MasterVolume => [:int],
|
322
|
+
:Mix_HaltChannel => [:int],
|
323
|
+
:Mix_HaltGroup => [:int],
|
324
|
+
:Mix_HaltMusic => [],
|
325
|
+
:Mix_ExpireChannel => [:int, :int],
|
326
|
+
:Mix_FadeOutChannel => [:int, :int],
|
327
|
+
:Mix_FadeOutGroup => [:int, :int],
|
328
|
+
:Mix_FadeOutMusic => [:int],
|
329
|
+
:Mix_FadingMusic => [],
|
330
|
+
:Mix_FadingChannel => [:int],
|
331
|
+
:Mix_Pause => [:int],
|
332
|
+
:Mix_Resume => [:int],
|
333
|
+
:Mix_Paused => [:int],
|
334
|
+
:Mix_PauseMusic => [],
|
335
|
+
:Mix_ResumeMusic => [],
|
336
|
+
:Mix_RewindMusic => [],
|
337
|
+
:Mix_PausedMusic => [],
|
338
|
+
:Mix_ModMusicJumpToOrder => [:int],
|
339
|
+
:Mix_SetMusicPosition => [:double],
|
340
|
+
:Mix_GetMusicPosition => [:pointer],
|
341
|
+
:Mix_MusicDuration => [:pointer],
|
342
|
+
:Mix_GetMusicLoopStartTime => [:pointer],
|
343
|
+
:Mix_GetMusicLoopEndTime => [:pointer],
|
344
|
+
:Mix_GetMusicLoopLengthTime => [:pointer],
|
345
|
+
:Mix_Playing => [:int],
|
346
|
+
:Mix_PlayingMusic => [],
|
347
|
+
:Mix_SetMusicCMD => [:pointer],
|
348
|
+
:Mix_SetSynchroValue => [:int],
|
349
|
+
:Mix_GetSynchroValue => [],
|
350
|
+
:Mix_SetSoundFonts => [:pointer],
|
351
|
+
:Mix_GetSoundFonts => [],
|
352
|
+
:Mix_EachSoundFont => [:pointer, :pointer],
|
353
|
+
:Mix_SetTimidityCfg => [:pointer],
|
354
|
+
:Mix_GetTimidityCfg => [],
|
355
|
+
:Mix_GetChunk => [:int],
|
356
|
+
:Mix_CloseAudio => [],
|
357
|
+
}
|
358
|
+
retvals = {
|
359
|
+
:Mix_Linked_Version => :pointer,
|
360
|
+
:Mix_Init => :int,
|
361
|
+
:Mix_Quit => :void,
|
362
|
+
:Mix_OpenAudio => :int,
|
363
|
+
:Mix_OpenAudioDevice => :int,
|
364
|
+
:Mix_QuerySpec => :int,
|
365
|
+
:Mix_AllocateChannels => :int,
|
366
|
+
:Mix_LoadWAV_RW => :pointer,
|
367
|
+
:Mix_LoadWAV => :pointer,
|
368
|
+
:Mix_LoadMUS => :pointer,
|
369
|
+
:Mix_LoadMUS_RW => :pointer,
|
370
|
+
:Mix_LoadMUSType_RW => :pointer,
|
371
|
+
:Mix_QuickLoad_WAV => :pointer,
|
372
|
+
:Mix_QuickLoad_RAW => :pointer,
|
373
|
+
:Mix_FreeChunk => :void,
|
374
|
+
:Mix_FreeMusic => :void,
|
375
|
+
:Mix_GetNumChunkDecoders => :int,
|
376
|
+
:Mix_GetChunkDecoder => :pointer,
|
377
|
+
:Mix_HasChunkDecoder => :int,
|
378
|
+
:Mix_GetNumMusicDecoders => :int,
|
379
|
+
:Mix_GetMusicDecoder => :pointer,
|
380
|
+
:Mix_HasMusicDecoder => :int,
|
381
|
+
:Mix_GetMusicType => :int,
|
382
|
+
:Mix_GetMusicTitle => :pointer,
|
383
|
+
:Mix_GetMusicTitleTag => :pointer,
|
384
|
+
:Mix_GetMusicArtistTag => :pointer,
|
385
|
+
:Mix_GetMusicAlbumTag => :pointer,
|
386
|
+
:Mix_GetMusicCopyrightTag => :pointer,
|
387
|
+
:Mix_SetPostMix => :void,
|
388
|
+
:Mix_HookMusic => :void,
|
389
|
+
:Mix_HookMusicFinished => :void,
|
390
|
+
:Mix_GetMusicHookData => :pointer,
|
391
|
+
:Mix_ChannelFinished => :void,
|
392
|
+
:Mix_RegisterEffect => :int,
|
393
|
+
:Mix_UnregisterEffect => :int,
|
394
|
+
:Mix_UnregisterAllEffects => :int,
|
395
|
+
:Mix_SetPanning => :int,
|
396
|
+
:Mix_SetPosition => :int,
|
397
|
+
:Mix_SetDistance => :int,
|
398
|
+
:Mix_SetReverseStereo => :int,
|
399
|
+
:Mix_ReserveChannels => :int,
|
400
|
+
:Mix_GroupChannel => :int,
|
401
|
+
:Mix_GroupChannels => :int,
|
402
|
+
:Mix_GroupAvailable => :int,
|
403
|
+
:Mix_GroupCount => :int,
|
404
|
+
:Mix_GroupOldest => :int,
|
405
|
+
:Mix_GroupNewer => :int,
|
406
|
+
:Mix_PlayChannel => :int,
|
407
|
+
:Mix_PlayChannelTimed => :int,
|
408
|
+
:Mix_PlayMusic => :int,
|
409
|
+
:Mix_FadeInMusic => :int,
|
410
|
+
:Mix_FadeInMusicPos => :int,
|
411
|
+
:Mix_FadeInChannel => :int,
|
412
|
+
:Mix_FadeInChannelTimed => :int,
|
413
|
+
:Mix_Volume => :int,
|
414
|
+
:Mix_VolumeChunk => :int,
|
415
|
+
:Mix_VolumeMusic => :int,
|
416
|
+
:Mix_GetMusicVolume => :int,
|
417
|
+
:Mix_MasterVolume => :int,
|
418
|
+
:Mix_HaltChannel => :int,
|
419
|
+
:Mix_HaltGroup => :int,
|
420
|
+
:Mix_HaltMusic => :int,
|
421
|
+
:Mix_ExpireChannel => :int,
|
422
|
+
:Mix_FadeOutChannel => :int,
|
423
|
+
:Mix_FadeOutGroup => :int,
|
424
|
+
:Mix_FadeOutMusic => :int,
|
425
|
+
:Mix_FadingMusic => :int,
|
426
|
+
:Mix_FadingChannel => :int,
|
427
|
+
:Mix_Pause => :void,
|
428
|
+
:Mix_Resume => :void,
|
429
|
+
:Mix_Paused => :int,
|
430
|
+
:Mix_PauseMusic => :void,
|
431
|
+
:Mix_ResumeMusic => :void,
|
432
|
+
:Mix_RewindMusic => :void,
|
433
|
+
:Mix_PausedMusic => :int,
|
434
|
+
:Mix_ModMusicJumpToOrder => :int,
|
435
|
+
:Mix_SetMusicPosition => :int,
|
436
|
+
:Mix_GetMusicPosition => :double,
|
437
|
+
:Mix_MusicDuration => :double,
|
438
|
+
:Mix_GetMusicLoopStartTime => :double,
|
439
|
+
:Mix_GetMusicLoopEndTime => :double,
|
440
|
+
:Mix_GetMusicLoopLengthTime => :double,
|
441
|
+
:Mix_Playing => :int,
|
442
|
+
:Mix_PlayingMusic => :int,
|
443
|
+
:Mix_SetMusicCMD => :int,
|
444
|
+
:Mix_SetSynchroValue => :int,
|
445
|
+
:Mix_GetSynchroValue => :int,
|
446
|
+
:Mix_SetSoundFonts => :int,
|
447
|
+
:Mix_GetSoundFonts => :pointer,
|
448
|
+
:Mix_EachSoundFont => :int,
|
449
|
+
:Mix_SetTimidityCfg => :int,
|
450
|
+
:Mix_GetTimidityCfg => :pointer,
|
451
|
+
:Mix_GetChunk => :pointer,
|
452
|
+
:Mix_CloseAudio => :void,
|
453
|
+
}
|
454
|
+
symbols.each do |sym|
|
455
|
+
begin
|
456
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
457
|
+
rescue FFI::NotFoundError => error
|
458
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
459
|
+
end
|
460
|
+
end
|
461
|
+
end
|
462
|
+
|
463
|
+
end
|
464
|
+
|