sdl2-bindings 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +83 -79
  3. data/LICENSE.txt +1 -1
  4. data/README.md +49 -49
  5. data/lib/sdl2.rb +170 -170
  6. data/lib/sdl2_audio.rb +219 -201
  7. data/lib/sdl2_blendmode.rb +69 -69
  8. data/lib/sdl2_clipboard.rb +51 -51
  9. data/lib/sdl2_cpuinfo.rb +106 -106
  10. data/lib/sdl2_error.rb +64 -64
  11. data/lib/sdl2_events.rb +530 -530
  12. data/lib/sdl2_filesystem.rb +48 -48
  13. data/lib/sdl2_framerate.rb +67 -67
  14. data/lib/sdl2_gamecontroller.rb +254 -254
  15. data/lib/sdl2_gesture.rb +55 -55
  16. data/lib/sdl2_gfxPrimitives.rb +222 -222
  17. data/lib/sdl2_haptic.rb +269 -269
  18. data/lib/sdl2_hints.rb +174 -174
  19. data/lib/sdl2_image.rb +185 -185
  20. data/lib/sdl2_imageFilter.rb +132 -132
  21. data/lib/sdl2_joystick.rb +230 -230
  22. data/lib/sdl2_keyboard.rb +99 -99
  23. data/lib/sdl2_keycode.rb +304 -304
  24. data/lib/sdl2_log.rb +115 -115
  25. data/lib/sdl2_main.rb +67 -67
  26. data/lib/sdl2_messagebox.rb +98 -98
  27. data/lib/sdl2_mixer.rb +317 -307
  28. data/lib/sdl2_mouse.rb +117 -117
  29. data/lib/sdl2_pixels.rb +224 -224
  30. data/lib/sdl2_platform.rb +45 -45
  31. data/lib/sdl2_power.rb +51 -51
  32. data/lib/sdl2_rect.rb +102 -102
  33. data/lib/sdl2_render.rb +290 -290
  34. data/lib/sdl2_rotozoom.rb +66 -66
  35. data/lib/sdl2_rwops.rb +208 -208
  36. data/lib/sdl2_scancode.rb +287 -287
  37. data/lib/sdl2_shape.rb +77 -77
  38. data/lib/sdl2_stdinc.rb +393 -393
  39. data/lib/sdl2_surface.rb +182 -182
  40. data/lib/sdl2_syswm.rb +154 -154
  41. data/lib/sdl2_timer.rb +62 -62
  42. data/lib/sdl2_touch.rb +73 -73
  43. data/lib/sdl2_ttf.rb +202 -190
  44. data/lib/sdl2_version.rb +62 -62
  45. data/lib/sdl2_video.rb +411 -411
  46. data/lib/sdl2_vulkan.rb +64 -64
  47. metadata +6 -6
data/lib/sdl2_mixer.rb CHANGED
@@ -1,307 +1,317 @@
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 SDL2
10
- extend FFI::Library
11
- # Define/Macro
12
-
13
- SDL_MIXER_MAJOR_VERSION = 2
14
- SDL_MIXER_MINOR_VERSION = 0
15
- SDL_MIXER_PATCHLEVEL = 4
16
-
17
- # Enum
18
-
19
- MIX_INIT_FLAC = 1
20
- MIX_INIT_MOD = 2
21
- MIX_INIT_MP3 = 8
22
- MIX_INIT_OGG = 16
23
- MIX_INIT_MID = 32
24
- MIX_INIT_OPUS = 64
25
- MIX_NO_FADING = 0
26
- MIX_FADING_OUT = 1
27
- MIX_FADING_IN = 2
28
- MUS_NONE = 0
29
- MUS_CMD = 1
30
- MUS_WAV = 2
31
- MUS_MOD = 3
32
- MUS_MID = 4
33
- MUS_OGG = 5
34
- MUS_MP3 = 6
35
- MUS_MP3_MAD_UNUSED = 7
36
- MUS_FLAC = 8
37
- MUS_MODPLUG_UNUSED = 9
38
- MUS_OPUS = 10
39
-
40
- # Typedef
41
-
42
- typedef :int, :MIX_InitFlags
43
- typedef :int, :Mix_Fading
44
- typedef :int, :Mix_MusicType
45
- callback :Mix_EffectFunc_t, [:int, :pointer, :int, :pointer], :void
46
- callback :Mix_EffectDone_t, [:int, :pointer], :void
47
-
48
- # Struct
49
-
50
- class Mix_Chunk < FFI::Struct
51
- layout(
52
- :allocated, :int,
53
- :abuf, :pointer,
54
- :alen, :uint,
55
- :volume, :uchar,
56
- )
57
- end
58
-
59
-
60
- # Function
61
-
62
- def self.setup_mixer_symbols()
63
- symbols = [
64
- :Mix_Linked_Version,
65
- :Mix_Init,
66
- :Mix_Quit,
67
- :Mix_OpenAudio,
68
- :Mix_OpenAudioDevice,
69
- :Mix_AllocateChannels,
70
- :Mix_QuerySpec,
71
- :Mix_LoadWAV_RW,
72
- :Mix_LoadMUS,
73
- :Mix_LoadMUS_RW,
74
- :Mix_LoadMUSType_RW,
75
- :Mix_QuickLoad_WAV,
76
- :Mix_QuickLoad_RAW,
77
- :Mix_FreeChunk,
78
- :Mix_FreeMusic,
79
- :Mix_GetNumChunkDecoders,
80
- :Mix_GetChunkDecoder,
81
- :Mix_HasChunkDecoder,
82
- :Mix_GetNumMusicDecoders,
83
- :Mix_GetMusicDecoder,
84
- :Mix_HasMusicDecoder,
85
- :Mix_GetMusicType,
86
- :Mix_SetPostMix,
87
- :Mix_HookMusic,
88
- :Mix_HookMusicFinished,
89
- :Mix_GetMusicHookData,
90
- :Mix_ChannelFinished,
91
- :Mix_RegisterEffect,
92
- :Mix_UnregisterEffect,
93
- :Mix_UnregisterAllEffects,
94
- :Mix_SetPanning,
95
- :Mix_SetPosition,
96
- :Mix_SetDistance,
97
- :Mix_SetReverseStereo,
98
- :Mix_ReserveChannels,
99
- :Mix_GroupChannel,
100
- :Mix_GroupChannels,
101
- :Mix_GroupAvailable,
102
- :Mix_GroupCount,
103
- :Mix_GroupOldest,
104
- :Mix_GroupNewer,
105
- :Mix_PlayChannelTimed,
106
- :Mix_PlayMusic,
107
- :Mix_FadeInMusic,
108
- :Mix_FadeInMusicPos,
109
- :Mix_FadeInChannelTimed,
110
- :Mix_Volume,
111
- :Mix_VolumeChunk,
112
- :Mix_VolumeMusic,
113
- :Mix_HaltChannel,
114
- :Mix_HaltGroup,
115
- :Mix_HaltMusic,
116
- :Mix_ExpireChannel,
117
- :Mix_FadeOutChannel,
118
- :Mix_FadeOutGroup,
119
- :Mix_FadeOutMusic,
120
- :Mix_FadingMusic,
121
- :Mix_FadingChannel,
122
- :Mix_Pause,
123
- :Mix_Resume,
124
- :Mix_Paused,
125
- :Mix_PauseMusic,
126
- :Mix_ResumeMusic,
127
- :Mix_RewindMusic,
128
- :Mix_PausedMusic,
129
- :Mix_SetMusicPosition,
130
- :Mix_Playing,
131
- :Mix_PlayingMusic,
132
- :Mix_SetMusicCMD,
133
- :Mix_SetSynchroValue,
134
- :Mix_GetSynchroValue,
135
- :Mix_SetSoundFonts,
136
- :Mix_GetSoundFonts,
137
- :Mix_EachSoundFont,
138
- :Mix_GetChunk,
139
- :Mix_CloseAudio,
140
- ]
141
- args = {
142
- :Mix_Linked_Version => [],
143
- :Mix_Init => [:int],
144
- :Mix_Quit => [],
145
- :Mix_OpenAudio => [:int, :ushort, :int, :int],
146
- :Mix_OpenAudioDevice => [:int, :ushort, :int, :int, :pointer, :int],
147
- :Mix_AllocateChannels => [:int],
148
- :Mix_QuerySpec => [:pointer, :pointer, :pointer],
149
- :Mix_LoadWAV_RW => [:pointer, :int],
150
- :Mix_LoadMUS => [:pointer],
151
- :Mix_LoadMUS_RW => [:pointer, :int],
152
- :Mix_LoadMUSType_RW => [:pointer, :int, :int],
153
- :Mix_QuickLoad_WAV => [:pointer],
154
- :Mix_QuickLoad_RAW => [:pointer, :uint],
155
- :Mix_FreeChunk => [:pointer],
156
- :Mix_FreeMusic => [:pointer],
157
- :Mix_GetNumChunkDecoders => [],
158
- :Mix_GetChunkDecoder => [:int],
159
- :Mix_HasChunkDecoder => [:pointer],
160
- :Mix_GetNumMusicDecoders => [],
161
- :Mix_GetMusicDecoder => [:int],
162
- :Mix_HasMusicDecoder => [:pointer],
163
- :Mix_GetMusicType => [:pointer],
164
- :Mix_SetPostMix => [:pointer, :pointer],
165
- :Mix_HookMusic => [:pointer, :pointer],
166
- :Mix_HookMusicFinished => [:pointer],
167
- :Mix_GetMusicHookData => [],
168
- :Mix_ChannelFinished => [:pointer],
169
- :Mix_RegisterEffect => [:int, :Mix_EffectFunc_t, :Mix_EffectDone_t, :pointer],
170
- :Mix_UnregisterEffect => [:int, :Mix_EffectFunc_t],
171
- :Mix_UnregisterAllEffects => [:int],
172
- :Mix_SetPanning => [:int, :uchar, :uchar],
173
- :Mix_SetPosition => [:int, :short, :uchar],
174
- :Mix_SetDistance => [:int, :uchar],
175
- :Mix_SetReverseStereo => [:int, :int],
176
- :Mix_ReserveChannels => [:int],
177
- :Mix_GroupChannel => [:int, :int],
178
- :Mix_GroupChannels => [:int, :int, :int],
179
- :Mix_GroupAvailable => [:int],
180
- :Mix_GroupCount => [:int],
181
- :Mix_GroupOldest => [:int],
182
- :Mix_GroupNewer => [:int],
183
- :Mix_PlayChannelTimed => [:int, :pointer, :int, :int],
184
- :Mix_PlayMusic => [:pointer, :int],
185
- :Mix_FadeInMusic => [:pointer, :int, :int],
186
- :Mix_FadeInMusicPos => [:pointer, :int, :int, :double],
187
- :Mix_FadeInChannelTimed => [:int, :pointer, :int, :int, :int],
188
- :Mix_Volume => [:int, :int],
189
- :Mix_VolumeChunk => [:pointer, :int],
190
- :Mix_VolumeMusic => [:int],
191
- :Mix_HaltChannel => [:int],
192
- :Mix_HaltGroup => [:int],
193
- :Mix_HaltMusic => [],
194
- :Mix_ExpireChannel => [:int, :int],
195
- :Mix_FadeOutChannel => [:int, :int],
196
- :Mix_FadeOutGroup => [:int, :int],
197
- :Mix_FadeOutMusic => [:int],
198
- :Mix_FadingMusic => [],
199
- :Mix_FadingChannel => [:int],
200
- :Mix_Pause => [:int],
201
- :Mix_Resume => [:int],
202
- :Mix_Paused => [:int],
203
- :Mix_PauseMusic => [],
204
- :Mix_ResumeMusic => [],
205
- :Mix_RewindMusic => [],
206
- :Mix_PausedMusic => [],
207
- :Mix_SetMusicPosition => [:double],
208
- :Mix_Playing => [:int],
209
- :Mix_PlayingMusic => [],
210
- :Mix_SetMusicCMD => [:pointer],
211
- :Mix_SetSynchroValue => [:int],
212
- :Mix_GetSynchroValue => [],
213
- :Mix_SetSoundFonts => [:pointer],
214
- :Mix_GetSoundFonts => [],
215
- :Mix_EachSoundFont => [:pointer, :pointer],
216
- :Mix_GetChunk => [:int],
217
- :Mix_CloseAudio => [],
218
- }
219
- retvals = {
220
- :Mix_Linked_Version => :pointer,
221
- :Mix_Init => :int,
222
- :Mix_Quit => :void,
223
- :Mix_OpenAudio => :int,
224
- :Mix_OpenAudioDevice => :int,
225
- :Mix_AllocateChannels => :int,
226
- :Mix_QuerySpec => :int,
227
- :Mix_LoadWAV_RW => :pointer,
228
- :Mix_LoadMUS => :pointer,
229
- :Mix_LoadMUS_RW => :pointer,
230
- :Mix_LoadMUSType_RW => :pointer,
231
- :Mix_QuickLoad_WAV => :pointer,
232
- :Mix_QuickLoad_RAW => :pointer,
233
- :Mix_FreeChunk => :void,
234
- :Mix_FreeMusic => :void,
235
- :Mix_GetNumChunkDecoders => :int,
236
- :Mix_GetChunkDecoder => :pointer,
237
- :Mix_HasChunkDecoder => :int,
238
- :Mix_GetNumMusicDecoders => :int,
239
- :Mix_GetMusicDecoder => :pointer,
240
- :Mix_HasMusicDecoder => :int,
241
- :Mix_GetMusicType => :int,
242
- :Mix_SetPostMix => :void,
243
- :Mix_HookMusic => :void,
244
- :Mix_HookMusicFinished => :void,
245
- :Mix_GetMusicHookData => :pointer,
246
- :Mix_ChannelFinished => :void,
247
- :Mix_RegisterEffect => :int,
248
- :Mix_UnregisterEffect => :int,
249
- :Mix_UnregisterAllEffects => :int,
250
- :Mix_SetPanning => :int,
251
- :Mix_SetPosition => :int,
252
- :Mix_SetDistance => :int,
253
- :Mix_SetReverseStereo => :int,
254
- :Mix_ReserveChannels => :int,
255
- :Mix_GroupChannel => :int,
256
- :Mix_GroupChannels => :int,
257
- :Mix_GroupAvailable => :int,
258
- :Mix_GroupCount => :int,
259
- :Mix_GroupOldest => :int,
260
- :Mix_GroupNewer => :int,
261
- :Mix_PlayChannelTimed => :int,
262
- :Mix_PlayMusic => :int,
263
- :Mix_FadeInMusic => :int,
264
- :Mix_FadeInMusicPos => :int,
265
- :Mix_FadeInChannelTimed => :int,
266
- :Mix_Volume => :int,
267
- :Mix_VolumeChunk => :int,
268
- :Mix_VolumeMusic => :int,
269
- :Mix_HaltChannel => :int,
270
- :Mix_HaltGroup => :int,
271
- :Mix_HaltMusic => :int,
272
- :Mix_ExpireChannel => :int,
273
- :Mix_FadeOutChannel => :int,
274
- :Mix_FadeOutGroup => :int,
275
- :Mix_FadeOutMusic => :int,
276
- :Mix_FadingMusic => :int,
277
- :Mix_FadingChannel => :int,
278
- :Mix_Pause => :void,
279
- :Mix_Resume => :void,
280
- :Mix_Paused => :int,
281
- :Mix_PauseMusic => :void,
282
- :Mix_ResumeMusic => :void,
283
- :Mix_RewindMusic => :void,
284
- :Mix_PausedMusic => :int,
285
- :Mix_SetMusicPosition => :int,
286
- :Mix_Playing => :int,
287
- :Mix_PlayingMusic => :int,
288
- :Mix_SetMusicCMD => :int,
289
- :Mix_SetSynchroValue => :int,
290
- :Mix_GetSynchroValue => :int,
291
- :Mix_SetSoundFonts => :int,
292
- :Mix_GetSoundFonts => :pointer,
293
- :Mix_EachSoundFont => :int,
294
- :Mix_GetChunk => :pointer,
295
- :Mix_CloseAudio => :void,
296
- }
297
- symbols.each do |sym|
298
- begin
299
- attach_function sym, args[sym], retvals[sym]
300
- rescue FFI::NotFoundError => error
301
- $stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
302
- end
303
- end
304
- end
305
-
306
- end
307
-
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 SDL2
10
+ extend FFI::Library
11
+ # Define/Macro
12
+
13
+ SDL_MIXER_MAJOR_VERSION = 2
14
+ SDL_MIXER_MINOR_VERSION = 0
15
+ SDL_MIXER_PATCHLEVEL = 4
16
+ MIX_MAJOR_VERSION = SDL_MIXER_MAJOR_VERSION
17
+ MIX_MINOR_VERSION = SDL_MIXER_MINOR_VERSION
18
+ MIX_PATCHLEVEL = SDL_MIXER_PATCHLEVEL
19
+ MIX_CHANNELS = 8
20
+ MIX_DEFAULT_FREQUENCY = 22050
21
+ MIX_DEFAULT_FORMAT = AUDIO_S16LSB
22
+ MIX_DEFAULT_CHANNELS = 2
23
+ MIX_MAX_VOLUME = SDL_MIX_MAXVOLUME
24
+ MIX_CHANNEL_POST = -2
25
+ MIX_EFFECTSMAXSPEED = "MIX_EFFECTSMAXSPEED"
26
+
27
+ # Enum
28
+
29
+ MIX_INIT_FLAC = 1
30
+ MIX_INIT_MOD = 2
31
+ MIX_INIT_MP3 = 8
32
+ MIX_INIT_OGG = 16
33
+ MIX_INIT_MID = 32
34
+ MIX_INIT_OPUS = 64
35
+ MIX_NO_FADING = 0
36
+ MIX_FADING_OUT = 1
37
+ MIX_FADING_IN = 2
38
+ MUS_NONE = 0
39
+ MUS_CMD = 1
40
+ MUS_WAV = 2
41
+ MUS_MOD = 3
42
+ MUS_MID = 4
43
+ MUS_OGG = 5
44
+ MUS_MP3 = 6
45
+ MUS_MP3_MAD_UNUSED = 7
46
+ MUS_FLAC = 8
47
+ MUS_MODPLUG_UNUSED = 9
48
+ MUS_OPUS = 10
49
+
50
+ # Typedef
51
+
52
+ typedef :int, :MIX_InitFlags
53
+ typedef :int, :Mix_Fading
54
+ typedef :int, :Mix_MusicType
55
+ callback :Mix_EffectFunc_t, [:int, :pointer, :int, :pointer], :void
56
+ callback :Mix_EffectDone_t, [:int, :pointer], :void
57
+
58
+ # Struct
59
+
60
+ class Mix_Chunk < FFI::Struct
61
+ layout(
62
+ :allocated, :int,
63
+ :abuf, :pointer,
64
+ :alen, :uint,
65
+ :volume, :uchar,
66
+ )
67
+ end
68
+
69
+
70
+ # Function
71
+
72
+ def self.setup_mixer_symbols()
73
+ symbols = [
74
+ :Mix_Linked_Version,
75
+ :Mix_Init,
76
+ :Mix_Quit,
77
+ :Mix_OpenAudio,
78
+ :Mix_OpenAudioDevice,
79
+ :Mix_AllocateChannels,
80
+ :Mix_QuerySpec,
81
+ :Mix_LoadWAV_RW,
82
+ :Mix_LoadMUS,
83
+ :Mix_LoadMUS_RW,
84
+ :Mix_LoadMUSType_RW,
85
+ :Mix_QuickLoad_WAV,
86
+ :Mix_QuickLoad_RAW,
87
+ :Mix_FreeChunk,
88
+ :Mix_FreeMusic,
89
+ :Mix_GetNumChunkDecoders,
90
+ :Mix_GetChunkDecoder,
91
+ :Mix_HasChunkDecoder,
92
+ :Mix_GetNumMusicDecoders,
93
+ :Mix_GetMusicDecoder,
94
+ :Mix_HasMusicDecoder,
95
+ :Mix_GetMusicType,
96
+ :Mix_SetPostMix,
97
+ :Mix_HookMusic,
98
+ :Mix_HookMusicFinished,
99
+ :Mix_GetMusicHookData,
100
+ :Mix_ChannelFinished,
101
+ :Mix_RegisterEffect,
102
+ :Mix_UnregisterEffect,
103
+ :Mix_UnregisterAllEffects,
104
+ :Mix_SetPanning,
105
+ :Mix_SetPosition,
106
+ :Mix_SetDistance,
107
+ :Mix_SetReverseStereo,
108
+ :Mix_ReserveChannels,
109
+ :Mix_GroupChannel,
110
+ :Mix_GroupChannels,
111
+ :Mix_GroupAvailable,
112
+ :Mix_GroupCount,
113
+ :Mix_GroupOldest,
114
+ :Mix_GroupNewer,
115
+ :Mix_PlayChannelTimed,
116
+ :Mix_PlayMusic,
117
+ :Mix_FadeInMusic,
118
+ :Mix_FadeInMusicPos,
119
+ :Mix_FadeInChannelTimed,
120
+ :Mix_Volume,
121
+ :Mix_VolumeChunk,
122
+ :Mix_VolumeMusic,
123
+ :Mix_HaltChannel,
124
+ :Mix_HaltGroup,
125
+ :Mix_HaltMusic,
126
+ :Mix_ExpireChannel,
127
+ :Mix_FadeOutChannel,
128
+ :Mix_FadeOutGroup,
129
+ :Mix_FadeOutMusic,
130
+ :Mix_FadingMusic,
131
+ :Mix_FadingChannel,
132
+ :Mix_Pause,
133
+ :Mix_Resume,
134
+ :Mix_Paused,
135
+ :Mix_PauseMusic,
136
+ :Mix_ResumeMusic,
137
+ :Mix_RewindMusic,
138
+ :Mix_PausedMusic,
139
+ :Mix_SetMusicPosition,
140
+ :Mix_Playing,
141
+ :Mix_PlayingMusic,
142
+ :Mix_SetMusicCMD,
143
+ :Mix_SetSynchroValue,
144
+ :Mix_GetSynchroValue,
145
+ :Mix_SetSoundFonts,
146
+ :Mix_GetSoundFonts,
147
+ :Mix_EachSoundFont,
148
+ :Mix_GetChunk,
149
+ :Mix_CloseAudio,
150
+ ]
151
+ args = {
152
+ :Mix_Linked_Version => [],
153
+ :Mix_Init => [:int],
154
+ :Mix_Quit => [],
155
+ :Mix_OpenAudio => [:int, :ushort, :int, :int],
156
+ :Mix_OpenAudioDevice => [:int, :ushort, :int, :int, :pointer, :int],
157
+ :Mix_AllocateChannels => [:int],
158
+ :Mix_QuerySpec => [:pointer, :pointer, :pointer],
159
+ :Mix_LoadWAV_RW => [:pointer, :int],
160
+ :Mix_LoadMUS => [:pointer],
161
+ :Mix_LoadMUS_RW => [:pointer, :int],
162
+ :Mix_LoadMUSType_RW => [:pointer, :int, :int],
163
+ :Mix_QuickLoad_WAV => [:pointer],
164
+ :Mix_QuickLoad_RAW => [:pointer, :uint],
165
+ :Mix_FreeChunk => [:pointer],
166
+ :Mix_FreeMusic => [:pointer],
167
+ :Mix_GetNumChunkDecoders => [],
168
+ :Mix_GetChunkDecoder => [:int],
169
+ :Mix_HasChunkDecoder => [:pointer],
170
+ :Mix_GetNumMusicDecoders => [],
171
+ :Mix_GetMusicDecoder => [:int],
172
+ :Mix_HasMusicDecoder => [:pointer],
173
+ :Mix_GetMusicType => [:pointer],
174
+ :Mix_SetPostMix => [:pointer, :pointer],
175
+ :Mix_HookMusic => [:pointer, :pointer],
176
+ :Mix_HookMusicFinished => [:pointer],
177
+ :Mix_GetMusicHookData => [],
178
+ :Mix_ChannelFinished => [:pointer],
179
+ :Mix_RegisterEffect => [:int, :Mix_EffectFunc_t, :Mix_EffectDone_t, :pointer],
180
+ :Mix_UnregisterEffect => [:int, :Mix_EffectFunc_t],
181
+ :Mix_UnregisterAllEffects => [:int],
182
+ :Mix_SetPanning => [:int, :uchar, :uchar],
183
+ :Mix_SetPosition => [:int, :short, :uchar],
184
+ :Mix_SetDistance => [:int, :uchar],
185
+ :Mix_SetReverseStereo => [:int, :int],
186
+ :Mix_ReserveChannels => [:int],
187
+ :Mix_GroupChannel => [:int, :int],
188
+ :Mix_GroupChannels => [:int, :int, :int],
189
+ :Mix_GroupAvailable => [:int],
190
+ :Mix_GroupCount => [:int],
191
+ :Mix_GroupOldest => [:int],
192
+ :Mix_GroupNewer => [:int],
193
+ :Mix_PlayChannelTimed => [:int, :pointer, :int, :int],
194
+ :Mix_PlayMusic => [:pointer, :int],
195
+ :Mix_FadeInMusic => [:pointer, :int, :int],
196
+ :Mix_FadeInMusicPos => [:pointer, :int, :int, :double],
197
+ :Mix_FadeInChannelTimed => [:int, :pointer, :int, :int, :int],
198
+ :Mix_Volume => [:int, :int],
199
+ :Mix_VolumeChunk => [:pointer, :int],
200
+ :Mix_VolumeMusic => [:int],
201
+ :Mix_HaltChannel => [:int],
202
+ :Mix_HaltGroup => [:int],
203
+ :Mix_HaltMusic => [],
204
+ :Mix_ExpireChannel => [:int, :int],
205
+ :Mix_FadeOutChannel => [:int, :int],
206
+ :Mix_FadeOutGroup => [:int, :int],
207
+ :Mix_FadeOutMusic => [:int],
208
+ :Mix_FadingMusic => [],
209
+ :Mix_FadingChannel => [:int],
210
+ :Mix_Pause => [:int],
211
+ :Mix_Resume => [:int],
212
+ :Mix_Paused => [:int],
213
+ :Mix_PauseMusic => [],
214
+ :Mix_ResumeMusic => [],
215
+ :Mix_RewindMusic => [],
216
+ :Mix_PausedMusic => [],
217
+ :Mix_SetMusicPosition => [:double],
218
+ :Mix_Playing => [:int],
219
+ :Mix_PlayingMusic => [],
220
+ :Mix_SetMusicCMD => [:pointer],
221
+ :Mix_SetSynchroValue => [:int],
222
+ :Mix_GetSynchroValue => [],
223
+ :Mix_SetSoundFonts => [:pointer],
224
+ :Mix_GetSoundFonts => [],
225
+ :Mix_EachSoundFont => [:pointer, :pointer],
226
+ :Mix_GetChunk => [:int],
227
+ :Mix_CloseAudio => [],
228
+ }
229
+ retvals = {
230
+ :Mix_Linked_Version => :pointer,
231
+ :Mix_Init => :int,
232
+ :Mix_Quit => :void,
233
+ :Mix_OpenAudio => :int,
234
+ :Mix_OpenAudioDevice => :int,
235
+ :Mix_AllocateChannels => :int,
236
+ :Mix_QuerySpec => :int,
237
+ :Mix_LoadWAV_RW => :pointer,
238
+ :Mix_LoadMUS => :pointer,
239
+ :Mix_LoadMUS_RW => :pointer,
240
+ :Mix_LoadMUSType_RW => :pointer,
241
+ :Mix_QuickLoad_WAV => :pointer,
242
+ :Mix_QuickLoad_RAW => :pointer,
243
+ :Mix_FreeChunk => :void,
244
+ :Mix_FreeMusic => :void,
245
+ :Mix_GetNumChunkDecoders => :int,
246
+ :Mix_GetChunkDecoder => :pointer,
247
+ :Mix_HasChunkDecoder => :int,
248
+ :Mix_GetNumMusicDecoders => :int,
249
+ :Mix_GetMusicDecoder => :pointer,
250
+ :Mix_HasMusicDecoder => :int,
251
+ :Mix_GetMusicType => :int,
252
+ :Mix_SetPostMix => :void,
253
+ :Mix_HookMusic => :void,
254
+ :Mix_HookMusicFinished => :void,
255
+ :Mix_GetMusicHookData => :pointer,
256
+ :Mix_ChannelFinished => :void,
257
+ :Mix_RegisterEffect => :int,
258
+ :Mix_UnregisterEffect => :int,
259
+ :Mix_UnregisterAllEffects => :int,
260
+ :Mix_SetPanning => :int,
261
+ :Mix_SetPosition => :int,
262
+ :Mix_SetDistance => :int,
263
+ :Mix_SetReverseStereo => :int,
264
+ :Mix_ReserveChannels => :int,
265
+ :Mix_GroupChannel => :int,
266
+ :Mix_GroupChannels => :int,
267
+ :Mix_GroupAvailable => :int,
268
+ :Mix_GroupCount => :int,
269
+ :Mix_GroupOldest => :int,
270
+ :Mix_GroupNewer => :int,
271
+ :Mix_PlayChannelTimed => :int,
272
+ :Mix_PlayMusic => :int,
273
+ :Mix_FadeInMusic => :int,
274
+ :Mix_FadeInMusicPos => :int,
275
+ :Mix_FadeInChannelTimed => :int,
276
+ :Mix_Volume => :int,
277
+ :Mix_VolumeChunk => :int,
278
+ :Mix_VolumeMusic => :int,
279
+ :Mix_HaltChannel => :int,
280
+ :Mix_HaltGroup => :int,
281
+ :Mix_HaltMusic => :int,
282
+ :Mix_ExpireChannel => :int,
283
+ :Mix_FadeOutChannel => :int,
284
+ :Mix_FadeOutGroup => :int,
285
+ :Mix_FadeOutMusic => :int,
286
+ :Mix_FadingMusic => :int,
287
+ :Mix_FadingChannel => :int,
288
+ :Mix_Pause => :void,
289
+ :Mix_Resume => :void,
290
+ :Mix_Paused => :int,
291
+ :Mix_PauseMusic => :void,
292
+ :Mix_ResumeMusic => :void,
293
+ :Mix_RewindMusic => :void,
294
+ :Mix_PausedMusic => :int,
295
+ :Mix_SetMusicPosition => :int,
296
+ :Mix_Playing => :int,
297
+ :Mix_PlayingMusic => :int,
298
+ :Mix_SetMusicCMD => :int,
299
+ :Mix_SetSynchroValue => :int,
300
+ :Mix_GetSynchroValue => :int,
301
+ :Mix_SetSoundFonts => :int,
302
+ :Mix_GetSoundFonts => :pointer,
303
+ :Mix_EachSoundFont => :int,
304
+ :Mix_GetChunk => :pointer,
305
+ :Mix_CloseAudio => :void,
306
+ }
307
+ symbols.each do |sym|
308
+ begin
309
+ attach_function sym, args[sym], retvals[sym]
310
+ rescue FFI::NotFoundError => error
311
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
312
+ end
313
+ end
314
+ end
315
+
316
+ end
317
+