taglib-ruby 0.4.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/.yardopts +9 -0
  2. data/CHANGES.md +53 -0
  3. data/Gemfile +4 -0
  4. data/Guardfile +8 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +87 -0
  7. data/Rakefile +29 -0
  8. data/docs/default/fulldoc/html/css/common.css +1 -0
  9. data/docs/taglib/base.rb +202 -0
  10. data/docs/taglib/id3v1.rb +5 -0
  11. data/docs/taglib/id3v2.rb +444 -0
  12. data/docs/taglib/mpeg.rb +120 -0
  13. data/docs/taglib/ogg.rb +77 -0
  14. data/docs/taglib/vorbis.rb +62 -0
  15. data/ext/extconf_common.rb +29 -0
  16. data/ext/taglib_base/extconf.rb +4 -0
  17. data/ext/taglib_base/includes.i +115 -0
  18. data/ext/taglib_base/taglib_base.i +139 -0
  19. data/ext/taglib_base/taglib_base_wrap.cxx +5153 -0
  20. data/ext/taglib_id3v1/extconf.rb +4 -0
  21. data/ext/taglib_id3v1/taglib_id3v1.i +11 -0
  22. data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +3110 -0
  23. data/ext/taglib_id3v2/extconf.rb +4 -0
  24. data/ext/taglib_id3v2/relativevolumeframe.i +35 -0
  25. data/ext/taglib_id3v2/taglib_id3v2.i +112 -0
  26. data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +9033 -0
  27. data/ext/taglib_mpeg/extconf.rb +4 -0
  28. data/ext/taglib_mpeg/taglib_mpeg.i +75 -0
  29. data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +4726 -0
  30. data/ext/taglib_ogg/extconf.rb +4 -0
  31. data/ext/taglib_ogg/taglib_ogg.i +36 -0
  32. data/ext/taglib_ogg/taglib_ogg_wrap.cxx +3631 -0
  33. data/ext/taglib_vorbis/extconf.rb +4 -0
  34. data/ext/taglib_vorbis/taglib_vorbis.i +48 -0
  35. data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +3083 -0
  36. data/ext/valgrind-suppressions.txt +170 -0
  37. data/ext/win.cmake +5 -0
  38. data/lib/libtag.dll +0 -0
  39. data/lib/taglib.rb +14 -0
  40. data/lib/taglib/base.rb +19 -0
  41. data/lib/taglib/id3v1.rb +1 -0
  42. data/lib/taglib/id3v2.rb +20 -0
  43. data/lib/taglib/mpeg.rb +7 -0
  44. data/lib/taglib/ogg.rb +1 -0
  45. data/lib/taglib/version.rb +10 -0
  46. data/lib/taglib/vorbis.rb +7 -0
  47. data/lib/taglib_base.so +0 -0
  48. data/lib/taglib_id3v1.so +0 -0
  49. data/lib/taglib_id3v2.so +0 -0
  50. data/lib/taglib_mpeg.so +0 -0
  51. data/lib/taglib_ogg.so +0 -0
  52. data/lib/taglib_vorbis.so +0 -0
  53. data/taglib-ruby.gemspec +122 -0
  54. data/tasks/docs_coverage.rake +26 -0
  55. data/tasks/ext.rake +81 -0
  56. data/tasks/gemspec_check.rake +19 -0
  57. data/tasks/swig.rake +43 -0
  58. data/test/data/Makefile +15 -0
  59. data/test/data/add-relative-volume.cpp +40 -0
  60. data/test/data/crash.mp3 +0 -0
  61. data/test/data/globe_east_540.jpg +0 -0
  62. data/test/data/id3v1-create.cpp +31 -0
  63. data/test/data/id3v1.mp3 +0 -0
  64. data/test/data/relative-volume.mp3 +0 -0
  65. data/test/data/sample.mp3 +0 -0
  66. data/test/data/unicode.mp3 +0 -0
  67. data/test/data/vorbis-create.cpp +42 -0
  68. data/test/data/vorbis.oga +0 -0
  69. data/test/fileref_open_test.rb +32 -0
  70. data/test/fileref_properties_test.rb +21 -0
  71. data/test/fileref_write_test.rb +62 -0
  72. data/test/helper.rb +10 -0
  73. data/test/id3v1_tag_test.rb +36 -0
  74. data/test/id3v2_frames_test.rb +115 -0
  75. data/test/id3v2_memory_test.rb +87 -0
  76. data/test/id3v2_relative_volume_test.rb +62 -0
  77. data/test/id3v2_tag_test.rb +59 -0
  78. data/test/id3v2_unicode_test.rb +47 -0
  79. data/test/id3v2_write_test.rb +100 -0
  80. data/test/mpeg_file_test.rb +76 -0
  81. data/test/tag_test.rb +21 -0
  82. data/test/unicode_filename_test.rb +29 -0
  83. data/test/vorbis_file_test.rb +54 -0
  84. data/test/vorbis_tag_test.rb +79 -0
  85. metadata +191 -0
@@ -0,0 +1,4 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..'))
2
+ require 'extconf_common'
3
+
4
+ create_makefile('taglib_mpeg')
@@ -0,0 +1,75 @@
1
+ %module "TagLib::MPEG"
2
+ %{
3
+ #include <taglib/taglib.h>
4
+ #include <taglib/xingheader.h>
5
+ #include <taglib/mpegheader.h>
6
+ #include <taglib/mpegproperties.h>
7
+ #include <taglib/mpegfile.h>
8
+ #include <taglib/id3v2tag.h>
9
+ %}
10
+
11
+ %include "../taglib_base/includes.i"
12
+ %import(module="taglib_base") "../taglib_base/taglib_base.i"
13
+
14
+ %ignore TagLib::MPEG::Header::operator=;
15
+ %include <taglib/xingheader.h>
16
+ %include <taglib/mpegheader.h>
17
+ %include <taglib/mpegproperties.h>
18
+
19
+ %rename(id3v1_tag) TagLib::MPEG::File::ID3v1Tag;
20
+ %rename(id3v2_tag) TagLib::MPEG::File::ID3v2Tag;
21
+ %rename(set_id3v2_frame_factory) TagLib::MPEG::File::setID3v2FrameFactory;
22
+
23
+ %freefunc TagLib::MPEG::File "free_taglib_mpeg_file";
24
+
25
+ %include <taglib/mpegfile.h>
26
+
27
+ // Unlink Ruby objects from the deleted C++ objects. Otherwise Ruby code
28
+ // that calls a method on a tag after the file is deleted segfaults.
29
+ %begin %{
30
+ static void free_taglib_mpeg_file(void *ptr);
31
+ %}
32
+ %header %{
33
+ static void free_taglib_mpeg_file(void *ptr) {
34
+ TagLib::MPEG::File *file = (TagLib::MPEG::File *) ptr;
35
+
36
+ TagLib::ID3v1::Tag *id3v1tag = file->ID3v1Tag(false);
37
+ if (id3v1tag) {
38
+ SWIG_RubyUnlinkObjects(id3v1tag);
39
+ SWIG_RubyRemoveTracking(id3v1tag);
40
+ }
41
+
42
+ TagLib::ID3v2::Tag *id3v2tag = file->ID3v2Tag(false);
43
+ if (id3v2tag) {
44
+ TagLib::ID3v2::FrameList frames = id3v2tag->frameList();
45
+ for (TagLib::ID3v2::FrameList::ConstIterator it = frames.begin(); it != frames.end(); it++) {
46
+ TagLib::ID3v2::Frame *frame = (*it);
47
+ SWIG_RubyUnlinkObjects(frame);
48
+ SWIG_RubyRemoveTracking(frame);
49
+ }
50
+
51
+ SWIG_RubyUnlinkObjects(id3v2tag);
52
+ SWIG_RubyRemoveTracking(id3v2tag);
53
+ }
54
+
55
+ TagLib::MPEG::Properties *properties = file->audioProperties();
56
+ if (properties) {
57
+ SWIG_RubyUnlinkObjects(properties);
58
+ SWIG_RubyRemoveTracking(properties);
59
+ }
60
+
61
+ SWIG_RubyUnlinkObjects(ptr);
62
+ SWIG_RubyRemoveTracking(ptr);
63
+
64
+ delete file;
65
+ }
66
+ %}
67
+
68
+ %extend TagLib::MPEG::File {
69
+ void close() {
70
+ free_taglib_mpeg_file($self);
71
+ }
72
+ }
73
+
74
+
75
+ // vim: set filetype=cpp sw=2 ts=2 expandtab:
@@ -0,0 +1,4726 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 2.0.5
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
+ * coding conventions designed to improve portability and efficiency. Do not make
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
+ * ----------------------------------------------------------------------------- */
10
+
11
+ static void free_taglib_mpeg_file(void *ptr);
12
+
13
+
14
+ #define SWIGRUBY
15
+
16
+
17
+ #ifdef __cplusplus
18
+ /* SwigValueWrapper is described in swig.swg */
19
+ template<typename T> class SwigValueWrapper {
20
+ struct SwigMovePointer {
21
+ T *ptr;
22
+ SwigMovePointer(T *p) : ptr(p) { }
23
+ ~SwigMovePointer() { delete ptr; }
24
+ SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
25
+ } pointer;
26
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
27
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs);
28
+ public:
29
+ SwigValueWrapper() : pointer(0) { }
30
+ SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
31
+ operator T&() const { return *pointer.ptr; }
32
+ T *operator&() { return pointer.ptr; }
33
+ };
34
+
35
+ template <typename T> T SwigValueInit() {
36
+ return T();
37
+ }
38
+ #endif
39
+
40
+ /* -----------------------------------------------------------------------------
41
+ * This section contains generic SWIG labels for method/variable
42
+ * declarations/attributes, and other compiler dependent labels.
43
+ * ----------------------------------------------------------------------------- */
44
+
45
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
46
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
47
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
48
+ # define SWIGTEMPLATEDISAMBIGUATOR template
49
+ # elif defined(__HP_aCC)
50
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
51
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
52
+ # define SWIGTEMPLATEDISAMBIGUATOR template
53
+ # else
54
+ # define SWIGTEMPLATEDISAMBIGUATOR
55
+ # endif
56
+ #endif
57
+
58
+ /* inline attribute */
59
+ #ifndef SWIGINLINE
60
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
61
+ # define SWIGINLINE inline
62
+ # else
63
+ # define SWIGINLINE
64
+ # endif
65
+ #endif
66
+
67
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
68
+ #ifndef SWIGUNUSED
69
+ # if defined(__GNUC__)
70
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
71
+ # define SWIGUNUSED __attribute__ ((__unused__))
72
+ # else
73
+ # define SWIGUNUSED
74
+ # endif
75
+ # elif defined(__ICC)
76
+ # define SWIGUNUSED __attribute__ ((__unused__))
77
+ # else
78
+ # define SWIGUNUSED
79
+ # endif
80
+ #endif
81
+
82
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
83
+ # if defined(_MSC_VER)
84
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
85
+ # endif
86
+ #endif
87
+
88
+ #ifndef SWIGUNUSEDPARM
89
+ # ifdef __cplusplus
90
+ # define SWIGUNUSEDPARM(p)
91
+ # else
92
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
93
+ # endif
94
+ #endif
95
+
96
+ /* internal SWIG method */
97
+ #ifndef SWIGINTERN
98
+ # define SWIGINTERN static SWIGUNUSED
99
+ #endif
100
+
101
+ /* internal inline SWIG method */
102
+ #ifndef SWIGINTERNINLINE
103
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
104
+ #endif
105
+
106
+ /* exporting methods */
107
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
108
+ # ifndef GCC_HASCLASSVISIBILITY
109
+ # define GCC_HASCLASSVISIBILITY
110
+ # endif
111
+ #endif
112
+
113
+ #ifndef SWIGEXPORT
114
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
115
+ # if defined(STATIC_LINKED)
116
+ # define SWIGEXPORT
117
+ # else
118
+ # define SWIGEXPORT __declspec(dllexport)
119
+ # endif
120
+ # else
121
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
122
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
123
+ # else
124
+ # define SWIGEXPORT
125
+ # endif
126
+ # endif
127
+ #endif
128
+
129
+ /* calling conventions for Windows */
130
+ #ifndef SWIGSTDCALL
131
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
132
+ # define SWIGSTDCALL __stdcall
133
+ # else
134
+ # define SWIGSTDCALL
135
+ # endif
136
+ #endif
137
+
138
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
139
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
140
+ # define _CRT_SECURE_NO_DEPRECATE
141
+ #endif
142
+
143
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
144
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
145
+ # define _SCL_SECURE_NO_DEPRECATE
146
+ #endif
147
+
148
+
149
+ /* -----------------------------------------------------------------------------
150
+ * This section contains generic SWIG labels for method/variable
151
+ * declarations/attributes, and other compiler dependent labels.
152
+ * ----------------------------------------------------------------------------- */
153
+
154
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
155
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
156
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
157
+ # define SWIGTEMPLATEDISAMBIGUATOR template
158
+ # elif defined(__HP_aCC)
159
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
160
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
161
+ # define SWIGTEMPLATEDISAMBIGUATOR template
162
+ # else
163
+ # define SWIGTEMPLATEDISAMBIGUATOR
164
+ # endif
165
+ #endif
166
+
167
+ /* inline attribute */
168
+ #ifndef SWIGINLINE
169
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
170
+ # define SWIGINLINE inline
171
+ # else
172
+ # define SWIGINLINE
173
+ # endif
174
+ #endif
175
+
176
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
177
+ #ifndef SWIGUNUSED
178
+ # if defined(__GNUC__)
179
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
180
+ # define SWIGUNUSED __attribute__ ((__unused__))
181
+ # else
182
+ # define SWIGUNUSED
183
+ # endif
184
+ # elif defined(__ICC)
185
+ # define SWIGUNUSED __attribute__ ((__unused__))
186
+ # else
187
+ # define SWIGUNUSED
188
+ # endif
189
+ #endif
190
+
191
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
192
+ # if defined(_MSC_VER)
193
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
194
+ # endif
195
+ #endif
196
+
197
+ #ifndef SWIGUNUSEDPARM
198
+ # ifdef __cplusplus
199
+ # define SWIGUNUSEDPARM(p)
200
+ # else
201
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
202
+ # endif
203
+ #endif
204
+
205
+ /* internal SWIG method */
206
+ #ifndef SWIGINTERN
207
+ # define SWIGINTERN static SWIGUNUSED
208
+ #endif
209
+
210
+ /* internal inline SWIG method */
211
+ #ifndef SWIGINTERNINLINE
212
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
213
+ #endif
214
+
215
+ /* exporting methods */
216
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
217
+ # ifndef GCC_HASCLASSVISIBILITY
218
+ # define GCC_HASCLASSVISIBILITY
219
+ # endif
220
+ #endif
221
+
222
+ #ifndef SWIGEXPORT
223
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
224
+ # if defined(STATIC_LINKED)
225
+ # define SWIGEXPORT
226
+ # else
227
+ # define SWIGEXPORT __declspec(dllexport)
228
+ # endif
229
+ # else
230
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
231
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
232
+ # else
233
+ # define SWIGEXPORT
234
+ # endif
235
+ # endif
236
+ #endif
237
+
238
+ /* calling conventions for Windows */
239
+ #ifndef SWIGSTDCALL
240
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
241
+ # define SWIGSTDCALL __stdcall
242
+ # else
243
+ # define SWIGSTDCALL
244
+ # endif
245
+ #endif
246
+
247
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
248
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
249
+ # define _CRT_SECURE_NO_DEPRECATE
250
+ #endif
251
+
252
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
253
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
254
+ # define _SCL_SECURE_NO_DEPRECATE
255
+ #endif
256
+
257
+
258
+ /* -----------------------------------------------------------------------------
259
+ * swigrun.swg
260
+ *
261
+ * This file contains generic C API SWIG runtime support for pointer
262
+ * type checking.
263
+ * ----------------------------------------------------------------------------- */
264
+
265
+ /* This should only be incremented when either the layout of swig_type_info changes,
266
+ or for whatever reason, the runtime changes incompatibly */
267
+ #define SWIG_RUNTIME_VERSION "4"
268
+
269
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
270
+ #ifdef SWIG_TYPE_TABLE
271
+ # define SWIG_QUOTE_STRING(x) #x
272
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
273
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
274
+ #else
275
+ # define SWIG_TYPE_TABLE_NAME
276
+ #endif
277
+
278
+ /*
279
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
280
+ creating a static or dynamic library from the SWIG runtime code.
281
+ In 99.9% of the cases, SWIG just needs to declare them as 'static'.
282
+
283
+ But only do this if strictly necessary, ie, if you have problems
284
+ with your compiler or suchlike.
285
+ */
286
+
287
+ #ifndef SWIGRUNTIME
288
+ # define SWIGRUNTIME SWIGINTERN
289
+ #endif
290
+
291
+ #ifndef SWIGRUNTIMEINLINE
292
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
293
+ #endif
294
+
295
+ /* Generic buffer size */
296
+ #ifndef SWIG_BUFFER_SIZE
297
+ # define SWIG_BUFFER_SIZE 1024
298
+ #endif
299
+
300
+ /* Flags for pointer conversions */
301
+ #define SWIG_POINTER_DISOWN 0x1
302
+ #define SWIG_CAST_NEW_MEMORY 0x2
303
+
304
+ /* Flags for new pointer objects */
305
+ #define SWIG_POINTER_OWN 0x1
306
+
307
+
308
+ /*
309
+ Flags/methods for returning states.
310
+
311
+ The SWIG conversion methods, as ConvertPtr, return an integer
312
+ that tells if the conversion was successful or not. And if not,
313
+ an error code can be returned (see swigerrors.swg for the codes).
314
+
315
+ Use the following macros/flags to set or process the returning
316
+ states.
317
+
318
+ In old versions of SWIG, code such as the following was usually written:
319
+
320
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
321
+ // success code
322
+ } else {
323
+ //fail code
324
+ }
325
+
326
+ Now you can be more explicit:
327
+
328
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
329
+ if (SWIG_IsOK(res)) {
330
+ // success code
331
+ } else {
332
+ // fail code
333
+ }
334
+
335
+ which is the same really, but now you can also do
336
+
337
+ Type *ptr;
338
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
339
+ if (SWIG_IsOK(res)) {
340
+ // success code
341
+ if (SWIG_IsNewObj(res) {
342
+ ...
343
+ delete *ptr;
344
+ } else {
345
+ ...
346
+ }
347
+ } else {
348
+ // fail code
349
+ }
350
+
351
+ I.e., now SWIG_ConvertPtr can return new objects and you can
352
+ identify the case and take care of the deallocation. Of course that
353
+ also requires SWIG_ConvertPtr to return new result values, such as
354
+
355
+ int SWIG_ConvertPtr(obj, ptr,...) {
356
+ if (<obj is ok>) {
357
+ if (<need new object>) {
358
+ *ptr = <ptr to new allocated object>;
359
+ return SWIG_NEWOBJ;
360
+ } else {
361
+ *ptr = <ptr to old object>;
362
+ return SWIG_OLDOBJ;
363
+ }
364
+ } else {
365
+ return SWIG_BADOBJ;
366
+ }
367
+ }
368
+
369
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
370
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
371
+ SWIG errors code.
372
+
373
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
374
+ allows to return the 'cast rank', for example, if you have this
375
+
376
+ int food(double)
377
+ int fooi(int);
378
+
379
+ and you call
380
+
381
+ food(1) // cast rank '1' (1 -> 1.0)
382
+ fooi(1) // cast rank '0'
383
+
384
+ just use the SWIG_AddCast()/SWIG_CheckState()
385
+ */
386
+
387
+ #define SWIG_OK (0)
388
+ #define SWIG_ERROR (-1)
389
+ #define SWIG_IsOK(r) (r >= 0)
390
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
391
+
392
+ /* The CastRankLimit says how many bits are used for the cast rank */
393
+ #define SWIG_CASTRANKLIMIT (1 << 8)
394
+ /* The NewMask denotes the object was created (using new/malloc) */
395
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
396
+ /* The TmpMask is for in/out typemaps that use temporal objects */
397
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
398
+ /* Simple returning values */
399
+ #define SWIG_BADOBJ (SWIG_ERROR)
400
+ #define SWIG_OLDOBJ (SWIG_OK)
401
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
402
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
403
+ /* Check, add and del mask methods */
404
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
405
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
406
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
407
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
408
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
409
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
410
+
411
+ /* Cast-Rank Mode */
412
+ #if defined(SWIG_CASTRANK_MODE)
413
+ # ifndef SWIG_TypeRank
414
+ # define SWIG_TypeRank unsigned long
415
+ # endif
416
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
417
+ # define SWIG_MAXCASTRANK (2)
418
+ # endif
419
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
420
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
421
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
422
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
423
+ }
424
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
425
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
426
+ }
427
+ #else /* no cast-rank mode */
428
+ # define SWIG_AddCast
429
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
430
+ #endif
431
+
432
+
433
+ #include <string.h>
434
+
435
+ #ifdef __cplusplus
436
+ extern "C" {
437
+ #endif
438
+
439
+ typedef void *(*swig_converter_func)(void *, int *);
440
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
441
+
442
+ /* Structure to store information on one type */
443
+ typedef struct swig_type_info {
444
+ const char *name; /* mangled name of this type */
445
+ const char *str; /* human readable name of this type */
446
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
447
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
448
+ void *clientdata; /* language specific type data */
449
+ int owndata; /* flag if the structure owns the clientdata */
450
+ } swig_type_info;
451
+
452
+ /* Structure to store a type and conversion function used for casting */
453
+ typedef struct swig_cast_info {
454
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
455
+ swig_converter_func converter; /* function to cast the void pointers */
456
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
457
+ struct swig_cast_info *prev; /* pointer to the previous cast */
458
+ } swig_cast_info;
459
+
460
+ /* Structure used to store module information
461
+ * Each module generates one structure like this, and the runtime collects
462
+ * all of these structures and stores them in a circularly linked list.*/
463
+ typedef struct swig_module_info {
464
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
465
+ size_t size; /* Number of types in this module */
466
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
467
+ swig_type_info **type_initial; /* Array of initially generated type structures */
468
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
469
+ void *clientdata; /* Language specific module data */
470
+ } swig_module_info;
471
+
472
+ /*
473
+ Compare two type names skipping the space characters, therefore
474
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
475
+
476
+ Return 0 when the two name types are equivalent, as in
477
+ strncmp, but skipping ' '.
478
+ */
479
+ SWIGRUNTIME int
480
+ SWIG_TypeNameComp(const char *f1, const char *l1,
481
+ const char *f2, const char *l2) {
482
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
483
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
484
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
485
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
486
+ }
487
+ return (int)((l1 - f1) - (l2 - f2));
488
+ }
489
+
490
+ /*
491
+ Check type equivalence in a name list like <name1>|<name2>|...
492
+ Return 0 if not equal, 1 if equal
493
+ */
494
+ SWIGRUNTIME int
495
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
496
+ int equiv = 0;
497
+ const char* te = tb + strlen(tb);
498
+ const char* ne = nb;
499
+ while (!equiv && *ne) {
500
+ for (nb = ne; *ne; ++ne) {
501
+ if (*ne == '|') break;
502
+ }
503
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
504
+ if (*ne) ++ne;
505
+ }
506
+ return equiv;
507
+ }
508
+
509
+ /*
510
+ Check type equivalence in a name list like <name1>|<name2>|...
511
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
512
+ */
513
+ SWIGRUNTIME int
514
+ SWIG_TypeCompare(const char *nb, const char *tb) {
515
+ int equiv = 0;
516
+ const char* te = tb + strlen(tb);
517
+ const char* ne = nb;
518
+ while (!equiv && *ne) {
519
+ for (nb = ne; *ne; ++ne) {
520
+ if (*ne == '|') break;
521
+ }
522
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
523
+ if (*ne) ++ne;
524
+ }
525
+ return equiv;
526
+ }
527
+
528
+
529
+ /*
530
+ Check the typename
531
+ */
532
+ SWIGRUNTIME swig_cast_info *
533
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
534
+ if (ty) {
535
+ swig_cast_info *iter = ty->cast;
536
+ while (iter) {
537
+ if (strcmp(iter->type->name, c) == 0) {
538
+ if (iter == ty->cast)
539
+ return iter;
540
+ /* Move iter to the top of the linked list */
541
+ iter->prev->next = iter->next;
542
+ if (iter->next)
543
+ iter->next->prev = iter->prev;
544
+ iter->next = ty->cast;
545
+ iter->prev = 0;
546
+ if (ty->cast) ty->cast->prev = iter;
547
+ ty->cast = iter;
548
+ return iter;
549
+ }
550
+ iter = iter->next;
551
+ }
552
+ }
553
+ return 0;
554
+ }
555
+
556
+ /*
557
+ Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
558
+ */
559
+ SWIGRUNTIME swig_cast_info *
560
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
561
+ if (ty) {
562
+ swig_cast_info *iter = ty->cast;
563
+ while (iter) {
564
+ if (iter->type == from) {
565
+ if (iter == ty->cast)
566
+ return iter;
567
+ /* Move iter to the top of the linked list */
568
+ iter->prev->next = iter->next;
569
+ if (iter->next)
570
+ iter->next->prev = iter->prev;
571
+ iter->next = ty->cast;
572
+ iter->prev = 0;
573
+ if (ty->cast) ty->cast->prev = iter;
574
+ ty->cast = iter;
575
+ return iter;
576
+ }
577
+ iter = iter->next;
578
+ }
579
+ }
580
+ return 0;
581
+ }
582
+
583
+ /*
584
+ Cast a pointer up an inheritance hierarchy
585
+ */
586
+ SWIGRUNTIMEINLINE void *
587
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
588
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
589
+ }
590
+
591
+ /*
592
+ Dynamic pointer casting. Down an inheritance hierarchy
593
+ */
594
+ SWIGRUNTIME swig_type_info *
595
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
596
+ swig_type_info *lastty = ty;
597
+ if (!ty || !ty->dcast) return ty;
598
+ while (ty && (ty->dcast)) {
599
+ ty = (*ty->dcast)(ptr);
600
+ if (ty) lastty = ty;
601
+ }
602
+ return lastty;
603
+ }
604
+
605
+ /*
606
+ Return the name associated with this type
607
+ */
608
+ SWIGRUNTIMEINLINE const char *
609
+ SWIG_TypeName(const swig_type_info *ty) {
610
+ return ty->name;
611
+ }
612
+
613
+ /*
614
+ Return the pretty name associated with this type,
615
+ that is an unmangled type name in a form presentable to the user.
616
+ */
617
+ SWIGRUNTIME const char *
618
+ SWIG_TypePrettyName(const swig_type_info *type) {
619
+ /* The "str" field contains the equivalent pretty names of the
620
+ type, separated by vertical-bar characters. We choose
621
+ to print the last name, as it is often (?) the most
622
+ specific. */
623
+ if (!type) return NULL;
624
+ if (type->str != NULL) {
625
+ const char *last_name = type->str;
626
+ const char *s;
627
+ for (s = type->str; *s; s++)
628
+ if (*s == '|') last_name = s+1;
629
+ return last_name;
630
+ }
631
+ else
632
+ return type->name;
633
+ }
634
+
635
+ /*
636
+ Set the clientdata field for a type
637
+ */
638
+ SWIGRUNTIME void
639
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
640
+ swig_cast_info *cast = ti->cast;
641
+ /* if (ti->clientdata == clientdata) return; */
642
+ ti->clientdata = clientdata;
643
+
644
+ while (cast) {
645
+ if (!cast->converter) {
646
+ swig_type_info *tc = cast->type;
647
+ if (!tc->clientdata) {
648
+ SWIG_TypeClientData(tc, clientdata);
649
+ }
650
+ }
651
+ cast = cast->next;
652
+ }
653
+ }
654
+ SWIGRUNTIME void
655
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
656
+ SWIG_TypeClientData(ti, clientdata);
657
+ ti->owndata = 1;
658
+ }
659
+
660
+ /*
661
+ Search for a swig_type_info structure only by mangled name
662
+ Search is a O(log #types)
663
+
664
+ We start searching at module start, and finish searching when start == end.
665
+ Note: if start == end at the beginning of the function, we go all the way around
666
+ the circular list.
667
+ */
668
+ SWIGRUNTIME swig_type_info *
669
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
670
+ swig_module_info *end,
671
+ const char *name) {
672
+ swig_module_info *iter = start;
673
+ do {
674
+ if (iter->size) {
675
+ register size_t l = 0;
676
+ register size_t r = iter->size - 1;
677
+ do {
678
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
679
+ register size_t i = (l + r) >> 1;
680
+ const char *iname = iter->types[i]->name;
681
+ if (iname) {
682
+ register int compare = strcmp(name, iname);
683
+ if (compare == 0) {
684
+ return iter->types[i];
685
+ } else if (compare < 0) {
686
+ if (i) {
687
+ r = i - 1;
688
+ } else {
689
+ break;
690
+ }
691
+ } else if (compare > 0) {
692
+ l = i + 1;
693
+ }
694
+ } else {
695
+ break; /* should never happen */
696
+ }
697
+ } while (l <= r);
698
+ }
699
+ iter = iter->next;
700
+ } while (iter != end);
701
+ return 0;
702
+ }
703
+
704
+ /*
705
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
706
+ It first searches the mangled names of the types, which is a O(log #types)
707
+ If a type is not found it then searches the human readable names, which is O(#types).
708
+
709
+ We start searching at module start, and finish searching when start == end.
710
+ Note: if start == end at the beginning of the function, we go all the way around
711
+ the circular list.
712
+ */
713
+ SWIGRUNTIME swig_type_info *
714
+ SWIG_TypeQueryModule(swig_module_info *start,
715
+ swig_module_info *end,
716
+ const char *name) {
717
+ /* STEP 1: Search the name field using binary search */
718
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
719
+ if (ret) {
720
+ return ret;
721
+ } else {
722
+ /* STEP 2: If the type hasn't been found, do a complete search
723
+ of the str field (the human readable name) */
724
+ swig_module_info *iter = start;
725
+ do {
726
+ register size_t i = 0;
727
+ for (; i < iter->size; ++i) {
728
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
729
+ return iter->types[i];
730
+ }
731
+ iter = iter->next;
732
+ } while (iter != end);
733
+ }
734
+
735
+ /* neither found a match */
736
+ return 0;
737
+ }
738
+
739
+ /*
740
+ Pack binary data into a string
741
+ */
742
+ SWIGRUNTIME char *
743
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
744
+ static const char hex[17] = "0123456789abcdef";
745
+ register const unsigned char *u = (unsigned char *) ptr;
746
+ register const unsigned char *eu = u + sz;
747
+ for (; u != eu; ++u) {
748
+ register unsigned char uu = *u;
749
+ *(c++) = hex[(uu & 0xf0) >> 4];
750
+ *(c++) = hex[uu & 0xf];
751
+ }
752
+ return c;
753
+ }
754
+
755
+ /*
756
+ Unpack binary data from a string
757
+ */
758
+ SWIGRUNTIME const char *
759
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
760
+ register unsigned char *u = (unsigned char *) ptr;
761
+ register const unsigned char *eu = u + sz;
762
+ for (; u != eu; ++u) {
763
+ register char d = *(c++);
764
+ register unsigned char uu;
765
+ if ((d >= '0') && (d <= '9'))
766
+ uu = ((d - '0') << 4);
767
+ else if ((d >= 'a') && (d <= 'f'))
768
+ uu = ((d - ('a'-10)) << 4);
769
+ else
770
+ return (char *) 0;
771
+ d = *(c++);
772
+ if ((d >= '0') && (d <= '9'))
773
+ uu |= (d - '0');
774
+ else if ((d >= 'a') && (d <= 'f'))
775
+ uu |= (d - ('a'-10));
776
+ else
777
+ return (char *) 0;
778
+ *u = uu;
779
+ }
780
+ return c;
781
+ }
782
+
783
+ /*
784
+ Pack 'void *' into a string buffer.
785
+ */
786
+ SWIGRUNTIME char *
787
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
788
+ char *r = buff;
789
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
790
+ *(r++) = '_';
791
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
792
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
793
+ strcpy(r,name);
794
+ return buff;
795
+ }
796
+
797
+ SWIGRUNTIME const char *
798
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
799
+ if (*c != '_') {
800
+ if (strcmp(c,"NULL") == 0) {
801
+ *ptr = (void *) 0;
802
+ return name;
803
+ } else {
804
+ return 0;
805
+ }
806
+ }
807
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
808
+ }
809
+
810
+ SWIGRUNTIME char *
811
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
812
+ char *r = buff;
813
+ size_t lname = (name ? strlen(name) : 0);
814
+ if ((2*sz + 2 + lname) > bsz) return 0;
815
+ *(r++) = '_';
816
+ r = SWIG_PackData(r,ptr,sz);
817
+ if (lname) {
818
+ strncpy(r,name,lname+1);
819
+ } else {
820
+ *r = 0;
821
+ }
822
+ return buff;
823
+ }
824
+
825
+ SWIGRUNTIME const char *
826
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
827
+ if (*c != '_') {
828
+ if (strcmp(c,"NULL") == 0) {
829
+ memset(ptr,0,sz);
830
+ return name;
831
+ } else {
832
+ return 0;
833
+ }
834
+ }
835
+ return SWIG_UnpackData(++c,ptr,sz);
836
+ }
837
+
838
+ #ifdef __cplusplus
839
+ }
840
+ #endif
841
+
842
+ /* Errors in SWIG */
843
+ #define SWIG_UnknownError -1
844
+ #define SWIG_IOError -2
845
+ #define SWIG_RuntimeError -3
846
+ #define SWIG_IndexError -4
847
+ #define SWIG_TypeError -5
848
+ #define SWIG_DivisionByZero -6
849
+ #define SWIG_OverflowError -7
850
+ #define SWIG_SyntaxError -8
851
+ #define SWIG_ValueError -9
852
+ #define SWIG_SystemError -10
853
+ #define SWIG_AttributeError -11
854
+ #define SWIG_MemoryError -12
855
+ #define SWIG_NullReferenceError -13
856
+
857
+
858
+
859
+ #include <ruby.h>
860
+
861
+ /* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
862
+ * breaks using rb_intern as an lvalue, as SWIG does. We work around this
863
+ * issue for now by disabling this.
864
+ * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
865
+ */
866
+ #ifdef rb_intern
867
+ # undef rb_intern
868
+ #endif
869
+
870
+ /* Remove global macros defined in Ruby's win32.h */
871
+ #ifdef write
872
+ # undef write
873
+ #endif
874
+ #ifdef read
875
+ # undef read
876
+ #endif
877
+ #ifdef bind
878
+ # undef bind
879
+ #endif
880
+ #ifdef close
881
+ # undef close
882
+ #endif
883
+ #ifdef connect
884
+ # undef connect
885
+ #endif
886
+
887
+
888
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
889
+ #ifndef NUM2LL
890
+ #define NUM2LL(x) NUM2LONG((x))
891
+ #endif
892
+ #ifndef LL2NUM
893
+ #define LL2NUM(x) INT2NUM((long) (x))
894
+ #endif
895
+ #ifndef ULL2NUM
896
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
897
+ #endif
898
+
899
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
900
+ #ifndef NUM2ULL
901
+ #ifdef HAVE_LONG_LONG
902
+ #define NUM2ULL(x) rb_num2ull((x))
903
+ #else
904
+ #define NUM2ULL(x) NUM2ULONG(x)
905
+ #endif
906
+ #endif
907
+
908
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
909
+ /* Define these for older versions so we can just write code the new way */
910
+ #ifndef RSTRING_LEN
911
+ # define RSTRING_LEN(x) RSTRING(x)->len
912
+ #endif
913
+ #ifndef RSTRING_PTR
914
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
915
+ #endif
916
+ #ifndef RSTRING_END
917
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
918
+ #endif
919
+ #ifndef RARRAY_LEN
920
+ # define RARRAY_LEN(x) RARRAY(x)->len
921
+ #endif
922
+ #ifndef RARRAY_PTR
923
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
924
+ #endif
925
+ #ifndef RFLOAT_VALUE
926
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
927
+ #endif
928
+ #ifndef DOUBLE2NUM
929
+ # define DOUBLE2NUM(x) rb_float_new(x)
930
+ #endif
931
+ #ifndef RHASH_TBL
932
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
933
+ #endif
934
+ #ifndef RHASH_ITER_LEV
935
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
936
+ #endif
937
+ #ifndef RHASH_IFNONE
938
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
939
+ #endif
940
+ #ifndef RHASH_SIZE
941
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
942
+ #endif
943
+ #ifndef RHASH_EMPTY_P
944
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
945
+ #endif
946
+ #ifndef RSTRUCT_LEN
947
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
948
+ #endif
949
+ #ifndef RSTRUCT_PTR
950
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
951
+ #endif
952
+
953
+
954
+
955
+ /*
956
+ * Need to be very careful about how these macros are defined, especially
957
+ * when compiling C++ code or C code with an ANSI C compiler.
958
+ *
959
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
960
+ * a Ruby method so that it can be passed as an argument to API functions
961
+ * like rb_define_method() and rb_define_singleton_method().
962
+ *
963
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
964
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
965
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
966
+ * and Data_Make_Struct().
967
+ */
968
+
969
+ #ifdef __cplusplus
970
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
971
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
972
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
973
+ # define VOIDFUNC(f) ((void (*)()) f)
974
+ # else
975
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
976
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
977
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
978
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
979
+ # else /* These definitions should work for Ruby 1.7+ */
980
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
981
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
982
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
983
+ # endif
984
+ # endif
985
+ #else
986
+ # define VALUEFUNC(f) (f)
987
+ # define VOIDFUNC(f) (f)
988
+ #endif
989
+
990
+ /* Don't use for expressions have side effect */
991
+ #ifndef RB_STRING_VALUE
992
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
993
+ #endif
994
+ #ifndef StringValue
995
+ #define StringValue(s) RB_STRING_VALUE(s)
996
+ #endif
997
+ #ifndef StringValuePtr
998
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
999
+ #endif
1000
+ #ifndef StringValueLen
1001
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
1002
+ #endif
1003
+ #ifndef SafeStringValue
1004
+ #define SafeStringValue(v) do {\
1005
+ StringValue(v);\
1006
+ rb_check_safe_str(v);\
1007
+ } while (0)
1008
+ #endif
1009
+
1010
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
1011
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
1012
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
1013
+ #endif
1014
+
1015
+ static VALUE _mSWIG = Qnil;
1016
+
1017
+ /* -----------------------------------------------------------------------------
1018
+ * error manipulation
1019
+ * ----------------------------------------------------------------------------- */
1020
+
1021
+
1022
+ /* Define some additional error types */
1023
+ #define SWIG_ObjectPreviouslyDeletedError -100
1024
+
1025
+
1026
+ /* Define custom exceptions for errors that do not map to existing Ruby
1027
+ exceptions. Note this only works for C++ since a global cannot be
1028
+ initialized by a function in C. For C, fallback to rb_eRuntimeError.*/
1029
+
1030
+ SWIGINTERN VALUE
1031
+ getNullReferenceError(void) {
1032
+ static int init = 0;
1033
+ static VALUE rb_eNullReferenceError ;
1034
+ if (!init) {
1035
+ init = 1;
1036
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
1037
+ }
1038
+ return rb_eNullReferenceError;
1039
+ }
1040
+
1041
+ SWIGINTERN VALUE
1042
+ getObjectPreviouslyDeletedError(void) {
1043
+ static int init = 0;
1044
+ static VALUE rb_eObjectPreviouslyDeleted ;
1045
+ if (!init) {
1046
+ init = 1;
1047
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
1048
+ }
1049
+ return rb_eObjectPreviouslyDeleted;
1050
+ }
1051
+
1052
+
1053
+ SWIGINTERN VALUE
1054
+ SWIG_Ruby_ErrorType(int SWIG_code) {
1055
+ VALUE type;
1056
+ switch (SWIG_code) {
1057
+ case SWIG_MemoryError:
1058
+ type = rb_eNoMemError;
1059
+ break;
1060
+ case SWIG_IOError:
1061
+ type = rb_eIOError;
1062
+ break;
1063
+ case SWIG_RuntimeError:
1064
+ type = rb_eRuntimeError;
1065
+ break;
1066
+ case SWIG_IndexError:
1067
+ type = rb_eIndexError;
1068
+ break;
1069
+ case SWIG_TypeError:
1070
+ type = rb_eTypeError;
1071
+ break;
1072
+ case SWIG_DivisionByZero:
1073
+ type = rb_eZeroDivError;
1074
+ break;
1075
+ case SWIG_OverflowError:
1076
+ type = rb_eRangeError;
1077
+ break;
1078
+ case SWIG_SyntaxError:
1079
+ type = rb_eSyntaxError;
1080
+ break;
1081
+ case SWIG_ValueError:
1082
+ type = rb_eArgError;
1083
+ break;
1084
+ case SWIG_SystemError:
1085
+ type = rb_eFatal;
1086
+ break;
1087
+ case SWIG_AttributeError:
1088
+ type = rb_eRuntimeError;
1089
+ break;
1090
+ case SWIG_NullReferenceError:
1091
+ type = getNullReferenceError();
1092
+ break;
1093
+ case SWIG_ObjectPreviouslyDeletedError:
1094
+ type = getObjectPreviouslyDeletedError();
1095
+ break;
1096
+ case SWIG_UnknownError:
1097
+ type = rb_eRuntimeError;
1098
+ break;
1099
+ default:
1100
+ type = rb_eRuntimeError;
1101
+ }
1102
+ return type;
1103
+ }
1104
+
1105
+
1106
+ /* This function is called when a user inputs a wrong argument to
1107
+ a method.
1108
+ */
1109
+ SWIGINTERN
1110
+ const char* Ruby_Format_TypeError( const char* msg,
1111
+ const char* type,
1112
+ const char* name,
1113
+ const int argn,
1114
+ VALUE input )
1115
+ {
1116
+ char buf[128];
1117
+ VALUE str;
1118
+ VALUE asStr;
1119
+ if ( msg && *msg )
1120
+ {
1121
+ str = rb_str_new2(msg);
1122
+ }
1123
+ else
1124
+ {
1125
+ str = rb_str_new(NULL, 0);
1126
+ }
1127
+
1128
+ str = rb_str_cat2( str, "Expected argument " );
1129
+ sprintf( buf, "%d of type ", argn-1 );
1130
+ str = rb_str_cat2( str, buf );
1131
+ str = rb_str_cat2( str, type );
1132
+ str = rb_str_cat2( str, ", but got " );
1133
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1134
+ str = rb_str_cat2( str, " " );
1135
+ asStr = rb_inspect(input);
1136
+ if ( RSTRING_LEN(asStr) > 30 )
1137
+ {
1138
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1139
+ str = rb_str_cat2( str, "..." );
1140
+ }
1141
+ else
1142
+ {
1143
+ str = rb_str_append( str, asStr );
1144
+ }
1145
+
1146
+ if ( name )
1147
+ {
1148
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1149
+ str = rb_str_cat2( str, name );
1150
+ str = rb_str_cat2( str, "'" );
1151
+ }
1152
+
1153
+ return StringValuePtr( str );
1154
+ }
1155
+
1156
+ /* This function is called when an overloaded method fails */
1157
+ SWIGINTERN
1158
+ void Ruby_Format_OverloadedError(
1159
+ const int argc,
1160
+ const int maxargs,
1161
+ const char* method,
1162
+ const char* prototypes
1163
+ )
1164
+ {
1165
+ const char* msg = "Wrong # of arguments";
1166
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1167
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1168
+ "Possible C/C++ prototypes are:\n%s",
1169
+ msg, method, prototypes);
1170
+ }
1171
+
1172
+ /* -----------------------------------------------------------------------------
1173
+ * rubytracking.swg
1174
+ *
1175
+ * This file contains support for tracking mappings from
1176
+ * Ruby objects to C++ objects. This functionality is needed
1177
+ * to implement mark functions for Ruby's mark and sweep
1178
+ * garbage collector.
1179
+ * ----------------------------------------------------------------------------- */
1180
+
1181
+ #ifdef __cplusplus
1182
+ extern "C" {
1183
+ #endif
1184
+
1185
+ /* Ruby 1.8 actually assumes the first case. */
1186
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1187
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1188
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1189
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1190
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1191
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1192
+ #else
1193
+ # error sizeof(void*) is not the same as long or long long
1194
+ #endif
1195
+
1196
+
1197
+ /* Global Ruby hash table to store Trackings from C/C++
1198
+ structs to Ruby Objects.
1199
+ */
1200
+ static VALUE swig_ruby_trackings = Qnil;
1201
+
1202
+ /* Global variable that stores a reference to the ruby
1203
+ hash table delete function. */
1204
+ static ID swig_ruby_hash_delete;
1205
+
1206
+ /* Setup a Ruby hash table to store Trackings */
1207
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1208
+ /* Create a ruby hash table to store Trackings from C++
1209
+ objects to Ruby objects. */
1210
+
1211
+ /* Try to see if some other .so has already created a
1212
+ tracking hash table, which we keep hidden in an instance var
1213
+ in the SWIG module.
1214
+ This is done to allow multiple DSOs to share the same
1215
+ tracking table.
1216
+ */
1217
+ ID trackings_id = rb_intern( "@__trackings__" );
1218
+ VALUE verbose = rb_gv_get("VERBOSE");
1219
+ rb_gv_set("VERBOSE", Qfalse);
1220
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1221
+ rb_gv_set("VERBOSE", verbose);
1222
+
1223
+ /* No, it hasn't. Create one ourselves */
1224
+ if ( swig_ruby_trackings == Qnil )
1225
+ {
1226
+ swig_ruby_trackings = rb_hash_new();
1227
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1228
+ }
1229
+
1230
+ /* Now store a reference to the hash table delete function
1231
+ so that we only have to look it up once.*/
1232
+ swig_ruby_hash_delete = rb_intern("delete");
1233
+ }
1234
+
1235
+ /* Get a Ruby number to reference a pointer */
1236
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1237
+ /* We cast the pointer to an unsigned long
1238
+ and then store a reference to it using
1239
+ a Ruby number object. */
1240
+
1241
+ /* Convert the pointer to a Ruby number */
1242
+ return SWIG2NUM(ptr);
1243
+ }
1244
+
1245
+ /* Get a Ruby number to reference an object */
1246
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1247
+ /* We cast the object to an unsigned long
1248
+ and then store a reference to it using
1249
+ a Ruby number object. */
1250
+
1251
+ /* Convert the Object to a Ruby number */
1252
+ return SWIG2NUM(object);
1253
+ }
1254
+
1255
+ /* Get a Ruby object from a previously stored reference */
1256
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1257
+ /* The provided Ruby number object is a reference
1258
+ to the Ruby object we want.*/
1259
+
1260
+ /* Convert the Ruby number to a Ruby object */
1261
+ return NUM2SWIG(reference);
1262
+ }
1263
+
1264
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1265
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1266
+ /* In a Ruby hash table we store the pointer and
1267
+ the associated Ruby object. The trick here is
1268
+ that we cannot store the Ruby object directly - if
1269
+ we do then it cannot be garbage collected. So
1270
+ instead we typecast it as a unsigned long and
1271
+ convert it to a Ruby number object.*/
1272
+
1273
+ /* Get a reference to the pointer as a Ruby number */
1274
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1275
+
1276
+ /* Get a reference to the Ruby object as a Ruby number */
1277
+ VALUE value = SWIG_RubyObjectToReference(object);
1278
+
1279
+ /* Store the mapping to the global hash table. */
1280
+ rb_hash_aset(swig_ruby_trackings, key, value);
1281
+ }
1282
+
1283
+ /* Get the Ruby object that owns the specified C/C++ struct */
1284
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1285
+ /* Get a reference to the pointer as a Ruby number */
1286
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1287
+
1288
+ /* Now lookup the value stored in the global hash table */
1289
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1290
+
1291
+ if (value == Qnil) {
1292
+ /* No object exists - return nil. */
1293
+ return Qnil;
1294
+ }
1295
+ else {
1296
+ /* Convert this value to Ruby object */
1297
+ return SWIG_RubyReferenceToObject(value);
1298
+ }
1299
+ }
1300
+
1301
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1302
+ is very important to remove objects once they are destroyed
1303
+ since the same memory address may be reused later to create
1304
+ a new object. */
1305
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1306
+ /* Get a reference to the pointer as a Ruby number */
1307
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1308
+
1309
+ /* Delete the object from the hash table by calling Ruby's
1310
+ do this we need to call the Hash.delete method.*/
1311
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1312
+ }
1313
+
1314
+ /* This is a helper method that unlinks a Ruby object from its
1315
+ underlying C++ object. This is needed if the lifetime of the
1316
+ Ruby object is longer than the C++ object */
1317
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1318
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1319
+
1320
+ if (object != Qnil) {
1321
+ DATA_PTR(object) = 0;
1322
+ }
1323
+ }
1324
+
1325
+
1326
+ #ifdef __cplusplus
1327
+ }
1328
+ #endif
1329
+
1330
+ /* -----------------------------------------------------------------------------
1331
+ * Ruby API portion that goes into the runtime
1332
+ * ----------------------------------------------------------------------------- */
1333
+
1334
+ #ifdef __cplusplus
1335
+ extern "C" {
1336
+ #endif
1337
+
1338
+ SWIGINTERN VALUE
1339
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1340
+ if (NIL_P(target)) {
1341
+ target = o;
1342
+ } else {
1343
+ if (TYPE(target) != T_ARRAY) {
1344
+ VALUE o2 = target;
1345
+ target = rb_ary_new();
1346
+ rb_ary_push(target, o2);
1347
+ }
1348
+ rb_ary_push(target, o);
1349
+ }
1350
+ return target;
1351
+ }
1352
+
1353
+ /* For ruby1.8.4 and earlier. */
1354
+ #ifndef RUBY_INIT_STACK
1355
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1356
+ # define RUBY_INIT_STACK \
1357
+ VALUE variable_in_this_stack_frame; \
1358
+ Init_stack(&variable_in_this_stack_frame);
1359
+ #endif
1360
+
1361
+
1362
+ #ifdef __cplusplus
1363
+ }
1364
+ #endif
1365
+
1366
+
1367
+ /* -----------------------------------------------------------------------------
1368
+ * rubyrun.swg
1369
+ *
1370
+ * This file contains the runtime support for Ruby modules
1371
+ * and includes code for managing global variables and pointer
1372
+ * type checking.
1373
+ * ----------------------------------------------------------------------------- */
1374
+
1375
+ /* For backward compatibility only */
1376
+ #define SWIG_POINTER_EXCEPTION 0
1377
+
1378
+ /* for raw pointers */
1379
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1380
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1381
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1382
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1383
+ #define swig_owntype ruby_owntype
1384
+
1385
+ /* for raw packed data */
1386
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1387
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1388
+
1389
+ /* for class or struct pointers */
1390
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1391
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1392
+
1393
+ /* for C or C++ function pointers */
1394
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1395
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1396
+
1397
+ /* for C++ member pointers, ie, member methods */
1398
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1399
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1400
+
1401
+
1402
+ /* Runtime API */
1403
+
1404
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1405
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1406
+
1407
+
1408
+ /* Error manipulation */
1409
+
1410
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1411
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
1412
+ #define SWIG_fail goto fail
1413
+
1414
+
1415
+ /* Ruby-specific SWIG API */
1416
+
1417
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1418
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1419
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1420
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1421
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1422
+
1423
+ #include "assert.h"
1424
+
1425
+ /* -----------------------------------------------------------------------------
1426
+ * pointers/data manipulation
1427
+ * ----------------------------------------------------------------------------- */
1428
+
1429
+ #ifdef __cplusplus
1430
+ extern "C" {
1431
+ #endif
1432
+
1433
+ typedef struct {
1434
+ VALUE klass;
1435
+ VALUE mImpl;
1436
+ void (*mark)(void *);
1437
+ void (*destroy)(void *);
1438
+ int trackObjects;
1439
+ } swig_class;
1440
+
1441
+
1442
+ /* Global pointer used to keep some internal SWIG stuff */
1443
+ static VALUE _cSWIG_Pointer = Qnil;
1444
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1445
+
1446
+ /* Global IDs used to keep some internal SWIG stuff */
1447
+ static ID swig_arity_id = 0;
1448
+ static ID swig_call_id = 0;
1449
+
1450
+ /*
1451
+ If your swig extension is to be run within an embedded ruby and has
1452
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1453
+ This will reset ruby's stack frame on each entry point from the main
1454
+ program the first time a virtual director function is invoked (in a
1455
+ non-recursive way).
1456
+ If this is not done, you run the risk of Ruby trashing the stack.
1457
+ */
1458
+
1459
+ #ifdef RUBY_EMBEDDED
1460
+
1461
+ # define SWIG_INIT_STACK \
1462
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1463
+ ++swig_virtual_calls;
1464
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1465
+ # define Ruby_DirectorTypeMismatchException(x) \
1466
+ rb_raise( rb_eTypeError, "%s", x ); return c_result;
1467
+
1468
+ static unsigned int swig_virtual_calls = 0;
1469
+
1470
+ #else /* normal non-embedded extension */
1471
+
1472
+ # define SWIG_INIT_STACK
1473
+ # define SWIG_RELEASE_STACK
1474
+ # define Ruby_DirectorTypeMismatchException(x) \
1475
+ throw Swig::DirectorTypeMismatchException( x );
1476
+
1477
+ #endif /* RUBY_EMBEDDED */
1478
+
1479
+
1480
+ SWIGRUNTIME VALUE
1481
+ getExceptionClass(void) {
1482
+ static int init = 0;
1483
+ static VALUE rubyExceptionClass ;
1484
+ if (!init) {
1485
+ init = 1;
1486
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1487
+ }
1488
+ return rubyExceptionClass;
1489
+ }
1490
+
1491
+ /* This code checks to see if the Ruby object being raised as part
1492
+ of an exception inherits from the Ruby class Exception. If so,
1493
+ the object is simply returned. If not, then a new Ruby exception
1494
+ object is created and that will be returned to Ruby.*/
1495
+ SWIGRUNTIME VALUE
1496
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1497
+ VALUE exceptionClass = getExceptionClass();
1498
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1499
+ return obj;
1500
+ } else {
1501
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1502
+ }
1503
+ }
1504
+
1505
+ /* Initialize Ruby runtime support */
1506
+ SWIGRUNTIME void
1507
+ SWIG_Ruby_InitRuntime(void)
1508
+ {
1509
+ if (_mSWIG == Qnil) {
1510
+ _mSWIG = rb_define_module("SWIG");
1511
+ swig_call_id = rb_intern("call");
1512
+ swig_arity_id = rb_intern("arity");
1513
+ }
1514
+ }
1515
+
1516
+ /* Define Ruby class for C type */
1517
+ SWIGRUNTIME void
1518
+ SWIG_Ruby_define_class(swig_type_info *type)
1519
+ {
1520
+ VALUE klass;
1521
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1522
+ sprintf(klass_name, "TYPE%s", type->name);
1523
+ if (NIL_P(_cSWIG_Pointer)) {
1524
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1525
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1526
+ }
1527
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1528
+ free((void *) klass_name);
1529
+ }
1530
+
1531
+ /* Create a new pointer object */
1532
+ SWIGRUNTIME VALUE
1533
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1534
+ {
1535
+ int own = flags & SWIG_POINTER_OWN;
1536
+ int track;
1537
+ char *klass_name;
1538
+ swig_class *sklass;
1539
+ VALUE klass;
1540
+ VALUE obj;
1541
+
1542
+ if (!ptr)
1543
+ return Qnil;
1544
+
1545
+ if (type->clientdata) {
1546
+ sklass = (swig_class *) type->clientdata;
1547
+
1548
+ /* Are we tracking this class and have we already returned this Ruby object? */
1549
+ track = sklass->trackObjects;
1550
+ if (track) {
1551
+ obj = SWIG_RubyInstanceFor(ptr);
1552
+
1553
+ /* Check the object's type and make sure it has the correct type.
1554
+ It might not in cases where methods do things like
1555
+ downcast methods. */
1556
+ if (obj != Qnil) {
1557
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1558
+ char* type_name = RSTRING_PTR(value);
1559
+
1560
+ if (strcmp(type->name, type_name) == 0) {
1561
+ return obj;
1562
+ }
1563
+ }
1564
+ }
1565
+
1566
+ /* Create a new Ruby object */
1567
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1568
+ ( own ? VOIDFUNC(sklass->destroy) :
1569
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1570
+ ), ptr);
1571
+
1572
+ /* If tracking is on for this class then track this object. */
1573
+ if (track) {
1574
+ SWIG_RubyAddTracking(ptr, obj);
1575
+ }
1576
+ } else {
1577
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1578
+ sprintf(klass_name, "TYPE%s", type->name);
1579
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1580
+ free((void *) klass_name);
1581
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1582
+ }
1583
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1584
+
1585
+ return obj;
1586
+ }
1587
+
1588
+ /* Create a new class instance (always owned) */
1589
+ SWIGRUNTIME VALUE
1590
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1591
+ {
1592
+ VALUE obj;
1593
+ swig_class *sklass = (swig_class *) type->clientdata;
1594
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1595
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1596
+ return obj;
1597
+ }
1598
+
1599
+ /* Get type mangle from class name */
1600
+ SWIGRUNTIMEINLINE char *
1601
+ SWIG_Ruby_MangleStr(VALUE obj)
1602
+ {
1603
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1604
+ return StringValuePtr(stype);
1605
+ }
1606
+
1607
+ /* Acquire a pointer value */
1608
+ typedef void (*ruby_owntype)(void*);
1609
+
1610
+ SWIGRUNTIME ruby_owntype
1611
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1612
+ if (obj) {
1613
+ ruby_owntype oldown = RDATA(obj)->dfree;
1614
+ RDATA(obj)->dfree = own;
1615
+ return oldown;
1616
+ } else {
1617
+ return 0;
1618
+ }
1619
+ }
1620
+
1621
+ /* Convert a pointer value */
1622
+ SWIGRUNTIME int
1623
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1624
+ {
1625
+ char *c;
1626
+ swig_cast_info *tc;
1627
+ void *vptr = 0;
1628
+
1629
+ /* Grab the pointer */
1630
+ if (NIL_P(obj)) {
1631
+ *ptr = 0;
1632
+ return SWIG_OK;
1633
+ } else {
1634
+ if (TYPE(obj) != T_DATA) {
1635
+ return SWIG_ERROR;
1636
+ }
1637
+ Data_Get_Struct(obj, void, vptr);
1638
+ }
1639
+
1640
+ if (own) *own = RDATA(obj)->dfree;
1641
+
1642
+ /* Check to see if the input object is giving up ownership
1643
+ of the underlying C struct or C++ object. If so then we
1644
+ need to reset the destructor since the Ruby object no
1645
+ longer owns the underlying C++ object.*/
1646
+ if (flags & SWIG_POINTER_DISOWN) {
1647
+ /* Is tracking on for this class? */
1648
+ int track = 0;
1649
+ if (ty && ty->clientdata) {
1650
+ swig_class *sklass = (swig_class *) ty->clientdata;
1651
+ track = sklass->trackObjects;
1652
+ }
1653
+
1654
+ if (track) {
1655
+ /* We are tracking objects for this class. Thus we change the destructor
1656
+ * to SWIG_RubyRemoveTracking. This allows us to
1657
+ * remove the mapping from the C++ to Ruby object
1658
+ * when the Ruby object is garbage collected. If we don't
1659
+ * do this, then it is possible we will return a reference
1660
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1661
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1662
+ } else {
1663
+ RDATA(obj)->dfree = 0;
1664
+ }
1665
+ }
1666
+
1667
+ /* Do type-checking if type info was provided */
1668
+ if (ty) {
1669
+ if (ty->clientdata) {
1670
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1671
+ if (vptr == 0) {
1672
+ /* The object has already been deleted */
1673
+ return SWIG_ObjectPreviouslyDeletedError;
1674
+ }
1675
+ *ptr = vptr;
1676
+ return SWIG_OK;
1677
+ }
1678
+ }
1679
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
1680
+ return SWIG_ERROR;
1681
+ }
1682
+ tc = SWIG_TypeCheck(c, ty);
1683
+ if (!tc) {
1684
+ return SWIG_ERROR;
1685
+ } else {
1686
+ int newmemory = 0;
1687
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1688
+ assert(!newmemory); /* newmemory handling not yet implemented */
1689
+ }
1690
+ } else {
1691
+ *ptr = vptr;
1692
+ }
1693
+
1694
+ return SWIG_OK;
1695
+ }
1696
+
1697
+ /* Check convert */
1698
+ SWIGRUNTIMEINLINE int
1699
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1700
+ {
1701
+ char *c = SWIG_MangleStr(obj);
1702
+ if (!c) return 0;
1703
+ return SWIG_TypeCheck(c,ty) != 0;
1704
+ }
1705
+
1706
+ SWIGRUNTIME VALUE
1707
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1708
+ char result[1024];
1709
+ char *r = result;
1710
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1711
+ *(r++) = '_';
1712
+ r = SWIG_PackData(r, ptr, sz);
1713
+ strcpy(r, type->name);
1714
+ return rb_str_new2(result);
1715
+ }
1716
+
1717
+ /* Convert a packed value value */
1718
+ SWIGRUNTIME int
1719
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1720
+ swig_cast_info *tc;
1721
+ const char *c;
1722
+
1723
+ if (TYPE(obj) != T_STRING) goto type_error;
1724
+ c = StringValuePtr(obj);
1725
+ /* Pointer values must start with leading underscore */
1726
+ if (*c != '_') goto type_error;
1727
+ c++;
1728
+ c = SWIG_UnpackData(c, ptr, sz);
1729
+ if (ty) {
1730
+ tc = SWIG_TypeCheck(c, ty);
1731
+ if (!tc) goto type_error;
1732
+ }
1733
+ return SWIG_OK;
1734
+
1735
+ type_error:
1736
+ return SWIG_ERROR;
1737
+ }
1738
+
1739
+ SWIGRUNTIME swig_module_info *
1740
+ SWIG_Ruby_GetModule(void)
1741
+ {
1742
+ VALUE pointer;
1743
+ swig_module_info *ret = 0;
1744
+ VALUE verbose = rb_gv_get("VERBOSE");
1745
+
1746
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1747
+ rb_gv_set("VERBOSE", Qfalse);
1748
+
1749
+ /* first check if pointer already created */
1750
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1751
+ if (pointer != Qnil) {
1752
+ Data_Get_Struct(pointer, swig_module_info, ret);
1753
+ }
1754
+
1755
+ /* reinstate warnings */
1756
+ rb_gv_set("VERBOSE", verbose);
1757
+ return ret;
1758
+ }
1759
+
1760
+ SWIGRUNTIME void
1761
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1762
+ {
1763
+ /* register a new class */
1764
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1765
+ /* create and store the structure pointer to a global variable */
1766
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1767
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1768
+ }
1769
+
1770
+ /* This function can be used to check whether a proc or method or similarly
1771
+ callable function has been passed. Usually used in a %typecheck, like:
1772
+
1773
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1774
+ $result = SWIG_Ruby_isCallable( $input );
1775
+ }
1776
+ */
1777
+ SWIGINTERN
1778
+ int SWIG_Ruby_isCallable( VALUE proc )
1779
+ {
1780
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1781
+ return 1;
1782
+ return 0;
1783
+ }
1784
+
1785
+ /* This function can be used to check the arity (number of arguments)
1786
+ a proc or method can take. Usually used in a %typecheck.
1787
+ Valid arities will be that equal to minimal or those < 0
1788
+ which indicate a variable number of parameters at the end.
1789
+ */
1790
+ SWIGINTERN
1791
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1792
+ {
1793
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1794
+ {
1795
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1796
+ int arity = NUM2INT(num);
1797
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1798
+ if ( arity == minimal ) return 1;
1799
+ return 1;
1800
+ }
1801
+ return 0;
1802
+ }
1803
+
1804
+
1805
+ #ifdef __cplusplus
1806
+ }
1807
+ #endif
1808
+
1809
+
1810
+
1811
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1812
+
1813
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1814
+
1815
+
1816
+
1817
+ /* -------- TYPES TABLE (BEGIN) -------- */
1818
+
1819
+ #define SWIGTYPE_p_TagLib__APE__Tag swig_types[0]
1820
+ #define SWIGTYPE_p_TagLib__AudioProperties swig_types[1]
1821
+ #define SWIGTYPE_p_TagLib__File swig_types[2]
1822
+ #define SWIGTYPE_p_TagLib__ID3v1__Tag swig_types[3]
1823
+ #define SWIGTYPE_p_TagLib__ID3v2__FrameFactory swig_types[4]
1824
+ #define SWIGTYPE_p_TagLib__ID3v2__Tag swig_types[5]
1825
+ #define SWIGTYPE_p_TagLib__MPEG__File swig_types[6]
1826
+ #define SWIGTYPE_p_TagLib__MPEG__Header swig_types[7]
1827
+ #define SWIGTYPE_p_TagLib__MPEG__Properties swig_types[8]
1828
+ #define SWIGTYPE_p_TagLib__MPEG__XingHeader swig_types[9]
1829
+ #define SWIGTYPE_p_TagLib__Tag swig_types[10]
1830
+ #define SWIGTYPE_p_char swig_types[11]
1831
+ #define SWIGTYPE_p_unsigned_char swig_types[12]
1832
+ #define SWIGTYPE_p_unsigned_int swig_types[13]
1833
+ #define SWIGTYPE_p_unsigned_long swig_types[14]
1834
+ #define SWIGTYPE_p_wchar_t swig_types[15]
1835
+ static swig_type_info *swig_types[17];
1836
+ static swig_module_info swig_module = {swig_types, 16, 0, 0, 0, 0};
1837
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1838
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1839
+
1840
+ /* -------- TYPES TABLE (END) -------- */
1841
+
1842
+ #define SWIG_init Init_taglib_mpeg
1843
+ #define SWIG_name "TagLib::MPEG"
1844
+
1845
+ static VALUE mMPEG;
1846
+
1847
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1848
+ #define SWIG_RUBY_THREAD_END_BLOCK
1849
+
1850
+
1851
+ #define SWIGVERSION 0x020005
1852
+ #define SWIG_VERSION SWIGVERSION
1853
+
1854
+
1855
+ #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
1856
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
1857
+
1858
+
1859
+ #include <stdexcept>
1860
+
1861
+
1862
+ #include <taglib/taglib.h>
1863
+ #include <taglib/xingheader.h>
1864
+ #include <taglib/mpegheader.h>
1865
+ #include <taglib/mpegproperties.h>
1866
+ #include <taglib/mpegfile.h>
1867
+ #include <taglib/id3v2tag.h>
1868
+
1869
+
1870
+ #include <taglib/tstring.h>
1871
+ #include <taglib/tstringlist.h>
1872
+ #include <taglib/tfile.h>
1873
+
1874
+ #if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
1875
+ # include <ruby/encoding.h>
1876
+ # define ASSOCIATE_UTF8_ENCODING(value) rb_enc_associate(value, rb_utf8_encoding());
1877
+ # define CONVERT_TO_UTF8(value) rb_str_export_to_enc(value, rb_utf8_encoding())
1878
+ #else
1879
+ # define ASSOCIATE_UTF8_ENCODING(value) /* nothing */
1880
+ # define CONVERT_TO_UTF8(value) value
1881
+ #endif
1882
+
1883
+ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
1884
+ if (byteVector.isNull()) {
1885
+ return Qnil;
1886
+ } else {
1887
+ return rb_tainted_str_new(byteVector.data(), byteVector.size());
1888
+ }
1889
+ }
1890
+
1891
+ TagLib::ByteVector ruby_string_to_taglib_bytevector(VALUE s) {
1892
+ return TagLib::ByteVector(RSTRING_PTR(s), RSTRING_LEN(s));
1893
+ }
1894
+
1895
+ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
1896
+ if (string.isNull()) {
1897
+ return Qnil;
1898
+ } else {
1899
+ VALUE result = rb_tainted_str_new2(string.toCString(true));
1900
+ ASSOCIATE_UTF8_ENCODING(result);
1901
+ return result;
1902
+ }
1903
+ }
1904
+
1905
+ TagLib::String ruby_string_to_taglib_string(VALUE s) {
1906
+ return TagLib::String(RSTRING_PTR(CONVERT_TO_UTF8(s)), TagLib::String::UTF8);
1907
+ }
1908
+
1909
+ VALUE taglib_string_list_to_ruby_array(const TagLib::StringList & list) {
1910
+ VALUE ary = rb_ary_new2(list.size());
1911
+ for (TagLib::StringList::ConstIterator it = list.begin(); it != list.end(); it++) {
1912
+ VALUE s = taglib_string_to_ruby_string(*it);
1913
+ rb_ary_push(ary, s);
1914
+ }
1915
+ return ary;
1916
+ }
1917
+
1918
+ TagLib::StringList ruby_array_to_taglib_string_list(VALUE ary) {
1919
+ TagLib::StringList result = TagLib::StringList();
1920
+ for (long i = 0; i < RARRAY_LEN(ary); i++) {
1921
+ VALUE e = RARRAY_PTR(ary)[i];
1922
+ TagLib::String s = ruby_string_to_taglib_string(e);
1923
+ result.append(s);
1924
+ }
1925
+ return result;
1926
+ }
1927
+
1928
+ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
1929
+ #ifdef _WIN32
1930
+ const char *s = (const char *) filename;
1931
+ return rb_tainted_str_new2(s);
1932
+ #else
1933
+ return rb_tainted_str_new2(filename);
1934
+ #endif
1935
+ }
1936
+
1937
+ TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
1938
+ #ifdef _WIN32
1939
+ #if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
1940
+ VALUE ospath;
1941
+ const char *utf8;
1942
+ int len;
1943
+ wchar_t *wide;
1944
+
1945
+ ospath = rb_str_encode_ospath(s);
1946
+ utf8 = StringValuePtr(ospath);
1947
+ len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0);
1948
+ if (!(wide = (wchar_t *) xmalloc(sizeof(wchar_t) * len))) {
1949
+ return TagLib::FileName((const char *) NULL);
1950
+ }
1951
+ MultiByteToWideChar(CP_UTF8, 0, utf8, -1, wide, len);
1952
+ TagLib::FileName filename(wide);
1953
+ xfree(wide);
1954
+ return filename;
1955
+ #else
1956
+ const char *filename = StringValuePtr(s);
1957
+ return TagLib::FileName(filename);
1958
+ #endif
1959
+ #else
1960
+ return StringValuePtr(s);
1961
+ #endif
1962
+ }
1963
+
1964
+
1965
+
1966
+ SWIGINTERN swig_type_info*
1967
+ SWIG_pchar_descriptor(void)
1968
+ {
1969
+ static int init = 0;
1970
+ static swig_type_info* info = 0;
1971
+ if (!init) {
1972
+ info = SWIG_TypeQuery("_p_char");
1973
+ init = 1;
1974
+ }
1975
+ return info;
1976
+ }
1977
+
1978
+
1979
+ SWIGINTERN int
1980
+ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1981
+ {
1982
+ if (TYPE(obj) == T_STRING) {
1983
+ #if defined(StringValuePtr)
1984
+ char *cstr = StringValuePtr(obj);
1985
+ #else
1986
+ char *cstr = STR2CSTR(obj);
1987
+ #endif
1988
+ size_t size = RSTRING_LEN(obj) + 1;
1989
+ if (cptr) {
1990
+ if (alloc) {
1991
+ if (*alloc == SWIG_NEWOBJ) {
1992
+ *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
1993
+ } else {
1994
+ *cptr = cstr;
1995
+ *alloc = SWIG_OLDOBJ;
1996
+ }
1997
+ }
1998
+ }
1999
+ if (psize) *psize = size;
2000
+ return SWIG_OK;
2001
+ } else {
2002
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
2003
+ if (pchar_descriptor) {
2004
+ void* vptr = 0;
2005
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
2006
+ if (cptr) *cptr = (char *)vptr;
2007
+ if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
2008
+ if (alloc) *alloc = SWIG_OLDOBJ;
2009
+ return SWIG_OK;
2010
+ }
2011
+ }
2012
+ }
2013
+ return SWIG_TypeError;
2014
+ }
2015
+
2016
+
2017
+
2018
+
2019
+
2020
+ SWIGINTERNINLINE VALUE
2021
+ SWIG_From_bool (bool value)
2022
+ {
2023
+ return value ? Qtrue : Qfalse;
2024
+ }
2025
+
2026
+
2027
+ #include <limits.h>
2028
+ #if !defined(SWIG_NO_LLONG_MAX)
2029
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
2030
+ # define LLONG_MAX __LONG_LONG_MAX__
2031
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
2032
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
2033
+ # endif
2034
+ #endif
2035
+
2036
+
2037
+ #define SWIG_From_long LONG2NUM
2038
+
2039
+
2040
+ SWIGINTERNINLINE VALUE
2041
+ SWIG_From_unsigned_SS_long (unsigned long value)
2042
+ {
2043
+ return ULONG2NUM(value);
2044
+ }
2045
+
2046
+
2047
+ SWIGINTERNINLINE VALUE
2048
+ SWIG_From_unsigned_SS_int (unsigned int value)
2049
+ {
2050
+ return SWIG_From_unsigned_SS_long (value);
2051
+ }
2052
+
2053
+
2054
+ SWIGINTERN VALUE
2055
+ SWIG_ruby_failed(void)
2056
+ {
2057
+ return Qnil;
2058
+ }
2059
+
2060
+
2061
+ /*@SWIG:/usr/local/share/swig/2.0.5/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2062
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
2063
+ {
2064
+ VALUE obj = args[0];
2065
+ VALUE type = TYPE(obj);
2066
+ long *res = (long *)(args[1]);
2067
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
2068
+ return obj;
2069
+ }
2070
+ /*@SWIG@*/
2071
+
2072
+ SWIGINTERN int
2073
+ SWIG_AsVal_long (VALUE obj, long* val)
2074
+ {
2075
+ VALUE type = TYPE(obj);
2076
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
2077
+ long v;
2078
+ VALUE a[2];
2079
+ a[0] = obj;
2080
+ a[1] = (VALUE)(&v);
2081
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2082
+ if (val) *val = v;
2083
+ return SWIG_OK;
2084
+ }
2085
+ }
2086
+ return SWIG_TypeError;
2087
+ }
2088
+
2089
+
2090
+ SWIGINTERN int
2091
+ SWIG_AsVal_int (VALUE obj, int *val)
2092
+ {
2093
+ long v;
2094
+ int res = SWIG_AsVal_long (obj, &v);
2095
+ if (SWIG_IsOK(res)) {
2096
+ if ((v < INT_MIN || v > INT_MAX)) {
2097
+ return SWIG_OverflowError;
2098
+ } else {
2099
+ if (val) *val = static_cast< int >(v);
2100
+ }
2101
+ }
2102
+ return res;
2103
+ }
2104
+
2105
+
2106
+ SWIGINTERNINLINE VALUE
2107
+ SWIG_From_int (int value)
2108
+ {
2109
+ return SWIG_From_long (value);
2110
+ }
2111
+
2112
+
2113
+ SWIGINTERN int
2114
+ SWIG_AsVal_bool (VALUE obj, bool *val)
2115
+ {
2116
+ if (obj == Qtrue) {
2117
+ if (val) *val = true;
2118
+ return SWIG_OK;
2119
+ } else if (obj == Qfalse) {
2120
+ if (val) *val = false;
2121
+ return SWIG_OK;
2122
+ } else {
2123
+ int res = 0;
2124
+ if (SWIG_AsVal_int (obj, &res) == SWIG_OK) {
2125
+ if (val) *val = res ? true : false;
2126
+ return SWIG_OK;
2127
+ }
2128
+ }
2129
+ return SWIG_TypeError;
2130
+ }
2131
+
2132
+ SWIGINTERN void TagLib_MPEG_File_close(TagLib::MPEG::File *self){
2133
+ free_taglib_mpeg_file(self);
2134
+ }
2135
+
2136
+ static void free_taglib_mpeg_file(void *ptr) {
2137
+ TagLib::MPEG::File *file = (TagLib::MPEG::File *) ptr;
2138
+
2139
+ TagLib::ID3v1::Tag *id3v1tag = file->ID3v1Tag(false);
2140
+ if (id3v1tag) {
2141
+ SWIG_RubyUnlinkObjects(id3v1tag);
2142
+ SWIG_RubyRemoveTracking(id3v1tag);
2143
+ }
2144
+
2145
+ TagLib::ID3v2::Tag *id3v2tag = file->ID3v2Tag(false);
2146
+ if (id3v2tag) {
2147
+ TagLib::ID3v2::FrameList frames = id3v2tag->frameList();
2148
+ for (TagLib::ID3v2::FrameList::ConstIterator it = frames.begin(); it != frames.end(); it++) {
2149
+ TagLib::ID3v2::Frame *frame = (*it);
2150
+ SWIG_RubyUnlinkObjects(frame);
2151
+ SWIG_RubyRemoveTracking(frame);
2152
+ }
2153
+
2154
+ SWIG_RubyUnlinkObjects(id3v2tag);
2155
+ SWIG_RubyRemoveTracking(id3v2tag);
2156
+ }
2157
+
2158
+ TagLib::MPEG::Properties *properties = file->audioProperties();
2159
+ if (properties) {
2160
+ SWIG_RubyUnlinkObjects(properties);
2161
+ SWIG_RubyRemoveTracking(properties);
2162
+ }
2163
+
2164
+ SWIG_RubyUnlinkObjects(ptr);
2165
+ SWIG_RubyRemoveTracking(ptr);
2166
+
2167
+ delete file;
2168
+ }
2169
+
2170
+ static swig_class SwigClassXingHeader;
2171
+
2172
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2173
+ SWIGINTERN VALUE
2174
+ _wrap_XingHeader_allocate(VALUE self) {
2175
+ #else
2176
+ SWIGINTERN VALUE
2177
+ _wrap_XingHeader_allocate(int argc, VALUE *argv, VALUE self) {
2178
+ #endif
2179
+
2180
+
2181
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MPEG__XingHeader);
2182
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2183
+ rb_obj_call_init(vresult, argc, argv);
2184
+ #endif
2185
+ return vresult;
2186
+ }
2187
+
2188
+
2189
+ SWIGINTERN VALUE
2190
+ _wrap_new_XingHeader(int argc, VALUE *argv, VALUE self) {
2191
+ TagLib::ByteVector *arg1 = 0 ;
2192
+ TagLib::ByteVector tmp1 ;
2193
+ TagLib::MPEG::XingHeader *result = 0 ;
2194
+
2195
+ if ((argc < 1) || (argc > 1)) {
2196
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2197
+ }
2198
+ {
2199
+ tmp1 = ruby_string_to_taglib_bytevector(argv[0]);
2200
+ arg1 = &tmp1;
2201
+ }
2202
+ result = (TagLib::MPEG::XingHeader *)new TagLib::MPEG::XingHeader((TagLib::ByteVector const &)*arg1);
2203
+ DATA_PTR(self) = result;
2204
+ SWIG_RubyAddTracking(result, self);
2205
+ return self;
2206
+ fail:
2207
+ return Qnil;
2208
+ }
2209
+
2210
+
2211
+ SWIGINTERN void
2212
+ free_TagLib_MPEG_XingHeader(TagLib::MPEG::XingHeader *arg1) {
2213
+ SWIG_RubyRemoveTracking(arg1);
2214
+ delete arg1;
2215
+ }
2216
+
2217
+ SWIGINTERN VALUE
2218
+ _wrap_XingHeader_validq___(int argc, VALUE *argv, VALUE self) {
2219
+ TagLib::MPEG::XingHeader *arg1 = (TagLib::MPEG::XingHeader *) 0 ;
2220
+ void *argp1 = 0 ;
2221
+ int res1 = 0 ;
2222
+ bool result;
2223
+ VALUE vresult = Qnil;
2224
+
2225
+ if ((argc < 0) || (argc > 0)) {
2226
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2227
+ }
2228
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__XingHeader, 0 | 0 );
2229
+ if (!SWIG_IsOK(res1)) {
2230
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::XingHeader const *","isValid", 1, self ));
2231
+ }
2232
+ arg1 = reinterpret_cast< TagLib::MPEG::XingHeader * >(argp1);
2233
+ result = (bool)((TagLib::MPEG::XingHeader const *)arg1)->isValid();
2234
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2235
+ return vresult;
2236
+ fail:
2237
+ return Qnil;
2238
+ }
2239
+
2240
+
2241
+ SWIGINTERN VALUE
2242
+ _wrap_XingHeader_total_frames(int argc, VALUE *argv, VALUE self) {
2243
+ TagLib::MPEG::XingHeader *arg1 = (TagLib::MPEG::XingHeader *) 0 ;
2244
+ void *argp1 = 0 ;
2245
+ int res1 = 0 ;
2246
+ TagLib::uint result;
2247
+ VALUE vresult = Qnil;
2248
+
2249
+ if ((argc < 0) || (argc > 0)) {
2250
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2251
+ }
2252
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__XingHeader, 0 | 0 );
2253
+ if (!SWIG_IsOK(res1)) {
2254
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::XingHeader const *","totalFrames", 1, self ));
2255
+ }
2256
+ arg1 = reinterpret_cast< TagLib::MPEG::XingHeader * >(argp1);
2257
+ result = (TagLib::uint)((TagLib::MPEG::XingHeader const *)arg1)->totalFrames();
2258
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2259
+ return vresult;
2260
+ fail:
2261
+ return Qnil;
2262
+ }
2263
+
2264
+
2265
+ SWIGINTERN VALUE
2266
+ _wrap_XingHeader_total_size(int argc, VALUE *argv, VALUE self) {
2267
+ TagLib::MPEG::XingHeader *arg1 = (TagLib::MPEG::XingHeader *) 0 ;
2268
+ void *argp1 = 0 ;
2269
+ int res1 = 0 ;
2270
+ TagLib::uint result;
2271
+ VALUE vresult = Qnil;
2272
+
2273
+ if ((argc < 0) || (argc > 0)) {
2274
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2275
+ }
2276
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__XingHeader, 0 | 0 );
2277
+ if (!SWIG_IsOK(res1)) {
2278
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::XingHeader const *","totalSize", 1, self ));
2279
+ }
2280
+ arg1 = reinterpret_cast< TagLib::MPEG::XingHeader * >(argp1);
2281
+ result = (TagLib::uint)((TagLib::MPEG::XingHeader const *)arg1)->totalSize();
2282
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2283
+ return vresult;
2284
+ fail:
2285
+ return Qnil;
2286
+ }
2287
+
2288
+
2289
+ SWIGINTERN VALUE
2290
+ _wrap_XingHeader_xing_header_offset(int argc, VALUE *argv, VALUE self) {
2291
+ TagLib::MPEG::Header::Version arg1 ;
2292
+ TagLib::MPEG::Header::ChannelMode arg2 ;
2293
+ int val1 ;
2294
+ int ecode1 = 0 ;
2295
+ int val2 ;
2296
+ int ecode2 = 0 ;
2297
+ int result;
2298
+ VALUE vresult = Qnil;
2299
+
2300
+ if ((argc < 2) || (argc > 2)) {
2301
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2302
+ }
2303
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2304
+ if (!SWIG_IsOK(ecode1)) {
2305
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header::Version","TagLib::MPEG::XingHeader::xingHeaderOffset", 1, argv[0] ));
2306
+ }
2307
+ arg1 = static_cast< TagLib::MPEG::Header::Version >(val1);
2308
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2309
+ if (!SWIG_IsOK(ecode2)) {
2310
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "TagLib::MPEG::Header::ChannelMode","TagLib::MPEG::XingHeader::xingHeaderOffset", 2, argv[1] ));
2311
+ }
2312
+ arg2 = static_cast< TagLib::MPEG::Header::ChannelMode >(val2);
2313
+ result = (int)TagLib::MPEG::XingHeader::xingHeaderOffset(arg1,arg2);
2314
+ vresult = SWIG_From_int(static_cast< int >(result));
2315
+ return vresult;
2316
+ fail:
2317
+ return Qnil;
2318
+ }
2319
+
2320
+
2321
+ static swig_class SwigClassHeader;
2322
+
2323
+ SWIGINTERN VALUE
2324
+ _wrap_new_Header__SWIG_0(int argc, VALUE *argv, VALUE self) {
2325
+ TagLib::ByteVector *arg1 = 0 ;
2326
+ TagLib::ByteVector tmp1 ;
2327
+ TagLib::MPEG::Header *result = 0 ;
2328
+
2329
+ if ((argc < 1) || (argc > 1)) {
2330
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2331
+ }
2332
+ {
2333
+ tmp1 = ruby_string_to_taglib_bytevector(argv[0]);
2334
+ arg1 = &tmp1;
2335
+ }
2336
+ result = (TagLib::MPEG::Header *)new TagLib::MPEG::Header((TagLib::ByteVector const &)*arg1);
2337
+ DATA_PTR(self) = result;
2338
+ SWIG_RubyAddTracking(result, self);
2339
+ return self;
2340
+ fail:
2341
+ return Qnil;
2342
+ }
2343
+
2344
+
2345
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2346
+ SWIGINTERN VALUE
2347
+ _wrap_Header_allocate(VALUE self) {
2348
+ #else
2349
+ SWIGINTERN VALUE
2350
+ _wrap_Header_allocate(int argc, VALUE *argv, VALUE self) {
2351
+ #endif
2352
+
2353
+
2354
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MPEG__Header);
2355
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2356
+ rb_obj_call_init(vresult, argc, argv);
2357
+ #endif
2358
+ return vresult;
2359
+ }
2360
+
2361
+
2362
+ SWIGINTERN VALUE
2363
+ _wrap_new_Header__SWIG_1(int argc, VALUE *argv, VALUE self) {
2364
+ TagLib::MPEG::Header *arg1 = 0 ;
2365
+ void *argp1 ;
2366
+ int res1 = 0 ;
2367
+ TagLib::MPEG::Header *result = 0 ;
2368
+
2369
+ if ((argc < 1) || (argc > 1)) {
2370
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2371
+ }
2372
+ res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_TagLib__MPEG__Header, 0 );
2373
+ if (!SWIG_IsOK(res1)) {
2374
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header const &","TagLib::MPEG::Header", 1, argv[0] ));
2375
+ }
2376
+ if (!argp1) {
2377
+ SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "TagLib::MPEG::Header const &","TagLib::MPEG::Header", 1, argv[0]));
2378
+ }
2379
+ arg1 = reinterpret_cast< TagLib::MPEG::Header * >(argp1);
2380
+ result = (TagLib::MPEG::Header *)new TagLib::MPEG::Header((TagLib::MPEG::Header const &)*arg1);
2381
+ DATA_PTR(self) = result;
2382
+ SWIG_RubyAddTracking(result, self);
2383
+ return self;
2384
+ fail:
2385
+ return Qnil;
2386
+ }
2387
+
2388
+
2389
+ SWIGINTERN VALUE _wrap_new_Header(int nargs, VALUE *args, VALUE self) {
2390
+ int argc;
2391
+ VALUE argv[1];
2392
+ int ii;
2393
+
2394
+ argc = nargs;
2395
+ if (argc > 1) SWIG_fail;
2396
+ for (ii = 0; (ii < argc); ++ii) {
2397
+ argv[ii] = args[ii];
2398
+ }
2399
+ if (argc == 1) {
2400
+ int _v;
2401
+ void *vptr = 0;
2402
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__Header, 0);
2403
+ _v = SWIG_CheckState(res);
2404
+ if (_v) {
2405
+ return _wrap_new_Header__SWIG_1(nargs, args, self);
2406
+ }
2407
+ }
2408
+ if (argc == 1) {
2409
+ int _v;
2410
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
2411
+ _v = SWIG_CheckState(res);
2412
+ if (_v) {
2413
+ return _wrap_new_Header__SWIG_0(nargs, args, self);
2414
+ }
2415
+ }
2416
+
2417
+ fail:
2418
+ Ruby_Format_OverloadedError( argc, 1, "Header.new",
2419
+ " Header.new(TagLib::ByteVector const &data)\n"
2420
+ " Header.new(TagLib::MPEG::Header const &h)\n");
2421
+
2422
+ return Qnil;
2423
+ }
2424
+
2425
+
2426
+ SWIGINTERN void
2427
+ free_TagLib_MPEG_Header(TagLib::MPEG::Header *arg1) {
2428
+ SWIG_RubyRemoveTracking(arg1);
2429
+ delete arg1;
2430
+ }
2431
+
2432
+ SWIGINTERN VALUE
2433
+ _wrap_Header_validq___(int argc, VALUE *argv, VALUE self) {
2434
+ TagLib::MPEG::Header *arg1 = (TagLib::MPEG::Header *) 0 ;
2435
+ void *argp1 = 0 ;
2436
+ int res1 = 0 ;
2437
+ bool result;
2438
+ VALUE vresult = Qnil;
2439
+
2440
+ if ((argc < 0) || (argc > 0)) {
2441
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2442
+ }
2443
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Header, 0 | 0 );
2444
+ if (!SWIG_IsOK(res1)) {
2445
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header const *","isValid", 1, self ));
2446
+ }
2447
+ arg1 = reinterpret_cast< TagLib::MPEG::Header * >(argp1);
2448
+ result = (bool)((TagLib::MPEG::Header const *)arg1)->isValid();
2449
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2450
+ return vresult;
2451
+ fail:
2452
+ return Qnil;
2453
+ }
2454
+
2455
+
2456
+ SWIGINTERN VALUE
2457
+ _wrap_Header_version(int argc, VALUE *argv, VALUE self) {
2458
+ TagLib::MPEG::Header *arg1 = (TagLib::MPEG::Header *) 0 ;
2459
+ void *argp1 = 0 ;
2460
+ int res1 = 0 ;
2461
+ TagLib::MPEG::Header::Version result;
2462
+ VALUE vresult = Qnil;
2463
+
2464
+ if ((argc < 0) || (argc > 0)) {
2465
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2466
+ }
2467
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Header, 0 | 0 );
2468
+ if (!SWIG_IsOK(res1)) {
2469
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header const *","version", 1, self ));
2470
+ }
2471
+ arg1 = reinterpret_cast< TagLib::MPEG::Header * >(argp1);
2472
+ result = (TagLib::MPEG::Header::Version)((TagLib::MPEG::Header const *)arg1)->version();
2473
+ vresult = SWIG_From_int(static_cast< int >(result));
2474
+ return vresult;
2475
+ fail:
2476
+ return Qnil;
2477
+ }
2478
+
2479
+
2480
+ SWIGINTERN VALUE
2481
+ _wrap_Header_layer(int argc, VALUE *argv, VALUE self) {
2482
+ TagLib::MPEG::Header *arg1 = (TagLib::MPEG::Header *) 0 ;
2483
+ void *argp1 = 0 ;
2484
+ int res1 = 0 ;
2485
+ int result;
2486
+ VALUE vresult = Qnil;
2487
+
2488
+ if ((argc < 0) || (argc > 0)) {
2489
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2490
+ }
2491
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Header, 0 | 0 );
2492
+ if (!SWIG_IsOK(res1)) {
2493
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header const *","layer", 1, self ));
2494
+ }
2495
+ arg1 = reinterpret_cast< TagLib::MPEG::Header * >(argp1);
2496
+ result = (int)((TagLib::MPEG::Header const *)arg1)->layer();
2497
+ vresult = SWIG_From_int(static_cast< int >(result));
2498
+ return vresult;
2499
+ fail:
2500
+ return Qnil;
2501
+ }
2502
+
2503
+
2504
+ SWIGINTERN VALUE
2505
+ _wrap_Header_protection_enabled(int argc, VALUE *argv, VALUE self) {
2506
+ TagLib::MPEG::Header *arg1 = (TagLib::MPEG::Header *) 0 ;
2507
+ void *argp1 = 0 ;
2508
+ int res1 = 0 ;
2509
+ bool result;
2510
+ VALUE vresult = Qnil;
2511
+
2512
+ if ((argc < 0) || (argc > 0)) {
2513
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2514
+ }
2515
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Header, 0 | 0 );
2516
+ if (!SWIG_IsOK(res1)) {
2517
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header const *","protectionEnabled", 1, self ));
2518
+ }
2519
+ arg1 = reinterpret_cast< TagLib::MPEG::Header * >(argp1);
2520
+ result = (bool)((TagLib::MPEG::Header const *)arg1)->protectionEnabled();
2521
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2522
+ return vresult;
2523
+ fail:
2524
+ return Qnil;
2525
+ }
2526
+
2527
+
2528
+ SWIGINTERN VALUE
2529
+ _wrap_Header_bitrate(int argc, VALUE *argv, VALUE self) {
2530
+ TagLib::MPEG::Header *arg1 = (TagLib::MPEG::Header *) 0 ;
2531
+ void *argp1 = 0 ;
2532
+ int res1 = 0 ;
2533
+ int result;
2534
+ VALUE vresult = Qnil;
2535
+
2536
+ if ((argc < 0) || (argc > 0)) {
2537
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2538
+ }
2539
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Header, 0 | 0 );
2540
+ if (!SWIG_IsOK(res1)) {
2541
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header const *","bitrate", 1, self ));
2542
+ }
2543
+ arg1 = reinterpret_cast< TagLib::MPEG::Header * >(argp1);
2544
+ result = (int)((TagLib::MPEG::Header const *)arg1)->bitrate();
2545
+ vresult = SWIG_From_int(static_cast< int >(result));
2546
+ return vresult;
2547
+ fail:
2548
+ return Qnil;
2549
+ }
2550
+
2551
+
2552
+ SWIGINTERN VALUE
2553
+ _wrap_Header_sample_rate(int argc, VALUE *argv, VALUE self) {
2554
+ TagLib::MPEG::Header *arg1 = (TagLib::MPEG::Header *) 0 ;
2555
+ void *argp1 = 0 ;
2556
+ int res1 = 0 ;
2557
+ int result;
2558
+ VALUE vresult = Qnil;
2559
+
2560
+ if ((argc < 0) || (argc > 0)) {
2561
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2562
+ }
2563
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Header, 0 | 0 );
2564
+ if (!SWIG_IsOK(res1)) {
2565
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header const *","sampleRate", 1, self ));
2566
+ }
2567
+ arg1 = reinterpret_cast< TagLib::MPEG::Header * >(argp1);
2568
+ result = (int)((TagLib::MPEG::Header const *)arg1)->sampleRate();
2569
+ vresult = SWIG_From_int(static_cast< int >(result));
2570
+ return vresult;
2571
+ fail:
2572
+ return Qnil;
2573
+ }
2574
+
2575
+
2576
+ SWIGINTERN VALUE
2577
+ _wrap_Header_paddedq___(int argc, VALUE *argv, VALUE self) {
2578
+ TagLib::MPEG::Header *arg1 = (TagLib::MPEG::Header *) 0 ;
2579
+ void *argp1 = 0 ;
2580
+ int res1 = 0 ;
2581
+ bool result;
2582
+ VALUE vresult = Qnil;
2583
+
2584
+ if ((argc < 0) || (argc > 0)) {
2585
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2586
+ }
2587
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Header, 0 | 0 );
2588
+ if (!SWIG_IsOK(res1)) {
2589
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header const *","isPadded", 1, self ));
2590
+ }
2591
+ arg1 = reinterpret_cast< TagLib::MPEG::Header * >(argp1);
2592
+ result = (bool)((TagLib::MPEG::Header const *)arg1)->isPadded();
2593
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2594
+ return vresult;
2595
+ fail:
2596
+ return Qnil;
2597
+ }
2598
+
2599
+
2600
+ SWIGINTERN VALUE
2601
+ _wrap_Header_channel_mode(int argc, VALUE *argv, VALUE self) {
2602
+ TagLib::MPEG::Header *arg1 = (TagLib::MPEG::Header *) 0 ;
2603
+ void *argp1 = 0 ;
2604
+ int res1 = 0 ;
2605
+ TagLib::MPEG::Header::ChannelMode result;
2606
+ VALUE vresult = Qnil;
2607
+
2608
+ if ((argc < 0) || (argc > 0)) {
2609
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2610
+ }
2611
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Header, 0 | 0 );
2612
+ if (!SWIG_IsOK(res1)) {
2613
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header const *","channelMode", 1, self ));
2614
+ }
2615
+ arg1 = reinterpret_cast< TagLib::MPEG::Header * >(argp1);
2616
+ result = (TagLib::MPEG::Header::ChannelMode)((TagLib::MPEG::Header const *)arg1)->channelMode();
2617
+ vresult = SWIG_From_int(static_cast< int >(result));
2618
+ return vresult;
2619
+ fail:
2620
+ return Qnil;
2621
+ }
2622
+
2623
+
2624
+ SWIGINTERN VALUE
2625
+ _wrap_Header_copyrightedq___(int argc, VALUE *argv, VALUE self) {
2626
+ TagLib::MPEG::Header *arg1 = (TagLib::MPEG::Header *) 0 ;
2627
+ void *argp1 = 0 ;
2628
+ int res1 = 0 ;
2629
+ bool result;
2630
+ VALUE vresult = Qnil;
2631
+
2632
+ if ((argc < 0) || (argc > 0)) {
2633
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2634
+ }
2635
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Header, 0 | 0 );
2636
+ if (!SWIG_IsOK(res1)) {
2637
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header const *","isCopyrighted", 1, self ));
2638
+ }
2639
+ arg1 = reinterpret_cast< TagLib::MPEG::Header * >(argp1);
2640
+ result = (bool)((TagLib::MPEG::Header const *)arg1)->isCopyrighted();
2641
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2642
+ return vresult;
2643
+ fail:
2644
+ return Qnil;
2645
+ }
2646
+
2647
+
2648
+ SWIGINTERN VALUE
2649
+ _wrap_Header_originalq___(int argc, VALUE *argv, VALUE self) {
2650
+ TagLib::MPEG::Header *arg1 = (TagLib::MPEG::Header *) 0 ;
2651
+ void *argp1 = 0 ;
2652
+ int res1 = 0 ;
2653
+ bool result;
2654
+ VALUE vresult = Qnil;
2655
+
2656
+ if ((argc < 0) || (argc > 0)) {
2657
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2658
+ }
2659
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Header, 0 | 0 );
2660
+ if (!SWIG_IsOK(res1)) {
2661
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header const *","isOriginal", 1, self ));
2662
+ }
2663
+ arg1 = reinterpret_cast< TagLib::MPEG::Header * >(argp1);
2664
+ result = (bool)((TagLib::MPEG::Header const *)arg1)->isOriginal();
2665
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2666
+ return vresult;
2667
+ fail:
2668
+ return Qnil;
2669
+ }
2670
+
2671
+
2672
+ SWIGINTERN VALUE
2673
+ _wrap_Header_frame_length(int argc, VALUE *argv, VALUE self) {
2674
+ TagLib::MPEG::Header *arg1 = (TagLib::MPEG::Header *) 0 ;
2675
+ void *argp1 = 0 ;
2676
+ int res1 = 0 ;
2677
+ int result;
2678
+ VALUE vresult = Qnil;
2679
+
2680
+ if ((argc < 0) || (argc > 0)) {
2681
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2682
+ }
2683
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Header, 0 | 0 );
2684
+ if (!SWIG_IsOK(res1)) {
2685
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header const *","frameLength", 1, self ));
2686
+ }
2687
+ arg1 = reinterpret_cast< TagLib::MPEG::Header * >(argp1);
2688
+ result = (int)((TagLib::MPEG::Header const *)arg1)->frameLength();
2689
+ vresult = SWIG_From_int(static_cast< int >(result));
2690
+ return vresult;
2691
+ fail:
2692
+ return Qnil;
2693
+ }
2694
+
2695
+
2696
+ SWIGINTERN VALUE
2697
+ _wrap_Header_samples_per_frame(int argc, VALUE *argv, VALUE self) {
2698
+ TagLib::MPEG::Header *arg1 = (TagLib::MPEG::Header *) 0 ;
2699
+ void *argp1 = 0 ;
2700
+ int res1 = 0 ;
2701
+ int result;
2702
+ VALUE vresult = Qnil;
2703
+
2704
+ if ((argc < 0) || (argc > 0)) {
2705
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2706
+ }
2707
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Header, 0 | 0 );
2708
+ if (!SWIG_IsOK(res1)) {
2709
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Header const *","samplesPerFrame", 1, self ));
2710
+ }
2711
+ arg1 = reinterpret_cast< TagLib::MPEG::Header * >(argp1);
2712
+ result = (int)((TagLib::MPEG::Header const *)arg1)->samplesPerFrame();
2713
+ vresult = SWIG_From_int(static_cast< int >(result));
2714
+ return vresult;
2715
+ fail:
2716
+ return Qnil;
2717
+ }
2718
+
2719
+
2720
+ static swig_class SwigClassProperties;
2721
+
2722
+ SWIGINTERN VALUE
2723
+ _wrap_new_Properties__SWIG_0(int argc, VALUE *argv, VALUE self) {
2724
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
2725
+ TagLib::AudioProperties::ReadStyle arg2 ;
2726
+ void *argp1 = 0 ;
2727
+ int res1 = 0 ;
2728
+ int val2 ;
2729
+ int ecode2 = 0 ;
2730
+ TagLib::MPEG::Properties *result = 0 ;
2731
+
2732
+ if ((argc < 2) || (argc > 2)) {
2733
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2734
+ }
2735
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
2736
+ if (!SWIG_IsOK(res1)) {
2737
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","TagLib::MPEG::Properties", 1, argv[0] ));
2738
+ }
2739
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
2740
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2741
+ if (!SWIG_IsOK(ecode2)) {
2742
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "TagLib::AudioProperties::ReadStyle","TagLib::MPEG::Properties", 2, argv[1] ));
2743
+ }
2744
+ arg2 = static_cast< TagLib::AudioProperties::ReadStyle >(val2);
2745
+ result = (TagLib::MPEG::Properties *)new TagLib::MPEG::Properties(arg1,arg2);
2746
+ DATA_PTR(self) = result;
2747
+ SWIG_RubyAddTracking(result, self);
2748
+ return self;
2749
+ fail:
2750
+ return Qnil;
2751
+ }
2752
+
2753
+
2754
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2755
+ SWIGINTERN VALUE
2756
+ _wrap_Properties_allocate(VALUE self) {
2757
+ #else
2758
+ SWIGINTERN VALUE
2759
+ _wrap_Properties_allocate(int argc, VALUE *argv, VALUE self) {
2760
+ #endif
2761
+
2762
+
2763
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MPEG__Properties);
2764
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2765
+ rb_obj_call_init(vresult, argc, argv);
2766
+ #endif
2767
+ return vresult;
2768
+ }
2769
+
2770
+
2771
+ SWIGINTERN VALUE
2772
+ _wrap_new_Properties__SWIG_1(int argc, VALUE *argv, VALUE self) {
2773
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
2774
+ void *argp1 = 0 ;
2775
+ int res1 = 0 ;
2776
+ TagLib::MPEG::Properties *result = 0 ;
2777
+
2778
+ if ((argc < 1) || (argc > 1)) {
2779
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2780
+ }
2781
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
2782
+ if (!SWIG_IsOK(res1)) {
2783
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","TagLib::MPEG::Properties", 1, argv[0] ));
2784
+ }
2785
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
2786
+ result = (TagLib::MPEG::Properties *)new TagLib::MPEG::Properties(arg1);
2787
+ DATA_PTR(self) = result;
2788
+ SWIG_RubyAddTracking(result, self);
2789
+ return self;
2790
+ fail:
2791
+ return Qnil;
2792
+ }
2793
+
2794
+
2795
+ SWIGINTERN VALUE _wrap_new_Properties(int nargs, VALUE *args, VALUE self) {
2796
+ int argc;
2797
+ VALUE argv[2];
2798
+ int ii;
2799
+
2800
+ argc = nargs;
2801
+ if (argc > 2) SWIG_fail;
2802
+ for (ii = 0; (ii < argc); ++ii) {
2803
+ argv[ii] = args[ii];
2804
+ }
2805
+ if (argc == 1) {
2806
+ int _v;
2807
+ void *vptr = 0;
2808
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
2809
+ _v = SWIG_CheckState(res);
2810
+ if (_v) {
2811
+ return _wrap_new_Properties__SWIG_1(nargs, args, self);
2812
+ }
2813
+ }
2814
+ if (argc == 2) {
2815
+ int _v;
2816
+ void *vptr = 0;
2817
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
2818
+ _v = SWIG_CheckState(res);
2819
+ if (_v) {
2820
+ {
2821
+ int res = SWIG_AsVal_int(argv[1], NULL);
2822
+ _v = SWIG_CheckState(res);
2823
+ }
2824
+ if (_v) {
2825
+ return _wrap_new_Properties__SWIG_0(nargs, args, self);
2826
+ }
2827
+ }
2828
+ }
2829
+
2830
+ fail:
2831
+ Ruby_Format_OverloadedError( argc, 2, "Properties.new",
2832
+ " Properties.new(TagLib::MPEG::File *file, TagLib::AudioProperties::ReadStyle style)\n"
2833
+ " Properties.new(TagLib::MPEG::File *file)\n");
2834
+
2835
+ return Qnil;
2836
+ }
2837
+
2838
+
2839
+ SWIGINTERN void
2840
+ free_TagLib_MPEG_Properties(TagLib::MPEG::Properties *arg1) {
2841
+ SWIG_RubyRemoveTracking(arg1);
2842
+ delete arg1;
2843
+ }
2844
+
2845
+ SWIGINTERN VALUE
2846
+ _wrap_Properties_length(int argc, VALUE *argv, VALUE self) {
2847
+ TagLib::MPEG::Properties *arg1 = (TagLib::MPEG::Properties *) 0 ;
2848
+ void *argp1 = 0 ;
2849
+ int res1 = 0 ;
2850
+ int result;
2851
+ VALUE vresult = Qnil;
2852
+
2853
+ if ((argc < 0) || (argc > 0)) {
2854
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2855
+ }
2856
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
2857
+ if (!SWIG_IsOK(res1)) {
2858
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","length", 1, self ));
2859
+ }
2860
+ arg1 = reinterpret_cast< TagLib::MPEG::Properties * >(argp1);
2861
+ result = (int)((TagLib::MPEG::Properties const *)arg1)->length();
2862
+ vresult = SWIG_From_int(static_cast< int >(result));
2863
+ return vresult;
2864
+ fail:
2865
+ return Qnil;
2866
+ }
2867
+
2868
+
2869
+ SWIGINTERN VALUE
2870
+ _wrap_Properties_bitrate(int argc, VALUE *argv, VALUE self) {
2871
+ TagLib::MPEG::Properties *arg1 = (TagLib::MPEG::Properties *) 0 ;
2872
+ void *argp1 = 0 ;
2873
+ int res1 = 0 ;
2874
+ int result;
2875
+ VALUE vresult = Qnil;
2876
+
2877
+ if ((argc < 0) || (argc > 0)) {
2878
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2879
+ }
2880
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
2881
+ if (!SWIG_IsOK(res1)) {
2882
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","bitrate", 1, self ));
2883
+ }
2884
+ arg1 = reinterpret_cast< TagLib::MPEG::Properties * >(argp1);
2885
+ result = (int)((TagLib::MPEG::Properties const *)arg1)->bitrate();
2886
+ vresult = SWIG_From_int(static_cast< int >(result));
2887
+ return vresult;
2888
+ fail:
2889
+ return Qnil;
2890
+ }
2891
+
2892
+
2893
+ SWIGINTERN VALUE
2894
+ _wrap_Properties_sample_rate(int argc, VALUE *argv, VALUE self) {
2895
+ TagLib::MPEG::Properties *arg1 = (TagLib::MPEG::Properties *) 0 ;
2896
+ void *argp1 = 0 ;
2897
+ int res1 = 0 ;
2898
+ int result;
2899
+ VALUE vresult = Qnil;
2900
+
2901
+ if ((argc < 0) || (argc > 0)) {
2902
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2903
+ }
2904
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
2905
+ if (!SWIG_IsOK(res1)) {
2906
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","sampleRate", 1, self ));
2907
+ }
2908
+ arg1 = reinterpret_cast< TagLib::MPEG::Properties * >(argp1);
2909
+ result = (int)((TagLib::MPEG::Properties const *)arg1)->sampleRate();
2910
+ vresult = SWIG_From_int(static_cast< int >(result));
2911
+ return vresult;
2912
+ fail:
2913
+ return Qnil;
2914
+ }
2915
+
2916
+
2917
+ SWIGINTERN VALUE
2918
+ _wrap_Properties_channels(int argc, VALUE *argv, VALUE self) {
2919
+ TagLib::MPEG::Properties *arg1 = (TagLib::MPEG::Properties *) 0 ;
2920
+ void *argp1 = 0 ;
2921
+ int res1 = 0 ;
2922
+ int result;
2923
+ VALUE vresult = Qnil;
2924
+
2925
+ if ((argc < 0) || (argc > 0)) {
2926
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2927
+ }
2928
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
2929
+ if (!SWIG_IsOK(res1)) {
2930
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","channels", 1, self ));
2931
+ }
2932
+ arg1 = reinterpret_cast< TagLib::MPEG::Properties * >(argp1);
2933
+ result = (int)((TagLib::MPEG::Properties const *)arg1)->channels();
2934
+ vresult = SWIG_From_int(static_cast< int >(result));
2935
+ return vresult;
2936
+ fail:
2937
+ return Qnil;
2938
+ }
2939
+
2940
+
2941
+ SWIGINTERN VALUE
2942
+ _wrap_Properties_xing_header(int argc, VALUE *argv, VALUE self) {
2943
+ TagLib::MPEG::Properties *arg1 = (TagLib::MPEG::Properties *) 0 ;
2944
+ void *argp1 = 0 ;
2945
+ int res1 = 0 ;
2946
+ TagLib::MPEG::XingHeader *result = 0 ;
2947
+ VALUE vresult = Qnil;
2948
+
2949
+ if ((argc < 0) || (argc > 0)) {
2950
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2951
+ }
2952
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
2953
+ if (!SWIG_IsOK(res1)) {
2954
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","xingHeader", 1, self ));
2955
+ }
2956
+ arg1 = reinterpret_cast< TagLib::MPEG::Properties * >(argp1);
2957
+ result = (TagLib::MPEG::XingHeader *)((TagLib::MPEG::Properties const *)arg1)->xingHeader();
2958
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__MPEG__XingHeader, 0 | 0 );
2959
+ return vresult;
2960
+ fail:
2961
+ return Qnil;
2962
+ }
2963
+
2964
+
2965
+ SWIGINTERN VALUE
2966
+ _wrap_Properties_version(int argc, VALUE *argv, VALUE self) {
2967
+ TagLib::MPEG::Properties *arg1 = (TagLib::MPEG::Properties *) 0 ;
2968
+ void *argp1 = 0 ;
2969
+ int res1 = 0 ;
2970
+ TagLib::MPEG::Header::Version result;
2971
+ VALUE vresult = Qnil;
2972
+
2973
+ if ((argc < 0) || (argc > 0)) {
2974
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2975
+ }
2976
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
2977
+ if (!SWIG_IsOK(res1)) {
2978
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","version", 1, self ));
2979
+ }
2980
+ arg1 = reinterpret_cast< TagLib::MPEG::Properties * >(argp1);
2981
+ result = (TagLib::MPEG::Header::Version)((TagLib::MPEG::Properties const *)arg1)->version();
2982
+ vresult = SWIG_From_int(static_cast< int >(result));
2983
+ return vresult;
2984
+ fail:
2985
+ return Qnil;
2986
+ }
2987
+
2988
+
2989
+ SWIGINTERN VALUE
2990
+ _wrap_Properties_layer(int argc, VALUE *argv, VALUE self) {
2991
+ TagLib::MPEG::Properties *arg1 = (TagLib::MPEG::Properties *) 0 ;
2992
+ void *argp1 = 0 ;
2993
+ int res1 = 0 ;
2994
+ int result;
2995
+ VALUE vresult = Qnil;
2996
+
2997
+ if ((argc < 0) || (argc > 0)) {
2998
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2999
+ }
3000
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
3001
+ if (!SWIG_IsOK(res1)) {
3002
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","layer", 1, self ));
3003
+ }
3004
+ arg1 = reinterpret_cast< TagLib::MPEG::Properties * >(argp1);
3005
+ result = (int)((TagLib::MPEG::Properties const *)arg1)->layer();
3006
+ vresult = SWIG_From_int(static_cast< int >(result));
3007
+ return vresult;
3008
+ fail:
3009
+ return Qnil;
3010
+ }
3011
+
3012
+
3013
+ SWIGINTERN VALUE
3014
+ _wrap_Properties_protection_enabled(int argc, VALUE *argv, VALUE self) {
3015
+ TagLib::MPEG::Properties *arg1 = (TagLib::MPEG::Properties *) 0 ;
3016
+ void *argp1 = 0 ;
3017
+ int res1 = 0 ;
3018
+ bool result;
3019
+ VALUE vresult = Qnil;
3020
+
3021
+ if ((argc < 0) || (argc > 0)) {
3022
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3023
+ }
3024
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
3025
+ if (!SWIG_IsOK(res1)) {
3026
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","protectionEnabled", 1, self ));
3027
+ }
3028
+ arg1 = reinterpret_cast< TagLib::MPEG::Properties * >(argp1);
3029
+ result = (bool)((TagLib::MPEG::Properties const *)arg1)->protectionEnabled();
3030
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3031
+ return vresult;
3032
+ fail:
3033
+ return Qnil;
3034
+ }
3035
+
3036
+
3037
+ SWIGINTERN VALUE
3038
+ _wrap_Properties_channel_mode(int argc, VALUE *argv, VALUE self) {
3039
+ TagLib::MPEG::Properties *arg1 = (TagLib::MPEG::Properties *) 0 ;
3040
+ void *argp1 = 0 ;
3041
+ int res1 = 0 ;
3042
+ TagLib::MPEG::Header::ChannelMode result;
3043
+ VALUE vresult = Qnil;
3044
+
3045
+ if ((argc < 0) || (argc > 0)) {
3046
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3047
+ }
3048
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
3049
+ if (!SWIG_IsOK(res1)) {
3050
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","channelMode", 1, self ));
3051
+ }
3052
+ arg1 = reinterpret_cast< TagLib::MPEG::Properties * >(argp1);
3053
+ result = (TagLib::MPEG::Header::ChannelMode)((TagLib::MPEG::Properties const *)arg1)->channelMode();
3054
+ vresult = SWIG_From_int(static_cast< int >(result));
3055
+ return vresult;
3056
+ fail:
3057
+ return Qnil;
3058
+ }
3059
+
3060
+
3061
+ SWIGINTERN VALUE
3062
+ _wrap_Properties_copyrightedq___(int argc, VALUE *argv, VALUE self) {
3063
+ TagLib::MPEG::Properties *arg1 = (TagLib::MPEG::Properties *) 0 ;
3064
+ void *argp1 = 0 ;
3065
+ int res1 = 0 ;
3066
+ bool result;
3067
+ VALUE vresult = Qnil;
3068
+
3069
+ if ((argc < 0) || (argc > 0)) {
3070
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3071
+ }
3072
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
3073
+ if (!SWIG_IsOK(res1)) {
3074
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","isCopyrighted", 1, self ));
3075
+ }
3076
+ arg1 = reinterpret_cast< TagLib::MPEG::Properties * >(argp1);
3077
+ result = (bool)((TagLib::MPEG::Properties const *)arg1)->isCopyrighted();
3078
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3079
+ return vresult;
3080
+ fail:
3081
+ return Qnil;
3082
+ }
3083
+
3084
+
3085
+ SWIGINTERN VALUE
3086
+ _wrap_Properties_originalq___(int argc, VALUE *argv, VALUE self) {
3087
+ TagLib::MPEG::Properties *arg1 = (TagLib::MPEG::Properties *) 0 ;
3088
+ void *argp1 = 0 ;
3089
+ int res1 = 0 ;
3090
+ bool result;
3091
+ VALUE vresult = Qnil;
3092
+
3093
+ if ((argc < 0) || (argc > 0)) {
3094
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3095
+ }
3096
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
3097
+ if (!SWIG_IsOK(res1)) {
3098
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","isOriginal", 1, self ));
3099
+ }
3100
+ arg1 = reinterpret_cast< TagLib::MPEG::Properties * >(argp1);
3101
+ result = (bool)((TagLib::MPEG::Properties const *)arg1)->isOriginal();
3102
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3103
+ return vresult;
3104
+ fail:
3105
+ return Qnil;
3106
+ }
3107
+
3108
+
3109
+ static swig_class SwigClassFile;
3110
+
3111
+ SWIGINTERN VALUE
3112
+ _wrap_new_File__SWIG_0(int argc, VALUE *argv, VALUE self) {
3113
+ SwigValueWrapper< TagLib::FileName > arg1 ;
3114
+ bool arg2 ;
3115
+ TagLib::MPEG::Properties::ReadStyle arg3 ;
3116
+ bool val2 ;
3117
+ int ecode2 = 0 ;
3118
+ int val3 ;
3119
+ int ecode3 = 0 ;
3120
+ TagLib::MPEG::File *result = 0 ;
3121
+
3122
+ if ((argc < 3) || (argc > 3)) {
3123
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
3124
+ }
3125
+ {
3126
+ arg1 = ruby_string_to_taglib_filename(argv[0]);
3127
+ if ((const char *)(TagLib::FileName)(arg1) == NULL) {
3128
+ SWIG_exception_fail(SWIG_MemoryError, "Failed to allocate memory for file name.");
3129
+ }
3130
+ }
3131
+ ecode2 = SWIG_AsVal_bool(argv[1], &val2);
3132
+ if (!SWIG_IsOK(ecode2)) {
3133
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","TagLib::MPEG::File", 2, argv[1] ));
3134
+ }
3135
+ arg2 = static_cast< bool >(val2);
3136
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
3137
+ if (!SWIG_IsOK(ecode3)) {
3138
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties::ReadStyle","TagLib::MPEG::File", 3, argv[2] ));
3139
+ }
3140
+ arg3 = static_cast< TagLib::MPEG::Properties::ReadStyle >(val3);
3141
+ result = (TagLib::MPEG::File *)new TagLib::MPEG::File(arg1,arg2,arg3);
3142
+ DATA_PTR(self) = result;
3143
+ SWIG_RubyAddTracking(result, self);
3144
+ return self;
3145
+ fail:
3146
+ return Qnil;
3147
+ }
3148
+
3149
+
3150
+ SWIGINTERN VALUE
3151
+ _wrap_new_File__SWIG_1(int argc, VALUE *argv, VALUE self) {
3152
+ SwigValueWrapper< TagLib::FileName > arg1 ;
3153
+ bool arg2 ;
3154
+ bool val2 ;
3155
+ int ecode2 = 0 ;
3156
+ TagLib::MPEG::File *result = 0 ;
3157
+
3158
+ if ((argc < 2) || (argc > 2)) {
3159
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3160
+ }
3161
+ {
3162
+ arg1 = ruby_string_to_taglib_filename(argv[0]);
3163
+ if ((const char *)(TagLib::FileName)(arg1) == NULL) {
3164
+ SWIG_exception_fail(SWIG_MemoryError, "Failed to allocate memory for file name.");
3165
+ }
3166
+ }
3167
+ ecode2 = SWIG_AsVal_bool(argv[1], &val2);
3168
+ if (!SWIG_IsOK(ecode2)) {
3169
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","TagLib::MPEG::File", 2, argv[1] ));
3170
+ }
3171
+ arg2 = static_cast< bool >(val2);
3172
+ result = (TagLib::MPEG::File *)new TagLib::MPEG::File(arg1,arg2);
3173
+ DATA_PTR(self) = result;
3174
+ SWIG_RubyAddTracking(result, self);
3175
+ return self;
3176
+ fail:
3177
+ return Qnil;
3178
+ }
3179
+
3180
+
3181
+ SWIGINTERN VALUE
3182
+ _wrap_new_File__SWIG_2(int argc, VALUE *argv, VALUE self) {
3183
+ SwigValueWrapper< TagLib::FileName > arg1 ;
3184
+ TagLib::MPEG::File *result = 0 ;
3185
+
3186
+ if ((argc < 1) || (argc > 1)) {
3187
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3188
+ }
3189
+ {
3190
+ arg1 = ruby_string_to_taglib_filename(argv[0]);
3191
+ if ((const char *)(TagLib::FileName)(arg1) == NULL) {
3192
+ SWIG_exception_fail(SWIG_MemoryError, "Failed to allocate memory for file name.");
3193
+ }
3194
+ }
3195
+ result = (TagLib::MPEG::File *)new TagLib::MPEG::File(arg1);
3196
+ DATA_PTR(self) = result;
3197
+ SWIG_RubyAddTracking(result, self);
3198
+ return self;
3199
+ fail:
3200
+ return Qnil;
3201
+ }
3202
+
3203
+
3204
+ SWIGINTERN VALUE
3205
+ _wrap_new_File__SWIG_3(int argc, VALUE *argv, VALUE self) {
3206
+ SwigValueWrapper< TagLib::FileName > arg1 ;
3207
+ TagLib::ID3v2::FrameFactory *arg2 = (TagLib::ID3v2::FrameFactory *) 0 ;
3208
+ bool arg3 ;
3209
+ TagLib::MPEG::Properties::ReadStyle arg4 ;
3210
+ void *argp2 = 0 ;
3211
+ int res2 = 0 ;
3212
+ bool val3 ;
3213
+ int ecode3 = 0 ;
3214
+ int val4 ;
3215
+ int ecode4 = 0 ;
3216
+ TagLib::MPEG::File *result = 0 ;
3217
+
3218
+ if ((argc < 4) || (argc > 4)) {
3219
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
3220
+ }
3221
+ {
3222
+ arg1 = ruby_string_to_taglib_filename(argv[0]);
3223
+ if ((const char *)(TagLib::FileName)(arg1) == NULL) {
3224
+ SWIG_exception_fail(SWIG_MemoryError, "Failed to allocate memory for file name.");
3225
+ }
3226
+ }
3227
+ res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_TagLib__ID3v2__FrameFactory, 0 | 0 );
3228
+ if (!SWIG_IsOK(res2)) {
3229
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "TagLib::ID3v2::FrameFactory *","TagLib::MPEG::File", 2, argv[1] ));
3230
+ }
3231
+ arg2 = reinterpret_cast< TagLib::ID3v2::FrameFactory * >(argp2);
3232
+ ecode3 = SWIG_AsVal_bool(argv[2], &val3);
3233
+ if (!SWIG_IsOK(ecode3)) {
3234
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","TagLib::MPEG::File", 3, argv[2] ));
3235
+ }
3236
+ arg3 = static_cast< bool >(val3);
3237
+ ecode4 = SWIG_AsVal_int(argv[3], &val4);
3238
+ if (!SWIG_IsOK(ecode4)) {
3239
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties::ReadStyle","TagLib::MPEG::File", 4, argv[3] ));
3240
+ }
3241
+ arg4 = static_cast< TagLib::MPEG::Properties::ReadStyle >(val4);
3242
+ result = (TagLib::MPEG::File *)new TagLib::MPEG::File(arg1,arg2,arg3,arg4);
3243
+ DATA_PTR(self) = result;
3244
+ SWIG_RubyAddTracking(result, self);
3245
+ return self;
3246
+ fail:
3247
+ return Qnil;
3248
+ }
3249
+
3250
+
3251
+ SWIGINTERN VALUE
3252
+ _wrap_new_File__SWIG_4(int argc, VALUE *argv, VALUE self) {
3253
+ SwigValueWrapper< TagLib::FileName > arg1 ;
3254
+ TagLib::ID3v2::FrameFactory *arg2 = (TagLib::ID3v2::FrameFactory *) 0 ;
3255
+ bool arg3 ;
3256
+ void *argp2 = 0 ;
3257
+ int res2 = 0 ;
3258
+ bool val3 ;
3259
+ int ecode3 = 0 ;
3260
+ TagLib::MPEG::File *result = 0 ;
3261
+
3262
+ if ((argc < 3) || (argc > 3)) {
3263
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
3264
+ }
3265
+ {
3266
+ arg1 = ruby_string_to_taglib_filename(argv[0]);
3267
+ if ((const char *)(TagLib::FileName)(arg1) == NULL) {
3268
+ SWIG_exception_fail(SWIG_MemoryError, "Failed to allocate memory for file name.");
3269
+ }
3270
+ }
3271
+ res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_TagLib__ID3v2__FrameFactory, 0 | 0 );
3272
+ if (!SWIG_IsOK(res2)) {
3273
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "TagLib::ID3v2::FrameFactory *","TagLib::MPEG::File", 2, argv[1] ));
3274
+ }
3275
+ arg2 = reinterpret_cast< TagLib::ID3v2::FrameFactory * >(argp2);
3276
+ ecode3 = SWIG_AsVal_bool(argv[2], &val3);
3277
+ if (!SWIG_IsOK(ecode3)) {
3278
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","TagLib::MPEG::File", 3, argv[2] ));
3279
+ }
3280
+ arg3 = static_cast< bool >(val3);
3281
+ result = (TagLib::MPEG::File *)new TagLib::MPEG::File(arg1,arg2,arg3);
3282
+ DATA_PTR(self) = result;
3283
+ SWIG_RubyAddTracking(result, self);
3284
+ return self;
3285
+ fail:
3286
+ return Qnil;
3287
+ }
3288
+
3289
+
3290
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
3291
+ SWIGINTERN VALUE
3292
+ _wrap_File_allocate(VALUE self) {
3293
+ #else
3294
+ SWIGINTERN VALUE
3295
+ _wrap_File_allocate(int argc, VALUE *argv, VALUE self) {
3296
+ #endif
3297
+
3298
+
3299
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MPEG__File);
3300
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
3301
+ rb_obj_call_init(vresult, argc, argv);
3302
+ #endif
3303
+ return vresult;
3304
+ }
3305
+
3306
+
3307
+ SWIGINTERN VALUE
3308
+ _wrap_new_File__SWIG_5(int argc, VALUE *argv, VALUE self) {
3309
+ SwigValueWrapper< TagLib::FileName > arg1 ;
3310
+ TagLib::ID3v2::FrameFactory *arg2 = (TagLib::ID3v2::FrameFactory *) 0 ;
3311
+ void *argp2 = 0 ;
3312
+ int res2 = 0 ;
3313
+ TagLib::MPEG::File *result = 0 ;
3314
+
3315
+ if ((argc < 2) || (argc > 2)) {
3316
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3317
+ }
3318
+ {
3319
+ arg1 = ruby_string_to_taglib_filename(argv[0]);
3320
+ if ((const char *)(TagLib::FileName)(arg1) == NULL) {
3321
+ SWIG_exception_fail(SWIG_MemoryError, "Failed to allocate memory for file name.");
3322
+ }
3323
+ }
3324
+ res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_TagLib__ID3v2__FrameFactory, 0 | 0 );
3325
+ if (!SWIG_IsOK(res2)) {
3326
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "TagLib::ID3v2::FrameFactory *","TagLib::MPEG::File", 2, argv[1] ));
3327
+ }
3328
+ arg2 = reinterpret_cast< TagLib::ID3v2::FrameFactory * >(argp2);
3329
+ result = (TagLib::MPEG::File *)new TagLib::MPEG::File(arg1,arg2);
3330
+ DATA_PTR(self) = result;
3331
+ SWIG_RubyAddTracking(result, self);
3332
+ return self;
3333
+ fail:
3334
+ return Qnil;
3335
+ }
3336
+
3337
+
3338
+ SWIGINTERN VALUE _wrap_new_File(int nargs, VALUE *args, VALUE self) {
3339
+ int argc;
3340
+ VALUE argv[4];
3341
+ int ii;
3342
+
3343
+ argc = nargs;
3344
+ if (argc > 4) SWIG_fail;
3345
+ for (ii = 0; (ii < argc); ++ii) {
3346
+ argv[ii] = args[ii];
3347
+ }
3348
+ if (argc == 1) {
3349
+ int _v;
3350
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
3351
+ _v = SWIG_CheckState(res);
3352
+ if (_v) {
3353
+ return _wrap_new_File__SWIG_2(nargs, args, self);
3354
+ }
3355
+ }
3356
+ if (argc == 2) {
3357
+ int _v;
3358
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
3359
+ _v = SWIG_CheckState(res);
3360
+ if (_v) {
3361
+ void *vptr = 0;
3362
+ int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_TagLib__ID3v2__FrameFactory, 0);
3363
+ _v = SWIG_CheckState(res);
3364
+ if (_v) {
3365
+ return _wrap_new_File__SWIG_5(nargs, args, self);
3366
+ }
3367
+ }
3368
+ }
3369
+ if (argc == 2) {
3370
+ int _v;
3371
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
3372
+ _v = SWIG_CheckState(res);
3373
+ if (_v) {
3374
+ {
3375
+ int res = SWIG_AsVal_bool(argv[1], NULL);
3376
+ _v = SWIG_CheckState(res);
3377
+ }
3378
+ if (_v) {
3379
+ return _wrap_new_File__SWIG_1(nargs, args, self);
3380
+ }
3381
+ }
3382
+ }
3383
+ if (argc == 3) {
3384
+ int _v;
3385
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
3386
+ _v = SWIG_CheckState(res);
3387
+ if (_v) {
3388
+ void *vptr = 0;
3389
+ int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_TagLib__ID3v2__FrameFactory, 0);
3390
+ _v = SWIG_CheckState(res);
3391
+ if (_v) {
3392
+ {
3393
+ int res = SWIG_AsVal_bool(argv[2], NULL);
3394
+ _v = SWIG_CheckState(res);
3395
+ }
3396
+ if (_v) {
3397
+ return _wrap_new_File__SWIG_4(nargs, args, self);
3398
+ }
3399
+ }
3400
+ }
3401
+ }
3402
+ if (argc == 3) {
3403
+ int _v;
3404
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
3405
+ _v = SWIG_CheckState(res);
3406
+ if (_v) {
3407
+ {
3408
+ int res = SWIG_AsVal_bool(argv[1], NULL);
3409
+ _v = SWIG_CheckState(res);
3410
+ }
3411
+ if (_v) {
3412
+ {
3413
+ int res = SWIG_AsVal_int(argv[2], NULL);
3414
+ _v = SWIG_CheckState(res);
3415
+ }
3416
+ if (_v) {
3417
+ return _wrap_new_File__SWIG_0(nargs, args, self);
3418
+ }
3419
+ }
3420
+ }
3421
+ }
3422
+ if (argc == 4) {
3423
+ int _v;
3424
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
3425
+ _v = SWIG_CheckState(res);
3426
+ if (_v) {
3427
+ void *vptr = 0;
3428
+ int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_TagLib__ID3v2__FrameFactory, 0);
3429
+ _v = SWIG_CheckState(res);
3430
+ if (_v) {
3431
+ {
3432
+ int res = SWIG_AsVal_bool(argv[2], NULL);
3433
+ _v = SWIG_CheckState(res);
3434
+ }
3435
+ if (_v) {
3436
+ {
3437
+ int res = SWIG_AsVal_int(argv[3], NULL);
3438
+ _v = SWIG_CheckState(res);
3439
+ }
3440
+ if (_v) {
3441
+ return _wrap_new_File__SWIG_3(nargs, args, self);
3442
+ }
3443
+ }
3444
+ }
3445
+ }
3446
+ }
3447
+
3448
+ fail:
3449
+ Ruby_Format_OverloadedError( argc, 4, "File.new",
3450
+ " File.new(TagLib::FileName file, bool readProperties, TagLib::MPEG::Properties::ReadStyle propertiesStyle)\n"
3451
+ " File.new(TagLib::FileName file, bool readProperties)\n"
3452
+ " File.new(TagLib::FileName file)\n"
3453
+ " File.new(TagLib::FileName file, TagLib::ID3v2::FrameFactory *frameFactory, bool readProperties, TagLib::MPEG::Properties::ReadStyle propertiesStyle)\n"
3454
+ " File.new(TagLib::FileName file, TagLib::ID3v2::FrameFactory *frameFactory, bool readProperties)\n"
3455
+ " File.new(TagLib::FileName file, TagLib::ID3v2::FrameFactory *frameFactory)\n");
3456
+
3457
+ return Qnil;
3458
+ }
3459
+
3460
+
3461
+ SWIGINTERN VALUE
3462
+ _wrap_File_tag(int argc, VALUE *argv, VALUE self) {
3463
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3464
+ void *argp1 = 0 ;
3465
+ int res1 = 0 ;
3466
+ TagLib::Tag *result = 0 ;
3467
+ VALUE vresult = Qnil;
3468
+
3469
+ if ((argc < 0) || (argc > 0)) {
3470
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3471
+ }
3472
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3473
+ if (!SWIG_IsOK(res1)) {
3474
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File const *","tag", 1, self ));
3475
+ }
3476
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3477
+ result = (TagLib::Tag *)((TagLib::MPEG::File const *)arg1)->tag();
3478
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__Tag, 0 | 0 );
3479
+ return vresult;
3480
+ fail:
3481
+ return Qnil;
3482
+ }
3483
+
3484
+
3485
+ SWIGINTERN VALUE
3486
+ _wrap_File_audio_properties(int argc, VALUE *argv, VALUE self) {
3487
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3488
+ void *argp1 = 0 ;
3489
+ int res1 = 0 ;
3490
+ TagLib::MPEG::Properties *result = 0 ;
3491
+ VALUE vresult = Qnil;
3492
+
3493
+ if ((argc < 0) || (argc > 0)) {
3494
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3495
+ }
3496
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3497
+ if (!SWIG_IsOK(res1)) {
3498
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File const *","audioProperties", 1, self ));
3499
+ }
3500
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3501
+ result = (TagLib::MPEG::Properties *)((TagLib::MPEG::File const *)arg1)->audioProperties();
3502
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
3503
+ return vresult;
3504
+ fail:
3505
+ return Qnil;
3506
+ }
3507
+
3508
+
3509
+ SWIGINTERN VALUE
3510
+ _wrap_File_save__SWIG_0(int argc, VALUE *argv, VALUE self) {
3511
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3512
+ void *argp1 = 0 ;
3513
+ int res1 = 0 ;
3514
+ bool result;
3515
+ VALUE vresult = Qnil;
3516
+
3517
+ if ((argc < 0) || (argc > 0)) {
3518
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3519
+ }
3520
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3521
+ if (!SWIG_IsOK(res1)) {
3522
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","save", 1, self ));
3523
+ }
3524
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3525
+ result = (bool)(arg1)->save();
3526
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3527
+ return vresult;
3528
+ fail:
3529
+ return Qnil;
3530
+ }
3531
+
3532
+
3533
+ SWIGINTERN VALUE
3534
+ _wrap_File_save__SWIG_1(int argc, VALUE *argv, VALUE self) {
3535
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3536
+ int arg2 ;
3537
+ void *argp1 = 0 ;
3538
+ int res1 = 0 ;
3539
+ int val2 ;
3540
+ int ecode2 = 0 ;
3541
+ bool result;
3542
+ VALUE vresult = Qnil;
3543
+
3544
+ if ((argc < 1) || (argc > 1)) {
3545
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3546
+ }
3547
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3548
+ if (!SWIG_IsOK(res1)) {
3549
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","save", 1, self ));
3550
+ }
3551
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3552
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3553
+ if (!SWIG_IsOK(ecode2)) {
3554
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","save", 2, argv[0] ));
3555
+ }
3556
+ arg2 = static_cast< int >(val2);
3557
+ result = (bool)(arg1)->save(arg2);
3558
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3559
+ return vresult;
3560
+ fail:
3561
+ return Qnil;
3562
+ }
3563
+
3564
+
3565
+ SWIGINTERN VALUE
3566
+ _wrap_File_save__SWIG_2(int argc, VALUE *argv, VALUE self) {
3567
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3568
+ int arg2 ;
3569
+ bool arg3 ;
3570
+ void *argp1 = 0 ;
3571
+ int res1 = 0 ;
3572
+ int val2 ;
3573
+ int ecode2 = 0 ;
3574
+ bool val3 ;
3575
+ int ecode3 = 0 ;
3576
+ bool result;
3577
+ VALUE vresult = Qnil;
3578
+
3579
+ if ((argc < 2) || (argc > 2)) {
3580
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3581
+ }
3582
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3583
+ if (!SWIG_IsOK(res1)) {
3584
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","save", 1, self ));
3585
+ }
3586
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3587
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3588
+ if (!SWIG_IsOK(ecode2)) {
3589
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","save", 2, argv[0] ));
3590
+ }
3591
+ arg2 = static_cast< int >(val2);
3592
+ ecode3 = SWIG_AsVal_bool(argv[1], &val3);
3593
+ if (!SWIG_IsOK(ecode3)) {
3594
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","save", 3, argv[1] ));
3595
+ }
3596
+ arg3 = static_cast< bool >(val3);
3597
+ result = (bool)(arg1)->save(arg2,arg3);
3598
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3599
+ return vresult;
3600
+ fail:
3601
+ return Qnil;
3602
+ }
3603
+
3604
+
3605
+ SWIGINTERN VALUE _wrap_File_save(int nargs, VALUE *args, VALUE self) {
3606
+ int argc;
3607
+ VALUE argv[4];
3608
+ int ii;
3609
+
3610
+ argc = nargs + 1;
3611
+ argv[0] = self;
3612
+ if (argc > 4) SWIG_fail;
3613
+ for (ii = 1; (ii < argc); ++ii) {
3614
+ argv[ii] = args[ii-1];
3615
+ }
3616
+ if (argc == 1) {
3617
+ int _v;
3618
+ void *vptr = 0;
3619
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3620
+ _v = SWIG_CheckState(res);
3621
+ if (_v) {
3622
+ return _wrap_File_save__SWIG_0(nargs, args, self);
3623
+ }
3624
+ }
3625
+ if (argc == 2) {
3626
+ int _v;
3627
+ void *vptr = 0;
3628
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3629
+ _v = SWIG_CheckState(res);
3630
+ if (_v) {
3631
+ {
3632
+ int res = SWIG_AsVal_int(argv[1], NULL);
3633
+ _v = SWIG_CheckState(res);
3634
+ }
3635
+ if (_v) {
3636
+ return _wrap_File_save__SWIG_1(nargs, args, self);
3637
+ }
3638
+ }
3639
+ }
3640
+ if (argc == 3) {
3641
+ int _v;
3642
+ void *vptr = 0;
3643
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3644
+ _v = SWIG_CheckState(res);
3645
+ if (_v) {
3646
+ {
3647
+ int res = SWIG_AsVal_int(argv[1], NULL);
3648
+ _v = SWIG_CheckState(res);
3649
+ }
3650
+ if (_v) {
3651
+ {
3652
+ int res = SWIG_AsVal_bool(argv[2], NULL);
3653
+ _v = SWIG_CheckState(res);
3654
+ }
3655
+ if (_v) {
3656
+ return _wrap_File_save__SWIG_2(nargs, args, self);
3657
+ }
3658
+ }
3659
+ }
3660
+ }
3661
+
3662
+ fail:
3663
+ Ruby_Format_OverloadedError( argc, 4, "File.save",
3664
+ " bool File.save()\n"
3665
+ " bool File.save(int tags)\n"
3666
+ " bool File.save(int tags, bool stripOthers)\n");
3667
+
3668
+ return Qnil;
3669
+ }
3670
+
3671
+
3672
+ SWIGINTERN VALUE
3673
+ _wrap_File_id3v2_tag__SWIG_0(int argc, VALUE *argv, VALUE self) {
3674
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3675
+ bool arg2 ;
3676
+ void *argp1 = 0 ;
3677
+ int res1 = 0 ;
3678
+ bool val2 ;
3679
+ int ecode2 = 0 ;
3680
+ TagLib::ID3v2::Tag *result = 0 ;
3681
+ VALUE vresult = Qnil;
3682
+
3683
+ if ((argc < 1) || (argc > 1)) {
3684
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3685
+ }
3686
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3687
+ if (!SWIG_IsOK(res1)) {
3688
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","ID3v2Tag", 1, self ));
3689
+ }
3690
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3691
+ ecode2 = SWIG_AsVal_bool(argv[0], &val2);
3692
+ if (!SWIG_IsOK(ecode2)) {
3693
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","ID3v2Tag", 2, argv[0] ));
3694
+ }
3695
+ arg2 = static_cast< bool >(val2);
3696
+ result = (TagLib::ID3v2::Tag *)(arg1)->ID3v2Tag(arg2);
3697
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__ID3v2__Tag, 0 | 0 );
3698
+ return vresult;
3699
+ fail:
3700
+ return Qnil;
3701
+ }
3702
+
3703
+
3704
+ SWIGINTERN VALUE
3705
+ _wrap_File_id3v2_tag__SWIG_1(int argc, VALUE *argv, VALUE self) {
3706
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3707
+ void *argp1 = 0 ;
3708
+ int res1 = 0 ;
3709
+ TagLib::ID3v2::Tag *result = 0 ;
3710
+ VALUE vresult = Qnil;
3711
+
3712
+ if ((argc < 0) || (argc > 0)) {
3713
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3714
+ }
3715
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3716
+ if (!SWIG_IsOK(res1)) {
3717
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","ID3v2Tag", 1, self ));
3718
+ }
3719
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3720
+ result = (TagLib::ID3v2::Tag *)(arg1)->ID3v2Tag();
3721
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__ID3v2__Tag, 0 | 0 );
3722
+ return vresult;
3723
+ fail:
3724
+ return Qnil;
3725
+ }
3726
+
3727
+
3728
+ SWIGINTERN VALUE _wrap_File_id3v2_tag(int nargs, VALUE *args, VALUE self) {
3729
+ int argc;
3730
+ VALUE argv[3];
3731
+ int ii;
3732
+
3733
+ argc = nargs + 1;
3734
+ argv[0] = self;
3735
+ if (argc > 3) SWIG_fail;
3736
+ for (ii = 1; (ii < argc); ++ii) {
3737
+ argv[ii] = args[ii-1];
3738
+ }
3739
+ if (argc == 1) {
3740
+ int _v;
3741
+ void *vptr = 0;
3742
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3743
+ _v = SWIG_CheckState(res);
3744
+ if (_v) {
3745
+ return _wrap_File_id3v2_tag__SWIG_1(nargs, args, self);
3746
+ }
3747
+ }
3748
+ if (argc == 2) {
3749
+ int _v;
3750
+ void *vptr = 0;
3751
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3752
+ _v = SWIG_CheckState(res);
3753
+ if (_v) {
3754
+ {
3755
+ int res = SWIG_AsVal_bool(argv[1], NULL);
3756
+ _v = SWIG_CheckState(res);
3757
+ }
3758
+ if (_v) {
3759
+ return _wrap_File_id3v2_tag__SWIG_0(nargs, args, self);
3760
+ }
3761
+ }
3762
+ }
3763
+
3764
+ fail:
3765
+ Ruby_Format_OverloadedError( argc, 3, "File.id3v2_tag",
3766
+ " TagLib::ID3v2::Tag * File.id3v2_tag(bool create)\n"
3767
+ " TagLib::ID3v2::Tag * File.id3v2_tag()\n");
3768
+
3769
+ return Qnil;
3770
+ }
3771
+
3772
+
3773
+ SWIGINTERN VALUE
3774
+ _wrap_File_id3v1_tag__SWIG_0(int argc, VALUE *argv, VALUE self) {
3775
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3776
+ bool arg2 ;
3777
+ void *argp1 = 0 ;
3778
+ int res1 = 0 ;
3779
+ bool val2 ;
3780
+ int ecode2 = 0 ;
3781
+ TagLib::ID3v1::Tag *result = 0 ;
3782
+ VALUE vresult = Qnil;
3783
+
3784
+ if ((argc < 1) || (argc > 1)) {
3785
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3786
+ }
3787
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3788
+ if (!SWIG_IsOK(res1)) {
3789
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","ID3v1Tag", 1, self ));
3790
+ }
3791
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3792
+ ecode2 = SWIG_AsVal_bool(argv[0], &val2);
3793
+ if (!SWIG_IsOK(ecode2)) {
3794
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","ID3v1Tag", 2, argv[0] ));
3795
+ }
3796
+ arg2 = static_cast< bool >(val2);
3797
+ result = (TagLib::ID3v1::Tag *)(arg1)->ID3v1Tag(arg2);
3798
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__ID3v1__Tag, 0 | 0 );
3799
+ return vresult;
3800
+ fail:
3801
+ return Qnil;
3802
+ }
3803
+
3804
+
3805
+ SWIGINTERN VALUE
3806
+ _wrap_File_id3v1_tag__SWIG_1(int argc, VALUE *argv, VALUE self) {
3807
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3808
+ void *argp1 = 0 ;
3809
+ int res1 = 0 ;
3810
+ TagLib::ID3v1::Tag *result = 0 ;
3811
+ VALUE vresult = Qnil;
3812
+
3813
+ if ((argc < 0) || (argc > 0)) {
3814
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3815
+ }
3816
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3817
+ if (!SWIG_IsOK(res1)) {
3818
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","ID3v1Tag", 1, self ));
3819
+ }
3820
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3821
+ result = (TagLib::ID3v1::Tag *)(arg1)->ID3v1Tag();
3822
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__ID3v1__Tag, 0 | 0 );
3823
+ return vresult;
3824
+ fail:
3825
+ return Qnil;
3826
+ }
3827
+
3828
+
3829
+ SWIGINTERN VALUE _wrap_File_id3v1_tag(int nargs, VALUE *args, VALUE self) {
3830
+ int argc;
3831
+ VALUE argv[3];
3832
+ int ii;
3833
+
3834
+ argc = nargs + 1;
3835
+ argv[0] = self;
3836
+ if (argc > 3) SWIG_fail;
3837
+ for (ii = 1; (ii < argc); ++ii) {
3838
+ argv[ii] = args[ii-1];
3839
+ }
3840
+ if (argc == 1) {
3841
+ int _v;
3842
+ void *vptr = 0;
3843
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3844
+ _v = SWIG_CheckState(res);
3845
+ if (_v) {
3846
+ return _wrap_File_id3v1_tag__SWIG_1(nargs, args, self);
3847
+ }
3848
+ }
3849
+ if (argc == 2) {
3850
+ int _v;
3851
+ void *vptr = 0;
3852
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3853
+ _v = SWIG_CheckState(res);
3854
+ if (_v) {
3855
+ {
3856
+ int res = SWIG_AsVal_bool(argv[1], NULL);
3857
+ _v = SWIG_CheckState(res);
3858
+ }
3859
+ if (_v) {
3860
+ return _wrap_File_id3v1_tag__SWIG_0(nargs, args, self);
3861
+ }
3862
+ }
3863
+ }
3864
+
3865
+ fail:
3866
+ Ruby_Format_OverloadedError( argc, 3, "File.id3v1_tag",
3867
+ " TagLib::ID3v1::Tag * File.id3v1_tag(bool create)\n"
3868
+ " TagLib::ID3v1::Tag * File.id3v1_tag()\n");
3869
+
3870
+ return Qnil;
3871
+ }
3872
+
3873
+
3874
+ SWIGINTERN VALUE
3875
+ _wrap_File_apetag__SWIG_0(int argc, VALUE *argv, VALUE self) {
3876
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3877
+ bool arg2 ;
3878
+ void *argp1 = 0 ;
3879
+ int res1 = 0 ;
3880
+ bool val2 ;
3881
+ int ecode2 = 0 ;
3882
+ TagLib::APE::Tag *result = 0 ;
3883
+ VALUE vresult = Qnil;
3884
+
3885
+ if ((argc < 1) || (argc > 1)) {
3886
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3887
+ }
3888
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3889
+ if (!SWIG_IsOK(res1)) {
3890
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","APETag", 1, self ));
3891
+ }
3892
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3893
+ ecode2 = SWIG_AsVal_bool(argv[0], &val2);
3894
+ if (!SWIG_IsOK(ecode2)) {
3895
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","APETag", 2, argv[0] ));
3896
+ }
3897
+ arg2 = static_cast< bool >(val2);
3898
+ result = (TagLib::APE::Tag *)(arg1)->APETag(arg2);
3899
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__APE__Tag, 0 | 0 );
3900
+ return vresult;
3901
+ fail:
3902
+ return Qnil;
3903
+ }
3904
+
3905
+
3906
+ SWIGINTERN VALUE
3907
+ _wrap_File_apetag__SWIG_1(int argc, VALUE *argv, VALUE self) {
3908
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3909
+ void *argp1 = 0 ;
3910
+ int res1 = 0 ;
3911
+ TagLib::APE::Tag *result = 0 ;
3912
+ VALUE vresult = Qnil;
3913
+
3914
+ if ((argc < 0) || (argc > 0)) {
3915
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3916
+ }
3917
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3918
+ if (!SWIG_IsOK(res1)) {
3919
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","APETag", 1, self ));
3920
+ }
3921
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3922
+ result = (TagLib::APE::Tag *)(arg1)->APETag();
3923
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__APE__Tag, 0 | 0 );
3924
+ return vresult;
3925
+ fail:
3926
+ return Qnil;
3927
+ }
3928
+
3929
+
3930
+ SWIGINTERN VALUE _wrap_File_apetag(int nargs, VALUE *args, VALUE self) {
3931
+ int argc;
3932
+ VALUE argv[3];
3933
+ int ii;
3934
+
3935
+ argc = nargs + 1;
3936
+ argv[0] = self;
3937
+ if (argc > 3) SWIG_fail;
3938
+ for (ii = 1; (ii < argc); ++ii) {
3939
+ argv[ii] = args[ii-1];
3940
+ }
3941
+ if (argc == 1) {
3942
+ int _v;
3943
+ void *vptr = 0;
3944
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3945
+ _v = SWIG_CheckState(res);
3946
+ if (_v) {
3947
+ return _wrap_File_apetag__SWIG_1(nargs, args, self);
3948
+ }
3949
+ }
3950
+ if (argc == 2) {
3951
+ int _v;
3952
+ void *vptr = 0;
3953
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3954
+ _v = SWIG_CheckState(res);
3955
+ if (_v) {
3956
+ {
3957
+ int res = SWIG_AsVal_bool(argv[1], NULL);
3958
+ _v = SWIG_CheckState(res);
3959
+ }
3960
+ if (_v) {
3961
+ return _wrap_File_apetag__SWIG_0(nargs, args, self);
3962
+ }
3963
+ }
3964
+ }
3965
+
3966
+ fail:
3967
+ Ruby_Format_OverloadedError( argc, 3, "File.apetag",
3968
+ " TagLib::APE::Tag * File.apetag(bool create)\n"
3969
+ " TagLib::APE::Tag * File.apetag()\n");
3970
+
3971
+ return Qnil;
3972
+ }
3973
+
3974
+
3975
+ SWIGINTERN VALUE
3976
+ _wrap_File_strip__SWIG_0(int argc, VALUE *argv, VALUE self) {
3977
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3978
+ int arg2 ;
3979
+ void *argp1 = 0 ;
3980
+ int res1 = 0 ;
3981
+ int val2 ;
3982
+ int ecode2 = 0 ;
3983
+ bool result;
3984
+ VALUE vresult = Qnil;
3985
+
3986
+ if ((argc < 1) || (argc > 1)) {
3987
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3988
+ }
3989
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3990
+ if (!SWIG_IsOK(res1)) {
3991
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","strip", 1, self ));
3992
+ }
3993
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3994
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3995
+ if (!SWIG_IsOK(ecode2)) {
3996
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","strip", 2, argv[0] ));
3997
+ }
3998
+ arg2 = static_cast< int >(val2);
3999
+ result = (bool)(arg1)->strip(arg2);
4000
+ vresult = SWIG_From_bool(static_cast< bool >(result));
4001
+ return vresult;
4002
+ fail:
4003
+ return Qnil;
4004
+ }
4005
+
4006
+
4007
+ SWIGINTERN VALUE
4008
+ _wrap_File_strip__SWIG_1(int argc, VALUE *argv, VALUE self) {
4009
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
4010
+ void *argp1 = 0 ;
4011
+ int res1 = 0 ;
4012
+ bool result;
4013
+ VALUE vresult = Qnil;
4014
+
4015
+ if ((argc < 0) || (argc > 0)) {
4016
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
4017
+ }
4018
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
4019
+ if (!SWIG_IsOK(res1)) {
4020
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","strip", 1, self ));
4021
+ }
4022
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
4023
+ result = (bool)(arg1)->strip();
4024
+ vresult = SWIG_From_bool(static_cast< bool >(result));
4025
+ return vresult;
4026
+ fail:
4027
+ return Qnil;
4028
+ }
4029
+
4030
+
4031
+ SWIGINTERN VALUE
4032
+ _wrap_File_strip__SWIG_2(int argc, VALUE *argv, VALUE self) {
4033
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
4034
+ int arg2 ;
4035
+ bool arg3 ;
4036
+ void *argp1 = 0 ;
4037
+ int res1 = 0 ;
4038
+ int val2 ;
4039
+ int ecode2 = 0 ;
4040
+ bool val3 ;
4041
+ int ecode3 = 0 ;
4042
+ bool result;
4043
+ VALUE vresult = Qnil;
4044
+
4045
+ if ((argc < 2) || (argc > 2)) {
4046
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
4047
+ }
4048
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
4049
+ if (!SWIG_IsOK(res1)) {
4050
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","strip", 1, self ));
4051
+ }
4052
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
4053
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
4054
+ if (!SWIG_IsOK(ecode2)) {
4055
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","strip", 2, argv[0] ));
4056
+ }
4057
+ arg2 = static_cast< int >(val2);
4058
+ ecode3 = SWIG_AsVal_bool(argv[1], &val3);
4059
+ if (!SWIG_IsOK(ecode3)) {
4060
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","strip", 3, argv[1] ));
4061
+ }
4062
+ arg3 = static_cast< bool >(val3);
4063
+ result = (bool)(arg1)->strip(arg2,arg3);
4064
+ vresult = SWIG_From_bool(static_cast< bool >(result));
4065
+ return vresult;
4066
+ fail:
4067
+ return Qnil;
4068
+ }
4069
+
4070
+
4071
+ SWIGINTERN VALUE _wrap_File_strip(int nargs, VALUE *args, VALUE self) {
4072
+ int argc;
4073
+ VALUE argv[4];
4074
+ int ii;
4075
+
4076
+ argc = nargs + 1;
4077
+ argv[0] = self;
4078
+ if (argc > 4) SWIG_fail;
4079
+ for (ii = 1; (ii < argc); ++ii) {
4080
+ argv[ii] = args[ii-1];
4081
+ }
4082
+ if (argc == 1) {
4083
+ int _v;
4084
+ void *vptr = 0;
4085
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
4086
+ _v = SWIG_CheckState(res);
4087
+ if (_v) {
4088
+ return _wrap_File_strip__SWIG_1(nargs, args, self);
4089
+ }
4090
+ }
4091
+ if (argc == 2) {
4092
+ int _v;
4093
+ void *vptr = 0;
4094
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
4095
+ _v = SWIG_CheckState(res);
4096
+ if (_v) {
4097
+ {
4098
+ int res = SWIG_AsVal_int(argv[1], NULL);
4099
+ _v = SWIG_CheckState(res);
4100
+ }
4101
+ if (_v) {
4102
+ return _wrap_File_strip__SWIG_0(nargs, args, self);
4103
+ }
4104
+ }
4105
+ }
4106
+ if (argc == 3) {
4107
+ int _v;
4108
+ void *vptr = 0;
4109
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
4110
+ _v = SWIG_CheckState(res);
4111
+ if (_v) {
4112
+ {
4113
+ int res = SWIG_AsVal_int(argv[1], NULL);
4114
+ _v = SWIG_CheckState(res);
4115
+ }
4116
+ if (_v) {
4117
+ {
4118
+ int res = SWIG_AsVal_bool(argv[2], NULL);
4119
+ _v = SWIG_CheckState(res);
4120
+ }
4121
+ if (_v) {
4122
+ return _wrap_File_strip__SWIG_2(nargs, args, self);
4123
+ }
4124
+ }
4125
+ }
4126
+ }
4127
+
4128
+ fail:
4129
+ Ruby_Format_OverloadedError( argc, 4, "File.strip",
4130
+ " bool File.strip(int tags)\n"
4131
+ " bool File.strip()\n"
4132
+ " bool File.strip(int tags, bool freeMemory)\n");
4133
+
4134
+ return Qnil;
4135
+ }
4136
+
4137
+
4138
+ SWIGINTERN VALUE
4139
+ _wrap_File_set_id3v2_frame_factory(int argc, VALUE *argv, VALUE self) {
4140
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
4141
+ TagLib::ID3v2::FrameFactory *arg2 = (TagLib::ID3v2::FrameFactory *) 0 ;
4142
+ void *argp1 = 0 ;
4143
+ int res1 = 0 ;
4144
+ void *argp2 = 0 ;
4145
+ int res2 = 0 ;
4146
+
4147
+ if ((argc < 1) || (argc > 1)) {
4148
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
4149
+ }
4150
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
4151
+ if (!SWIG_IsOK(res1)) {
4152
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","setID3v2FrameFactory", 1, self ));
4153
+ }
4154
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
4155
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_TagLib__ID3v2__FrameFactory, 0 | 0 );
4156
+ if (!SWIG_IsOK(res2)) {
4157
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "TagLib::ID3v2::FrameFactory const *","setID3v2FrameFactory", 2, argv[0] ));
4158
+ }
4159
+ arg2 = reinterpret_cast< TagLib::ID3v2::FrameFactory * >(argp2);
4160
+ (arg1)->setID3v2FrameFactory((TagLib::ID3v2::FrameFactory const *)arg2);
4161
+ return Qnil;
4162
+ fail:
4163
+ return Qnil;
4164
+ }
4165
+
4166
+
4167
+ SWIGINTERN VALUE
4168
+ _wrap_File_first_frame_offset(int argc, VALUE *argv, VALUE self) {
4169
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
4170
+ void *argp1 = 0 ;
4171
+ int res1 = 0 ;
4172
+ long result;
4173
+ VALUE vresult = Qnil;
4174
+
4175
+ if ((argc < 0) || (argc > 0)) {
4176
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
4177
+ }
4178
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
4179
+ if (!SWIG_IsOK(res1)) {
4180
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","firstFrameOffset", 1, self ));
4181
+ }
4182
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
4183
+ result = (long)(arg1)->firstFrameOffset();
4184
+ vresult = SWIG_From_long(static_cast< long >(result));
4185
+ return vresult;
4186
+ fail:
4187
+ return Qnil;
4188
+ }
4189
+
4190
+
4191
+ SWIGINTERN VALUE
4192
+ _wrap_File_next_frame_offset(int argc, VALUE *argv, VALUE self) {
4193
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
4194
+ long arg2 ;
4195
+ void *argp1 = 0 ;
4196
+ int res1 = 0 ;
4197
+ long val2 ;
4198
+ int ecode2 = 0 ;
4199
+ long result;
4200
+ VALUE vresult = Qnil;
4201
+
4202
+ if ((argc < 1) || (argc > 1)) {
4203
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
4204
+ }
4205
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
4206
+ if (!SWIG_IsOK(res1)) {
4207
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","nextFrameOffset", 1, self ));
4208
+ }
4209
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
4210
+ ecode2 = SWIG_AsVal_long(argv[0], &val2);
4211
+ if (!SWIG_IsOK(ecode2)) {
4212
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "long","nextFrameOffset", 2, argv[0] ));
4213
+ }
4214
+ arg2 = static_cast< long >(val2);
4215
+ result = (long)(arg1)->nextFrameOffset(arg2);
4216
+ vresult = SWIG_From_long(static_cast< long >(result));
4217
+ return vresult;
4218
+ fail:
4219
+ return Qnil;
4220
+ }
4221
+
4222
+
4223
+ SWIGINTERN VALUE
4224
+ _wrap_File_previous_frame_offset(int argc, VALUE *argv, VALUE self) {
4225
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
4226
+ long arg2 ;
4227
+ void *argp1 = 0 ;
4228
+ int res1 = 0 ;
4229
+ long val2 ;
4230
+ int ecode2 = 0 ;
4231
+ long result;
4232
+ VALUE vresult = Qnil;
4233
+
4234
+ if ((argc < 1) || (argc > 1)) {
4235
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
4236
+ }
4237
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
4238
+ if (!SWIG_IsOK(res1)) {
4239
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","previousFrameOffset", 1, self ));
4240
+ }
4241
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
4242
+ ecode2 = SWIG_AsVal_long(argv[0], &val2);
4243
+ if (!SWIG_IsOK(ecode2)) {
4244
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "long","previousFrameOffset", 2, argv[0] ));
4245
+ }
4246
+ arg2 = static_cast< long >(val2);
4247
+ result = (long)(arg1)->previousFrameOffset(arg2);
4248
+ vresult = SWIG_From_long(static_cast< long >(result));
4249
+ return vresult;
4250
+ fail:
4251
+ return Qnil;
4252
+ }
4253
+
4254
+
4255
+ SWIGINTERN VALUE
4256
+ _wrap_File_last_frame_offset(int argc, VALUE *argv, VALUE self) {
4257
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
4258
+ void *argp1 = 0 ;
4259
+ int res1 = 0 ;
4260
+ long result;
4261
+ VALUE vresult = Qnil;
4262
+
4263
+ if ((argc < 0) || (argc > 0)) {
4264
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
4265
+ }
4266
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
4267
+ if (!SWIG_IsOK(res1)) {
4268
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","lastFrameOffset", 1, self ));
4269
+ }
4270
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
4271
+ result = (long)(arg1)->lastFrameOffset();
4272
+ vresult = SWIG_From_long(static_cast< long >(result));
4273
+ return vresult;
4274
+ fail:
4275
+ return Qnil;
4276
+ }
4277
+
4278
+
4279
+ SWIGINTERN VALUE
4280
+ _wrap_File_close(int argc, VALUE *argv, VALUE self) {
4281
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
4282
+ void *argp1 = 0 ;
4283
+ int res1 = 0 ;
4284
+
4285
+ if ((argc < 0) || (argc > 0)) {
4286
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
4287
+ }
4288
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
4289
+ if (!SWIG_IsOK(res1)) {
4290
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","close", 1, self ));
4291
+ }
4292
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
4293
+ TagLib_MPEG_File_close(arg1);
4294
+ return Qnil;
4295
+ fail:
4296
+ return Qnil;
4297
+ }
4298
+
4299
+
4300
+
4301
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
4302
+
4303
+ static void *_p_TagLib__MPEG__FileTo_p_TagLib__File(void *x, int *SWIGUNUSEDPARM(newmemory)) {
4304
+ return (void *)((TagLib::File *) ((TagLib::MPEG::File *) x));
4305
+ }
4306
+ static void *_p_TagLib__MPEG__PropertiesTo_p_TagLib__AudioProperties(void *x, int *SWIGUNUSEDPARM(newmemory)) {
4307
+ return (void *)((TagLib::AudioProperties *) ((TagLib::MPEG::Properties *) x));
4308
+ }
4309
+ static swig_type_info _swigt__p_TagLib__APE__Tag = {"_p_TagLib__APE__Tag", "TagLib::APE::Tag *", 0, 0, (void*)0, 0};
4310
+ static swig_type_info _swigt__p_TagLib__AudioProperties = {"_p_TagLib__AudioProperties", "TagLib::AudioProperties *", 0, 0, (void*)0, 0};
4311
+ static swig_type_info _swigt__p_TagLib__File = {"_p_TagLib__File", "TagLib::File *", 0, 0, (void*)0, 0};
4312
+ static swig_type_info _swigt__p_TagLib__ID3v1__Tag = {"_p_TagLib__ID3v1__Tag", "TagLib::ID3v1::Tag *", 0, 0, (void*)0, 0};
4313
+ static swig_type_info _swigt__p_TagLib__ID3v2__FrameFactory = {"_p_TagLib__ID3v2__FrameFactory", "TagLib::ID3v2::FrameFactory *", 0, 0, (void*)0, 0};
4314
+ static swig_type_info _swigt__p_TagLib__ID3v2__Tag = {"_p_TagLib__ID3v2__Tag", "TagLib::ID3v2::Tag *", 0, 0, (void*)0, 0};
4315
+ static swig_type_info _swigt__p_TagLib__MPEG__File = {"_p_TagLib__MPEG__File", "TagLib::MPEG::File *", 0, 0, (void*)0, 0};
4316
+ static swig_type_info _swigt__p_TagLib__MPEG__Header = {"_p_TagLib__MPEG__Header", "TagLib::MPEG::Header *", 0, 0, (void*)0, 0};
4317
+ static swig_type_info _swigt__p_TagLib__MPEG__Properties = {"_p_TagLib__MPEG__Properties", "TagLib::MPEG::Properties *", 0, 0, (void*)0, 0};
4318
+ static swig_type_info _swigt__p_TagLib__MPEG__XingHeader = {"_p_TagLib__MPEG__XingHeader", "TagLib::MPEG::XingHeader *", 0, 0, (void*)0, 0};
4319
+ static swig_type_info _swigt__p_TagLib__Tag = {"_p_TagLib__Tag", "TagLib::Tag *", 0, 0, (void*)0, 0};
4320
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
4321
+ static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "TagLib::uchar *|unsigned char *", 0, 0, (void*)0, 0};
4322
+ static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *|TagLib::uint *", 0, 0, (void*)0, 0};
4323
+ static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "TagLib::ulong *|unsigned long *", 0, 0, (void*)0, 0};
4324
+ static swig_type_info _swigt__p_wchar_t = {"_p_wchar_t", "TagLib::wchar *|wchar_t *", 0, 0, (void*)0, 0};
4325
+
4326
+ static swig_type_info *swig_type_initial[] = {
4327
+ &_swigt__p_TagLib__APE__Tag,
4328
+ &_swigt__p_TagLib__AudioProperties,
4329
+ &_swigt__p_TagLib__File,
4330
+ &_swigt__p_TagLib__ID3v1__Tag,
4331
+ &_swigt__p_TagLib__ID3v2__FrameFactory,
4332
+ &_swigt__p_TagLib__ID3v2__Tag,
4333
+ &_swigt__p_TagLib__MPEG__File,
4334
+ &_swigt__p_TagLib__MPEG__Header,
4335
+ &_swigt__p_TagLib__MPEG__Properties,
4336
+ &_swigt__p_TagLib__MPEG__XingHeader,
4337
+ &_swigt__p_TagLib__Tag,
4338
+ &_swigt__p_char,
4339
+ &_swigt__p_unsigned_char,
4340
+ &_swigt__p_unsigned_int,
4341
+ &_swigt__p_unsigned_long,
4342
+ &_swigt__p_wchar_t,
4343
+ };
4344
+
4345
+ static swig_cast_info _swigc__p_TagLib__APE__Tag[] = { {&_swigt__p_TagLib__APE__Tag, 0, 0, 0},{0, 0, 0, 0}};
4346
+ static swig_cast_info _swigc__p_TagLib__AudioProperties[] = { {&_swigt__p_TagLib__AudioProperties, 0, 0, 0}, {&_swigt__p_TagLib__MPEG__Properties, _p_TagLib__MPEG__PropertiesTo_p_TagLib__AudioProperties, 0, 0},{0, 0, 0, 0}};
4347
+ static swig_cast_info _swigc__p_TagLib__File[] = { {&_swigt__p_TagLib__MPEG__File, _p_TagLib__MPEG__FileTo_p_TagLib__File, 0, 0}, {&_swigt__p_TagLib__File, 0, 0, 0},{0, 0, 0, 0}};
4348
+ static swig_cast_info _swigc__p_TagLib__ID3v1__Tag[] = { {&_swigt__p_TagLib__ID3v1__Tag, 0, 0, 0},{0, 0, 0, 0}};
4349
+ static swig_cast_info _swigc__p_TagLib__ID3v2__FrameFactory[] = { {&_swigt__p_TagLib__ID3v2__FrameFactory, 0, 0, 0},{0, 0, 0, 0}};
4350
+ static swig_cast_info _swigc__p_TagLib__ID3v2__Tag[] = { {&_swigt__p_TagLib__ID3v2__Tag, 0, 0, 0},{0, 0, 0, 0}};
4351
+ static swig_cast_info _swigc__p_TagLib__MPEG__File[] = { {&_swigt__p_TagLib__MPEG__File, 0, 0, 0},{0, 0, 0, 0}};
4352
+ static swig_cast_info _swigc__p_TagLib__MPEG__Header[] = { {&_swigt__p_TagLib__MPEG__Header, 0, 0, 0},{0, 0, 0, 0}};
4353
+ static swig_cast_info _swigc__p_TagLib__MPEG__Properties[] = { {&_swigt__p_TagLib__MPEG__Properties, 0, 0, 0},{0, 0, 0, 0}};
4354
+ static swig_cast_info _swigc__p_TagLib__MPEG__XingHeader[] = { {&_swigt__p_TagLib__MPEG__XingHeader, 0, 0, 0},{0, 0, 0, 0}};
4355
+ static swig_cast_info _swigc__p_TagLib__Tag[] = { {&_swigt__p_TagLib__Tag, 0, 0, 0},{0, 0, 0, 0}};
4356
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
4357
+ static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
4358
+ static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
4359
+ static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
4360
+ static swig_cast_info _swigc__p_wchar_t[] = { {&_swigt__p_wchar_t, 0, 0, 0},{0, 0, 0, 0}};
4361
+
4362
+ static swig_cast_info *swig_cast_initial[] = {
4363
+ _swigc__p_TagLib__APE__Tag,
4364
+ _swigc__p_TagLib__AudioProperties,
4365
+ _swigc__p_TagLib__File,
4366
+ _swigc__p_TagLib__ID3v1__Tag,
4367
+ _swigc__p_TagLib__ID3v2__FrameFactory,
4368
+ _swigc__p_TagLib__ID3v2__Tag,
4369
+ _swigc__p_TagLib__MPEG__File,
4370
+ _swigc__p_TagLib__MPEG__Header,
4371
+ _swigc__p_TagLib__MPEG__Properties,
4372
+ _swigc__p_TagLib__MPEG__XingHeader,
4373
+ _swigc__p_TagLib__Tag,
4374
+ _swigc__p_char,
4375
+ _swigc__p_unsigned_char,
4376
+ _swigc__p_unsigned_int,
4377
+ _swigc__p_unsigned_long,
4378
+ _swigc__p_wchar_t,
4379
+ };
4380
+
4381
+
4382
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
4383
+
4384
+ /* -----------------------------------------------------------------------------
4385
+ * Type initialization:
4386
+ * This problem is tough by the requirement that no dynamic
4387
+ * memory is used. Also, since swig_type_info structures store pointers to
4388
+ * swig_cast_info structures and swig_cast_info structures store pointers back
4389
+ * to swig_type_info structures, we need some lookup code at initialization.
4390
+ * The idea is that swig generates all the structures that are needed.
4391
+ * The runtime then collects these partially filled structures.
4392
+ * The SWIG_InitializeModule function takes these initial arrays out of
4393
+ * swig_module, and does all the lookup, filling in the swig_module.types
4394
+ * array with the correct data and linking the correct swig_cast_info
4395
+ * structures together.
4396
+ *
4397
+ * The generated swig_type_info structures are assigned staticly to an initial
4398
+ * array. We just loop through that array, and handle each type individually.
4399
+ * First we lookup if this type has been already loaded, and if so, use the
4400
+ * loaded structure instead of the generated one. Then we have to fill in the
4401
+ * cast linked list. The cast data is initially stored in something like a
4402
+ * two-dimensional array. Each row corresponds to a type (there are the same
4403
+ * number of rows as there are in the swig_type_initial array). Each entry in
4404
+ * a column is one of the swig_cast_info structures for that type.
4405
+ * The cast_initial array is actually an array of arrays, because each row has
4406
+ * a variable number of columns. So to actually build the cast linked list,
4407
+ * we find the array of casts associated with the type, and loop through it
4408
+ * adding the casts to the list. The one last trick we need to do is making
4409
+ * sure the type pointer in the swig_cast_info struct is correct.
4410
+ *
4411
+ * First off, we lookup the cast->type name to see if it is already loaded.
4412
+ * There are three cases to handle:
4413
+ * 1) If the cast->type has already been loaded AND the type we are adding
4414
+ * casting info to has not been loaded (it is in this module), THEN we
4415
+ * replace the cast->type pointer with the type pointer that has already
4416
+ * been loaded.
4417
+ * 2) If BOTH types (the one we are adding casting info to, and the
4418
+ * cast->type) are loaded, THEN the cast info has already been loaded by
4419
+ * the previous module so we just ignore it.
4420
+ * 3) Finally, if cast->type has not already been loaded, then we add that
4421
+ * swig_cast_info to the linked list (because the cast->type) pointer will
4422
+ * be correct.
4423
+ * ----------------------------------------------------------------------------- */
4424
+
4425
+ #ifdef __cplusplus
4426
+ extern "C" {
4427
+ #if 0
4428
+ } /* c-mode */
4429
+ #endif
4430
+ #endif
4431
+
4432
+ #if 0
4433
+ #define SWIGRUNTIME_DEBUG
4434
+ #endif
4435
+
4436
+
4437
+ SWIGRUNTIME void
4438
+ SWIG_InitializeModule(void *clientdata) {
4439
+ size_t i;
4440
+ swig_module_info *module_head, *iter;
4441
+ int found, init;
4442
+
4443
+ clientdata = clientdata;
4444
+
4445
+ /* check to see if the circular list has been setup, if not, set it up */
4446
+ if (swig_module.next==0) {
4447
+ /* Initialize the swig_module */
4448
+ swig_module.type_initial = swig_type_initial;
4449
+ swig_module.cast_initial = swig_cast_initial;
4450
+ swig_module.next = &swig_module;
4451
+ init = 1;
4452
+ } else {
4453
+ init = 0;
4454
+ }
4455
+
4456
+ /* Try and load any already created modules */
4457
+ module_head = SWIG_GetModule(clientdata);
4458
+ if (!module_head) {
4459
+ /* This is the first module loaded for this interpreter */
4460
+ /* so set the swig module into the interpreter */
4461
+ SWIG_SetModule(clientdata, &swig_module);
4462
+ module_head = &swig_module;
4463
+ } else {
4464
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
4465
+ found=0;
4466
+ iter=module_head;
4467
+ do {
4468
+ if (iter==&swig_module) {
4469
+ found=1;
4470
+ break;
4471
+ }
4472
+ iter=iter->next;
4473
+ } while (iter!= module_head);
4474
+
4475
+ /* if the is found in the list, then all is done and we may leave */
4476
+ if (found) return;
4477
+ /* otherwise we must add out module into the list */
4478
+ swig_module.next = module_head->next;
4479
+ module_head->next = &swig_module;
4480
+ }
4481
+
4482
+ /* When multiple interpeters are used, a module could have already been initialized in
4483
+ a different interpreter, but not yet have a pointer in this interpreter.
4484
+ In this case, we do not want to continue adding types... everything should be
4485
+ set up already */
4486
+ if (init == 0) return;
4487
+
4488
+ /* Now work on filling in swig_module.types */
4489
+ #ifdef SWIGRUNTIME_DEBUG
4490
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
4491
+ #endif
4492
+ for (i = 0; i < swig_module.size; ++i) {
4493
+ swig_type_info *type = 0;
4494
+ swig_type_info *ret;
4495
+ swig_cast_info *cast;
4496
+
4497
+ #ifdef SWIGRUNTIME_DEBUG
4498
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4499
+ #endif
4500
+
4501
+ /* if there is another module already loaded */
4502
+ if (swig_module.next != &swig_module) {
4503
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
4504
+ }
4505
+ if (type) {
4506
+ /* Overwrite clientdata field */
4507
+ #ifdef SWIGRUNTIME_DEBUG
4508
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
4509
+ #endif
4510
+ if (swig_module.type_initial[i]->clientdata) {
4511
+ type->clientdata = swig_module.type_initial[i]->clientdata;
4512
+ #ifdef SWIGRUNTIME_DEBUG
4513
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
4514
+ #endif
4515
+ }
4516
+ } else {
4517
+ type = swig_module.type_initial[i];
4518
+ }
4519
+
4520
+ /* Insert casting types */
4521
+ cast = swig_module.cast_initial[i];
4522
+ while (cast->type) {
4523
+
4524
+ /* Don't need to add information already in the list */
4525
+ ret = 0;
4526
+ #ifdef SWIGRUNTIME_DEBUG
4527
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
4528
+ #endif
4529
+ if (swig_module.next != &swig_module) {
4530
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
4531
+ #ifdef SWIGRUNTIME_DEBUG
4532
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
4533
+ #endif
4534
+ }
4535
+ if (ret) {
4536
+ if (type == swig_module.type_initial[i]) {
4537
+ #ifdef SWIGRUNTIME_DEBUG
4538
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
4539
+ #endif
4540
+ cast->type = ret;
4541
+ ret = 0;
4542
+ } else {
4543
+ /* Check for casting already in the list */
4544
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
4545
+ #ifdef SWIGRUNTIME_DEBUG
4546
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
4547
+ #endif
4548
+ if (!ocast) ret = 0;
4549
+ }
4550
+ }
4551
+
4552
+ if (!ret) {
4553
+ #ifdef SWIGRUNTIME_DEBUG
4554
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
4555
+ #endif
4556
+ if (type->cast) {
4557
+ type->cast->prev = cast;
4558
+ cast->next = type->cast;
4559
+ }
4560
+ type->cast = cast;
4561
+ }
4562
+ cast++;
4563
+ }
4564
+ /* Set entry in modules->types array equal to the type */
4565
+ swig_module.types[i] = type;
4566
+ }
4567
+ swig_module.types[i] = 0;
4568
+
4569
+ #ifdef SWIGRUNTIME_DEBUG
4570
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
4571
+ for (i = 0; i < swig_module.size; ++i) {
4572
+ int j = 0;
4573
+ swig_cast_info *cast = swig_module.cast_initial[i];
4574
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4575
+ while (cast->type) {
4576
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
4577
+ cast++;
4578
+ ++j;
4579
+ }
4580
+ printf("---- Total casts: %d\n",j);
4581
+ }
4582
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
4583
+ #endif
4584
+ }
4585
+
4586
+ /* This function will propagate the clientdata field of type to
4587
+ * any new swig_type_info structures that have been added into the list
4588
+ * of equivalent types. It is like calling
4589
+ * SWIG_TypeClientData(type, clientdata) a second time.
4590
+ */
4591
+ SWIGRUNTIME void
4592
+ SWIG_PropagateClientData(void) {
4593
+ size_t i;
4594
+ swig_cast_info *equiv;
4595
+ static int init_run = 0;
4596
+
4597
+ if (init_run) return;
4598
+ init_run = 1;
4599
+
4600
+ for (i = 0; i < swig_module.size; i++) {
4601
+ if (swig_module.types[i]->clientdata) {
4602
+ equiv = swig_module.types[i]->cast;
4603
+ while (equiv) {
4604
+ if (!equiv->converter) {
4605
+ if (equiv->type && !equiv->type->clientdata)
4606
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
4607
+ }
4608
+ equiv = equiv->next;
4609
+ }
4610
+ }
4611
+ }
4612
+ }
4613
+
4614
+ #ifdef __cplusplus
4615
+ #if 0
4616
+ { /* c-mode */
4617
+ #endif
4618
+ }
4619
+ #endif
4620
+
4621
+ /*
4622
+
4623
+ */
4624
+ #ifdef __cplusplus
4625
+ extern "C"
4626
+ #endif
4627
+ SWIGEXPORT void Init_taglib_mpeg(void) {
4628
+ size_t i;
4629
+
4630
+ SWIG_InitRuntime();
4631
+ mMPEG = rb_define_module("TagLib");
4632
+ mMPEG = rb_define_module_under(mMPEG, "MPEG");
4633
+
4634
+ SWIG_InitializeModule(0);
4635
+ for (i = 0; i < swig_module.size; i++) {
4636
+ SWIG_define_class(swig_module.types[i]);
4637
+ }
4638
+
4639
+ SWIG_RubyInitializeTrackings();
4640
+ rb_require("taglib_base");
4641
+
4642
+ SwigClassXingHeader.klass = rb_define_class_under(mMPEG, "XingHeader", rb_cObject);
4643
+ SWIG_TypeClientData(SWIGTYPE_p_TagLib__MPEG__XingHeader, (void *) &SwigClassXingHeader);
4644
+ rb_define_alloc_func(SwigClassXingHeader.klass, _wrap_XingHeader_allocate);
4645
+ rb_define_method(SwigClassXingHeader.klass, "initialize", VALUEFUNC(_wrap_new_XingHeader), -1);
4646
+ rb_define_method(SwigClassXingHeader.klass, "valid?", VALUEFUNC(_wrap_XingHeader_validq___), -1);
4647
+ rb_define_method(SwigClassXingHeader.klass, "total_frames", VALUEFUNC(_wrap_XingHeader_total_frames), -1);
4648
+ rb_define_method(SwigClassXingHeader.klass, "total_size", VALUEFUNC(_wrap_XingHeader_total_size), -1);
4649
+ rb_define_singleton_method(SwigClassXingHeader.klass, "xing_header_offset", VALUEFUNC(_wrap_XingHeader_xing_header_offset), -1);
4650
+ SwigClassXingHeader.mark = 0;
4651
+ SwigClassXingHeader.destroy = (void (*)(void *)) free_TagLib_MPEG_XingHeader;
4652
+ SwigClassXingHeader.trackObjects = 1;
4653
+
4654
+ SwigClassHeader.klass = rb_define_class_under(mMPEG, "Header", rb_cObject);
4655
+ SWIG_TypeClientData(SWIGTYPE_p_TagLib__MPEG__Header, (void *) &SwigClassHeader);
4656
+ rb_define_alloc_func(SwigClassHeader.klass, _wrap_Header_allocate);
4657
+ rb_define_method(SwigClassHeader.klass, "initialize", VALUEFUNC(_wrap_new_Header), -1);
4658
+ rb_define_method(SwigClassHeader.klass, "valid?", VALUEFUNC(_wrap_Header_validq___), -1);
4659
+ rb_define_const(SwigClassHeader.klass, "Version1", SWIG_From_int(static_cast< int >(TagLib::MPEG::Header::Version1)));
4660
+ rb_define_const(SwigClassHeader.klass, "Version2", SWIG_From_int(static_cast< int >(TagLib::MPEG::Header::Version2)));
4661
+ rb_define_const(SwigClassHeader.klass, "Version2_5", SWIG_From_int(static_cast< int >(TagLib::MPEG::Header::Version2_5)));
4662
+ rb_define_method(SwigClassHeader.klass, "version", VALUEFUNC(_wrap_Header_version), -1);
4663
+ rb_define_method(SwigClassHeader.klass, "layer", VALUEFUNC(_wrap_Header_layer), -1);
4664
+ rb_define_method(SwigClassHeader.klass, "protection_enabled", VALUEFUNC(_wrap_Header_protection_enabled), -1);
4665
+ rb_define_method(SwigClassHeader.klass, "bitrate", VALUEFUNC(_wrap_Header_bitrate), -1);
4666
+ rb_define_method(SwigClassHeader.klass, "sample_rate", VALUEFUNC(_wrap_Header_sample_rate), -1);
4667
+ rb_define_method(SwigClassHeader.klass, "padded?", VALUEFUNC(_wrap_Header_paddedq___), -1);
4668
+ rb_define_const(SwigClassHeader.klass, "Stereo", SWIG_From_int(static_cast< int >(TagLib::MPEG::Header::Stereo)));
4669
+ rb_define_const(SwigClassHeader.klass, "JointStereo", SWIG_From_int(static_cast< int >(TagLib::MPEG::Header::JointStereo)));
4670
+ rb_define_const(SwigClassHeader.klass, "DualChannel", SWIG_From_int(static_cast< int >(TagLib::MPEG::Header::DualChannel)));
4671
+ rb_define_const(SwigClassHeader.klass, "SingleChannel", SWIG_From_int(static_cast< int >(TagLib::MPEG::Header::SingleChannel)));
4672
+ rb_define_method(SwigClassHeader.klass, "channel_mode", VALUEFUNC(_wrap_Header_channel_mode), -1);
4673
+ rb_define_method(SwigClassHeader.klass, "copyrighted?", VALUEFUNC(_wrap_Header_copyrightedq___), -1);
4674
+ rb_define_method(SwigClassHeader.klass, "original?", VALUEFUNC(_wrap_Header_originalq___), -1);
4675
+ rb_define_method(SwigClassHeader.klass, "frame_length", VALUEFUNC(_wrap_Header_frame_length), -1);
4676
+ rb_define_method(SwigClassHeader.klass, "samples_per_frame", VALUEFUNC(_wrap_Header_samples_per_frame), -1);
4677
+ SwigClassHeader.mark = 0;
4678
+ SwigClassHeader.destroy = (void (*)(void *)) free_TagLib_MPEG_Header;
4679
+ SwigClassHeader.trackObjects = 1;
4680
+
4681
+ SwigClassProperties.klass = rb_define_class_under(mMPEG, "Properties", ((swig_class *) SWIGTYPE_p_TagLib__AudioProperties->clientdata)->klass);
4682
+ SWIG_TypeClientData(SWIGTYPE_p_TagLib__MPEG__Properties, (void *) &SwigClassProperties);
4683
+ rb_define_alloc_func(SwigClassProperties.klass, _wrap_Properties_allocate);
4684
+ rb_define_method(SwigClassProperties.klass, "initialize", VALUEFUNC(_wrap_new_Properties), -1);
4685
+ rb_define_method(SwigClassProperties.klass, "length", VALUEFUNC(_wrap_Properties_length), -1);
4686
+ rb_define_method(SwigClassProperties.klass, "bitrate", VALUEFUNC(_wrap_Properties_bitrate), -1);
4687
+ rb_define_method(SwigClassProperties.klass, "sample_rate", VALUEFUNC(_wrap_Properties_sample_rate), -1);
4688
+ rb_define_method(SwigClassProperties.klass, "channels", VALUEFUNC(_wrap_Properties_channels), -1);
4689
+ rb_define_method(SwigClassProperties.klass, "xing_header", VALUEFUNC(_wrap_Properties_xing_header), -1);
4690
+ rb_define_method(SwigClassProperties.klass, "version", VALUEFUNC(_wrap_Properties_version), -1);
4691
+ rb_define_method(SwigClassProperties.klass, "layer", VALUEFUNC(_wrap_Properties_layer), -1);
4692
+ rb_define_method(SwigClassProperties.klass, "protection_enabled", VALUEFUNC(_wrap_Properties_protection_enabled), -1);
4693
+ rb_define_method(SwigClassProperties.klass, "channel_mode", VALUEFUNC(_wrap_Properties_channel_mode), -1);
4694
+ rb_define_method(SwigClassProperties.klass, "copyrighted?", VALUEFUNC(_wrap_Properties_copyrightedq___), -1);
4695
+ rb_define_method(SwigClassProperties.klass, "original?", VALUEFUNC(_wrap_Properties_originalq___), -1);
4696
+ SwigClassProperties.mark = 0;
4697
+ SwigClassProperties.destroy = (void (*)(void *)) free_TagLib_MPEG_Properties;
4698
+ SwigClassProperties.trackObjects = 1;
4699
+
4700
+ SwigClassFile.klass = rb_define_class_under(mMPEG, "File", ((swig_class *) SWIGTYPE_p_TagLib__File->clientdata)->klass);
4701
+ SWIG_TypeClientData(SWIGTYPE_p_TagLib__MPEG__File, (void *) &SwigClassFile);
4702
+ rb_define_alloc_func(SwigClassFile.klass, _wrap_File_allocate);
4703
+ rb_define_method(SwigClassFile.klass, "initialize", VALUEFUNC(_wrap_new_File), -1);
4704
+ rb_define_const(SwigClassFile.klass, "NoTags", SWIG_From_int(static_cast< int >(TagLib::MPEG::File::NoTags)));
4705
+ rb_define_const(SwigClassFile.klass, "ID3v1", SWIG_From_int(static_cast< int >(TagLib::MPEG::File::ID3v1)));
4706
+ rb_define_const(SwigClassFile.klass, "ID3v2", SWIG_From_int(static_cast< int >(TagLib::MPEG::File::ID3v2)));
4707
+ rb_define_const(SwigClassFile.klass, "APE", SWIG_From_int(static_cast< int >(TagLib::MPEG::File::APE)));
4708
+ rb_define_const(SwigClassFile.klass, "AllTags", SWIG_From_int(static_cast< int >(TagLib::MPEG::File::AllTags)));
4709
+ rb_define_method(SwigClassFile.klass, "tag", VALUEFUNC(_wrap_File_tag), -1);
4710
+ rb_define_method(SwigClassFile.klass, "audio_properties", VALUEFUNC(_wrap_File_audio_properties), -1);
4711
+ rb_define_method(SwigClassFile.klass, "save", VALUEFUNC(_wrap_File_save), -1);
4712
+ rb_define_method(SwigClassFile.klass, "id3v2_tag", VALUEFUNC(_wrap_File_id3v2_tag), -1);
4713
+ rb_define_method(SwigClassFile.klass, "id3v1_tag", VALUEFUNC(_wrap_File_id3v1_tag), -1);
4714
+ rb_define_method(SwigClassFile.klass, "apetag", VALUEFUNC(_wrap_File_apetag), -1);
4715
+ rb_define_method(SwigClassFile.klass, "strip", VALUEFUNC(_wrap_File_strip), -1);
4716
+ rb_define_method(SwigClassFile.klass, "set_id3v2_frame_factory", VALUEFUNC(_wrap_File_set_id3v2_frame_factory), -1);
4717
+ rb_define_method(SwigClassFile.klass, "first_frame_offset", VALUEFUNC(_wrap_File_first_frame_offset), -1);
4718
+ rb_define_method(SwigClassFile.klass, "next_frame_offset", VALUEFUNC(_wrap_File_next_frame_offset), -1);
4719
+ rb_define_method(SwigClassFile.klass, "previous_frame_offset", VALUEFUNC(_wrap_File_previous_frame_offset), -1);
4720
+ rb_define_method(SwigClassFile.klass, "last_frame_offset", VALUEFUNC(_wrap_File_last_frame_offset), -1);
4721
+ rb_define_method(SwigClassFile.klass, "close", VALUEFUNC(_wrap_File_close), -1);
4722
+ SwigClassFile.mark = 0;
4723
+ SwigClassFile.destroy = (void (*)(void *)) free_taglib_mpeg_file;
4724
+ SwigClassFile.trackObjects = 1;
4725
+ }
4726
+