taglib-ruby 0.6.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +1 -1
  3. data/{CHANGES.md → CHANGELOG.md} +46 -11
  4. data/README.md +61 -17
  5. data/Rakefile +12 -3
  6. data/docs/taglib/aiff.rb +95 -0
  7. data/docs/taglib/base.rb +30 -2
  8. data/docs/taglib/flac.rb +60 -4
  9. data/docs/taglib/id3v1.rb +29 -0
  10. data/docs/taglib/id3v2.rb +22 -3
  11. data/docs/taglib/mp4.rb +124 -13
  12. data/docs/taglib/mpeg.rb +30 -1
  13. data/docs/taglib/ogg.rb +47 -5
  14. data/docs/taglib/riff.rb +3 -0
  15. data/docs/taglib/vorbis.rb +1 -1
  16. data/docs/taglib/wav.rb +116 -0
  17. data/ext/extconf_common.rb +24 -3
  18. data/ext/taglib_aiff/extconf.rb +4 -0
  19. data/ext/taglib_aiff/taglib_aiff.i +84 -0
  20. data/ext/taglib_aiff/taglib_aiff_wrap.cxx +3111 -0
  21. data/ext/taglib_base/includes.i +34 -5
  22. data/ext/taglib_base/taglib_base.i +42 -2
  23. data/ext/taglib_base/taglib_base_wrap.cxx +226 -186
  24. data/ext/taglib_flac/taglib_flac.i +21 -18
  25. data/ext/taglib_flac/taglib_flac_wrap.cxx +519 -955
  26. data/ext/taglib_flac_picture/extconf.rb +4 -0
  27. data/ext/taglib_flac_picture/includes.i +15 -0
  28. data/ext/taglib_flac_picture/taglib_flac_picture.i +15 -0
  29. data/ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx +3087 -0
  30. data/ext/taglib_id3v1/taglib_id3v1.i +19 -0
  31. data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +391 -193
  32. data/ext/taglib_id3v2/relativevolumeframe.i +4 -17
  33. data/ext/taglib_id3v2/taglib_id3v2.i +72 -2
  34. data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +3051 -1113
  35. data/ext/taglib_mp4/taglib_mp4.i +101 -20
  36. data/ext/taglib_mp4/taglib_mp4_wrap.cxx +1088 -282
  37. data/ext/taglib_mpeg/taglib_mpeg.i +11 -16
  38. data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +646 -317
  39. data/ext/taglib_ogg/taglib_ogg.i +11 -0
  40. data/ext/taglib_ogg/taglib_ogg_wrap.cxx +478 -192
  41. data/ext/taglib_vorbis/taglib_vorbis.i +8 -0
  42. data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +202 -156
  43. data/ext/taglib_wav/extconf.rb +4 -0
  44. data/ext/taglib_wav/taglib_wav.i +90 -0
  45. data/ext/taglib_wav/taglib_wav_wrap.cxx +3423 -0
  46. data/lib/taglib.rb +2 -0
  47. data/lib/taglib/aiff.rb +7 -0
  48. data/lib/taglib/mp4.rb +2 -1
  49. data/lib/taglib/version.rb +2 -2
  50. data/lib/taglib/wav.rb +11 -0
  51. data/taglib-ruby.gemspec +42 -8
  52. data/tasks/ext.rake +48 -20
  53. data/tasks/gemspec_check.rake +1 -1
  54. data/tasks/swig.rake +36 -2
  55. data/test/aiff_examples_test.rb +39 -0
  56. data/test/aiff_file_test.rb +103 -0
  57. data/test/aiff_file_write_test.rb +88 -0
  58. data/test/data/Makefile +8 -2
  59. data/test/data/aiff-sample.aiff +0 -0
  60. data/test/data/flac_nopic.flac +0 -0
  61. data/test/data/vorbis-create.cpp +20 -1
  62. data/test/data/vorbis.oga +0 -0
  63. data/test/data/wav-create.cpp +55 -0
  64. data/test/data/wav-dump.cpp +74 -0
  65. data/test/data/wav-sample.wav +0 -0
  66. data/test/file_test.rb +21 -0
  67. data/test/fileref_properties_test.rb +1 -1
  68. data/test/flac_file_test.rb +45 -30
  69. data/test/flac_picture_memory_test.rb +43 -0
  70. data/test/id3v1_genres_test.rb +23 -0
  71. data/test/id3v1_tag_test.rb +1 -0
  72. data/test/id3v2_frames_test.rb +64 -0
  73. data/test/id3v2_tag_test.rb +6 -6
  74. data/test/id3v2_unknown_frames_test.rb +30 -0
  75. data/test/id3v2_write_test.rb +10 -13
  76. data/test/mp4_file_test.rb +33 -4
  77. data/test/mp4_file_write_test.rb +5 -5
  78. data/test/mp4_items_test.rb +83 -29
  79. data/test/mpeg_file_test.rb +120 -7
  80. data/test/vorbis_file_test.rb +2 -2
  81. data/test/vorbis_tag_test.rb +61 -7
  82. data/test/wav_examples_test.rb +42 -0
  83. data/test/wav_file_test.rb +108 -0
  84. data/test/wav_file_write_test.rb +113 -0
  85. metadata +86 -56
@@ -0,0 +1,4 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..'))
2
+ require 'extconf_common'
3
+
4
+ create_makefile('taglib_wav')
@@ -0,0 +1,90 @@
1
+ %module "TagLib::RIFF::WAV"
2
+ %{
3
+ #include <taglib/taglib.h>
4
+ #include <taglib/wavfile.h>
5
+ #include <taglib/wavproperties.h>
6
+ #include <taglib/id3v2tag.h>
7
+ using namespace TagLib::RIFF;
8
+ %}
9
+
10
+ %include "../taglib_base/includes.i"
11
+ %import(module="taglib_base") "../taglib_base/taglib_base.i"
12
+
13
+ // Deprecated
14
+ %ignore TagLib::RIFF::WAV::Properties::Properties(const ByteVector&, ReadStyle);
15
+ %ignore TagLib::RIFF::WAV::Properties::Properties(const ByteVector&, unsigned int, ReadStyle);
16
+ %ignore TagLib::RIFF::WAV::Properties::length;
17
+ %ignore TagLib::RIFF::WAV::Properties::sampleWidth;
18
+
19
+ %include <taglib/wavproperties.h>
20
+
21
+ %freefunc TagLib::RIFF::WAV::File "free_taglib_riff_wav_file";
22
+
23
+ namespace TagLib {
24
+ namespace ID3v2 {
25
+ class Tag;
26
+ }
27
+ }
28
+
29
+ // Ignore IOStream and all the constructors using it.
30
+ %ignore IOStream;
31
+ %ignore TagLib::RIFF::WAV::File::File(IOStream *, bool, Properties::ReadStyle);
32
+ %ignore TagLib::RIFF::WAV::File::File(IOStream *, bool);
33
+ %ignore TagLib::RIFF::WAV::File::File(IOStream *);
34
+
35
+ // Ignore the unified property interface.
36
+ %ignore TagLib::RIFF::WAV::File::properties;
37
+ %ignore TagLib::RIFF::WAV::File::setProperties;
38
+ %ignore TagLib::RIFF::WAV::File::removeUnsupportedProperties;
39
+
40
+ %ignore TagLib::RIFF::WAV::File::InfoTag;
41
+
42
+ %rename(id3v2_tag) TagLib::RIFF::WAV::File::ID3v2Tag;
43
+ %rename("id3v2_tag?") TagLib::RIFF::WAV::File::hasID3v2Tag;
44
+ %rename("info_tag?") TagLib::RIFF::WAV::File::hasInfoTag;
45
+
46
+ %include <taglib/wavfile.h>
47
+
48
+ // Unlink Ruby objects from the deleted C++ objects. Otherwise Ruby code
49
+ // that calls a method on a tag after the file is deleted segfaults.
50
+ %begin %{
51
+ static void free_taglib_riff_wav_file(void *ptr);
52
+ %}
53
+ %header %{
54
+ static void free_taglib_riff_wav_file(void *ptr) {
55
+ TagLib::RIFF::WAV::File *file = (TagLib::RIFF::WAV::File *) ptr;
56
+
57
+ TagLib::ID3v2::Tag *id3v2tag = file->tag();
58
+ if (id3v2tag) {
59
+ TagLib::ID3v2::FrameList frames = id3v2tag->frameList();
60
+ for (TagLib::ID3v2::FrameList::ConstIterator it = frames.begin(); it != frames.end(); it++) {
61
+ TagLib::ID3v2::Frame *frame = (*it);
62
+ SWIG_RubyUnlinkObjects(frame);
63
+ SWIG_RubyRemoveTracking(frame);
64
+ }
65
+
66
+ SWIG_RubyUnlinkObjects(id3v2tag);
67
+ SWIG_RubyRemoveTracking(id3v2tag);
68
+ }
69
+
70
+ TagLib::RIFF::WAV::Properties *properties = file->audioProperties();
71
+ if (properties) {
72
+ SWIG_RubyUnlinkObjects(properties);
73
+ SWIG_RubyRemoveTracking(properties);
74
+ }
75
+
76
+ SWIG_RubyUnlinkObjects(ptr);
77
+ SWIG_RubyRemoveTracking(ptr);
78
+
79
+ delete file;
80
+ }
81
+ %}
82
+
83
+ %extend TagLib::RIFF::WAV::File {
84
+ void close() {
85
+ free_taglib_riff_wav_file($self);
86
+ }
87
+ }
88
+
89
+
90
+ // vim: set filetype=cpp sw=2 ts=2 expandtab:
@@ -0,0 +1,3423 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 3.0.7
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_riff_wav_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
+ /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
149
+ #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
150
+ # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
151
+ #endif
152
+
153
+ /* Intel's compiler complains if a variable which was never initialised is
154
+ * cast to void, which is a common idiom which we use to indicate that we
155
+ * are aware a variable isn't used. So we just silence that warning.
156
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
157
+ */
158
+ #ifdef __INTEL_COMPILER
159
+ # pragma warning disable 592
160
+ #endif
161
+
162
+ /* -----------------------------------------------------------------------------
163
+ * This section contains generic SWIG labels for method/variable
164
+ * declarations/attributes, and other compiler dependent labels.
165
+ * ----------------------------------------------------------------------------- */
166
+
167
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
168
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
169
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
170
+ # define SWIGTEMPLATEDISAMBIGUATOR template
171
+ # elif defined(__HP_aCC)
172
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
173
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
174
+ # define SWIGTEMPLATEDISAMBIGUATOR template
175
+ # else
176
+ # define SWIGTEMPLATEDISAMBIGUATOR
177
+ # endif
178
+ #endif
179
+
180
+ /* inline attribute */
181
+ #ifndef SWIGINLINE
182
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
183
+ # define SWIGINLINE inline
184
+ # else
185
+ # define SWIGINLINE
186
+ # endif
187
+ #endif
188
+
189
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
190
+ #ifndef SWIGUNUSED
191
+ # if defined(__GNUC__)
192
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
193
+ # define SWIGUNUSED __attribute__ ((__unused__))
194
+ # else
195
+ # define SWIGUNUSED
196
+ # endif
197
+ # elif defined(__ICC)
198
+ # define SWIGUNUSED __attribute__ ((__unused__))
199
+ # else
200
+ # define SWIGUNUSED
201
+ # endif
202
+ #endif
203
+
204
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
205
+ # if defined(_MSC_VER)
206
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
207
+ # endif
208
+ #endif
209
+
210
+ #ifndef SWIGUNUSEDPARM
211
+ # ifdef __cplusplus
212
+ # define SWIGUNUSEDPARM(p)
213
+ # else
214
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
215
+ # endif
216
+ #endif
217
+
218
+ /* internal SWIG method */
219
+ #ifndef SWIGINTERN
220
+ # define SWIGINTERN static SWIGUNUSED
221
+ #endif
222
+
223
+ /* internal inline SWIG method */
224
+ #ifndef SWIGINTERNINLINE
225
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
226
+ #endif
227
+
228
+ /* exporting methods */
229
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
230
+ # ifndef GCC_HASCLASSVISIBILITY
231
+ # define GCC_HASCLASSVISIBILITY
232
+ # endif
233
+ #endif
234
+
235
+ #ifndef SWIGEXPORT
236
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
237
+ # if defined(STATIC_LINKED)
238
+ # define SWIGEXPORT
239
+ # else
240
+ # define SWIGEXPORT __declspec(dllexport)
241
+ # endif
242
+ # else
243
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
244
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
245
+ # else
246
+ # define SWIGEXPORT
247
+ # endif
248
+ # endif
249
+ #endif
250
+
251
+ /* calling conventions for Windows */
252
+ #ifndef SWIGSTDCALL
253
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
254
+ # define SWIGSTDCALL __stdcall
255
+ # else
256
+ # define SWIGSTDCALL
257
+ # endif
258
+ #endif
259
+
260
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
261
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
262
+ # define _CRT_SECURE_NO_DEPRECATE
263
+ #endif
264
+
265
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
266
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
267
+ # define _SCL_SECURE_NO_DEPRECATE
268
+ #endif
269
+
270
+ /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
271
+ #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
272
+ # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
273
+ #endif
274
+
275
+ /* Intel's compiler complains if a variable which was never initialised is
276
+ * cast to void, which is a common idiom which we use to indicate that we
277
+ * are aware a variable isn't used. So we just silence that warning.
278
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
279
+ */
280
+ #ifdef __INTEL_COMPILER
281
+ # pragma warning disable 592
282
+ #endif
283
+
284
+ /* -----------------------------------------------------------------------------
285
+ * swigrun.swg
286
+ *
287
+ * This file contains generic C API SWIG runtime support for pointer
288
+ * type checking.
289
+ * ----------------------------------------------------------------------------- */
290
+
291
+ /* This should only be incremented when either the layout of swig_type_info changes,
292
+ or for whatever reason, the runtime changes incompatibly */
293
+ #define SWIG_RUNTIME_VERSION "4"
294
+
295
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
296
+ #ifdef SWIG_TYPE_TABLE
297
+ # define SWIG_QUOTE_STRING(x) #x
298
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
299
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
300
+ #else
301
+ # define SWIG_TYPE_TABLE_NAME
302
+ #endif
303
+
304
+ /*
305
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
306
+ creating a static or dynamic library from the SWIG runtime code.
307
+ In 99.9% of the cases, SWIG just needs to declare them as 'static'.
308
+
309
+ But only do this if strictly necessary, ie, if you have problems
310
+ with your compiler or suchlike.
311
+ */
312
+
313
+ #ifndef SWIGRUNTIME
314
+ # define SWIGRUNTIME SWIGINTERN
315
+ #endif
316
+
317
+ #ifndef SWIGRUNTIMEINLINE
318
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
319
+ #endif
320
+
321
+ /* Generic buffer size */
322
+ #ifndef SWIG_BUFFER_SIZE
323
+ # define SWIG_BUFFER_SIZE 1024
324
+ #endif
325
+
326
+ /* Flags for pointer conversions */
327
+ #define SWIG_POINTER_DISOWN 0x1
328
+ #define SWIG_CAST_NEW_MEMORY 0x2
329
+
330
+ /* Flags for new pointer objects */
331
+ #define SWIG_POINTER_OWN 0x1
332
+
333
+
334
+ /*
335
+ Flags/methods for returning states.
336
+
337
+ The SWIG conversion methods, as ConvertPtr, return an integer
338
+ that tells if the conversion was successful or not. And if not,
339
+ an error code can be returned (see swigerrors.swg for the codes).
340
+
341
+ Use the following macros/flags to set or process the returning
342
+ states.
343
+
344
+ In old versions of SWIG, code such as the following was usually written:
345
+
346
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
347
+ // success code
348
+ } else {
349
+ //fail code
350
+ }
351
+
352
+ Now you can be more explicit:
353
+
354
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
355
+ if (SWIG_IsOK(res)) {
356
+ // success code
357
+ } else {
358
+ // fail code
359
+ }
360
+
361
+ which is the same really, but now you can also do
362
+
363
+ Type *ptr;
364
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
365
+ if (SWIG_IsOK(res)) {
366
+ // success code
367
+ if (SWIG_IsNewObj(res) {
368
+ ...
369
+ delete *ptr;
370
+ } else {
371
+ ...
372
+ }
373
+ } else {
374
+ // fail code
375
+ }
376
+
377
+ I.e., now SWIG_ConvertPtr can return new objects and you can
378
+ identify the case and take care of the deallocation. Of course that
379
+ also requires SWIG_ConvertPtr to return new result values, such as
380
+
381
+ int SWIG_ConvertPtr(obj, ptr,...) {
382
+ if (<obj is ok>) {
383
+ if (<need new object>) {
384
+ *ptr = <ptr to new allocated object>;
385
+ return SWIG_NEWOBJ;
386
+ } else {
387
+ *ptr = <ptr to old object>;
388
+ return SWIG_OLDOBJ;
389
+ }
390
+ } else {
391
+ return SWIG_BADOBJ;
392
+ }
393
+ }
394
+
395
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
396
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
397
+ SWIG errors code.
398
+
399
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
400
+ allows to return the 'cast rank', for example, if you have this
401
+
402
+ int food(double)
403
+ int fooi(int);
404
+
405
+ and you call
406
+
407
+ food(1) // cast rank '1' (1 -> 1.0)
408
+ fooi(1) // cast rank '0'
409
+
410
+ just use the SWIG_AddCast()/SWIG_CheckState()
411
+ */
412
+
413
+ #define SWIG_OK (0)
414
+ #define SWIG_ERROR (-1)
415
+ #define SWIG_IsOK(r) (r >= 0)
416
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
417
+
418
+ /* The CastRankLimit says how many bits are used for the cast rank */
419
+ #define SWIG_CASTRANKLIMIT (1 << 8)
420
+ /* The NewMask denotes the object was created (using new/malloc) */
421
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
422
+ /* The TmpMask is for in/out typemaps that use temporal objects */
423
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
424
+ /* Simple returning values */
425
+ #define SWIG_BADOBJ (SWIG_ERROR)
426
+ #define SWIG_OLDOBJ (SWIG_OK)
427
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
428
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
429
+ /* Check, add and del mask methods */
430
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
431
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
432
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
433
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
434
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
435
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
436
+
437
+ /* Cast-Rank Mode */
438
+ #if defined(SWIG_CASTRANK_MODE)
439
+ # ifndef SWIG_TypeRank
440
+ # define SWIG_TypeRank unsigned long
441
+ # endif
442
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
443
+ # define SWIG_MAXCASTRANK (2)
444
+ # endif
445
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
446
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
447
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
448
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
449
+ }
450
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
451
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
452
+ }
453
+ #else /* no cast-rank mode */
454
+ # define SWIG_AddCast(r) (r)
455
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
456
+ #endif
457
+
458
+
459
+ #include <string.h>
460
+
461
+ #ifdef __cplusplus
462
+ extern "C" {
463
+ #endif
464
+
465
+ typedef void *(*swig_converter_func)(void *, int *);
466
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
467
+
468
+ /* Structure to store information on one type */
469
+ typedef struct swig_type_info {
470
+ const char *name; /* mangled name of this type */
471
+ const char *str; /* human readable name of this type */
472
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
473
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
474
+ void *clientdata; /* language specific type data */
475
+ int owndata; /* flag if the structure owns the clientdata */
476
+ } swig_type_info;
477
+
478
+ /* Structure to store a type and conversion function used for casting */
479
+ typedef struct swig_cast_info {
480
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
481
+ swig_converter_func converter; /* function to cast the void pointers */
482
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
483
+ struct swig_cast_info *prev; /* pointer to the previous cast */
484
+ } swig_cast_info;
485
+
486
+ /* Structure used to store module information
487
+ * Each module generates one structure like this, and the runtime collects
488
+ * all of these structures and stores them in a circularly linked list.*/
489
+ typedef struct swig_module_info {
490
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
491
+ size_t size; /* Number of types in this module */
492
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
493
+ swig_type_info **type_initial; /* Array of initially generated type structures */
494
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
495
+ void *clientdata; /* Language specific module data */
496
+ } swig_module_info;
497
+
498
+ /*
499
+ Compare two type names skipping the space characters, therefore
500
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
501
+
502
+ Return 0 when the two name types are equivalent, as in
503
+ strncmp, but skipping ' '.
504
+ */
505
+ SWIGRUNTIME int
506
+ SWIG_TypeNameComp(const char *f1, const char *l1,
507
+ const char *f2, const char *l2) {
508
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
509
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
510
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
511
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
512
+ }
513
+ return (int)((l1 - f1) - (l2 - f2));
514
+ }
515
+
516
+ /*
517
+ Check type equivalence in a name list like <name1>|<name2>|...
518
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
519
+ */
520
+ SWIGRUNTIME int
521
+ SWIG_TypeCmp(const char *nb, const char *tb) {
522
+ int equiv = 1;
523
+ const char* te = tb + strlen(tb);
524
+ const char* ne = nb;
525
+ while (equiv != 0 && *ne) {
526
+ for (nb = ne; *ne; ++ne) {
527
+ if (*ne == '|') break;
528
+ }
529
+ equiv = SWIG_TypeNameComp(nb, ne, tb, te);
530
+ if (*ne) ++ne;
531
+ }
532
+ return equiv;
533
+ }
534
+
535
+ /*
536
+ Check type equivalence in a name list like <name1>|<name2>|...
537
+ Return 0 if not equal, 1 if equal
538
+ */
539
+ SWIGRUNTIME int
540
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
541
+ return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
542
+ }
543
+
544
+ /*
545
+ Check the typename
546
+ */
547
+ SWIGRUNTIME swig_cast_info *
548
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
549
+ if (ty) {
550
+ swig_cast_info *iter = ty->cast;
551
+ while (iter) {
552
+ if (strcmp(iter->type->name, c) == 0) {
553
+ if (iter == ty->cast)
554
+ return iter;
555
+ /* Move iter to the top of the linked list */
556
+ iter->prev->next = iter->next;
557
+ if (iter->next)
558
+ iter->next->prev = iter->prev;
559
+ iter->next = ty->cast;
560
+ iter->prev = 0;
561
+ if (ty->cast) ty->cast->prev = iter;
562
+ ty->cast = iter;
563
+ return iter;
564
+ }
565
+ iter = iter->next;
566
+ }
567
+ }
568
+ return 0;
569
+ }
570
+
571
+ /*
572
+ Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
573
+ */
574
+ SWIGRUNTIME swig_cast_info *
575
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
576
+ if (ty) {
577
+ swig_cast_info *iter = ty->cast;
578
+ while (iter) {
579
+ if (iter->type == from) {
580
+ if (iter == ty->cast)
581
+ return iter;
582
+ /* Move iter to the top of the linked list */
583
+ iter->prev->next = iter->next;
584
+ if (iter->next)
585
+ iter->next->prev = iter->prev;
586
+ iter->next = ty->cast;
587
+ iter->prev = 0;
588
+ if (ty->cast) ty->cast->prev = iter;
589
+ ty->cast = iter;
590
+ return iter;
591
+ }
592
+ iter = iter->next;
593
+ }
594
+ }
595
+ return 0;
596
+ }
597
+
598
+ /*
599
+ Cast a pointer up an inheritance hierarchy
600
+ */
601
+ SWIGRUNTIMEINLINE void *
602
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
603
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
604
+ }
605
+
606
+ /*
607
+ Dynamic pointer casting. Down an inheritance hierarchy
608
+ */
609
+ SWIGRUNTIME swig_type_info *
610
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
611
+ swig_type_info *lastty = ty;
612
+ if (!ty || !ty->dcast) return ty;
613
+ while (ty && (ty->dcast)) {
614
+ ty = (*ty->dcast)(ptr);
615
+ if (ty) lastty = ty;
616
+ }
617
+ return lastty;
618
+ }
619
+
620
+ /*
621
+ Return the name associated with this type
622
+ */
623
+ SWIGRUNTIMEINLINE const char *
624
+ SWIG_TypeName(const swig_type_info *ty) {
625
+ return ty->name;
626
+ }
627
+
628
+ /*
629
+ Return the pretty name associated with this type,
630
+ that is an unmangled type name in a form presentable to the user.
631
+ */
632
+ SWIGRUNTIME const char *
633
+ SWIG_TypePrettyName(const swig_type_info *type) {
634
+ /* The "str" field contains the equivalent pretty names of the
635
+ type, separated by vertical-bar characters. We choose
636
+ to print the last name, as it is often (?) the most
637
+ specific. */
638
+ if (!type) return NULL;
639
+ if (type->str != NULL) {
640
+ const char *last_name = type->str;
641
+ const char *s;
642
+ for (s = type->str; *s; s++)
643
+ if (*s == '|') last_name = s+1;
644
+ return last_name;
645
+ }
646
+ else
647
+ return type->name;
648
+ }
649
+
650
+ /*
651
+ Set the clientdata field for a type
652
+ */
653
+ SWIGRUNTIME void
654
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
655
+ swig_cast_info *cast = ti->cast;
656
+ /* if (ti->clientdata == clientdata) return; */
657
+ ti->clientdata = clientdata;
658
+
659
+ while (cast) {
660
+ if (!cast->converter) {
661
+ swig_type_info *tc = cast->type;
662
+ if (!tc->clientdata) {
663
+ SWIG_TypeClientData(tc, clientdata);
664
+ }
665
+ }
666
+ cast = cast->next;
667
+ }
668
+ }
669
+ SWIGRUNTIME void
670
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
671
+ SWIG_TypeClientData(ti, clientdata);
672
+ ti->owndata = 1;
673
+ }
674
+
675
+ /*
676
+ Search for a swig_type_info structure only by mangled name
677
+ Search is a O(log #types)
678
+
679
+ We start searching at module start, and finish searching when start == end.
680
+ Note: if start == end at the beginning of the function, we go all the way around
681
+ the circular list.
682
+ */
683
+ SWIGRUNTIME swig_type_info *
684
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
685
+ swig_module_info *end,
686
+ const char *name) {
687
+ swig_module_info *iter = start;
688
+ do {
689
+ if (iter->size) {
690
+ size_t l = 0;
691
+ size_t r = iter->size - 1;
692
+ do {
693
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
694
+ size_t i = (l + r) >> 1;
695
+ const char *iname = iter->types[i]->name;
696
+ if (iname) {
697
+ int compare = strcmp(name, iname);
698
+ if (compare == 0) {
699
+ return iter->types[i];
700
+ } else if (compare < 0) {
701
+ if (i) {
702
+ r = i - 1;
703
+ } else {
704
+ break;
705
+ }
706
+ } else if (compare > 0) {
707
+ l = i + 1;
708
+ }
709
+ } else {
710
+ break; /* should never happen */
711
+ }
712
+ } while (l <= r);
713
+ }
714
+ iter = iter->next;
715
+ } while (iter != end);
716
+ return 0;
717
+ }
718
+
719
+ /*
720
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
721
+ It first searches the mangled names of the types, which is a O(log #types)
722
+ If a type is not found it then searches the human readable names, which is O(#types).
723
+
724
+ We start searching at module start, and finish searching when start == end.
725
+ Note: if start == end at the beginning of the function, we go all the way around
726
+ the circular list.
727
+ */
728
+ SWIGRUNTIME swig_type_info *
729
+ SWIG_TypeQueryModule(swig_module_info *start,
730
+ swig_module_info *end,
731
+ const char *name) {
732
+ /* STEP 1: Search the name field using binary search */
733
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
734
+ if (ret) {
735
+ return ret;
736
+ } else {
737
+ /* STEP 2: If the type hasn't been found, do a complete search
738
+ of the str field (the human readable name) */
739
+ swig_module_info *iter = start;
740
+ do {
741
+ size_t i = 0;
742
+ for (; i < iter->size; ++i) {
743
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
744
+ return iter->types[i];
745
+ }
746
+ iter = iter->next;
747
+ } while (iter != end);
748
+ }
749
+
750
+ /* neither found a match */
751
+ return 0;
752
+ }
753
+
754
+ /*
755
+ Pack binary data into a string
756
+ */
757
+ SWIGRUNTIME char *
758
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
759
+ static const char hex[17] = "0123456789abcdef";
760
+ const unsigned char *u = (unsigned char *) ptr;
761
+ const unsigned char *eu = u + sz;
762
+ for (; u != eu; ++u) {
763
+ unsigned char uu = *u;
764
+ *(c++) = hex[(uu & 0xf0) >> 4];
765
+ *(c++) = hex[uu & 0xf];
766
+ }
767
+ return c;
768
+ }
769
+
770
+ /*
771
+ Unpack binary data from a string
772
+ */
773
+ SWIGRUNTIME const char *
774
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
775
+ unsigned char *u = (unsigned char *) ptr;
776
+ const unsigned char *eu = u + sz;
777
+ for (; u != eu; ++u) {
778
+ char d = *(c++);
779
+ unsigned char uu;
780
+ if ((d >= '0') && (d <= '9'))
781
+ uu = ((d - '0') << 4);
782
+ else if ((d >= 'a') && (d <= 'f'))
783
+ uu = ((d - ('a'-10)) << 4);
784
+ else
785
+ return (char *) 0;
786
+ d = *(c++);
787
+ if ((d >= '0') && (d <= '9'))
788
+ uu |= (d - '0');
789
+ else if ((d >= 'a') && (d <= 'f'))
790
+ uu |= (d - ('a'-10));
791
+ else
792
+ return (char *) 0;
793
+ *u = uu;
794
+ }
795
+ return c;
796
+ }
797
+
798
+ /*
799
+ Pack 'void *' into a string buffer.
800
+ */
801
+ SWIGRUNTIME char *
802
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
803
+ char *r = buff;
804
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
805
+ *(r++) = '_';
806
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
807
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
808
+ strcpy(r,name);
809
+ return buff;
810
+ }
811
+
812
+ SWIGRUNTIME const char *
813
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
814
+ if (*c != '_') {
815
+ if (strcmp(c,"NULL") == 0) {
816
+ *ptr = (void *) 0;
817
+ return name;
818
+ } else {
819
+ return 0;
820
+ }
821
+ }
822
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
823
+ }
824
+
825
+ SWIGRUNTIME char *
826
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
827
+ char *r = buff;
828
+ size_t lname = (name ? strlen(name) : 0);
829
+ if ((2*sz + 2 + lname) > bsz) return 0;
830
+ *(r++) = '_';
831
+ r = SWIG_PackData(r,ptr,sz);
832
+ if (lname) {
833
+ strncpy(r,name,lname+1);
834
+ } else {
835
+ *r = 0;
836
+ }
837
+ return buff;
838
+ }
839
+
840
+ SWIGRUNTIME const char *
841
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
842
+ if (*c != '_') {
843
+ if (strcmp(c,"NULL") == 0) {
844
+ memset(ptr,0,sz);
845
+ return name;
846
+ } else {
847
+ return 0;
848
+ }
849
+ }
850
+ return SWIG_UnpackData(++c,ptr,sz);
851
+ }
852
+
853
+ #ifdef __cplusplus
854
+ }
855
+ #endif
856
+
857
+ /* Errors in SWIG */
858
+ #define SWIG_UnknownError -1
859
+ #define SWIG_IOError -2
860
+ #define SWIG_RuntimeError -3
861
+ #define SWIG_IndexError -4
862
+ #define SWIG_TypeError -5
863
+ #define SWIG_DivisionByZero -6
864
+ #define SWIG_OverflowError -7
865
+ #define SWIG_SyntaxError -8
866
+ #define SWIG_ValueError -9
867
+ #define SWIG_SystemError -10
868
+ #define SWIG_AttributeError -11
869
+ #define SWIG_MemoryError -12
870
+ #define SWIG_NullReferenceError -13
871
+
872
+
873
+
874
+ #include <ruby.h>
875
+
876
+ /* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
877
+ * breaks using rb_intern as an lvalue, as SWIG does. We work around this
878
+ * issue for now by disabling this.
879
+ * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
880
+ */
881
+ #ifdef rb_intern
882
+ # undef rb_intern
883
+ #endif
884
+
885
+ /* Remove global macros defined in Ruby's win32.h */
886
+ #ifdef write
887
+ # undef write
888
+ #endif
889
+ #ifdef read
890
+ # undef read
891
+ #endif
892
+ #ifdef bind
893
+ # undef bind
894
+ #endif
895
+ #ifdef close
896
+ # undef close
897
+ #endif
898
+ #ifdef connect
899
+ # undef connect
900
+ #endif
901
+
902
+
903
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
904
+ #ifndef NUM2LL
905
+ #define NUM2LL(x) NUM2LONG((x))
906
+ #endif
907
+ #ifndef LL2NUM
908
+ #define LL2NUM(x) INT2NUM((long) (x))
909
+ #endif
910
+ #ifndef ULL2NUM
911
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
912
+ #endif
913
+
914
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
915
+ #ifndef NUM2ULL
916
+ #ifdef HAVE_LONG_LONG
917
+ #define NUM2ULL(x) rb_num2ull((x))
918
+ #else
919
+ #define NUM2ULL(x) NUM2ULONG(x)
920
+ #endif
921
+ #endif
922
+
923
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
924
+ /* Define these for older versions so we can just write code the new way */
925
+ #ifndef RSTRING_LEN
926
+ # define RSTRING_LEN(x) RSTRING(x)->len
927
+ #endif
928
+ #ifndef RSTRING_PTR
929
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
930
+ #endif
931
+ #ifndef RSTRING_END
932
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
933
+ #endif
934
+ #ifndef RARRAY_LEN
935
+ # define RARRAY_LEN(x) RARRAY(x)->len
936
+ #endif
937
+ #ifndef RARRAY_PTR
938
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
939
+ #endif
940
+ #ifndef RFLOAT_VALUE
941
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
942
+ #endif
943
+ #ifndef DOUBLE2NUM
944
+ # define DOUBLE2NUM(x) rb_float_new(x)
945
+ #endif
946
+ #ifndef RHASH_TBL
947
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
948
+ #endif
949
+ #ifndef RHASH_ITER_LEV
950
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
951
+ #endif
952
+ #ifndef RHASH_IFNONE
953
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
954
+ #endif
955
+ #ifndef RHASH_SIZE
956
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
957
+ #endif
958
+ #ifndef RHASH_EMPTY_P
959
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
960
+ #endif
961
+ #ifndef RSTRUCT_LEN
962
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
963
+ #endif
964
+ #ifndef RSTRUCT_PTR
965
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
966
+ #endif
967
+
968
+
969
+
970
+ /*
971
+ * Need to be very careful about how these macros are defined, especially
972
+ * when compiling C++ code or C code with an ANSI C compiler.
973
+ *
974
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
975
+ * a Ruby method so that it can be passed as an argument to API functions
976
+ * like rb_define_method() and rb_define_singleton_method().
977
+ *
978
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
979
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
980
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
981
+ * and Data_Make_Struct().
982
+ */
983
+
984
+ #ifdef __cplusplus
985
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
986
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
987
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
988
+ # define VOIDFUNC(f) ((void (*)()) f)
989
+ # else
990
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
991
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
992
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
993
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
994
+ # else /* These definitions should work for Ruby 1.7+ */
995
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
996
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
997
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
998
+ # endif
999
+ # endif
1000
+ #else
1001
+ # define VALUEFUNC(f) (f)
1002
+ # define VOIDFUNC(f) (f)
1003
+ #endif
1004
+
1005
+ /* Don't use for expressions have side effect */
1006
+ #ifndef RB_STRING_VALUE
1007
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
1008
+ #endif
1009
+ #ifndef StringValue
1010
+ #define StringValue(s) RB_STRING_VALUE(s)
1011
+ #endif
1012
+ #ifndef StringValuePtr
1013
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
1014
+ #endif
1015
+ #ifndef StringValueLen
1016
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
1017
+ #endif
1018
+ #ifndef SafeStringValue
1019
+ #define SafeStringValue(v) do {\
1020
+ StringValue(v);\
1021
+ rb_check_safe_str(v);\
1022
+ } while (0)
1023
+ #endif
1024
+
1025
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
1026
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
1027
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
1028
+ #endif
1029
+
1030
+ static VALUE _mSWIG = Qnil;
1031
+
1032
+ /* -----------------------------------------------------------------------------
1033
+ * error manipulation
1034
+ * ----------------------------------------------------------------------------- */
1035
+
1036
+
1037
+ /* Define some additional error types */
1038
+ #define SWIG_ObjectPreviouslyDeletedError -100
1039
+
1040
+
1041
+ /* Define custom exceptions for errors that do not map to existing Ruby
1042
+ exceptions. Note this only works for C++ since a global cannot be
1043
+ initialized by a function in C. For C, fallback to rb_eRuntimeError.*/
1044
+
1045
+ SWIGINTERN VALUE
1046
+ getNullReferenceError(void) {
1047
+ static int init = 0;
1048
+ static VALUE rb_eNullReferenceError ;
1049
+ if (!init) {
1050
+ init = 1;
1051
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
1052
+ }
1053
+ return rb_eNullReferenceError;
1054
+ }
1055
+
1056
+ SWIGINTERN VALUE
1057
+ getObjectPreviouslyDeletedError(void) {
1058
+ static int init = 0;
1059
+ static VALUE rb_eObjectPreviouslyDeleted ;
1060
+ if (!init) {
1061
+ init = 1;
1062
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
1063
+ }
1064
+ return rb_eObjectPreviouslyDeleted;
1065
+ }
1066
+
1067
+
1068
+ SWIGINTERN VALUE
1069
+ SWIG_Ruby_ErrorType(int SWIG_code) {
1070
+ VALUE type;
1071
+ switch (SWIG_code) {
1072
+ case SWIG_MemoryError:
1073
+ type = rb_eNoMemError;
1074
+ break;
1075
+ case SWIG_IOError:
1076
+ type = rb_eIOError;
1077
+ break;
1078
+ case SWIG_RuntimeError:
1079
+ type = rb_eRuntimeError;
1080
+ break;
1081
+ case SWIG_IndexError:
1082
+ type = rb_eIndexError;
1083
+ break;
1084
+ case SWIG_TypeError:
1085
+ type = rb_eTypeError;
1086
+ break;
1087
+ case SWIG_DivisionByZero:
1088
+ type = rb_eZeroDivError;
1089
+ break;
1090
+ case SWIG_OverflowError:
1091
+ type = rb_eRangeError;
1092
+ break;
1093
+ case SWIG_SyntaxError:
1094
+ type = rb_eSyntaxError;
1095
+ break;
1096
+ case SWIG_ValueError:
1097
+ type = rb_eArgError;
1098
+ break;
1099
+ case SWIG_SystemError:
1100
+ type = rb_eFatal;
1101
+ break;
1102
+ case SWIG_AttributeError:
1103
+ type = rb_eRuntimeError;
1104
+ break;
1105
+ case SWIG_NullReferenceError:
1106
+ type = getNullReferenceError();
1107
+ break;
1108
+ case SWIG_ObjectPreviouslyDeletedError:
1109
+ type = getObjectPreviouslyDeletedError();
1110
+ break;
1111
+ case SWIG_UnknownError:
1112
+ type = rb_eRuntimeError;
1113
+ break;
1114
+ default:
1115
+ type = rb_eRuntimeError;
1116
+ }
1117
+ return type;
1118
+ }
1119
+
1120
+
1121
+ /* This function is called when a user inputs a wrong argument to
1122
+ a method.
1123
+ */
1124
+ SWIGINTERN
1125
+ const char* Ruby_Format_TypeError( const char* msg,
1126
+ const char* type,
1127
+ const char* name,
1128
+ const int argn,
1129
+ VALUE input )
1130
+ {
1131
+ char buf[128];
1132
+ VALUE str;
1133
+ VALUE asStr;
1134
+ if ( msg && *msg )
1135
+ {
1136
+ str = rb_str_new2(msg);
1137
+ }
1138
+ else
1139
+ {
1140
+ str = rb_str_new(NULL, 0);
1141
+ }
1142
+
1143
+ str = rb_str_cat2( str, "Expected argument " );
1144
+ sprintf( buf, "%d of type ", argn-1 );
1145
+ str = rb_str_cat2( str, buf );
1146
+ str = rb_str_cat2( str, type );
1147
+ str = rb_str_cat2( str, ", but got " );
1148
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1149
+ str = rb_str_cat2( str, " " );
1150
+ asStr = rb_inspect(input);
1151
+ if ( RSTRING_LEN(asStr) > 30 )
1152
+ {
1153
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1154
+ str = rb_str_cat2( str, "..." );
1155
+ }
1156
+ else
1157
+ {
1158
+ str = rb_str_append( str, asStr );
1159
+ }
1160
+
1161
+ if ( name )
1162
+ {
1163
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1164
+ str = rb_str_cat2( str, name );
1165
+ str = rb_str_cat2( str, "'" );
1166
+ }
1167
+
1168
+ return StringValuePtr( str );
1169
+ }
1170
+
1171
+ /* This function is called when an overloaded method fails */
1172
+ SWIGINTERN
1173
+ void Ruby_Format_OverloadedError(
1174
+ const int argc,
1175
+ const int maxargs,
1176
+ const char* method,
1177
+ const char* prototypes
1178
+ )
1179
+ {
1180
+ const char* msg = "Wrong # of arguments";
1181
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1182
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1183
+ "Possible C/C++ prototypes are:\n%s",
1184
+ msg, method, prototypes);
1185
+ }
1186
+
1187
+ /* -----------------------------------------------------------------------------
1188
+ * rubytracking.swg
1189
+ *
1190
+ * This file contains support for tracking mappings from
1191
+ * Ruby objects to C++ objects. This functionality is needed
1192
+ * to implement mark functions for Ruby's mark and sweep
1193
+ * garbage collector.
1194
+ * ----------------------------------------------------------------------------- */
1195
+
1196
+ #ifdef __cplusplus
1197
+ extern "C" {
1198
+ #endif
1199
+
1200
+ /* Ruby 1.8 actually assumes the first case. */
1201
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1202
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1203
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1204
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1205
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1206
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1207
+ #else
1208
+ # error sizeof(void*) is not the same as long or long long
1209
+ #endif
1210
+
1211
+
1212
+ /* Global Ruby hash table to store Trackings from C/C++
1213
+ structs to Ruby Objects.
1214
+ */
1215
+ static VALUE swig_ruby_trackings = Qnil;
1216
+
1217
+ /* Global variable that stores a reference to the ruby
1218
+ hash table delete function. */
1219
+ static ID swig_ruby_hash_delete;
1220
+
1221
+ /* Setup a Ruby hash table to store Trackings */
1222
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1223
+ /* Create a ruby hash table to store Trackings from C++
1224
+ objects to Ruby objects. */
1225
+
1226
+ /* Try to see if some other .so has already created a
1227
+ tracking hash table, which we keep hidden in an instance var
1228
+ in the SWIG module.
1229
+ This is done to allow multiple DSOs to share the same
1230
+ tracking table.
1231
+ */
1232
+ ID trackings_id = rb_intern( "@__trackings__" );
1233
+ VALUE verbose = rb_gv_get("VERBOSE");
1234
+ rb_gv_set("VERBOSE", Qfalse);
1235
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1236
+ rb_gv_set("VERBOSE", verbose);
1237
+
1238
+ /* No, it hasn't. Create one ourselves */
1239
+ if ( swig_ruby_trackings == Qnil )
1240
+ {
1241
+ swig_ruby_trackings = rb_hash_new();
1242
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1243
+ }
1244
+
1245
+ /* Now store a reference to the hash table delete function
1246
+ so that we only have to look it up once.*/
1247
+ swig_ruby_hash_delete = rb_intern("delete");
1248
+ }
1249
+
1250
+ /* Get a Ruby number to reference a pointer */
1251
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1252
+ /* We cast the pointer to an unsigned long
1253
+ and then store a reference to it using
1254
+ a Ruby number object. */
1255
+
1256
+ /* Convert the pointer to a Ruby number */
1257
+ return SWIG2NUM(ptr);
1258
+ }
1259
+
1260
+ /* Get a Ruby number to reference an object */
1261
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1262
+ /* We cast the object to an unsigned long
1263
+ and then store a reference to it using
1264
+ a Ruby number object. */
1265
+
1266
+ /* Convert the Object to a Ruby number */
1267
+ return SWIG2NUM(object);
1268
+ }
1269
+
1270
+ /* Get a Ruby object from a previously stored reference */
1271
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1272
+ /* The provided Ruby number object is a reference
1273
+ to the Ruby object we want.*/
1274
+
1275
+ /* Convert the Ruby number to a Ruby object */
1276
+ return NUM2SWIG(reference);
1277
+ }
1278
+
1279
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1280
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1281
+ /* In a Ruby hash table we store the pointer and
1282
+ the associated Ruby object. The trick here is
1283
+ that we cannot store the Ruby object directly - if
1284
+ we do then it cannot be garbage collected. So
1285
+ instead we typecast it as a unsigned long and
1286
+ convert it to a Ruby number object.*/
1287
+
1288
+ /* Get a reference to the pointer as a Ruby number */
1289
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1290
+
1291
+ /* Get a reference to the Ruby object as a Ruby number */
1292
+ VALUE value = SWIG_RubyObjectToReference(object);
1293
+
1294
+ /* Store the mapping to the global hash table. */
1295
+ rb_hash_aset(swig_ruby_trackings, key, value);
1296
+ }
1297
+
1298
+ /* Get the Ruby object that owns the specified C/C++ struct */
1299
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1300
+ /* Get a reference to the pointer as a Ruby number */
1301
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1302
+
1303
+ /* Now lookup the value stored in the global hash table */
1304
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1305
+
1306
+ if (value == Qnil) {
1307
+ /* No object exists - return nil. */
1308
+ return Qnil;
1309
+ }
1310
+ else {
1311
+ /* Convert this value to Ruby object */
1312
+ return SWIG_RubyReferenceToObject(value);
1313
+ }
1314
+ }
1315
+
1316
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1317
+ is very important to remove objects once they are destroyed
1318
+ since the same memory address may be reused later to create
1319
+ a new object. */
1320
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1321
+ /* Get a reference to the pointer as a Ruby number */
1322
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1323
+
1324
+ /* Delete the object from the hash table by calling Ruby's
1325
+ do this we need to call the Hash.delete method.*/
1326
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1327
+ }
1328
+
1329
+ /* This is a helper method that unlinks a Ruby object from its
1330
+ underlying C++ object. This is needed if the lifetime of the
1331
+ Ruby object is longer than the C++ object */
1332
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1333
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1334
+
1335
+ if (object != Qnil) {
1336
+ DATA_PTR(object) = 0;
1337
+ }
1338
+ }
1339
+
1340
+
1341
+ #ifdef __cplusplus
1342
+ }
1343
+ #endif
1344
+
1345
+ /* -----------------------------------------------------------------------------
1346
+ * Ruby API portion that goes into the runtime
1347
+ * ----------------------------------------------------------------------------- */
1348
+
1349
+ #ifdef __cplusplus
1350
+ extern "C" {
1351
+ #endif
1352
+
1353
+ SWIGINTERN VALUE
1354
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1355
+ if (NIL_P(target)) {
1356
+ target = o;
1357
+ } else {
1358
+ if (TYPE(target) != T_ARRAY) {
1359
+ VALUE o2 = target;
1360
+ target = rb_ary_new();
1361
+ rb_ary_push(target, o2);
1362
+ }
1363
+ rb_ary_push(target, o);
1364
+ }
1365
+ return target;
1366
+ }
1367
+
1368
+ /* For ruby1.8.4 and earlier. */
1369
+ #ifndef RUBY_INIT_STACK
1370
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1371
+ # define RUBY_INIT_STACK \
1372
+ VALUE variable_in_this_stack_frame; \
1373
+ Init_stack(&variable_in_this_stack_frame);
1374
+ #endif
1375
+
1376
+
1377
+ #ifdef __cplusplus
1378
+ }
1379
+ #endif
1380
+
1381
+
1382
+ /* -----------------------------------------------------------------------------
1383
+ * rubyrun.swg
1384
+ *
1385
+ * This file contains the runtime support for Ruby modules
1386
+ * and includes code for managing global variables and pointer
1387
+ * type checking.
1388
+ * ----------------------------------------------------------------------------- */
1389
+
1390
+ /* For backward compatibility only */
1391
+ #define SWIG_POINTER_EXCEPTION 0
1392
+
1393
+ /* for raw pointers */
1394
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1395
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1396
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1397
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1398
+ #define swig_owntype ruby_owntype
1399
+
1400
+ /* for raw packed data */
1401
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1402
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1403
+
1404
+ /* for class or struct pointers */
1405
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1406
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1407
+
1408
+ /* for C or C++ function pointers */
1409
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1410
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1411
+
1412
+ /* for C++ member pointers, ie, member methods */
1413
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1414
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1415
+
1416
+
1417
+ /* Runtime API */
1418
+
1419
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule(clientdata)
1420
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1421
+
1422
+
1423
+ /* Error manipulation */
1424
+
1425
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1426
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
1427
+ #define SWIG_fail goto fail
1428
+
1429
+
1430
+ /* Ruby-specific SWIG API */
1431
+
1432
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1433
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1434
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1435
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1436
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1437
+
1438
+ #include "assert.h"
1439
+
1440
+ /* -----------------------------------------------------------------------------
1441
+ * pointers/data manipulation
1442
+ * ----------------------------------------------------------------------------- */
1443
+
1444
+ #ifdef __cplusplus
1445
+ extern "C" {
1446
+ #endif
1447
+
1448
+ typedef struct {
1449
+ VALUE klass;
1450
+ VALUE mImpl;
1451
+ void (*mark)(void *);
1452
+ void (*destroy)(void *);
1453
+ int trackObjects;
1454
+ } swig_class;
1455
+
1456
+
1457
+ /* Global pointer used to keep some internal SWIG stuff */
1458
+ static VALUE _cSWIG_Pointer = Qnil;
1459
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1460
+
1461
+ /* Global IDs used to keep some internal SWIG stuff */
1462
+ static ID swig_arity_id = 0;
1463
+ static ID swig_call_id = 0;
1464
+
1465
+ /*
1466
+ If your swig extension is to be run within an embedded ruby and has
1467
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1468
+ This will reset ruby's stack frame on each entry point from the main
1469
+ program the first time a virtual director function is invoked (in a
1470
+ non-recursive way).
1471
+ If this is not done, you run the risk of Ruby trashing the stack.
1472
+ */
1473
+
1474
+ #ifdef RUBY_EMBEDDED
1475
+
1476
+ # define SWIG_INIT_STACK \
1477
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1478
+ ++swig_virtual_calls;
1479
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1480
+ # define Ruby_DirectorTypeMismatchException(x) \
1481
+ rb_raise( rb_eTypeError, "%s", x ); return c_result;
1482
+
1483
+ static unsigned int swig_virtual_calls = 0;
1484
+
1485
+ #else /* normal non-embedded extension */
1486
+
1487
+ # define SWIG_INIT_STACK
1488
+ # define SWIG_RELEASE_STACK
1489
+ # define Ruby_DirectorTypeMismatchException(x) \
1490
+ throw Swig::DirectorTypeMismatchException( x );
1491
+
1492
+ #endif /* RUBY_EMBEDDED */
1493
+
1494
+
1495
+ SWIGRUNTIME VALUE
1496
+ getExceptionClass(void) {
1497
+ static int init = 0;
1498
+ static VALUE rubyExceptionClass ;
1499
+ if (!init) {
1500
+ init = 1;
1501
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1502
+ }
1503
+ return rubyExceptionClass;
1504
+ }
1505
+
1506
+ /* This code checks to see if the Ruby object being raised as part
1507
+ of an exception inherits from the Ruby class Exception. If so,
1508
+ the object is simply returned. If not, then a new Ruby exception
1509
+ object is created and that will be returned to Ruby.*/
1510
+ SWIGRUNTIME VALUE
1511
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1512
+ VALUE exceptionClass = getExceptionClass();
1513
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1514
+ return obj;
1515
+ } else {
1516
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1517
+ }
1518
+ }
1519
+
1520
+ /* Initialize Ruby runtime support */
1521
+ SWIGRUNTIME void
1522
+ SWIG_Ruby_InitRuntime(void)
1523
+ {
1524
+ if (_mSWIG == Qnil) {
1525
+ _mSWIG = rb_define_module("SWIG");
1526
+ swig_call_id = rb_intern("call");
1527
+ swig_arity_id = rb_intern("arity");
1528
+ }
1529
+ }
1530
+
1531
+ /* Define Ruby class for C type */
1532
+ SWIGRUNTIME void
1533
+ SWIG_Ruby_define_class(swig_type_info *type)
1534
+ {
1535
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1536
+ sprintf(klass_name, "TYPE%s", type->name);
1537
+ if (NIL_P(_cSWIG_Pointer)) {
1538
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1539
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1540
+ }
1541
+ rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1542
+ free((void *) klass_name);
1543
+ }
1544
+
1545
+ /* Create a new pointer object */
1546
+ SWIGRUNTIME VALUE
1547
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1548
+ {
1549
+ int own = flags & SWIG_POINTER_OWN;
1550
+ int track;
1551
+ char *klass_name;
1552
+ swig_class *sklass;
1553
+ VALUE klass;
1554
+ VALUE obj;
1555
+
1556
+ if (!ptr)
1557
+ return Qnil;
1558
+
1559
+ if (type->clientdata) {
1560
+ sklass = (swig_class *) type->clientdata;
1561
+
1562
+ /* Are we tracking this class and have we already returned this Ruby object? */
1563
+ track = sklass->trackObjects;
1564
+ if (track) {
1565
+ obj = SWIG_RubyInstanceFor(ptr);
1566
+
1567
+ /* Check the object's type and make sure it has the correct type.
1568
+ It might not in cases where methods do things like
1569
+ downcast methods. */
1570
+ if (obj != Qnil) {
1571
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1572
+ const char* type_name = RSTRING_PTR(value);
1573
+
1574
+ if (strcmp(type->name, type_name) == 0) {
1575
+ return obj;
1576
+ }
1577
+ }
1578
+ }
1579
+
1580
+ /* Create a new Ruby object */
1581
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1582
+ ( own ? VOIDFUNC(sklass->destroy) :
1583
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1584
+ ), ptr);
1585
+
1586
+ /* If tracking is on for this class then track this object. */
1587
+ if (track) {
1588
+ SWIG_RubyAddTracking(ptr, obj);
1589
+ }
1590
+ } else {
1591
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1592
+ sprintf(klass_name, "TYPE%s", type->name);
1593
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1594
+ free((void *) klass_name);
1595
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1596
+ }
1597
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1598
+
1599
+ return obj;
1600
+ }
1601
+
1602
+ /* Create a new class instance (always owned) */
1603
+ SWIGRUNTIME VALUE
1604
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1605
+ {
1606
+ VALUE obj;
1607
+ swig_class *sklass = (swig_class *) type->clientdata;
1608
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1609
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1610
+ return obj;
1611
+ }
1612
+
1613
+ /* Get type mangle from class name */
1614
+ SWIGRUNTIMEINLINE char *
1615
+ SWIG_Ruby_MangleStr(VALUE obj)
1616
+ {
1617
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1618
+ return StringValuePtr(stype);
1619
+ }
1620
+
1621
+ /* Acquire a pointer value */
1622
+ typedef void (*ruby_owntype)(void*);
1623
+
1624
+ SWIGRUNTIME ruby_owntype
1625
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1626
+ if (obj) {
1627
+ ruby_owntype oldown = RDATA(obj)->dfree;
1628
+ RDATA(obj)->dfree = own;
1629
+ return oldown;
1630
+ } else {
1631
+ return 0;
1632
+ }
1633
+ }
1634
+
1635
+ /* Convert a pointer value */
1636
+ SWIGRUNTIME int
1637
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1638
+ {
1639
+ char *c;
1640
+ swig_cast_info *tc;
1641
+ void *vptr = 0;
1642
+
1643
+ /* Grab the pointer */
1644
+ if (NIL_P(obj)) {
1645
+ *ptr = 0;
1646
+ return SWIG_OK;
1647
+ } else {
1648
+ if (TYPE(obj) != T_DATA) {
1649
+ return SWIG_ERROR;
1650
+ }
1651
+ Data_Get_Struct(obj, void, vptr);
1652
+ }
1653
+
1654
+ if (own) *own = RDATA(obj)->dfree;
1655
+
1656
+ /* Check to see if the input object is giving up ownership
1657
+ of the underlying C struct or C++ object. If so then we
1658
+ need to reset the destructor since the Ruby object no
1659
+ longer owns the underlying C++ object.*/
1660
+ if (flags & SWIG_POINTER_DISOWN) {
1661
+ /* Is tracking on for this class? */
1662
+ int track = 0;
1663
+ if (ty && ty->clientdata) {
1664
+ swig_class *sklass = (swig_class *) ty->clientdata;
1665
+ track = sklass->trackObjects;
1666
+ }
1667
+
1668
+ if (track) {
1669
+ /* We are tracking objects for this class. Thus we change the destructor
1670
+ * to SWIG_RubyRemoveTracking. This allows us to
1671
+ * remove the mapping from the C++ to Ruby object
1672
+ * when the Ruby object is garbage collected. If we don't
1673
+ * do this, then it is possible we will return a reference
1674
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1675
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1676
+ } else {
1677
+ RDATA(obj)->dfree = 0;
1678
+ }
1679
+ }
1680
+
1681
+ /* Do type-checking if type info was provided */
1682
+ if (ty) {
1683
+ if (ty->clientdata) {
1684
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1685
+ if (vptr == 0) {
1686
+ /* The object has already been deleted */
1687
+ return SWIG_ObjectPreviouslyDeletedError;
1688
+ }
1689
+ *ptr = vptr;
1690
+ return SWIG_OK;
1691
+ }
1692
+ }
1693
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
1694
+ return SWIG_ERROR;
1695
+ }
1696
+ tc = SWIG_TypeCheck(c, ty);
1697
+ if (!tc) {
1698
+ return SWIG_ERROR;
1699
+ } else {
1700
+ int newmemory = 0;
1701
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1702
+ assert(!newmemory); /* newmemory handling not yet implemented */
1703
+ }
1704
+ } else {
1705
+ *ptr = vptr;
1706
+ }
1707
+
1708
+ return SWIG_OK;
1709
+ }
1710
+
1711
+ /* Check convert */
1712
+ SWIGRUNTIMEINLINE int
1713
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1714
+ {
1715
+ char *c = SWIG_MangleStr(obj);
1716
+ if (!c) return 0;
1717
+ return SWIG_TypeCheck(c,ty) != 0;
1718
+ }
1719
+
1720
+ SWIGRUNTIME VALUE
1721
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1722
+ char result[1024];
1723
+ char *r = result;
1724
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1725
+ *(r++) = '_';
1726
+ r = SWIG_PackData(r, ptr, sz);
1727
+ strcpy(r, type->name);
1728
+ return rb_str_new2(result);
1729
+ }
1730
+
1731
+ /* Convert a packed value value */
1732
+ SWIGRUNTIME int
1733
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1734
+ swig_cast_info *tc;
1735
+ const char *c;
1736
+
1737
+ if (TYPE(obj) != T_STRING) goto type_error;
1738
+ c = StringValuePtr(obj);
1739
+ /* Pointer values must start with leading underscore */
1740
+ if (*c != '_') goto type_error;
1741
+ c++;
1742
+ c = SWIG_UnpackData(c, ptr, sz);
1743
+ if (ty) {
1744
+ tc = SWIG_TypeCheck(c, ty);
1745
+ if (!tc) goto type_error;
1746
+ }
1747
+ return SWIG_OK;
1748
+
1749
+ type_error:
1750
+ return SWIG_ERROR;
1751
+ }
1752
+
1753
+ SWIGRUNTIME swig_module_info *
1754
+ SWIG_Ruby_GetModule(void *SWIGUNUSEDPARM(clientdata))
1755
+ {
1756
+ VALUE pointer;
1757
+ swig_module_info *ret = 0;
1758
+ VALUE verbose = rb_gv_get("VERBOSE");
1759
+
1760
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1761
+ rb_gv_set("VERBOSE", Qfalse);
1762
+
1763
+ /* first check if pointer already created */
1764
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1765
+ if (pointer != Qnil) {
1766
+ Data_Get_Struct(pointer, swig_module_info, ret);
1767
+ }
1768
+
1769
+ /* reinstate warnings */
1770
+ rb_gv_set("VERBOSE", verbose);
1771
+ return ret;
1772
+ }
1773
+
1774
+ SWIGRUNTIME void
1775
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1776
+ {
1777
+ /* register a new class */
1778
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1779
+ /* create and store the structure pointer to a global variable */
1780
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1781
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1782
+ }
1783
+
1784
+ /* This function can be used to check whether a proc or method or similarly
1785
+ callable function has been passed. Usually used in a %typecheck, like:
1786
+
1787
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1788
+ $result = SWIG_Ruby_isCallable( $input );
1789
+ }
1790
+ */
1791
+ SWIGINTERN
1792
+ int SWIG_Ruby_isCallable( VALUE proc )
1793
+ {
1794
+ if ( rb_respond_to( proc, swig_call_id ) )
1795
+ return 1;
1796
+ return 0;
1797
+ }
1798
+
1799
+ /* This function can be used to check the arity (number of arguments)
1800
+ a proc or method can take. Usually used in a %typecheck.
1801
+ Valid arities will be that equal to minimal or those < 0
1802
+ which indicate a variable number of parameters at the end.
1803
+ */
1804
+ SWIGINTERN
1805
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1806
+ {
1807
+ if ( rb_respond_to( proc, swig_arity_id ) )
1808
+ {
1809
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1810
+ int arity = NUM2INT(num);
1811
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1812
+ if ( arity == minimal ) return 1;
1813
+ return 1;
1814
+ }
1815
+ return 0;
1816
+ }
1817
+
1818
+
1819
+ #ifdef __cplusplus
1820
+ }
1821
+ #endif
1822
+
1823
+
1824
+
1825
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1826
+
1827
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1828
+
1829
+
1830
+
1831
+ /* -------- TYPES TABLE (BEGIN) -------- */
1832
+
1833
+ #define SWIGTYPE_p_TagLib__AudioProperties swig_types[0]
1834
+ #define SWIGTYPE_p_TagLib__ID3v2__Tag swig_types[1]
1835
+ #define SWIGTYPE_p_TagLib__RIFF__WAV__File swig_types[2]
1836
+ #define SWIGTYPE_p_TagLib__RIFF__WAV__Properties swig_types[3]
1837
+ #define SWIGTYPE_p_char swig_types[4]
1838
+ #define SWIGTYPE_p_unsigned_char swig_types[5]
1839
+ #define SWIGTYPE_p_unsigned_int swig_types[6]
1840
+ #define SWIGTYPE_p_unsigned_long swig_types[7]
1841
+ #define SWIGTYPE_p_wchar_t swig_types[8]
1842
+ static swig_type_info *swig_types[10];
1843
+ static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0};
1844
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1845
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1846
+
1847
+ /* -------- TYPES TABLE (END) -------- */
1848
+
1849
+ #define SWIG_init Init_taglib_wav
1850
+ #define SWIG_name "TagLib::RIFF::WAV"
1851
+
1852
+ static VALUE mWAV;
1853
+
1854
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1855
+ #define SWIG_RUBY_THREAD_END_BLOCK
1856
+
1857
+
1858
+ #define SWIGVERSION 0x030007
1859
+ #define SWIG_VERSION SWIGVERSION
1860
+
1861
+
1862
+ #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
1863
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
1864
+
1865
+
1866
+ #include <stdexcept>
1867
+
1868
+
1869
+ #include <taglib/taglib.h>
1870
+ #include <taglib/wavfile.h>
1871
+ #include <taglib/wavproperties.h>
1872
+ #include <taglib/id3v2tag.h>
1873
+ using namespace TagLib::RIFF;
1874
+
1875
+
1876
+ #include <taglib/tstring.h>
1877
+ #include <taglib/tstringlist.h>
1878
+ #include <taglib/tfile.h>
1879
+
1880
+ #if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
1881
+ # include <ruby/encoding.h>
1882
+ # define ASSOCIATE_UTF8_ENCODING(value) rb_enc_associate(value, rb_utf8_encoding());
1883
+ # define ASSOCIATE_FILESYSTEM_ENCODING(value) rb_enc_associate(value, rb_filesystem_encoding());
1884
+ # define CONVERT_TO_UTF8(value) rb_str_export_to_enc(value, rb_utf8_encoding())
1885
+ #else
1886
+ # define ASSOCIATE_UTF8_ENCODING(value) /* nothing */
1887
+ # define ASSOCIATE_FILESYSTEM_ENCODING(value)
1888
+ # define CONVERT_TO_UTF8(value) value
1889
+ #endif
1890
+
1891
+ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
1892
+ if (byteVector.isNull()) {
1893
+ return Qnil;
1894
+ } else {
1895
+ return rb_str_new(byteVector.data(), byteVector.size());
1896
+ }
1897
+ }
1898
+
1899
+ TagLib::ByteVector ruby_string_to_taglib_bytevector(VALUE s) {
1900
+ if (NIL_P(s)) {
1901
+ return TagLib::ByteVector::null;
1902
+ } else {
1903
+ return TagLib::ByteVector(RSTRING_PTR(StringValue(s)), RSTRING_LEN(s));
1904
+ }
1905
+ }
1906
+
1907
+ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
1908
+ if (string.isNull()) {
1909
+ return Qnil;
1910
+ } else {
1911
+ VALUE result = rb_str_new2(string.toCString(true));
1912
+ ASSOCIATE_UTF8_ENCODING(result);
1913
+ return result;
1914
+ }
1915
+ }
1916
+
1917
+ TagLib::String ruby_string_to_taglib_string(VALUE s) {
1918
+ if (NIL_P(s)) {
1919
+ return TagLib::String::null;
1920
+ } else {
1921
+ return TagLib::String(RSTRING_PTR(CONVERT_TO_UTF8(StringValue(s))), TagLib::String::UTF8);
1922
+ }
1923
+ }
1924
+
1925
+ VALUE taglib_string_list_to_ruby_array(const TagLib::StringList & list) {
1926
+ VALUE ary = rb_ary_new2(list.size());
1927
+ for (TagLib::StringList::ConstIterator it = list.begin(); it != list.end(); it++) {
1928
+ VALUE s = taglib_string_to_ruby_string(*it);
1929
+ rb_ary_push(ary, s);
1930
+ }
1931
+ return ary;
1932
+ }
1933
+
1934
+ TagLib::StringList ruby_array_to_taglib_string_list(VALUE ary) {
1935
+ TagLib::StringList result = TagLib::StringList();
1936
+ if (NIL_P(ary)) {
1937
+ return result;
1938
+ }
1939
+ for (long i = 0; i < RARRAY_LEN(ary); i++) {
1940
+ VALUE e = rb_ary_entry(ary, i);
1941
+ TagLib::String s = ruby_string_to_taglib_string(e);
1942
+ result.append(s);
1943
+ }
1944
+ return result;
1945
+ }
1946
+
1947
+ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
1948
+ VALUE result;
1949
+ #ifdef _WIN32
1950
+ const char *s = (const char *) filename;
1951
+ result = rb_str_new2(s);
1952
+ #else
1953
+ result = rb_str_new2(filename);
1954
+ #endif
1955
+ ASSOCIATE_FILESYSTEM_ENCODING(result);
1956
+ return result;
1957
+ }
1958
+
1959
+ TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
1960
+ #ifdef _WIN32
1961
+ #if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
1962
+ VALUE ospath;
1963
+ const char *utf8;
1964
+ int len;
1965
+ wchar_t *wide;
1966
+
1967
+ ospath = rb_str_encode_ospath(s);
1968
+ utf8 = StringValuePtr(ospath);
1969
+ len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0);
1970
+ if (!(wide = (wchar_t *) xmalloc(sizeof(wchar_t) * len))) {
1971
+ return TagLib::FileName((const char *) NULL);
1972
+ }
1973
+ MultiByteToWideChar(CP_UTF8, 0, utf8, -1, wide, len);
1974
+ TagLib::FileName filename(wide);
1975
+ xfree(wide);
1976
+ return filename;
1977
+ #else
1978
+ const char *filename = StringValuePtr(s);
1979
+ return TagLib::FileName(filename);
1980
+ #endif
1981
+ #else
1982
+ return StringValuePtr(s);
1983
+ #endif
1984
+ }
1985
+
1986
+
1987
+
1988
+ #include <limits.h>
1989
+ #if !defined(SWIG_NO_LLONG_MAX)
1990
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1991
+ # define LLONG_MAX __LONG_LONG_MAX__
1992
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
1993
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1994
+ # endif
1995
+ #endif
1996
+
1997
+
1998
+ SWIGINTERN VALUE
1999
+ SWIG_ruby_failed(void)
2000
+ {
2001
+ return Qnil;
2002
+ }
2003
+
2004
+
2005
+ /*@SWIG:/usr/local/share/swig/3.0.7/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2006
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
2007
+ {
2008
+ VALUE obj = args[0];
2009
+ VALUE type = TYPE(obj);
2010
+ long *res = (long *)(args[1]);
2011
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
2012
+ return obj;
2013
+ }
2014
+ /*@SWIG@*/
2015
+
2016
+ SWIGINTERN int
2017
+ SWIG_AsVal_long (VALUE obj, long* val)
2018
+ {
2019
+ VALUE type = TYPE(obj);
2020
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
2021
+ long v;
2022
+ VALUE a[2];
2023
+ a[0] = obj;
2024
+ a[1] = (VALUE)(&v);
2025
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2026
+ if (val) *val = v;
2027
+ return SWIG_OK;
2028
+ }
2029
+ }
2030
+ return SWIG_TypeError;
2031
+ }
2032
+
2033
+
2034
+ SWIGINTERN int
2035
+ SWIG_AsVal_int (VALUE obj, int *val)
2036
+ {
2037
+ long v;
2038
+ int res = SWIG_AsVal_long (obj, &v);
2039
+ if (SWIG_IsOK(res)) {
2040
+ if ((v < INT_MIN || v > INT_MAX)) {
2041
+ return SWIG_OverflowError;
2042
+ } else {
2043
+ if (val) *val = static_cast< int >(v);
2044
+ }
2045
+ }
2046
+ return res;
2047
+ }
2048
+
2049
+
2050
+ #define SWIG_From_long LONG2NUM
2051
+
2052
+
2053
+ SWIGINTERNINLINE VALUE
2054
+ SWIG_From_int (int value)
2055
+ {
2056
+ return SWIG_From_long (value);
2057
+ }
2058
+
2059
+
2060
+ SWIGINTERNINLINE VALUE
2061
+ SWIG_From_unsigned_SS_long (unsigned long value)
2062
+ {
2063
+ return ULONG2NUM(value);
2064
+ }
2065
+
2066
+
2067
+ SWIGINTERNINLINE VALUE
2068
+ SWIG_From_unsigned_SS_int (unsigned int value)
2069
+ {
2070
+ return SWIG_From_unsigned_SS_long (value);
2071
+ }
2072
+
2073
+
2074
+ SWIGINTERN int
2075
+ SWIG_AsVal_bool (VALUE obj, bool *val)
2076
+ {
2077
+ if (obj == Qtrue) {
2078
+ if (val) *val = true;
2079
+ return SWIG_OK;
2080
+ } else if (obj == Qfalse) {
2081
+ if (val) *val = false;
2082
+ return SWIG_OK;
2083
+ } else {
2084
+ int res = 0;
2085
+ if (SWIG_AsVal_int (obj, &res) == SWIG_OK) {
2086
+ if (val) *val = res ? true : false;
2087
+ return SWIG_OK;
2088
+ }
2089
+ }
2090
+ return SWIG_TypeError;
2091
+ }
2092
+
2093
+
2094
+ SWIGINTERN swig_type_info*
2095
+ SWIG_pchar_descriptor(void)
2096
+ {
2097
+ static int init = 0;
2098
+ static swig_type_info* info = 0;
2099
+ if (!init) {
2100
+ info = SWIG_TypeQuery("_p_char");
2101
+ init = 1;
2102
+ }
2103
+ return info;
2104
+ }
2105
+
2106
+
2107
+ SWIGINTERN int
2108
+ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
2109
+ {
2110
+ if (TYPE(obj) == T_STRING) {
2111
+ char *cstr = StringValuePtr(obj);
2112
+ size_t size = RSTRING_LEN(obj) + 1;
2113
+ if (cptr) {
2114
+ if (alloc) {
2115
+ if (*alloc == SWIG_NEWOBJ) {
2116
+ *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
2117
+ } else {
2118
+ *cptr = cstr;
2119
+ *alloc = SWIG_OLDOBJ;
2120
+ }
2121
+ }
2122
+ }
2123
+ if (psize) *psize = size;
2124
+ return SWIG_OK;
2125
+ } else {
2126
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
2127
+ if (pchar_descriptor) {
2128
+ void* vptr = 0;
2129
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
2130
+ if (cptr) *cptr = (char *)vptr;
2131
+ if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
2132
+ if (alloc) *alloc = SWIG_OLDOBJ;
2133
+ return SWIG_OK;
2134
+ }
2135
+ }
2136
+ }
2137
+ return SWIG_TypeError;
2138
+ }
2139
+
2140
+
2141
+
2142
+
2143
+
2144
+ SWIGINTERNINLINE VALUE
2145
+ SWIG_From_bool (bool value)
2146
+ {
2147
+ return value ? Qtrue : Qfalse;
2148
+ }
2149
+
2150
+ SWIGINTERN void TagLib_RIFF_WAV_File_close(TagLib::RIFF::WAV::File *self){
2151
+ free_taglib_riff_wav_file(self);
2152
+ }
2153
+
2154
+ static void free_taglib_riff_wav_file(void *ptr) {
2155
+ TagLib::RIFF::WAV::File *file = (TagLib::RIFF::WAV::File *) ptr;
2156
+
2157
+ TagLib::ID3v2::Tag *id3v2tag = file->tag();
2158
+ if (id3v2tag) {
2159
+ TagLib::ID3v2::FrameList frames = id3v2tag->frameList();
2160
+ for (TagLib::ID3v2::FrameList::ConstIterator it = frames.begin(); it != frames.end(); it++) {
2161
+ TagLib::ID3v2::Frame *frame = (*it);
2162
+ SWIG_RubyUnlinkObjects(frame);
2163
+ SWIG_RubyRemoveTracking(frame);
2164
+ }
2165
+
2166
+ SWIG_RubyUnlinkObjects(id3v2tag);
2167
+ SWIG_RubyRemoveTracking(id3v2tag);
2168
+ }
2169
+
2170
+ TagLib::RIFF::WAV::Properties *properties = file->audioProperties();
2171
+ if (properties) {
2172
+ SWIG_RubyUnlinkObjects(properties);
2173
+ SWIG_RubyRemoveTracking(properties);
2174
+ }
2175
+
2176
+ SWIG_RubyUnlinkObjects(ptr);
2177
+ SWIG_RubyRemoveTracking(ptr);
2178
+
2179
+ delete file;
2180
+ }
2181
+
2182
+ static swig_class SwigClassProperties;
2183
+
2184
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2185
+ SWIGINTERN VALUE
2186
+ _wrap_Properties_allocate(VALUE self) {
2187
+ #else
2188
+ SWIGINTERN VALUE
2189
+ _wrap_Properties_allocate(int argc, VALUE *argv, VALUE self) {
2190
+ #endif
2191
+
2192
+
2193
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__RIFF__WAV__Properties);
2194
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2195
+ rb_obj_call_init(vresult, argc, argv);
2196
+ #endif
2197
+ return vresult;
2198
+ }
2199
+
2200
+
2201
+ SWIGINTERN VALUE
2202
+ _wrap_new_Properties(int argc, VALUE *argv, VALUE self) {
2203
+ TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
2204
+ TagLib::AudioProperties::ReadStyle arg2 ;
2205
+ void *argp1 = 0 ;
2206
+ int res1 = 0 ;
2207
+ int val2 ;
2208
+ int ecode2 = 0 ;
2209
+ TagLib::RIFF::WAV::Properties *result = 0 ;
2210
+
2211
+ if ((argc < 2) || (argc > 2)) {
2212
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2213
+ }
2214
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__File, 0 | 0 );
2215
+ if (!SWIG_IsOK(res1)) {
2216
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File *","Properties", 1, argv[0] ));
2217
+ }
2218
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
2219
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2220
+ if (!SWIG_IsOK(ecode2)) {
2221
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "TagLib::AudioProperties::ReadStyle","Properties", 2, argv[1] ));
2222
+ }
2223
+ arg2 = static_cast< TagLib::AudioProperties::ReadStyle >(val2);
2224
+ result = (TagLib::RIFF::WAV::Properties *)new TagLib::RIFF::WAV::Properties(arg1,arg2);
2225
+ DATA_PTR(self) = result;
2226
+ SWIG_RubyAddTracking(result, self);
2227
+ return self;
2228
+ fail:
2229
+ return Qnil;
2230
+ }
2231
+
2232
+
2233
+ SWIGINTERN void
2234
+ free_TagLib_RIFF_WAV_Properties(TagLib::RIFF::WAV::Properties *arg1) {
2235
+ SWIG_RubyRemoveTracking(arg1);
2236
+ delete arg1;
2237
+ }
2238
+
2239
+ SWIGINTERN VALUE
2240
+ _wrap_Properties_length_in_seconds(int argc, VALUE *argv, VALUE self) {
2241
+ TagLib::RIFF::WAV::Properties *arg1 = (TagLib::RIFF::WAV::Properties *) 0 ;
2242
+ void *argp1 = 0 ;
2243
+ int res1 = 0 ;
2244
+ int result;
2245
+ VALUE vresult = Qnil;
2246
+
2247
+ if ((argc < 0) || (argc > 0)) {
2248
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2249
+ }
2250
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__Properties, 0 | 0 );
2251
+ if (!SWIG_IsOK(res1)) {
2252
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::Properties const *","lengthInSeconds", 1, self ));
2253
+ }
2254
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::Properties * >(argp1);
2255
+ result = (int)((TagLib::RIFF::WAV::Properties const *)arg1)->lengthInSeconds();
2256
+ vresult = SWIG_From_int(static_cast< int >(result));
2257
+ return vresult;
2258
+ fail:
2259
+ return Qnil;
2260
+ }
2261
+
2262
+
2263
+ SWIGINTERN VALUE
2264
+ _wrap_Properties_length_in_milliseconds(int argc, VALUE *argv, VALUE self) {
2265
+ TagLib::RIFF::WAV::Properties *arg1 = (TagLib::RIFF::WAV::Properties *) 0 ;
2266
+ void *argp1 = 0 ;
2267
+ int res1 = 0 ;
2268
+ int result;
2269
+ VALUE vresult = Qnil;
2270
+
2271
+ if ((argc < 0) || (argc > 0)) {
2272
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2273
+ }
2274
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__Properties, 0 | 0 );
2275
+ if (!SWIG_IsOK(res1)) {
2276
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::Properties const *","lengthInMilliseconds", 1, self ));
2277
+ }
2278
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::Properties * >(argp1);
2279
+ result = (int)((TagLib::RIFF::WAV::Properties const *)arg1)->lengthInMilliseconds();
2280
+ vresult = SWIG_From_int(static_cast< int >(result));
2281
+ return vresult;
2282
+ fail:
2283
+ return Qnil;
2284
+ }
2285
+
2286
+
2287
+ SWIGINTERN VALUE
2288
+ _wrap_Properties_bitrate(int argc, VALUE *argv, VALUE self) {
2289
+ TagLib::RIFF::WAV::Properties *arg1 = (TagLib::RIFF::WAV::Properties *) 0 ;
2290
+ void *argp1 = 0 ;
2291
+ int res1 = 0 ;
2292
+ int result;
2293
+ VALUE vresult = Qnil;
2294
+
2295
+ if ((argc < 0) || (argc > 0)) {
2296
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2297
+ }
2298
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__Properties, 0 | 0 );
2299
+ if (!SWIG_IsOK(res1)) {
2300
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::Properties const *","bitrate", 1, self ));
2301
+ }
2302
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::Properties * >(argp1);
2303
+ result = (int)((TagLib::RIFF::WAV::Properties const *)arg1)->bitrate();
2304
+ vresult = SWIG_From_int(static_cast< int >(result));
2305
+ return vresult;
2306
+ fail:
2307
+ return Qnil;
2308
+ }
2309
+
2310
+
2311
+ SWIGINTERN VALUE
2312
+ _wrap_Properties_sample_rate(int argc, VALUE *argv, VALUE self) {
2313
+ TagLib::RIFF::WAV::Properties *arg1 = (TagLib::RIFF::WAV::Properties *) 0 ;
2314
+ void *argp1 = 0 ;
2315
+ int res1 = 0 ;
2316
+ int result;
2317
+ VALUE vresult = Qnil;
2318
+
2319
+ if ((argc < 0) || (argc > 0)) {
2320
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2321
+ }
2322
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__Properties, 0 | 0 );
2323
+ if (!SWIG_IsOK(res1)) {
2324
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::Properties const *","sampleRate", 1, self ));
2325
+ }
2326
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::Properties * >(argp1);
2327
+ result = (int)((TagLib::RIFF::WAV::Properties const *)arg1)->sampleRate();
2328
+ vresult = SWIG_From_int(static_cast< int >(result));
2329
+ return vresult;
2330
+ fail:
2331
+ return Qnil;
2332
+ }
2333
+
2334
+
2335
+ SWIGINTERN VALUE
2336
+ _wrap_Properties_channels(int argc, VALUE *argv, VALUE self) {
2337
+ TagLib::RIFF::WAV::Properties *arg1 = (TagLib::RIFF::WAV::Properties *) 0 ;
2338
+ void *argp1 = 0 ;
2339
+ int res1 = 0 ;
2340
+ int result;
2341
+ VALUE vresult = Qnil;
2342
+
2343
+ if ((argc < 0) || (argc > 0)) {
2344
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2345
+ }
2346
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__Properties, 0 | 0 );
2347
+ if (!SWIG_IsOK(res1)) {
2348
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::Properties const *","channels", 1, self ));
2349
+ }
2350
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::Properties * >(argp1);
2351
+ result = (int)((TagLib::RIFF::WAV::Properties const *)arg1)->channels();
2352
+ vresult = SWIG_From_int(static_cast< int >(result));
2353
+ return vresult;
2354
+ fail:
2355
+ return Qnil;
2356
+ }
2357
+
2358
+
2359
+ SWIGINTERN VALUE
2360
+ _wrap_Properties_bits_per_sample(int argc, VALUE *argv, VALUE self) {
2361
+ TagLib::RIFF::WAV::Properties *arg1 = (TagLib::RIFF::WAV::Properties *) 0 ;
2362
+ void *argp1 = 0 ;
2363
+ int res1 = 0 ;
2364
+ int result;
2365
+ VALUE vresult = Qnil;
2366
+
2367
+ if ((argc < 0) || (argc > 0)) {
2368
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2369
+ }
2370
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__Properties, 0 | 0 );
2371
+ if (!SWIG_IsOK(res1)) {
2372
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::Properties const *","bitsPerSample", 1, self ));
2373
+ }
2374
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::Properties * >(argp1);
2375
+ result = (int)((TagLib::RIFF::WAV::Properties const *)arg1)->bitsPerSample();
2376
+ vresult = SWIG_From_int(static_cast< int >(result));
2377
+ return vresult;
2378
+ fail:
2379
+ return Qnil;
2380
+ }
2381
+
2382
+
2383
+ SWIGINTERN VALUE
2384
+ _wrap_Properties_sample_frames(int argc, VALUE *argv, VALUE self) {
2385
+ TagLib::RIFF::WAV::Properties *arg1 = (TagLib::RIFF::WAV::Properties *) 0 ;
2386
+ void *argp1 = 0 ;
2387
+ int res1 = 0 ;
2388
+ unsigned int result;
2389
+ VALUE vresult = Qnil;
2390
+
2391
+ if ((argc < 0) || (argc > 0)) {
2392
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2393
+ }
2394
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__Properties, 0 | 0 );
2395
+ if (!SWIG_IsOK(res1)) {
2396
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::Properties const *","sampleFrames", 1, self ));
2397
+ }
2398
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::Properties * >(argp1);
2399
+ result = (unsigned int)((TagLib::RIFF::WAV::Properties const *)arg1)->sampleFrames();
2400
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2401
+ return vresult;
2402
+ fail:
2403
+ return Qnil;
2404
+ }
2405
+
2406
+
2407
+ SWIGINTERN VALUE
2408
+ _wrap_Properties_format(int argc, VALUE *argv, VALUE self) {
2409
+ TagLib::RIFF::WAV::Properties *arg1 = (TagLib::RIFF::WAV::Properties *) 0 ;
2410
+ void *argp1 = 0 ;
2411
+ int res1 = 0 ;
2412
+ int result;
2413
+ VALUE vresult = Qnil;
2414
+
2415
+ if ((argc < 0) || (argc > 0)) {
2416
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2417
+ }
2418
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__Properties, 0 | 0 );
2419
+ if (!SWIG_IsOK(res1)) {
2420
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::Properties const *","format", 1, self ));
2421
+ }
2422
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::Properties * >(argp1);
2423
+ result = (int)((TagLib::RIFF::WAV::Properties const *)arg1)->format();
2424
+ vresult = SWIG_From_int(static_cast< int >(result));
2425
+ return vresult;
2426
+ fail:
2427
+ return Qnil;
2428
+ }
2429
+
2430
+
2431
+ static swig_class SwigClassFile;
2432
+
2433
+ SWIGINTERN VALUE
2434
+ _wrap_new_File__SWIG_0(int argc, VALUE *argv, VALUE self) {
2435
+ TagLib::FileName arg1 ;
2436
+ bool arg2 ;
2437
+ TagLib::RIFF::WAV::Properties::ReadStyle arg3 ;
2438
+ bool val2 ;
2439
+ int ecode2 = 0 ;
2440
+ int val3 ;
2441
+ int ecode3 = 0 ;
2442
+ TagLib::RIFF::WAV::File *result = 0 ;
2443
+
2444
+ if ((argc < 3) || (argc > 3)) {
2445
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
2446
+ }
2447
+ {
2448
+ arg1 = ruby_string_to_taglib_filename(argv[0]);
2449
+ if ((const char *)(TagLib::FileName)(arg1) == NULL) {
2450
+ SWIG_exception_fail(SWIG_MemoryError, "Failed to allocate memory for file name.");
2451
+ }
2452
+ }
2453
+ ecode2 = SWIG_AsVal_bool(argv[1], &val2);
2454
+ if (!SWIG_IsOK(ecode2)) {
2455
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","File", 2, argv[1] ));
2456
+ }
2457
+ arg2 = static_cast< bool >(val2);
2458
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
2459
+ if (!SWIG_IsOK(ecode3)) {
2460
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::Properties::ReadStyle","File", 3, argv[2] ));
2461
+ }
2462
+ arg3 = static_cast< TagLib::RIFF::WAV::Properties::ReadStyle >(val3);
2463
+ result = (TagLib::RIFF::WAV::File *)new TagLib::RIFF::WAV::File(arg1,arg2,arg3);
2464
+ DATA_PTR(self) = result;
2465
+ SWIG_RubyAddTracking(result, self);
2466
+ return self;
2467
+ fail:
2468
+ return Qnil;
2469
+ }
2470
+
2471
+
2472
+ SWIGINTERN VALUE
2473
+ _wrap_new_File__SWIG_1(int argc, VALUE *argv, VALUE self) {
2474
+ TagLib::FileName arg1 ;
2475
+ bool arg2 ;
2476
+ bool val2 ;
2477
+ int ecode2 = 0 ;
2478
+ TagLib::RIFF::WAV::File *result = 0 ;
2479
+
2480
+ if ((argc < 2) || (argc > 2)) {
2481
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2482
+ }
2483
+ {
2484
+ arg1 = ruby_string_to_taglib_filename(argv[0]);
2485
+ if ((const char *)(TagLib::FileName)(arg1) == NULL) {
2486
+ SWIG_exception_fail(SWIG_MemoryError, "Failed to allocate memory for file name.");
2487
+ }
2488
+ }
2489
+ ecode2 = SWIG_AsVal_bool(argv[1], &val2);
2490
+ if (!SWIG_IsOK(ecode2)) {
2491
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","File", 2, argv[1] ));
2492
+ }
2493
+ arg2 = static_cast< bool >(val2);
2494
+ result = (TagLib::RIFF::WAV::File *)new TagLib::RIFF::WAV::File(arg1,arg2);
2495
+ DATA_PTR(self) = result;
2496
+ SWIG_RubyAddTracking(result, self);
2497
+ return self;
2498
+ fail:
2499
+ return Qnil;
2500
+ }
2501
+
2502
+
2503
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2504
+ SWIGINTERN VALUE
2505
+ _wrap_File_allocate(VALUE self) {
2506
+ #else
2507
+ SWIGINTERN VALUE
2508
+ _wrap_File_allocate(int argc, VALUE *argv, VALUE self) {
2509
+ #endif
2510
+
2511
+
2512
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__RIFF__WAV__File);
2513
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2514
+ rb_obj_call_init(vresult, argc, argv);
2515
+ #endif
2516
+ return vresult;
2517
+ }
2518
+
2519
+
2520
+ SWIGINTERN VALUE
2521
+ _wrap_new_File__SWIG_2(int argc, VALUE *argv, VALUE self) {
2522
+ TagLib::FileName arg1 ;
2523
+ TagLib::RIFF::WAV::File *result = 0 ;
2524
+
2525
+ if ((argc < 1) || (argc > 1)) {
2526
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2527
+ }
2528
+ {
2529
+ arg1 = ruby_string_to_taglib_filename(argv[0]);
2530
+ if ((const char *)(TagLib::FileName)(arg1) == NULL) {
2531
+ SWIG_exception_fail(SWIG_MemoryError, "Failed to allocate memory for file name.");
2532
+ }
2533
+ }
2534
+ result = (TagLib::RIFF::WAV::File *)new TagLib::RIFF::WAV::File(arg1);
2535
+ DATA_PTR(self) = result;
2536
+ SWIG_RubyAddTracking(result, self);
2537
+ return self;
2538
+ fail:
2539
+ return Qnil;
2540
+ }
2541
+
2542
+
2543
+ SWIGINTERN VALUE _wrap_new_File(int nargs, VALUE *args, VALUE self) {
2544
+ int argc;
2545
+ VALUE argv[3];
2546
+ int ii;
2547
+
2548
+ argc = nargs;
2549
+ if (argc > 3) SWIG_fail;
2550
+ for (ii = 0; (ii < argc); ++ii) {
2551
+ argv[ii] = args[ii];
2552
+ }
2553
+ if (argc == 1) {
2554
+ int _v;
2555
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
2556
+ _v = SWIG_CheckState(res);
2557
+ if (_v) {
2558
+ return _wrap_new_File__SWIG_2(nargs, args, self);
2559
+ }
2560
+ }
2561
+ if (argc == 2) {
2562
+ int _v;
2563
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
2564
+ _v = SWIG_CheckState(res);
2565
+ if (_v) {
2566
+ {
2567
+ int res = SWIG_AsVal_bool(argv[1], NULL);
2568
+ _v = SWIG_CheckState(res);
2569
+ }
2570
+ if (_v) {
2571
+ return _wrap_new_File__SWIG_1(nargs, args, self);
2572
+ }
2573
+ }
2574
+ }
2575
+ if (argc == 3) {
2576
+ int _v;
2577
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
2578
+ _v = SWIG_CheckState(res);
2579
+ if (_v) {
2580
+ {
2581
+ int res = SWIG_AsVal_bool(argv[1], NULL);
2582
+ _v = SWIG_CheckState(res);
2583
+ }
2584
+ if (_v) {
2585
+ {
2586
+ int res = SWIG_AsVal_int(argv[2], NULL);
2587
+ _v = SWIG_CheckState(res);
2588
+ }
2589
+ if (_v) {
2590
+ return _wrap_new_File__SWIG_0(nargs, args, self);
2591
+ }
2592
+ }
2593
+ }
2594
+ }
2595
+
2596
+ fail:
2597
+ Ruby_Format_OverloadedError( argc, 3, "File.new",
2598
+ " File.new(TagLib::FileName file, bool readProperties, TagLib::RIFF::WAV::Properties::ReadStyle propertiesStyle)\n"
2599
+ " File.new(TagLib::FileName file, bool readProperties)\n"
2600
+ " File.new(TagLib::FileName file)\n");
2601
+
2602
+ return Qnil;
2603
+ }
2604
+
2605
+
2606
+ SWIGINTERN VALUE
2607
+ _wrap_File_tag(int argc, VALUE *argv, VALUE self) {
2608
+ TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
2609
+ void *argp1 = 0 ;
2610
+ int res1 = 0 ;
2611
+ TagLib::ID3v2::Tag *result = 0 ;
2612
+ VALUE vresult = Qnil;
2613
+
2614
+ if ((argc < 0) || (argc > 0)) {
2615
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2616
+ }
2617
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__File, 0 | 0 );
2618
+ if (!SWIG_IsOK(res1)) {
2619
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File const *","tag", 1, self ));
2620
+ }
2621
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
2622
+ result = (TagLib::ID3v2::Tag *)((TagLib::RIFF::WAV::File const *)arg1)->tag();
2623
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__ID3v2__Tag, 0 | 0 );
2624
+ return vresult;
2625
+ fail:
2626
+ return Qnil;
2627
+ }
2628
+
2629
+
2630
+ SWIGINTERN VALUE
2631
+ _wrap_File_id3v2_tag(int argc, VALUE *argv, VALUE self) {
2632
+ TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
2633
+ void *argp1 = 0 ;
2634
+ int res1 = 0 ;
2635
+ TagLib::ID3v2::Tag *result = 0 ;
2636
+ VALUE vresult = Qnil;
2637
+
2638
+ if ((argc < 0) || (argc > 0)) {
2639
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2640
+ }
2641
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__File, 0 | 0 );
2642
+ if (!SWIG_IsOK(res1)) {
2643
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File const *","ID3v2Tag", 1, self ));
2644
+ }
2645
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
2646
+ result = (TagLib::ID3v2::Tag *)((TagLib::RIFF::WAV::File const *)arg1)->ID3v2Tag();
2647
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__ID3v2__Tag, 0 | 0 );
2648
+ return vresult;
2649
+ fail:
2650
+ return Qnil;
2651
+ }
2652
+
2653
+
2654
+ SWIGINTERN VALUE
2655
+ _wrap_File_strip__SWIG_0(int argc, VALUE *argv, VALUE self) {
2656
+ TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
2657
+ TagLib::RIFF::WAV::File::TagTypes arg2 ;
2658
+ void *argp1 = 0 ;
2659
+ int res1 = 0 ;
2660
+ int val2 ;
2661
+ int ecode2 = 0 ;
2662
+
2663
+ if ((argc < 1) || (argc > 1)) {
2664
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2665
+ }
2666
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__File, 0 | 0 );
2667
+ if (!SWIG_IsOK(res1)) {
2668
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File *","strip", 1, self ));
2669
+ }
2670
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
2671
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2672
+ if (!SWIG_IsOK(ecode2)) {
2673
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File::TagTypes","strip", 2, argv[0] ));
2674
+ }
2675
+ arg2 = static_cast< TagLib::RIFF::WAV::File::TagTypes >(val2);
2676
+ (arg1)->strip(arg2);
2677
+ return Qnil;
2678
+ fail:
2679
+ return Qnil;
2680
+ }
2681
+
2682
+
2683
+ SWIGINTERN VALUE
2684
+ _wrap_File_strip__SWIG_1(int argc, VALUE *argv, VALUE self) {
2685
+ TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
2686
+ void *argp1 = 0 ;
2687
+ int res1 = 0 ;
2688
+
2689
+ if ((argc < 0) || (argc > 0)) {
2690
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2691
+ }
2692
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__File, 0 | 0 );
2693
+ if (!SWIG_IsOK(res1)) {
2694
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File *","strip", 1, self ));
2695
+ }
2696
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
2697
+ (arg1)->strip();
2698
+ return Qnil;
2699
+ fail:
2700
+ return Qnil;
2701
+ }
2702
+
2703
+
2704
+ SWIGINTERN VALUE _wrap_File_strip(int nargs, VALUE *args, VALUE self) {
2705
+ int argc;
2706
+ VALUE argv[3];
2707
+ int ii;
2708
+
2709
+ argc = nargs + 1;
2710
+ argv[0] = self;
2711
+ if (argc > 3) SWIG_fail;
2712
+ for (ii = 1; (ii < argc); ++ii) {
2713
+ argv[ii] = args[ii-1];
2714
+ }
2715
+ if (argc == 1) {
2716
+ int _v;
2717
+ void *vptr = 0;
2718
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__RIFF__WAV__File, 0);
2719
+ _v = SWIG_CheckState(res);
2720
+ if (_v) {
2721
+ return _wrap_File_strip__SWIG_1(nargs, args, self);
2722
+ }
2723
+ }
2724
+ if (argc == 2) {
2725
+ int _v;
2726
+ void *vptr = 0;
2727
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__RIFF__WAV__File, 0);
2728
+ _v = SWIG_CheckState(res);
2729
+ if (_v) {
2730
+ {
2731
+ int res = SWIG_AsVal_int(argv[1], NULL);
2732
+ _v = SWIG_CheckState(res);
2733
+ }
2734
+ if (_v) {
2735
+ return _wrap_File_strip__SWIG_0(nargs, args, self);
2736
+ }
2737
+ }
2738
+ }
2739
+
2740
+ fail:
2741
+ Ruby_Format_OverloadedError( argc, 3, "File.strip",
2742
+ " void File.strip(TagLib::RIFF::WAV::File::TagTypes tags)\n"
2743
+ " void File.strip()\n");
2744
+
2745
+ return Qnil;
2746
+ }
2747
+
2748
+
2749
+ SWIGINTERN VALUE
2750
+ _wrap_File_audio_properties(int argc, VALUE *argv, VALUE self) {
2751
+ TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
2752
+ void *argp1 = 0 ;
2753
+ int res1 = 0 ;
2754
+ TagLib::RIFF::WAV::Properties *result = 0 ;
2755
+ VALUE vresult = Qnil;
2756
+
2757
+ if ((argc < 0) || (argc > 0)) {
2758
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2759
+ }
2760
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__File, 0 | 0 );
2761
+ if (!SWIG_IsOK(res1)) {
2762
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File const *","audioProperties", 1, self ));
2763
+ }
2764
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
2765
+ result = (TagLib::RIFF::WAV::Properties *)((TagLib::RIFF::WAV::File const *)arg1)->audioProperties();
2766
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__RIFF__WAV__Properties, 0 | 0 );
2767
+ return vresult;
2768
+ fail:
2769
+ return Qnil;
2770
+ }
2771
+
2772
+
2773
+ SWIGINTERN VALUE
2774
+ _wrap_File_save__SWIG_0(int argc, VALUE *argv, VALUE self) {
2775
+ TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
2776
+ void *argp1 = 0 ;
2777
+ int res1 = 0 ;
2778
+ bool result;
2779
+ VALUE vresult = Qnil;
2780
+
2781
+ if ((argc < 0) || (argc > 0)) {
2782
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2783
+ }
2784
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__File, 0 | 0 );
2785
+ if (!SWIG_IsOK(res1)) {
2786
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File *","save", 1, self ));
2787
+ }
2788
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
2789
+ result = (bool)(arg1)->save();
2790
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2791
+ return vresult;
2792
+ fail:
2793
+ return Qnil;
2794
+ }
2795
+
2796
+
2797
+ SWIGINTERN VALUE
2798
+ _wrap_File_save__SWIG_1(int argc, VALUE *argv, VALUE self) {
2799
+ TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
2800
+ TagLib::RIFF::WAV::File::TagTypes arg2 ;
2801
+ bool arg3 ;
2802
+ int arg4 ;
2803
+ void *argp1 = 0 ;
2804
+ int res1 = 0 ;
2805
+ int val2 ;
2806
+ int ecode2 = 0 ;
2807
+ bool val3 ;
2808
+ int ecode3 = 0 ;
2809
+ int val4 ;
2810
+ int ecode4 = 0 ;
2811
+ bool result;
2812
+ VALUE vresult = Qnil;
2813
+
2814
+ if ((argc < 3) || (argc > 3)) {
2815
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
2816
+ }
2817
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__File, 0 | 0 );
2818
+ if (!SWIG_IsOK(res1)) {
2819
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File *","save", 1, self ));
2820
+ }
2821
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
2822
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2823
+ if (!SWIG_IsOK(ecode2)) {
2824
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File::TagTypes","save", 2, argv[0] ));
2825
+ }
2826
+ arg2 = static_cast< TagLib::RIFF::WAV::File::TagTypes >(val2);
2827
+ ecode3 = SWIG_AsVal_bool(argv[1], &val3);
2828
+ if (!SWIG_IsOK(ecode3)) {
2829
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","save", 3, argv[1] ));
2830
+ }
2831
+ arg3 = static_cast< bool >(val3);
2832
+ ecode4 = SWIG_AsVal_int(argv[2], &val4);
2833
+ if (!SWIG_IsOK(ecode4)) {
2834
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","save", 4, argv[2] ));
2835
+ }
2836
+ arg4 = static_cast< int >(val4);
2837
+ result = (bool)(arg1)->save(arg2,arg3,arg4);
2838
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2839
+ return vresult;
2840
+ fail:
2841
+ return Qnil;
2842
+ }
2843
+
2844
+
2845
+ SWIGINTERN VALUE
2846
+ _wrap_File_save__SWIG_2(int argc, VALUE *argv, VALUE self) {
2847
+ TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
2848
+ TagLib::RIFF::WAV::File::TagTypes arg2 ;
2849
+ bool arg3 ;
2850
+ void *argp1 = 0 ;
2851
+ int res1 = 0 ;
2852
+ int val2 ;
2853
+ int ecode2 = 0 ;
2854
+ bool val3 ;
2855
+ int ecode3 = 0 ;
2856
+ bool result;
2857
+ VALUE vresult = Qnil;
2858
+
2859
+ if ((argc < 2) || (argc > 2)) {
2860
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2861
+ }
2862
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__File, 0 | 0 );
2863
+ if (!SWIG_IsOK(res1)) {
2864
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File *","save", 1, self ));
2865
+ }
2866
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
2867
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2868
+ if (!SWIG_IsOK(ecode2)) {
2869
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File::TagTypes","save", 2, argv[0] ));
2870
+ }
2871
+ arg2 = static_cast< TagLib::RIFF::WAV::File::TagTypes >(val2);
2872
+ ecode3 = SWIG_AsVal_bool(argv[1], &val3);
2873
+ if (!SWIG_IsOK(ecode3)) {
2874
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","save", 3, argv[1] ));
2875
+ }
2876
+ arg3 = static_cast< bool >(val3);
2877
+ result = (bool)(arg1)->save(arg2,arg3);
2878
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2879
+ return vresult;
2880
+ fail:
2881
+ return Qnil;
2882
+ }
2883
+
2884
+
2885
+ SWIGINTERN VALUE
2886
+ _wrap_File_save__SWIG_3(int argc, VALUE *argv, VALUE self) {
2887
+ TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
2888
+ TagLib::RIFF::WAV::File::TagTypes arg2 ;
2889
+ void *argp1 = 0 ;
2890
+ int res1 = 0 ;
2891
+ int val2 ;
2892
+ int ecode2 = 0 ;
2893
+ bool result;
2894
+ VALUE vresult = Qnil;
2895
+
2896
+ if ((argc < 1) || (argc > 1)) {
2897
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2898
+ }
2899
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__File, 0 | 0 );
2900
+ if (!SWIG_IsOK(res1)) {
2901
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File *","save", 1, self ));
2902
+ }
2903
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
2904
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2905
+ if (!SWIG_IsOK(ecode2)) {
2906
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File::TagTypes","save", 2, argv[0] ));
2907
+ }
2908
+ arg2 = static_cast< TagLib::RIFF::WAV::File::TagTypes >(val2);
2909
+ result = (bool)(arg1)->save(arg2);
2910
+ vresult = SWIG_From_bool(static_cast< bool >(result));
2911
+ return vresult;
2912
+ fail:
2913
+ return Qnil;
2914
+ }
2915
+
2916
+
2917
+ SWIGINTERN VALUE _wrap_File_save(int nargs, VALUE *args, VALUE self) {
2918
+ int argc;
2919
+ VALUE argv[5];
2920
+ int ii;
2921
+
2922
+ argc = nargs + 1;
2923
+ argv[0] = self;
2924
+ if (argc > 5) SWIG_fail;
2925
+ for (ii = 1; (ii < argc); ++ii) {
2926
+ argv[ii] = args[ii-1];
2927
+ }
2928
+ if (argc == 1) {
2929
+ int _v;
2930
+ void *vptr = 0;
2931
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__RIFF__WAV__File, 0);
2932
+ _v = SWIG_CheckState(res);
2933
+ if (_v) {
2934
+ return _wrap_File_save__SWIG_0(nargs, args, self);
2935
+ }
2936
+ }
2937
+ if (argc == 2) {
2938
+ int _v;
2939
+ void *vptr = 0;
2940
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__RIFF__WAV__File, 0);
2941
+ _v = SWIG_CheckState(res);
2942
+ if (_v) {
2943
+ {
2944
+ int res = SWIG_AsVal_int(argv[1], NULL);
2945
+ _v = SWIG_CheckState(res);
2946
+ }
2947
+ if (_v) {
2948
+ return _wrap_File_save__SWIG_3(nargs, args, self);
2949
+ }
2950
+ }
2951
+ }
2952
+ if (argc == 3) {
2953
+ int _v;
2954
+ void *vptr = 0;
2955
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__RIFF__WAV__File, 0);
2956
+ _v = SWIG_CheckState(res);
2957
+ if (_v) {
2958
+ {
2959
+ int res = SWIG_AsVal_int(argv[1], NULL);
2960
+ _v = SWIG_CheckState(res);
2961
+ }
2962
+ if (_v) {
2963
+ {
2964
+ int res = SWIG_AsVal_bool(argv[2], NULL);
2965
+ _v = SWIG_CheckState(res);
2966
+ }
2967
+ if (_v) {
2968
+ return _wrap_File_save__SWIG_2(nargs, args, self);
2969
+ }
2970
+ }
2971
+ }
2972
+ }
2973
+ if (argc == 4) {
2974
+ int _v;
2975
+ void *vptr = 0;
2976
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__RIFF__WAV__File, 0);
2977
+ _v = SWIG_CheckState(res);
2978
+ if (_v) {
2979
+ {
2980
+ int res = SWIG_AsVal_int(argv[1], NULL);
2981
+ _v = SWIG_CheckState(res);
2982
+ }
2983
+ if (_v) {
2984
+ {
2985
+ int res = SWIG_AsVal_bool(argv[2], NULL);
2986
+ _v = SWIG_CheckState(res);
2987
+ }
2988
+ if (_v) {
2989
+ {
2990
+ int res = SWIG_AsVal_int(argv[3], NULL);
2991
+ _v = SWIG_CheckState(res);
2992
+ }
2993
+ if (_v) {
2994
+ return _wrap_File_save__SWIG_1(nargs, args, self);
2995
+ }
2996
+ }
2997
+ }
2998
+ }
2999
+ }
3000
+
3001
+ fail:
3002
+ Ruby_Format_OverloadedError( argc, 5, "File.save",
3003
+ " bool File.save()\n"
3004
+ " bool File.save(TagLib::RIFF::WAV::File::TagTypes tags, bool stripOthers, int id3v2Version)\n"
3005
+ " bool File.save(TagLib::RIFF::WAV::File::TagTypes tags, bool stripOthers)\n"
3006
+ " bool File.save(TagLib::RIFF::WAV::File::TagTypes tags)\n");
3007
+
3008
+ return Qnil;
3009
+ }
3010
+
3011
+
3012
+ SWIGINTERN VALUE
3013
+ _wrap_File_id3v2_tagq___(int argc, VALUE *argv, VALUE self) {
3014
+ TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
3015
+ void *argp1 = 0 ;
3016
+ int res1 = 0 ;
3017
+ bool result;
3018
+ VALUE vresult = Qnil;
3019
+
3020
+ if ((argc < 0) || (argc > 0)) {
3021
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3022
+ }
3023
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__File, 0 | 0 );
3024
+ if (!SWIG_IsOK(res1)) {
3025
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File const *","hasID3v2Tag", 1, self ));
3026
+ }
3027
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
3028
+ result = (bool)((TagLib::RIFF::WAV::File const *)arg1)->hasID3v2Tag();
3029
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3030
+ return vresult;
3031
+ fail:
3032
+ return Qnil;
3033
+ }
3034
+
3035
+
3036
+ SWIGINTERN VALUE
3037
+ _wrap_File_info_tagq___(int argc, VALUE *argv, VALUE self) {
3038
+ TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
3039
+ void *argp1 = 0 ;
3040
+ int res1 = 0 ;
3041
+ bool result;
3042
+ VALUE vresult = Qnil;
3043
+
3044
+ if ((argc < 0) || (argc > 0)) {
3045
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3046
+ }
3047
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__File, 0 | 0 );
3048
+ if (!SWIG_IsOK(res1)) {
3049
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File const *","hasInfoTag", 1, self ));
3050
+ }
3051
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
3052
+ result = (bool)((TagLib::RIFF::WAV::File const *)arg1)->hasInfoTag();
3053
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3054
+ return vresult;
3055
+ fail:
3056
+ return Qnil;
3057
+ }
3058
+
3059
+
3060
+ SWIGINTERN VALUE
3061
+ _wrap_File_close(int argc, VALUE *argv, VALUE self) {
3062
+ TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
3063
+ void *argp1 = 0 ;
3064
+ int res1 = 0 ;
3065
+
3066
+ if ((argc < 0) || (argc > 0)) {
3067
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3068
+ }
3069
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__File, 0 | 0 );
3070
+ if (!SWIG_IsOK(res1)) {
3071
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File *","close", 1, self ));
3072
+ }
3073
+ arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
3074
+ TagLib_RIFF_WAV_File_close(arg1);
3075
+ return Qnil;
3076
+ fail:
3077
+ return Qnil;
3078
+ }
3079
+
3080
+
3081
+
3082
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
3083
+
3084
+ static void *_p_TagLib__RIFF__WAV__PropertiesTo_p_TagLib__AudioProperties(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3085
+ return (void *)((TagLib::AudioProperties *) ((TagLib::RIFF::WAV::Properties *) x));
3086
+ }
3087
+ static swig_type_info _swigt__p_TagLib__AudioProperties = {"_p_TagLib__AudioProperties", "TagLib::AudioProperties *", 0, 0, (void*)0, 0};
3088
+ static swig_type_info _swigt__p_TagLib__ID3v2__Tag = {"_p_TagLib__ID3v2__Tag", "TagLib::ID3v2::Tag *", 0, 0, (void*)0, 0};
3089
+ static swig_type_info _swigt__p_TagLib__RIFF__WAV__File = {"_p_TagLib__RIFF__WAV__File", "TagLib::RIFF::WAV::File *", 0, 0, (void*)0, 0};
3090
+ static swig_type_info _swigt__p_TagLib__RIFF__WAV__Properties = {"_p_TagLib__RIFF__WAV__Properties", "TagLib::RIFF::WAV::Properties *", 0, 0, (void*)0, 0};
3091
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
3092
+ static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "TagLib::uchar *|unsigned char *", 0, 0, (void*)0, 0};
3093
+ static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *|TagLib::uint *", 0, 0, (void*)0, 0};
3094
+ static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "TagLib::ulong *|unsigned long *", 0, 0, (void*)0, 0};
3095
+ static swig_type_info _swigt__p_wchar_t = {"_p_wchar_t", "TagLib::wchar *|wchar_t *", 0, 0, (void*)0, 0};
3096
+
3097
+ static swig_type_info *swig_type_initial[] = {
3098
+ &_swigt__p_TagLib__AudioProperties,
3099
+ &_swigt__p_TagLib__ID3v2__Tag,
3100
+ &_swigt__p_TagLib__RIFF__WAV__File,
3101
+ &_swigt__p_TagLib__RIFF__WAV__Properties,
3102
+ &_swigt__p_char,
3103
+ &_swigt__p_unsigned_char,
3104
+ &_swigt__p_unsigned_int,
3105
+ &_swigt__p_unsigned_long,
3106
+ &_swigt__p_wchar_t,
3107
+ };
3108
+
3109
+ static swig_cast_info _swigc__p_TagLib__AudioProperties[] = { {&_swigt__p_TagLib__AudioProperties, 0, 0, 0}, {&_swigt__p_TagLib__RIFF__WAV__Properties, _p_TagLib__RIFF__WAV__PropertiesTo_p_TagLib__AudioProperties, 0, 0},{0, 0, 0, 0}};
3110
+ static swig_cast_info _swigc__p_TagLib__ID3v2__Tag[] = { {&_swigt__p_TagLib__ID3v2__Tag, 0, 0, 0},{0, 0, 0, 0}};
3111
+ static swig_cast_info _swigc__p_TagLib__RIFF__WAV__File[] = { {&_swigt__p_TagLib__RIFF__WAV__File, 0, 0, 0},{0, 0, 0, 0}};
3112
+ static swig_cast_info _swigc__p_TagLib__RIFF__WAV__Properties[] = { {&_swigt__p_TagLib__RIFF__WAV__Properties, 0, 0, 0},{0, 0, 0, 0}};
3113
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
3114
+ static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
3115
+ static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
3116
+ static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
3117
+ static swig_cast_info _swigc__p_wchar_t[] = { {&_swigt__p_wchar_t, 0, 0, 0},{0, 0, 0, 0}};
3118
+
3119
+ static swig_cast_info *swig_cast_initial[] = {
3120
+ _swigc__p_TagLib__AudioProperties,
3121
+ _swigc__p_TagLib__ID3v2__Tag,
3122
+ _swigc__p_TagLib__RIFF__WAV__File,
3123
+ _swigc__p_TagLib__RIFF__WAV__Properties,
3124
+ _swigc__p_char,
3125
+ _swigc__p_unsigned_char,
3126
+ _swigc__p_unsigned_int,
3127
+ _swigc__p_unsigned_long,
3128
+ _swigc__p_wchar_t,
3129
+ };
3130
+
3131
+
3132
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3133
+
3134
+ /* -----------------------------------------------------------------------------
3135
+ * Type initialization:
3136
+ * This problem is tough by the requirement that no dynamic
3137
+ * memory is used. Also, since swig_type_info structures store pointers to
3138
+ * swig_cast_info structures and swig_cast_info structures store pointers back
3139
+ * to swig_type_info structures, we need some lookup code at initialization.
3140
+ * The idea is that swig generates all the structures that are needed.
3141
+ * The runtime then collects these partially filled structures.
3142
+ * The SWIG_InitializeModule function takes these initial arrays out of
3143
+ * swig_module, and does all the lookup, filling in the swig_module.types
3144
+ * array with the correct data and linking the correct swig_cast_info
3145
+ * structures together.
3146
+ *
3147
+ * The generated swig_type_info structures are assigned statically to an initial
3148
+ * array. We just loop through that array, and handle each type individually.
3149
+ * First we lookup if this type has been already loaded, and if so, use the
3150
+ * loaded structure instead of the generated one. Then we have to fill in the
3151
+ * cast linked list. The cast data is initially stored in something like a
3152
+ * two-dimensional array. Each row corresponds to a type (there are the same
3153
+ * number of rows as there are in the swig_type_initial array). Each entry in
3154
+ * a column is one of the swig_cast_info structures for that type.
3155
+ * The cast_initial array is actually an array of arrays, because each row has
3156
+ * a variable number of columns. So to actually build the cast linked list,
3157
+ * we find the array of casts associated with the type, and loop through it
3158
+ * adding the casts to the list. The one last trick we need to do is making
3159
+ * sure the type pointer in the swig_cast_info struct is correct.
3160
+ *
3161
+ * First off, we lookup the cast->type name to see if it is already loaded.
3162
+ * There are three cases to handle:
3163
+ * 1) If the cast->type has already been loaded AND the type we are adding
3164
+ * casting info to has not been loaded (it is in this module), THEN we
3165
+ * replace the cast->type pointer with the type pointer that has already
3166
+ * been loaded.
3167
+ * 2) If BOTH types (the one we are adding casting info to, and the
3168
+ * cast->type) are loaded, THEN the cast info has already been loaded by
3169
+ * the previous module so we just ignore it.
3170
+ * 3) Finally, if cast->type has not already been loaded, then we add that
3171
+ * swig_cast_info to the linked list (because the cast->type) pointer will
3172
+ * be correct.
3173
+ * ----------------------------------------------------------------------------- */
3174
+
3175
+ #ifdef __cplusplus
3176
+ extern "C" {
3177
+ #if 0
3178
+ } /* c-mode */
3179
+ #endif
3180
+ #endif
3181
+
3182
+ #if 0
3183
+ #define SWIGRUNTIME_DEBUG
3184
+ #endif
3185
+
3186
+
3187
+ SWIGRUNTIME void
3188
+ SWIG_InitializeModule(void *clientdata) {
3189
+ size_t i;
3190
+ swig_module_info *module_head, *iter;
3191
+ int init;
3192
+
3193
+ /* check to see if the circular list has been setup, if not, set it up */
3194
+ if (swig_module.next==0) {
3195
+ /* Initialize the swig_module */
3196
+ swig_module.type_initial = swig_type_initial;
3197
+ swig_module.cast_initial = swig_cast_initial;
3198
+ swig_module.next = &swig_module;
3199
+ init = 1;
3200
+ } else {
3201
+ init = 0;
3202
+ }
3203
+
3204
+ /* Try and load any already created modules */
3205
+ module_head = SWIG_GetModule(clientdata);
3206
+ if (!module_head) {
3207
+ /* This is the first module loaded for this interpreter */
3208
+ /* so set the swig module into the interpreter */
3209
+ SWIG_SetModule(clientdata, &swig_module);
3210
+ } else {
3211
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
3212
+ iter=module_head;
3213
+ do {
3214
+ if (iter==&swig_module) {
3215
+ /* Our module is already in the list, so there's nothing more to do. */
3216
+ return;
3217
+ }
3218
+ iter=iter->next;
3219
+ } while (iter!= module_head);
3220
+
3221
+ /* otherwise we must add our module into the list */
3222
+ swig_module.next = module_head->next;
3223
+ module_head->next = &swig_module;
3224
+ }
3225
+
3226
+ /* When multiple interpreters are used, a module could have already been initialized in
3227
+ a different interpreter, but not yet have a pointer in this interpreter.
3228
+ In this case, we do not want to continue adding types... everything should be
3229
+ set up already */
3230
+ if (init == 0) return;
3231
+
3232
+ /* Now work on filling in swig_module.types */
3233
+ #ifdef SWIGRUNTIME_DEBUG
3234
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
3235
+ #endif
3236
+ for (i = 0; i < swig_module.size; ++i) {
3237
+ swig_type_info *type = 0;
3238
+ swig_type_info *ret;
3239
+ swig_cast_info *cast;
3240
+
3241
+ #ifdef SWIGRUNTIME_DEBUG
3242
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3243
+ #endif
3244
+
3245
+ /* if there is another module already loaded */
3246
+ if (swig_module.next != &swig_module) {
3247
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
3248
+ }
3249
+ if (type) {
3250
+ /* Overwrite clientdata field */
3251
+ #ifdef SWIGRUNTIME_DEBUG
3252
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
3253
+ #endif
3254
+ if (swig_module.type_initial[i]->clientdata) {
3255
+ type->clientdata = swig_module.type_initial[i]->clientdata;
3256
+ #ifdef SWIGRUNTIME_DEBUG
3257
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
3258
+ #endif
3259
+ }
3260
+ } else {
3261
+ type = swig_module.type_initial[i];
3262
+ }
3263
+
3264
+ /* Insert casting types */
3265
+ cast = swig_module.cast_initial[i];
3266
+ while (cast->type) {
3267
+
3268
+ /* Don't need to add information already in the list */
3269
+ ret = 0;
3270
+ #ifdef SWIGRUNTIME_DEBUG
3271
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
3272
+ #endif
3273
+ if (swig_module.next != &swig_module) {
3274
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3275
+ #ifdef SWIGRUNTIME_DEBUG
3276
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
3277
+ #endif
3278
+ }
3279
+ if (ret) {
3280
+ if (type == swig_module.type_initial[i]) {
3281
+ #ifdef SWIGRUNTIME_DEBUG
3282
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
3283
+ #endif
3284
+ cast->type = ret;
3285
+ ret = 0;
3286
+ } else {
3287
+ /* Check for casting already in the list */
3288
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
3289
+ #ifdef SWIGRUNTIME_DEBUG
3290
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
3291
+ #endif
3292
+ if (!ocast) ret = 0;
3293
+ }
3294
+ }
3295
+
3296
+ if (!ret) {
3297
+ #ifdef SWIGRUNTIME_DEBUG
3298
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
3299
+ #endif
3300
+ if (type->cast) {
3301
+ type->cast->prev = cast;
3302
+ cast->next = type->cast;
3303
+ }
3304
+ type->cast = cast;
3305
+ }
3306
+ cast++;
3307
+ }
3308
+ /* Set entry in modules->types array equal to the type */
3309
+ swig_module.types[i] = type;
3310
+ }
3311
+ swig_module.types[i] = 0;
3312
+
3313
+ #ifdef SWIGRUNTIME_DEBUG
3314
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3315
+ for (i = 0; i < swig_module.size; ++i) {
3316
+ int j = 0;
3317
+ swig_cast_info *cast = swig_module.cast_initial[i];
3318
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3319
+ while (cast->type) {
3320
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
3321
+ cast++;
3322
+ ++j;
3323
+ }
3324
+ printf("---- Total casts: %d\n",j);
3325
+ }
3326
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3327
+ #endif
3328
+ }
3329
+
3330
+ /* This function will propagate the clientdata field of type to
3331
+ * any new swig_type_info structures that have been added into the list
3332
+ * of equivalent types. It is like calling
3333
+ * SWIG_TypeClientData(type, clientdata) a second time.
3334
+ */
3335
+ SWIGRUNTIME void
3336
+ SWIG_PropagateClientData(void) {
3337
+ size_t i;
3338
+ swig_cast_info *equiv;
3339
+ static int init_run = 0;
3340
+
3341
+ if (init_run) return;
3342
+ init_run = 1;
3343
+
3344
+ for (i = 0; i < swig_module.size; i++) {
3345
+ if (swig_module.types[i]->clientdata) {
3346
+ equiv = swig_module.types[i]->cast;
3347
+ while (equiv) {
3348
+ if (!equiv->converter) {
3349
+ if (equiv->type && !equiv->type->clientdata)
3350
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
3351
+ }
3352
+ equiv = equiv->next;
3353
+ }
3354
+ }
3355
+ }
3356
+ }
3357
+
3358
+ #ifdef __cplusplus
3359
+ #if 0
3360
+ { /* c-mode */
3361
+ #endif
3362
+ }
3363
+ #endif
3364
+
3365
+ /*
3366
+
3367
+ */
3368
+ #ifdef __cplusplus
3369
+ extern "C"
3370
+ #endif
3371
+ SWIGEXPORT void Init_taglib_wav(void) {
3372
+ size_t i;
3373
+
3374
+ SWIG_InitRuntime();
3375
+ mWAV = rb_define_module("TagLib");
3376
+ mWAV = rb_define_module_under(mWAV, "RIFF");
3377
+ mWAV = rb_define_module_under(mWAV, "WAV");
3378
+
3379
+ SWIG_InitializeModule(0);
3380
+ for (i = 0; i < swig_module.size; i++) {
3381
+ SWIG_define_class(swig_module.types[i]);
3382
+ }
3383
+
3384
+ SWIG_RubyInitializeTrackings();
3385
+ rb_require("taglib_base");
3386
+
3387
+ SwigClassProperties.klass = rb_define_class_under(mWAV, "Properties", ((swig_class *) SWIGTYPE_p_TagLib__AudioProperties->clientdata)->klass);
3388
+ SWIG_TypeClientData(SWIGTYPE_p_TagLib__RIFF__WAV__Properties, (void *) &SwigClassProperties);
3389
+ rb_define_alloc_func(SwigClassProperties.klass, _wrap_Properties_allocate);
3390
+ rb_define_method(SwigClassProperties.klass, "initialize", VALUEFUNC(_wrap_new_Properties), -1);
3391
+ rb_define_method(SwigClassProperties.klass, "length_in_seconds", VALUEFUNC(_wrap_Properties_length_in_seconds), -1);
3392
+ rb_define_method(SwigClassProperties.klass, "length_in_milliseconds", VALUEFUNC(_wrap_Properties_length_in_milliseconds), -1);
3393
+ rb_define_method(SwigClassProperties.klass, "bitrate", VALUEFUNC(_wrap_Properties_bitrate), -1);
3394
+ rb_define_method(SwigClassProperties.klass, "sample_rate", VALUEFUNC(_wrap_Properties_sample_rate), -1);
3395
+ rb_define_method(SwigClassProperties.klass, "channels", VALUEFUNC(_wrap_Properties_channels), -1);
3396
+ rb_define_method(SwigClassProperties.klass, "bits_per_sample", VALUEFUNC(_wrap_Properties_bits_per_sample), -1);
3397
+ rb_define_method(SwigClassProperties.klass, "sample_frames", VALUEFUNC(_wrap_Properties_sample_frames), -1);
3398
+ rb_define_method(SwigClassProperties.klass, "format", VALUEFUNC(_wrap_Properties_format), -1);
3399
+ SwigClassProperties.mark = 0;
3400
+ SwigClassProperties.destroy = (void (*)(void *)) free_TagLib_RIFF_WAV_Properties;
3401
+ SwigClassProperties.trackObjects = 1;
3402
+
3403
+ SwigClassFile.klass = rb_define_class_under(mWAV, "File", rb_cObject);
3404
+ SWIG_TypeClientData(SWIGTYPE_p_TagLib__RIFF__WAV__File, (void *) &SwigClassFile);
3405
+ rb_define_alloc_func(SwigClassFile.klass, _wrap_File_allocate);
3406
+ rb_define_method(SwigClassFile.klass, "initialize", VALUEFUNC(_wrap_new_File), -1);
3407
+ rb_define_const(SwigClassFile.klass, "NoTags", SWIG_From_int(static_cast< int >(TagLib::RIFF::WAV::File::NoTags)));
3408
+ rb_define_const(SwigClassFile.klass, "ID3v2", SWIG_From_int(static_cast< int >(TagLib::RIFF::WAV::File::ID3v2)));
3409
+ rb_define_const(SwigClassFile.klass, "Info", SWIG_From_int(static_cast< int >(TagLib::RIFF::WAV::File::Info)));
3410
+ rb_define_const(SwigClassFile.klass, "AllTags", SWIG_From_int(static_cast< int >(TagLib::RIFF::WAV::File::AllTags)));
3411
+ rb_define_method(SwigClassFile.klass, "tag", VALUEFUNC(_wrap_File_tag), -1);
3412
+ rb_define_method(SwigClassFile.klass, "id3v2_tag", VALUEFUNC(_wrap_File_id3v2_tag), -1);
3413
+ rb_define_method(SwigClassFile.klass, "strip", VALUEFUNC(_wrap_File_strip), -1);
3414
+ rb_define_method(SwigClassFile.klass, "audio_properties", VALUEFUNC(_wrap_File_audio_properties), -1);
3415
+ rb_define_method(SwigClassFile.klass, "save", VALUEFUNC(_wrap_File_save), -1);
3416
+ rb_define_method(SwigClassFile.klass, "id3v2_tag?", VALUEFUNC(_wrap_File_id3v2_tagq___), -1);
3417
+ rb_define_method(SwigClassFile.klass, "info_tag?", VALUEFUNC(_wrap_File_info_tagq___), -1);
3418
+ rb_define_method(SwigClassFile.klass, "close", VALUEFUNC(_wrap_File_close), -1);
3419
+ SwigClassFile.mark = 0;
3420
+ SwigClassFile.destroy = (void (*)(void *)) free_taglib_riff_wav_file;
3421
+ SwigClassFile.trackObjects = 1;
3422
+ }
3423
+