taglib-ruby 0.6.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +1 -1
- data/{CHANGES.md → CHANGELOG.md} +46 -11
- data/README.md +61 -17
- data/Rakefile +12 -3
- data/docs/taglib/aiff.rb +95 -0
- data/docs/taglib/base.rb +30 -2
- data/docs/taglib/flac.rb +60 -4
- data/docs/taglib/id3v1.rb +29 -0
- data/docs/taglib/id3v2.rb +22 -3
- data/docs/taglib/mp4.rb +124 -13
- data/docs/taglib/mpeg.rb +30 -1
- data/docs/taglib/ogg.rb +47 -5
- data/docs/taglib/riff.rb +3 -0
- data/docs/taglib/vorbis.rb +1 -1
- data/docs/taglib/wav.rb +116 -0
- data/ext/extconf_common.rb +24 -3
- data/ext/taglib_aiff/extconf.rb +4 -0
- data/ext/taglib_aiff/taglib_aiff.i +84 -0
- data/ext/taglib_aiff/taglib_aiff_wrap.cxx +3111 -0
- data/ext/taglib_base/includes.i +34 -5
- data/ext/taglib_base/taglib_base.i +42 -2
- data/ext/taglib_base/taglib_base_wrap.cxx +226 -186
- data/ext/taglib_flac/taglib_flac.i +21 -18
- data/ext/taglib_flac/taglib_flac_wrap.cxx +519 -955
- data/ext/taglib_flac_picture/extconf.rb +4 -0
- data/ext/taglib_flac_picture/includes.i +15 -0
- data/ext/taglib_flac_picture/taglib_flac_picture.i +15 -0
- data/ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx +3087 -0
- data/ext/taglib_id3v1/taglib_id3v1.i +19 -0
- data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +391 -193
- data/ext/taglib_id3v2/relativevolumeframe.i +4 -17
- data/ext/taglib_id3v2/taglib_id3v2.i +72 -2
- data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +3051 -1113
- data/ext/taglib_mp4/taglib_mp4.i +101 -20
- data/ext/taglib_mp4/taglib_mp4_wrap.cxx +1088 -282
- data/ext/taglib_mpeg/taglib_mpeg.i +11 -16
- data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +646 -317
- data/ext/taglib_ogg/taglib_ogg.i +11 -0
- data/ext/taglib_ogg/taglib_ogg_wrap.cxx +478 -192
- data/ext/taglib_vorbis/taglib_vorbis.i +8 -0
- data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +202 -156
- data/ext/taglib_wav/extconf.rb +4 -0
- data/ext/taglib_wav/taglib_wav.i +90 -0
- data/ext/taglib_wav/taglib_wav_wrap.cxx +3423 -0
- data/lib/taglib.rb +2 -0
- data/lib/taglib/aiff.rb +7 -0
- data/lib/taglib/mp4.rb +2 -1
- data/lib/taglib/version.rb +2 -2
- data/lib/taglib/wav.rb +11 -0
- data/taglib-ruby.gemspec +42 -8
- data/tasks/ext.rake +48 -20
- data/tasks/gemspec_check.rake +1 -1
- data/tasks/swig.rake +36 -2
- data/test/aiff_examples_test.rb +39 -0
- data/test/aiff_file_test.rb +103 -0
- data/test/aiff_file_write_test.rb +88 -0
- data/test/data/Makefile +8 -2
- data/test/data/aiff-sample.aiff +0 -0
- data/test/data/flac_nopic.flac +0 -0
- data/test/data/vorbis-create.cpp +20 -1
- data/test/data/vorbis.oga +0 -0
- data/test/data/wav-create.cpp +55 -0
- data/test/data/wav-dump.cpp +74 -0
- data/test/data/wav-sample.wav +0 -0
- data/test/file_test.rb +21 -0
- data/test/fileref_properties_test.rb +1 -1
- data/test/flac_file_test.rb +45 -30
- data/test/flac_picture_memory_test.rb +43 -0
- data/test/id3v1_genres_test.rb +23 -0
- data/test/id3v1_tag_test.rb +1 -0
- data/test/id3v2_frames_test.rb +64 -0
- data/test/id3v2_tag_test.rb +6 -6
- data/test/id3v2_unknown_frames_test.rb +30 -0
- data/test/id3v2_write_test.rb +10 -13
- data/test/mp4_file_test.rb +33 -4
- data/test/mp4_file_write_test.rb +5 -5
- data/test/mp4_items_test.rb +83 -29
- data/test/mpeg_file_test.rb +120 -7
- data/test/vorbis_file_test.rb +2 -2
- data/test/vorbis_tag_test.rb +61 -7
- data/test/wav_examples_test.rb +42 -0
- data/test/wav_file_test.rb +108 -0
- data/test/wav_file_write_test.rb +113 -0
- metadata +86 -56
data/ext/taglib_base/includes.i
CHANGED
@@ -19,14 +19,18 @@
|
|
19
19
|
%{
|
20
20
|
#include <taglib/tstring.h>
|
21
21
|
#include <taglib/tstringlist.h>
|
22
|
+
#include <taglib/tbytevector.h>
|
23
|
+
#include <taglib/tbytevectorlist.h>
|
22
24
|
#include <taglib/tfile.h>
|
23
25
|
|
24
26
|
#if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
|
25
27
|
# include <ruby/encoding.h>
|
26
28
|
# define ASSOCIATE_UTF8_ENCODING(value) rb_enc_associate(value, rb_utf8_encoding());
|
29
|
+
# define ASSOCIATE_FILESYSTEM_ENCODING(value) rb_enc_associate(value, rb_filesystem_encoding());
|
27
30
|
# define CONVERT_TO_UTF8(value) rb_str_export_to_enc(value, rb_utf8_encoding())
|
28
31
|
#else
|
29
32
|
# define ASSOCIATE_UTF8_ENCODING(value) /* nothing */
|
33
|
+
# define ASSOCIATE_FILESYSTEM_ENCODING(value)
|
30
34
|
# define CONVERT_TO_UTF8(value) value
|
31
35
|
#endif
|
32
36
|
|
@@ -34,7 +38,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
|
|
34
38
|
if (byteVector.isNull()) {
|
35
39
|
return Qnil;
|
36
40
|
} else {
|
37
|
-
return
|
41
|
+
return rb_str_new(byteVector.data(), byteVector.size());
|
38
42
|
}
|
39
43
|
}
|
40
44
|
|
@@ -50,7 +54,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
|
|
50
54
|
if (string.isNull()) {
|
51
55
|
return Qnil;
|
52
56
|
} else {
|
53
|
-
VALUE result =
|
57
|
+
VALUE result = rb_str_new2(string.toCString(true));
|
54
58
|
ASSOCIATE_UTF8_ENCODING(result);
|
55
59
|
return result;
|
56
60
|
}
|
@@ -79,20 +83,45 @@ TagLib::StringList ruby_array_to_taglib_string_list(VALUE ary) {
|
|
79
83
|
return result;
|
80
84
|
}
|
81
85
|
for (long i = 0; i < RARRAY_LEN(ary); i++) {
|
82
|
-
VALUE e =
|
86
|
+
VALUE e = rb_ary_entry(ary, i);
|
83
87
|
TagLib::String s = ruby_string_to_taglib_string(e);
|
84
88
|
result.append(s);
|
85
89
|
}
|
86
90
|
return result;
|
87
91
|
}
|
88
92
|
|
93
|
+
VALUE taglib_bytevectorlist_to_ruby_array(const TagLib::ByteVectorList & list) {
|
94
|
+
VALUE ary = rb_ary_new2(list.size());
|
95
|
+
for (TagLib::ByteVectorList::ConstIterator it = list.begin(); it != list.end(); it++) {
|
96
|
+
VALUE s = taglib_bytevector_to_ruby_string(*it);
|
97
|
+
rb_ary_push(ary, s);
|
98
|
+
}
|
99
|
+
return ary;
|
100
|
+
}
|
101
|
+
|
102
|
+
TagLib::ByteVectorList ruby_array_to_taglib_bytevectorlist(VALUE ary) {
|
103
|
+
TagLib::ByteVectorList result = TagLib::ByteVectorList();
|
104
|
+
if (NIL_P(ary)) {
|
105
|
+
return result;
|
106
|
+
}
|
107
|
+
for (long i = 0; i < RARRAY_LEN(ary); i++) {
|
108
|
+
VALUE e = rb_ary_entry(ary, i);
|
109
|
+
TagLib::ByteVector s = ruby_string_to_taglib_bytevector(e);
|
110
|
+
result.append(s);
|
111
|
+
}
|
112
|
+
return result;
|
113
|
+
}
|
114
|
+
|
89
115
|
VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
|
116
|
+
VALUE result;
|
90
117
|
#ifdef _WIN32
|
91
118
|
const char *s = (const char *) filename;
|
92
|
-
|
119
|
+
result = rb_str_new2(s);
|
93
120
|
#else
|
94
|
-
|
121
|
+
result = rb_str_new2(filename);
|
95
122
|
#endif
|
123
|
+
ASSOCIATE_FILESYSTEM_ENCODING(result);
|
124
|
+
return result;
|
96
125
|
}
|
97
126
|
|
98
127
|
TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
|
@@ -2,6 +2,7 @@
|
|
2
2
|
%{
|
3
3
|
#include <taglib/taglib.h>
|
4
4
|
#include <taglib/tbytevector.h>
|
5
|
+
#include <taglib/tbytevectorlist.h>
|
5
6
|
#include <taglib/tlist.h>
|
6
7
|
#include <taglib/fileref.h>
|
7
8
|
#include <taglib/tag.h>
|
@@ -12,6 +13,7 @@
|
|
12
13
|
namespace TagLib {
|
13
14
|
class StringList;
|
14
15
|
class ByteVector;
|
16
|
+
class ByteVectorList;
|
15
17
|
|
16
18
|
class String {
|
17
19
|
public:
|
@@ -32,11 +34,12 @@ namespace TagLib {
|
|
32
34
|
|
33
35
|
// Rename setters to Ruby convention (combining SWIG rename functions
|
34
36
|
// does not seem to be possible, thus resort to some magic)
|
35
|
-
|
37
|
+
// setFoo -> foo=
|
38
|
+
%rename("%(command: perl -e \"print lc(join('_', split(/(?=[A-Z])/, substr(@ARGV[0], 3)))), '='\" )s",
|
36
39
|
regexmatch$name="^set[A-Z]") "";
|
37
40
|
|
38
41
|
// isFoo -> foo?
|
39
|
-
%rename("%(command:
|
42
|
+
%rename("%(command: perl -e \"print lc(join('_', split(/(?=[A-Z])/, substr(@ARGV[0], 2)))), '?'\" )s",
|
40
43
|
regexmatch$name="^is[A-Z]") "";
|
41
44
|
|
42
45
|
// ByteVector
|
@@ -56,6 +59,22 @@ namespace TagLib {
|
|
56
59
|
}
|
57
60
|
%typemap(typecheck) const TagLib::ByteVector & = char *;
|
58
61
|
|
62
|
+
// ByteVectorList
|
63
|
+
%typemap(out) TagLib::ByteVectorList {
|
64
|
+
$result = taglib_bytevectorlist_to_ruby_array($1);
|
65
|
+
}
|
66
|
+
%typemap(out) TagLib::ByteVectorList * {
|
67
|
+
$result = taglib_bytevectorlist_to_ruby_array(*($1));
|
68
|
+
}
|
69
|
+
%typemap(in) TagLib::ByteVectorList & (TagLib::ByteVectorList tmp) {
|
70
|
+
tmp = ruby_array_to_taglib_bytevectorlist($input);
|
71
|
+
$1 = &tmp;
|
72
|
+
}
|
73
|
+
%typemap(in) TagLib::ByteVectorList * (TagLib::ByteVectorList tmp) {
|
74
|
+
tmp = ruby_array_to_taglib_bytevectorlist($input);
|
75
|
+
$1 = &tmp;
|
76
|
+
}
|
77
|
+
|
59
78
|
// String
|
60
79
|
%typemap(out) TagLib::String {
|
61
80
|
$result = taglib_string_to_ruby_string($1);
|
@@ -93,15 +112,36 @@ namespace TagLib {
|
|
93
112
|
|
94
113
|
%ignore TagLib::List::operator[];
|
95
114
|
%ignore TagLib::List::operator=;
|
115
|
+
%ignore TagLib::List::operator!=;
|
96
116
|
%include <taglib/tlist.h>
|
97
117
|
|
118
|
+
// Ignore the unified property interface.
|
119
|
+
%ignore TagLib::Tag::properties;
|
120
|
+
%ignore TagLib::Tag::setProperties;
|
121
|
+
%ignore TagLib::Tag::removeUnsupportedProperties;
|
122
|
+
|
98
123
|
%include <taglib/tag.h>
|
99
124
|
|
125
|
+
%ignore TagLib::AudioProperties::length; // Deprecated.
|
100
126
|
%include <taglib/audioproperties.h>
|
101
127
|
|
102
128
|
%ignore TagLib::FileName;
|
129
|
+
|
130
|
+
// Ignore the unified property interface.
|
131
|
+
%ignore TagLib::File::properties;
|
132
|
+
%ignore TagLib::File::setProperties;
|
133
|
+
%ignore TagLib::File::removeUnsupportedProperties;
|
134
|
+
|
103
135
|
%include <taglib/tfile.h>
|
104
136
|
|
137
|
+
// Ignore IOStream and all the constructors using it.
|
138
|
+
%ignore IOStream;
|
139
|
+
%ignore TagLib::FileRef::FileRef(IOStream*, bool, AudioProperties::ReadStyle);
|
140
|
+
%ignore TagLib::FileRef::FileRef(IOStream*, bool);
|
141
|
+
%ignore TagLib::FileRef::FileRef(IOStream*);
|
142
|
+
|
143
|
+
%ignore TagLib::FileRef::swap; // Only useful internally.
|
144
|
+
|
105
145
|
%ignore TagLib::FileRef::operator=;
|
106
146
|
%ignore TagLib::FileRef::operator!=;
|
107
147
|
%warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) TagLib::FileRef::FileTypeResolver;
|
@@ -1,11 +1,11 @@
|
|
1
1
|
/* ----------------------------------------------------------------------------
|
2
2
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
3
|
-
* Version
|
4
|
-
*
|
5
|
-
* This file is not intended to be easily readable and contains a number of
|
3
|
+
* Version 3.0.7
|
4
|
+
*
|
5
|
+
* This file is not intended to be easily readable and contains a number of
|
6
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.
|
7
|
+
* changes to this file unless you know what you are doing--modify the SWIG
|
8
|
+
* interface file instead.
|
9
9
|
* ----------------------------------------------------------------------------- */
|
10
10
|
|
11
11
|
static void free_taglib_fileref(void *ptr);
|
@@ -68,28 +68,28 @@ template <typename T> T SwigValueInit() {
|
|
68
68
|
#ifndef SWIGUNUSED
|
69
69
|
# if defined(__GNUC__)
|
70
70
|
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
71
|
-
# define SWIGUNUSED __attribute__ ((__unused__))
|
71
|
+
# define SWIGUNUSED __attribute__ ((__unused__))
|
72
72
|
# else
|
73
73
|
# define SWIGUNUSED
|
74
74
|
# endif
|
75
75
|
# elif defined(__ICC)
|
76
|
-
# define SWIGUNUSED __attribute__ ((__unused__))
|
76
|
+
# define SWIGUNUSED __attribute__ ((__unused__))
|
77
77
|
# else
|
78
|
-
# define SWIGUNUSED
|
78
|
+
# define SWIGUNUSED
|
79
79
|
# endif
|
80
80
|
#endif
|
81
81
|
|
82
82
|
#ifndef SWIG_MSC_UNSUPPRESS_4505
|
83
83
|
# if defined(_MSC_VER)
|
84
84
|
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
|
85
|
-
# endif
|
85
|
+
# endif
|
86
86
|
#endif
|
87
87
|
|
88
88
|
#ifndef SWIGUNUSEDPARM
|
89
89
|
# ifdef __cplusplus
|
90
90
|
# define SWIGUNUSEDPARM(p)
|
91
91
|
# else
|
92
|
-
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
|
92
|
+
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
|
93
93
|
# endif
|
94
94
|
#endif
|
95
95
|
|
@@ -132,7 +132,7 @@ template <typename T> T SwigValueInit() {
|
|
132
132
|
# define SWIGSTDCALL __stdcall
|
133
133
|
# else
|
134
134
|
# define SWIGSTDCALL
|
135
|
-
# endif
|
135
|
+
# endif
|
136
136
|
#endif
|
137
137
|
|
138
138
|
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
|
@@ -145,6 +145,19 @@ template <typename T> T SwigValueInit() {
|
|
145
145
|
# define _SCL_SECURE_NO_DEPRECATE
|
146
146
|
#endif
|
147
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
|
148
161
|
|
149
162
|
/* -----------------------------------------------------------------------------
|
150
163
|
* This section contains generic SWIG labels for method/variable
|
@@ -177,28 +190,28 @@ template <typename T> T SwigValueInit() {
|
|
177
190
|
#ifndef SWIGUNUSED
|
178
191
|
# if defined(__GNUC__)
|
179
192
|
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
180
|
-
# define SWIGUNUSED __attribute__ ((__unused__))
|
193
|
+
# define SWIGUNUSED __attribute__ ((__unused__))
|
181
194
|
# else
|
182
195
|
# define SWIGUNUSED
|
183
196
|
# endif
|
184
197
|
# elif defined(__ICC)
|
185
|
-
# define SWIGUNUSED __attribute__ ((__unused__))
|
198
|
+
# define SWIGUNUSED __attribute__ ((__unused__))
|
186
199
|
# else
|
187
|
-
# define SWIGUNUSED
|
200
|
+
# define SWIGUNUSED
|
188
201
|
# endif
|
189
202
|
#endif
|
190
203
|
|
191
204
|
#ifndef SWIG_MSC_UNSUPPRESS_4505
|
192
205
|
# if defined(_MSC_VER)
|
193
206
|
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
|
194
|
-
# endif
|
207
|
+
# endif
|
195
208
|
#endif
|
196
209
|
|
197
210
|
#ifndef SWIGUNUSEDPARM
|
198
211
|
# ifdef __cplusplus
|
199
212
|
# define SWIGUNUSEDPARM(p)
|
200
213
|
# else
|
201
|
-
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
|
214
|
+
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
|
202
215
|
# endif
|
203
216
|
#endif
|
204
217
|
|
@@ -241,7 +254,7 @@ template <typename T> T SwigValueInit() {
|
|
241
254
|
# define SWIGSTDCALL __stdcall
|
242
255
|
# else
|
243
256
|
# define SWIGSTDCALL
|
244
|
-
# endif
|
257
|
+
# endif
|
245
258
|
#endif
|
246
259
|
|
247
260
|
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
|
@@ -254,6 +267,19 @@ template <typename T> T SwigValueInit() {
|
|
254
267
|
# define _SCL_SECURE_NO_DEPRECATE
|
255
268
|
#endif
|
256
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
|
257
283
|
|
258
284
|
/* -----------------------------------------------------------------------------
|
259
285
|
* swigrun.swg
|
@@ -279,7 +305,7 @@ template <typename T> T SwigValueInit() {
|
|
279
305
|
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
|
280
306
|
creating a static or dynamic library from the SWIG runtime code.
|
281
307
|
In 99.9% of the cases, SWIG just needs to declare them as 'static'.
|
282
|
-
|
308
|
+
|
283
309
|
But only do this if strictly necessary, ie, if you have problems
|
284
310
|
with your compiler or suchlike.
|
285
311
|
*/
|
@@ -305,16 +331,16 @@ template <typename T> T SwigValueInit() {
|
|
305
331
|
#define SWIG_POINTER_OWN 0x1
|
306
332
|
|
307
333
|
|
308
|
-
/*
|
334
|
+
/*
|
309
335
|
Flags/methods for returning states.
|
310
|
-
|
311
|
-
The SWIG conversion methods, as ConvertPtr, return an integer
|
336
|
+
|
337
|
+
The SWIG conversion methods, as ConvertPtr, return an integer
|
312
338
|
that tells if the conversion was successful or not. And if not,
|
313
339
|
an error code can be returned (see swigerrors.swg for the codes).
|
314
|
-
|
340
|
+
|
315
341
|
Use the following macros/flags to set or process the returning
|
316
342
|
states.
|
317
|
-
|
343
|
+
|
318
344
|
In old versions of SWIG, code such as the following was usually written:
|
319
345
|
|
320
346
|
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
|
@@ -347,23 +373,23 @@ template <typename T> T SwigValueInit() {
|
|
347
373
|
} else {
|
348
374
|
// fail code
|
349
375
|
}
|
350
|
-
|
376
|
+
|
351
377
|
I.e., now SWIG_ConvertPtr can return new objects and you can
|
352
378
|
identify the case and take care of the deallocation. Of course that
|
353
379
|
also requires SWIG_ConvertPtr to return new result values, such as
|
354
380
|
|
355
|
-
int SWIG_ConvertPtr(obj, ptr,...) {
|
356
|
-
if (<obj is ok>) {
|
357
|
-
if (<need new object>) {
|
358
|
-
*ptr = <ptr to new allocated object>;
|
359
|
-
return SWIG_NEWOBJ;
|
360
|
-
} else {
|
361
|
-
*ptr = <ptr to old object>;
|
362
|
-
return SWIG_OLDOBJ;
|
363
|
-
}
|
364
|
-
} else {
|
365
|
-
return SWIG_BADOBJ;
|
366
|
-
}
|
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
|
+
}
|
367
393
|
}
|
368
394
|
|
369
395
|
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
|
@@ -377,17 +403,17 @@ template <typename T> T SwigValueInit() {
|
|
377
403
|
int fooi(int);
|
378
404
|
|
379
405
|
and you call
|
380
|
-
|
406
|
+
|
381
407
|
food(1) // cast rank '1' (1 -> 1.0)
|
382
408
|
fooi(1) // cast rank '0'
|
383
409
|
|
384
410
|
just use the SWIG_AddCast()/SWIG_CheckState()
|
385
411
|
*/
|
386
412
|
|
387
|
-
#define SWIG_OK (0)
|
413
|
+
#define SWIG_OK (0)
|
388
414
|
#define SWIG_ERROR (-1)
|
389
415
|
#define SWIG_IsOK(r) (r >= 0)
|
390
|
-
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
|
416
|
+
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
|
391
417
|
|
392
418
|
/* The CastRankLimit says how many bits are used for the cast rank */
|
393
419
|
#define SWIG_CASTRANKLIMIT (1 << 8)
|
@@ -418,14 +444,14 @@ template <typename T> T SwigValueInit() {
|
|
418
444
|
# endif
|
419
445
|
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
|
420
446
|
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
|
421
|
-
SWIGINTERNINLINE int SWIG_AddCast(int r) {
|
447
|
+
SWIGINTERNINLINE int SWIG_AddCast(int r) {
|
422
448
|
return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
|
423
449
|
}
|
424
|
-
SWIGINTERNINLINE int SWIG_CheckState(int r) {
|
425
|
-
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
|
450
|
+
SWIGINTERNINLINE int SWIG_CheckState(int r) {
|
451
|
+
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
|
426
452
|
}
|
427
453
|
#else /* no cast-rank mode */
|
428
|
-
# define SWIG_AddCast
|
454
|
+
# define SWIG_AddCast(r) (r)
|
429
455
|
# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
|
430
456
|
#endif
|
431
457
|
|
@@ -469,7 +495,7 @@ typedef struct swig_module_info {
|
|
469
495
|
void *clientdata; /* Language specific module data */
|
470
496
|
} swig_module_info;
|
471
497
|
|
472
|
-
/*
|
498
|
+
/*
|
473
499
|
Compare two type names skipping the space characters, therefore
|
474
500
|
"char*" == "char *" and "Class<int>" == "Class<int >", etc.
|
475
501
|
|
@@ -489,18 +515,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
|
|
489
515
|
|
490
516
|
/*
|
491
517
|
Check type equivalence in a name list like <name1>|<name2>|...
|
492
|
-
Return 0 if
|
518
|
+
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
|
493
519
|
*/
|
494
520
|
SWIGRUNTIME int
|
495
|
-
|
496
|
-
int equiv =
|
521
|
+
SWIG_TypeCmp(const char *nb, const char *tb) {
|
522
|
+
int equiv = 1;
|
497
523
|
const char* te = tb + strlen(tb);
|
498
524
|
const char* ne = nb;
|
499
|
-
while (
|
525
|
+
while (equiv != 0 && *ne) {
|
500
526
|
for (nb = ne; *ne; ++ne) {
|
501
527
|
if (*ne == '|') break;
|
502
528
|
}
|
503
|
-
equiv =
|
529
|
+
equiv = SWIG_TypeNameComp(nb, ne, tb, te);
|
504
530
|
if (*ne) ++ne;
|
505
531
|
}
|
506
532
|
return equiv;
|
@@ -508,24 +534,13 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
|
|
508
534
|
|
509
535
|
/*
|
510
536
|
Check type equivalence in a name list like <name1>|<name2>|...
|
511
|
-
Return 0 if equal,
|
537
|
+
Return 0 if not equal, 1 if equal
|
512
538
|
*/
|
513
539
|
SWIGRUNTIME int
|
514
|
-
|
515
|
-
|
516
|
-
const char* te = tb + strlen(tb);
|
517
|
-
const char* ne = nb;
|
518
|
-
while (!equiv && *ne) {
|
519
|
-
for (nb = ne; *ne; ++ne) {
|
520
|
-
if (*ne == '|') break;
|
521
|
-
}
|
522
|
-
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
|
523
|
-
if (*ne) ++ne;
|
524
|
-
}
|
525
|
-
return equiv;
|
540
|
+
SWIG_TypeEquiv(const char *nb, const char *tb) {
|
541
|
+
return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
|
526
542
|
}
|
527
543
|
|
528
|
-
|
529
544
|
/*
|
530
545
|
Check the typename
|
531
546
|
*/
|
@@ -553,7 +568,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
|
|
553
568
|
return 0;
|
554
569
|
}
|
555
570
|
|
556
|
-
/*
|
571
|
+
/*
|
557
572
|
Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
|
558
573
|
*/
|
559
574
|
SWIGRUNTIME swig_cast_info *
|
@@ -588,7 +603,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
|
|
588
603
|
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
|
589
604
|
}
|
590
605
|
|
591
|
-
/*
|
606
|
+
/*
|
592
607
|
Dynamic pointer casting. Down an inheritance hierarchy
|
593
608
|
*/
|
594
609
|
SWIGRUNTIME swig_type_info *
|
@@ -632,7 +647,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
|
|
632
647
|
return type->name;
|
633
648
|
}
|
634
649
|
|
635
|
-
/*
|
650
|
+
/*
|
636
651
|
Set the clientdata field for a type
|
637
652
|
*/
|
638
653
|
SWIGRUNTIME void
|
@@ -640,14 +655,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
|
|
640
655
|
swig_cast_info *cast = ti->cast;
|
641
656
|
/* if (ti->clientdata == clientdata) return; */
|
642
657
|
ti->clientdata = clientdata;
|
643
|
-
|
658
|
+
|
644
659
|
while (cast) {
|
645
660
|
if (!cast->converter) {
|
646
661
|
swig_type_info *tc = cast->type;
|
647
662
|
if (!tc->clientdata) {
|
648
663
|
SWIG_TypeClientData(tc, clientdata);
|
649
664
|
}
|
650
|
-
}
|
665
|
+
}
|
651
666
|
cast = cast->next;
|
652
667
|
}
|
653
668
|
}
|
@@ -656,31 +671,31 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
|
|
656
671
|
SWIG_TypeClientData(ti, clientdata);
|
657
672
|
ti->owndata = 1;
|
658
673
|
}
|
659
|
-
|
674
|
+
|
660
675
|
/*
|
661
676
|
Search for a swig_type_info structure only by mangled name
|
662
677
|
Search is a O(log #types)
|
663
|
-
|
664
|
-
We start searching at module start, and finish searching when start == end.
|
678
|
+
|
679
|
+
We start searching at module start, and finish searching when start == end.
|
665
680
|
Note: if start == end at the beginning of the function, we go all the way around
|
666
681
|
the circular list.
|
667
682
|
*/
|
668
683
|
SWIGRUNTIME swig_type_info *
|
669
|
-
SWIG_MangledTypeQueryModule(swig_module_info *start,
|
670
|
-
swig_module_info *end,
|
684
|
+
SWIG_MangledTypeQueryModule(swig_module_info *start,
|
685
|
+
swig_module_info *end,
|
671
686
|
const char *name) {
|
672
687
|
swig_module_info *iter = start;
|
673
688
|
do {
|
674
689
|
if (iter->size) {
|
675
|
-
|
676
|
-
|
690
|
+
size_t l = 0;
|
691
|
+
size_t r = iter->size - 1;
|
677
692
|
do {
|
678
693
|
/* since l+r >= 0, we can (>> 1) instead (/ 2) */
|
679
|
-
|
694
|
+
size_t i = (l + r) >> 1;
|
680
695
|
const char *iname = iter->types[i]->name;
|
681
696
|
if (iname) {
|
682
|
-
|
683
|
-
if (compare == 0) {
|
697
|
+
int compare = strcmp(name, iname);
|
698
|
+
if (compare == 0) {
|
684
699
|
return iter->types[i];
|
685
700
|
} else if (compare < 0) {
|
686
701
|
if (i) {
|
@@ -705,14 +720,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
|
|
705
720
|
Search for a swig_type_info structure for either a mangled name or a human readable name.
|
706
721
|
It first searches the mangled names of the types, which is a O(log #types)
|
707
722
|
If a type is not found it then searches the human readable names, which is O(#types).
|
708
|
-
|
709
|
-
We start searching at module start, and finish searching when start == end.
|
723
|
+
|
724
|
+
We start searching at module start, and finish searching when start == end.
|
710
725
|
Note: if start == end at the beginning of the function, we go all the way around
|
711
726
|
the circular list.
|
712
727
|
*/
|
713
728
|
SWIGRUNTIME swig_type_info *
|
714
|
-
SWIG_TypeQueryModule(swig_module_info *start,
|
715
|
-
swig_module_info *end,
|
729
|
+
SWIG_TypeQueryModule(swig_module_info *start,
|
730
|
+
swig_module_info *end,
|
716
731
|
const char *name) {
|
717
732
|
/* STEP 1: Search the name field using binary search */
|
718
733
|
swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
|
@@ -723,7 +738,7 @@ SWIG_TypeQueryModule(swig_module_info *start,
|
|
723
738
|
of the str field (the human readable name) */
|
724
739
|
swig_module_info *iter = start;
|
725
740
|
do {
|
726
|
-
|
741
|
+
size_t i = 0;
|
727
742
|
for (; i < iter->size; ++i) {
|
728
743
|
if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
|
729
744
|
return iter->types[i];
|
@@ -731,56 +746,56 @@ SWIG_TypeQueryModule(swig_module_info *start,
|
|
731
746
|
iter = iter->next;
|
732
747
|
} while (iter != end);
|
733
748
|
}
|
734
|
-
|
749
|
+
|
735
750
|
/* neither found a match */
|
736
751
|
return 0;
|
737
752
|
}
|
738
753
|
|
739
|
-
/*
|
754
|
+
/*
|
740
755
|
Pack binary data into a string
|
741
756
|
*/
|
742
757
|
SWIGRUNTIME char *
|
743
758
|
SWIG_PackData(char *c, void *ptr, size_t sz) {
|
744
759
|
static const char hex[17] = "0123456789abcdef";
|
745
|
-
|
746
|
-
|
760
|
+
const unsigned char *u = (unsigned char *) ptr;
|
761
|
+
const unsigned char *eu = u + sz;
|
747
762
|
for (; u != eu; ++u) {
|
748
|
-
|
763
|
+
unsigned char uu = *u;
|
749
764
|
*(c++) = hex[(uu & 0xf0) >> 4];
|
750
765
|
*(c++) = hex[uu & 0xf];
|
751
766
|
}
|
752
767
|
return c;
|
753
768
|
}
|
754
769
|
|
755
|
-
/*
|
770
|
+
/*
|
756
771
|
Unpack binary data from a string
|
757
772
|
*/
|
758
773
|
SWIGRUNTIME const char *
|
759
774
|
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
|
760
|
-
|
761
|
-
|
775
|
+
unsigned char *u = (unsigned char *) ptr;
|
776
|
+
const unsigned char *eu = u + sz;
|
762
777
|
for (; u != eu; ++u) {
|
763
|
-
|
764
|
-
|
778
|
+
char d = *(c++);
|
779
|
+
unsigned char uu;
|
765
780
|
if ((d >= '0') && (d <= '9'))
|
766
781
|
uu = ((d - '0') << 4);
|
767
782
|
else if ((d >= 'a') && (d <= 'f'))
|
768
783
|
uu = ((d - ('a'-10)) << 4);
|
769
|
-
else
|
784
|
+
else
|
770
785
|
return (char *) 0;
|
771
786
|
d = *(c++);
|
772
787
|
if ((d >= '0') && (d <= '9'))
|
773
788
|
uu |= (d - '0');
|
774
789
|
else if ((d >= 'a') && (d <= 'f'))
|
775
790
|
uu |= (d - ('a'-10));
|
776
|
-
else
|
791
|
+
else
|
777
792
|
return (char *) 0;
|
778
793
|
*u = uu;
|
779
794
|
}
|
780
795
|
return c;
|
781
796
|
}
|
782
797
|
|
783
|
-
/*
|
798
|
+
/*
|
784
799
|
Pack 'void *' into a string buffer.
|
785
800
|
*/
|
786
801
|
SWIGRUNTIME char *
|
@@ -840,18 +855,18 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
|
|
840
855
|
#endif
|
841
856
|
|
842
857
|
/* Errors in SWIG */
|
843
|
-
#define SWIG_UnknownError -1
|
844
|
-
#define SWIG_IOError -2
|
845
|
-
#define SWIG_RuntimeError -3
|
846
|
-
#define SWIG_IndexError -4
|
847
|
-
#define SWIG_TypeError -5
|
848
|
-
#define SWIG_DivisionByZero -6
|
849
|
-
#define SWIG_OverflowError -7
|
850
|
-
#define SWIG_SyntaxError -8
|
851
|
-
#define SWIG_ValueError -9
|
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
|
852
867
|
#define SWIG_SystemError -10
|
853
868
|
#define SWIG_AttributeError -11
|
854
|
-
#define SWIG_MemoryError -12
|
869
|
+
#define SWIG_MemoryError -12
|
855
870
|
#define SWIG_NullReferenceError -13
|
856
871
|
|
857
872
|
|
@@ -1517,14 +1532,13 @@ SWIG_Ruby_InitRuntime(void)
|
|
1517
1532
|
SWIGRUNTIME void
|
1518
1533
|
SWIG_Ruby_define_class(swig_type_info *type)
|
1519
1534
|
{
|
1520
|
-
VALUE klass;
|
1521
1535
|
char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
|
1522
1536
|
sprintf(klass_name, "TYPE%s", type->name);
|
1523
1537
|
if (NIL_P(_cSWIG_Pointer)) {
|
1524
1538
|
_cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
|
1525
1539
|
rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
|
1526
1540
|
}
|
1527
|
-
|
1541
|
+
rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
|
1528
1542
|
free((void *) klass_name);
|
1529
1543
|
}
|
1530
1544
|
|
@@ -1777,7 +1791,7 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
|
|
1777
1791
|
SWIGINTERN
|
1778
1792
|
int SWIG_Ruby_isCallable( VALUE proc )
|
1779
1793
|
{
|
1780
|
-
if ( rb_respond_to( proc, swig_call_id )
|
1794
|
+
if ( rb_respond_to( proc, swig_call_id ) )
|
1781
1795
|
return 1;
|
1782
1796
|
return 0;
|
1783
1797
|
}
|
@@ -1790,7 +1804,7 @@ int SWIG_Ruby_isCallable( VALUE proc )
|
|
1790
1804
|
SWIGINTERN
|
1791
1805
|
int SWIG_Ruby_arity( VALUE proc, int minimal )
|
1792
1806
|
{
|
1793
|
-
if ( rb_respond_to( proc, swig_arity_id )
|
1807
|
+
if ( rb_respond_to( proc, swig_arity_id ) )
|
1794
1808
|
{
|
1795
1809
|
VALUE num = rb_funcall( proc, swig_arity_id, 0 );
|
1796
1810
|
int arity = NUM2INT(num);
|
@@ -1843,7 +1857,7 @@ static VALUE mTagLib;
|
|
1843
1857
|
#define SWIG_RUBY_THREAD_END_BLOCK
|
1844
1858
|
|
1845
1859
|
|
1846
|
-
#define SWIGVERSION
|
1860
|
+
#define SWIGVERSION 0x030007
|
1847
1861
|
#define SWIG_VERSION SWIGVERSION
|
1848
1862
|
|
1849
1863
|
|
@@ -1868,9 +1882,11 @@ static VALUE mTagLib;
|
|
1868
1882
|
#if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
|
1869
1883
|
# include <ruby/encoding.h>
|
1870
1884
|
# define ASSOCIATE_UTF8_ENCODING(value) rb_enc_associate(value, rb_utf8_encoding());
|
1885
|
+
# define ASSOCIATE_FILESYSTEM_ENCODING(value) rb_enc_associate(value, rb_filesystem_encoding());
|
1871
1886
|
# define CONVERT_TO_UTF8(value) rb_str_export_to_enc(value, rb_utf8_encoding())
|
1872
1887
|
#else
|
1873
1888
|
# define ASSOCIATE_UTF8_ENCODING(value) /* nothing */
|
1889
|
+
# define ASSOCIATE_FILESYSTEM_ENCODING(value)
|
1874
1890
|
# define CONVERT_TO_UTF8(value) value
|
1875
1891
|
#endif
|
1876
1892
|
|
@@ -1878,7 +1894,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
|
|
1878
1894
|
if (byteVector.isNull()) {
|
1879
1895
|
return Qnil;
|
1880
1896
|
} else {
|
1881
|
-
return
|
1897
|
+
return rb_str_new(byteVector.data(), byteVector.size());
|
1882
1898
|
}
|
1883
1899
|
}
|
1884
1900
|
|
@@ -1894,7 +1910,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
|
|
1894
1910
|
if (string.isNull()) {
|
1895
1911
|
return Qnil;
|
1896
1912
|
} else {
|
1897
|
-
VALUE result =
|
1913
|
+
VALUE result = rb_str_new2(string.toCString(true));
|
1898
1914
|
ASSOCIATE_UTF8_ENCODING(result);
|
1899
1915
|
return result;
|
1900
1916
|
}
|
@@ -1923,7 +1939,7 @@ TagLib::StringList ruby_array_to_taglib_string_list(VALUE ary) {
|
|
1923
1939
|
return result;
|
1924
1940
|
}
|
1925
1941
|
for (long i = 0; i < RARRAY_LEN(ary); i++) {
|
1926
|
-
VALUE e =
|
1942
|
+
VALUE e = rb_ary_entry(ary, i);
|
1927
1943
|
TagLib::String s = ruby_string_to_taglib_string(e);
|
1928
1944
|
result.append(s);
|
1929
1945
|
}
|
@@ -1931,12 +1947,15 @@ TagLib::StringList ruby_array_to_taglib_string_list(VALUE ary) {
|
|
1931
1947
|
}
|
1932
1948
|
|
1933
1949
|
VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
|
1950
|
+
VALUE result;
|
1934
1951
|
#ifdef _WIN32
|
1935
1952
|
const char *s = (const char *) filename;
|
1936
|
-
|
1953
|
+
result = rb_str_new2(s);
|
1937
1954
|
#else
|
1938
|
-
|
1955
|
+
result = rb_str_new2(filename);
|
1939
1956
|
#endif
|
1957
|
+
ASSOCIATE_FILESYSTEM_ENCODING(result);
|
1958
|
+
return result;
|
1940
1959
|
}
|
1941
1960
|
|
1942
1961
|
TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
|
@@ -2059,7 +2078,7 @@ SWIG_ruby_failed(void)
|
|
2059
2078
|
}
|
2060
2079
|
|
2061
2080
|
|
2062
|
-
/*@SWIG:/usr/local/share/swig/
|
2081
|
+
/*@SWIG:/usr/local/share/swig/3.0.7/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2063
2082
|
SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
|
2064
2083
|
{
|
2065
2084
|
VALUE obj = args[0];
|
@@ -2111,7 +2130,7 @@ SWIG_From_bool (bool value)
|
|
2111
2130
|
}
|
2112
2131
|
|
2113
2132
|
|
2114
|
-
/*@SWIG:/usr/local/share/swig/
|
2133
|
+
/*@SWIG:/usr/local/share/swig/3.0.7/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2115
2134
|
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
|
2116
2135
|
{
|
2117
2136
|
VALUE obj = args[0];
|
@@ -2384,7 +2403,7 @@ _wrap_Tag_year(int argc, VALUE *argv, VALUE self) {
|
|
2384
2403
|
TagLib::Tag *arg1 = (TagLib::Tag *) 0 ;
|
2385
2404
|
void *argp1 = 0 ;
|
2386
2405
|
int res1 = 0 ;
|
2387
|
-
|
2406
|
+
unsigned int result;
|
2388
2407
|
VALUE vresult = Qnil;
|
2389
2408
|
|
2390
2409
|
if ((argc < 0) || (argc > 0)) {
|
@@ -2395,7 +2414,7 @@ _wrap_Tag_year(int argc, VALUE *argv, VALUE self) {
|
|
2395
2414
|
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::Tag const *","year", 1, self ));
|
2396
2415
|
}
|
2397
2416
|
arg1 = reinterpret_cast< TagLib::Tag * >(argp1);
|
2398
|
-
result = (
|
2417
|
+
result = (unsigned int)((TagLib::Tag const *)arg1)->year();
|
2399
2418
|
vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
2400
2419
|
return vresult;
|
2401
2420
|
fail:
|
@@ -2408,7 +2427,7 @@ _wrap_Tag_track(int argc, VALUE *argv, VALUE self) {
|
|
2408
2427
|
TagLib::Tag *arg1 = (TagLib::Tag *) 0 ;
|
2409
2428
|
void *argp1 = 0 ;
|
2410
2429
|
int res1 = 0 ;
|
2411
|
-
|
2430
|
+
unsigned int result;
|
2412
2431
|
VALUE vresult = Qnil;
|
2413
2432
|
|
2414
2433
|
if ((argc < 0) || (argc > 0)) {
|
@@ -2419,7 +2438,7 @@ _wrap_Tag_track(int argc, VALUE *argv, VALUE self) {
|
|
2419
2438
|
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::Tag const *","track", 1, self ));
|
2420
2439
|
}
|
2421
2440
|
arg1 = reinterpret_cast< TagLib::Tag * >(argp1);
|
2422
|
-
result = (
|
2441
|
+
result = (unsigned int)((TagLib::Tag const *)arg1)->track();
|
2423
2442
|
vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
2424
2443
|
return vresult;
|
2425
2444
|
fail:
|
@@ -2565,7 +2584,7 @@ fail:
|
|
2565
2584
|
SWIGINTERN VALUE
|
2566
2585
|
_wrap_Tag_yeare___(int argc, VALUE *argv, VALUE self) {
|
2567
2586
|
TagLib::Tag *arg1 = (TagLib::Tag *) 0 ;
|
2568
|
-
|
2587
|
+
unsigned int arg2 ;
|
2569
2588
|
void *argp1 = 0 ;
|
2570
2589
|
int res1 = 0 ;
|
2571
2590
|
unsigned int val2 ;
|
@@ -2581,9 +2600,9 @@ _wrap_Tag_yeare___(int argc, VALUE *argv, VALUE self) {
|
|
2581
2600
|
arg1 = reinterpret_cast< TagLib::Tag * >(argp1);
|
2582
2601
|
ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
|
2583
2602
|
if (!SWIG_IsOK(ecode2)) {
|
2584
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "
|
2603
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setYear", 2, argv[0] ));
|
2585
2604
|
}
|
2586
|
-
arg2 = static_cast<
|
2605
|
+
arg2 = static_cast< unsigned int >(val2);
|
2587
2606
|
(arg1)->setYear(arg2);
|
2588
2607
|
return Qnil;
|
2589
2608
|
fail:
|
@@ -2594,7 +2613,7 @@ fail:
|
|
2594
2613
|
SWIGINTERN VALUE
|
2595
2614
|
_wrap_Tag_tracke___(int argc, VALUE *argv, VALUE self) {
|
2596
2615
|
TagLib::Tag *arg1 = (TagLib::Tag *) 0 ;
|
2597
|
-
|
2616
|
+
unsigned int arg2 ;
|
2598
2617
|
void *argp1 = 0 ;
|
2599
2618
|
int res1 = 0 ;
|
2600
2619
|
unsigned int val2 ;
|
@@ -2610,9 +2629,9 @@ _wrap_Tag_tracke___(int argc, VALUE *argv, VALUE self) {
|
|
2610
2629
|
arg1 = reinterpret_cast< TagLib::Tag * >(argp1);
|
2611
2630
|
ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
|
2612
2631
|
if (!SWIG_IsOK(ecode2)) {
|
2613
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "
|
2632
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setTrack", 2, argv[0] ));
|
2614
2633
|
}
|
2615
|
-
arg2 = static_cast<
|
2634
|
+
arg2 = static_cast< unsigned int >(val2);
|
2616
2635
|
(arg1)->setTrack(arg2);
|
2617
2636
|
return Qnil;
|
2618
2637
|
fail:
|
@@ -2773,7 +2792,31 @@ free_TagLib_AudioProperties(TagLib::AudioProperties *arg1) {
|
|
2773
2792
|
}
|
2774
2793
|
|
2775
2794
|
SWIGINTERN VALUE
|
2776
|
-
|
2795
|
+
_wrap_AudioProperties_length_in_seconds(int argc, VALUE *argv, VALUE self) {
|
2796
|
+
TagLib::AudioProperties *arg1 = (TagLib::AudioProperties *) 0 ;
|
2797
|
+
void *argp1 = 0 ;
|
2798
|
+
int res1 = 0 ;
|
2799
|
+
int result;
|
2800
|
+
VALUE vresult = Qnil;
|
2801
|
+
|
2802
|
+
if ((argc < 0) || (argc > 0)) {
|
2803
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2804
|
+
}
|
2805
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__AudioProperties, 0 | 0 );
|
2806
|
+
if (!SWIG_IsOK(res1)) {
|
2807
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::AudioProperties const *","lengthInSeconds", 1, self ));
|
2808
|
+
}
|
2809
|
+
arg1 = reinterpret_cast< TagLib::AudioProperties * >(argp1);
|
2810
|
+
result = (int)((TagLib::AudioProperties const *)arg1)->lengthInSeconds();
|
2811
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
2812
|
+
return vresult;
|
2813
|
+
fail:
|
2814
|
+
return Qnil;
|
2815
|
+
}
|
2816
|
+
|
2817
|
+
|
2818
|
+
SWIGINTERN VALUE
|
2819
|
+
_wrap_AudioProperties_length_in_milliseconds(int argc, VALUE *argv, VALUE self) {
|
2777
2820
|
TagLib::AudioProperties *arg1 = (TagLib::AudioProperties *) 0 ;
|
2778
2821
|
void *argp1 = 0 ;
|
2779
2822
|
int res1 = 0 ;
|
@@ -2785,10 +2828,10 @@ _wrap_AudioProperties_length(int argc, VALUE *argv, VALUE self) {
|
|
2785
2828
|
}
|
2786
2829
|
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__AudioProperties, 0 | 0 );
|
2787
2830
|
if (!SWIG_IsOK(res1)) {
|
2788
|
-
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::AudioProperties const *","
|
2831
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::AudioProperties const *","lengthInMilliseconds", 1, self ));
|
2789
2832
|
}
|
2790
2833
|
arg1 = reinterpret_cast< TagLib::AudioProperties * >(argp1);
|
2791
|
-
result = (int)((TagLib::AudioProperties const *)arg1)->
|
2834
|
+
result = (int)((TagLib::AudioProperties const *)arg1)->lengthInMilliseconds();
|
2792
2835
|
vresult = SWIG_From_int(static_cast< int >(result));
|
2793
2836
|
return vresult;
|
2794
2837
|
fail:
|
@@ -2881,7 +2924,7 @@ _wrap_File_name(int argc, VALUE *argv, VALUE self) {
|
|
2881
2924
|
TagLib::File *arg1 = (TagLib::File *) 0 ;
|
2882
2925
|
void *argp1 = 0 ;
|
2883
2926
|
int res1 = 0 ;
|
2884
|
-
|
2927
|
+
TagLib::FileName result;
|
2885
2928
|
VALUE vresult = Qnil;
|
2886
2929
|
|
2887
2930
|
if ((argc < 0) || (argc > 0)) {
|
@@ -2977,7 +3020,7 @@ fail:
|
|
2977
3020
|
SWIGINTERN VALUE
|
2978
3021
|
_wrap_File_read_block(int argc, VALUE *argv, VALUE self) {
|
2979
3022
|
TagLib::File *arg1 = (TagLib::File *) 0 ;
|
2980
|
-
|
3023
|
+
unsigned long arg2 ;
|
2981
3024
|
void *argp1 = 0 ;
|
2982
3025
|
int res1 = 0 ;
|
2983
3026
|
unsigned long val2 ;
|
@@ -2995,9 +3038,9 @@ _wrap_File_read_block(int argc, VALUE *argv, VALUE self) {
|
|
2995
3038
|
arg1 = reinterpret_cast< TagLib::File * >(argp1);
|
2996
3039
|
ecode2 = SWIG_AsVal_unsigned_SS_long(argv[0], &val2);
|
2997
3040
|
if (!SWIG_IsOK(ecode2)) {
|
2998
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "
|
3041
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned long","readBlock", 2, argv[0] ));
|
2999
3042
|
}
|
3000
|
-
arg2 = static_cast<
|
3043
|
+
arg2 = static_cast< unsigned long >(val2);
|
3001
3044
|
result = (arg1)->readBlock(arg2);
|
3002
3045
|
{
|
3003
3046
|
vresult = taglib_bytevector_to_ruby_string(result);
|
@@ -3040,7 +3083,7 @@ fail:
|
|
3040
3083
|
Document-method: TagLib::File.find
|
3041
3084
|
|
3042
3085
|
call-seq:
|
3043
|
-
find(pattern, fromOffset=0, before=ByteVector
|
3086
|
+
find(pattern, fromOffset=0, before=TagLib::ByteVector()) -> long
|
3044
3087
|
find(pattern, fromOffset=0) -> long
|
3045
3088
|
find(pattern) -> long
|
3046
3089
|
|
@@ -3439,8 +3482,8 @@ SWIGINTERN VALUE
|
|
3439
3482
|
_wrap_File_insert__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
3440
3483
|
TagLib::File *arg1 = (TagLib::File *) 0 ;
|
3441
3484
|
TagLib::ByteVector *arg2 = 0 ;
|
3442
|
-
|
3443
|
-
|
3485
|
+
unsigned long arg3 ;
|
3486
|
+
unsigned long arg4 ;
|
3444
3487
|
void *argp1 = 0 ;
|
3445
3488
|
int res1 = 0 ;
|
3446
3489
|
TagLib::ByteVector tmp2 ;
|
@@ -3463,14 +3506,14 @@ _wrap_File_insert__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
|
3463
3506
|
}
|
3464
3507
|
ecode3 = SWIG_AsVal_unsigned_SS_long(argv[1], &val3);
|
3465
3508
|
if (!SWIG_IsOK(ecode3)) {
|
3466
|
-
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "
|
3509
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned long","insert", 3, argv[1] ));
|
3467
3510
|
}
|
3468
|
-
arg3 = static_cast<
|
3511
|
+
arg3 = static_cast< unsigned long >(val3);
|
3469
3512
|
ecode4 = SWIG_AsVal_unsigned_SS_long(argv[2], &val4);
|
3470
3513
|
if (!SWIG_IsOK(ecode4)) {
|
3471
|
-
SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "
|
3514
|
+
SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned long","insert", 4, argv[2] ));
|
3472
3515
|
}
|
3473
|
-
arg4 = static_cast<
|
3516
|
+
arg4 = static_cast< unsigned long >(val4);
|
3474
3517
|
(arg1)->insert((TagLib::ByteVector const &)*arg2,arg3,arg4);
|
3475
3518
|
return Qnil;
|
3476
3519
|
fail:
|
@@ -3482,7 +3525,7 @@ SWIGINTERN VALUE
|
|
3482
3525
|
_wrap_File_insert__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
3483
3526
|
TagLib::File *arg1 = (TagLib::File *) 0 ;
|
3484
3527
|
TagLib::ByteVector *arg2 = 0 ;
|
3485
|
-
|
3528
|
+
unsigned long arg3 ;
|
3486
3529
|
void *argp1 = 0 ;
|
3487
3530
|
int res1 = 0 ;
|
3488
3531
|
TagLib::ByteVector tmp2 ;
|
@@ -3503,9 +3546,9 @@ _wrap_File_insert__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
|
3503
3546
|
}
|
3504
3547
|
ecode3 = SWIG_AsVal_unsigned_SS_long(argv[1], &val3);
|
3505
3548
|
if (!SWIG_IsOK(ecode3)) {
|
3506
|
-
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "
|
3549
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned long","insert", 3, argv[1] ));
|
3507
3550
|
}
|
3508
|
-
arg3 = static_cast<
|
3551
|
+
arg3 = static_cast< unsigned long >(val3);
|
3509
3552
|
(arg1)->insert((TagLib::ByteVector const &)*arg2,arg3);
|
3510
3553
|
return Qnil;
|
3511
3554
|
fail:
|
@@ -3611,8 +3654,8 @@ SWIGINTERN VALUE _wrap_File_insert(int nargs, VALUE *args, VALUE self) {
|
|
3611
3654
|
|
3612
3655
|
fail:
|
3613
3656
|
Ruby_Format_OverloadedError( argc, 5, "File.insert",
|
3614
|
-
" void File.insert(TagLib::ByteVector const &data,
|
3615
|
-
" void File.insert(TagLib::ByteVector const &data,
|
3657
|
+
" void File.insert(TagLib::ByteVector const &data, unsigned long start, unsigned long replace)\n"
|
3658
|
+
" void File.insert(TagLib::ByteVector const &data, unsigned long start)\n"
|
3616
3659
|
" void File.insert(TagLib::ByteVector const &data)\n");
|
3617
3660
|
|
3618
3661
|
return Qnil;
|
@@ -3622,8 +3665,8 @@ fail:
|
|
3622
3665
|
SWIGINTERN VALUE
|
3623
3666
|
_wrap_File_remove_block__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
3624
3667
|
TagLib::File *arg1 = (TagLib::File *) 0 ;
|
3625
|
-
|
3626
|
-
|
3668
|
+
unsigned long arg2 ;
|
3669
|
+
unsigned long arg3 ;
|
3627
3670
|
void *argp1 = 0 ;
|
3628
3671
|
int res1 = 0 ;
|
3629
3672
|
unsigned long val2 ;
|
@@ -3641,14 +3684,14 @@ _wrap_File_remove_block__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
|
3641
3684
|
arg1 = reinterpret_cast< TagLib::File * >(argp1);
|
3642
3685
|
ecode2 = SWIG_AsVal_unsigned_SS_long(argv[0], &val2);
|
3643
3686
|
if (!SWIG_IsOK(ecode2)) {
|
3644
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "
|
3687
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned long","removeBlock", 2, argv[0] ));
|
3645
3688
|
}
|
3646
|
-
arg2 = static_cast<
|
3689
|
+
arg2 = static_cast< unsigned long >(val2);
|
3647
3690
|
ecode3 = SWIG_AsVal_unsigned_SS_long(argv[1], &val3);
|
3648
3691
|
if (!SWIG_IsOK(ecode3)) {
|
3649
|
-
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "
|
3692
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned long","removeBlock", 3, argv[1] ));
|
3650
3693
|
}
|
3651
|
-
arg3 = static_cast<
|
3694
|
+
arg3 = static_cast< unsigned long >(val3);
|
3652
3695
|
(arg1)->removeBlock(arg2,arg3);
|
3653
3696
|
return Qnil;
|
3654
3697
|
fail:
|
@@ -3659,7 +3702,7 @@ fail:
|
|
3659
3702
|
SWIGINTERN VALUE
|
3660
3703
|
_wrap_File_remove_block__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
3661
3704
|
TagLib::File *arg1 = (TagLib::File *) 0 ;
|
3662
|
-
|
3705
|
+
unsigned long arg2 ;
|
3663
3706
|
void *argp1 = 0 ;
|
3664
3707
|
int res1 = 0 ;
|
3665
3708
|
unsigned long val2 ;
|
@@ -3675,9 +3718,9 @@ _wrap_File_remove_block__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
|
3675
3718
|
arg1 = reinterpret_cast< TagLib::File * >(argp1);
|
3676
3719
|
ecode2 = SWIG_AsVal_unsigned_SS_long(argv[0], &val2);
|
3677
3720
|
if (!SWIG_IsOK(ecode2)) {
|
3678
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "
|
3721
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned long","removeBlock", 2, argv[0] ));
|
3679
3722
|
}
|
3680
|
-
arg2 = static_cast<
|
3723
|
+
arg2 = static_cast< unsigned long >(val2);
|
3681
3724
|
(arg1)->removeBlock(arg2);
|
3682
3725
|
return Qnil;
|
3683
3726
|
fail:
|
@@ -3765,8 +3808,8 @@ SWIGINTERN VALUE _wrap_File_remove_block(int nargs, VALUE *args, VALUE self) {
|
|
3765
3808
|
|
3766
3809
|
fail:
|
3767
3810
|
Ruby_Format_OverloadedError( argc, 4, "File.remove_block",
|
3768
|
-
" void File.remove_block(
|
3769
|
-
" void File.remove_block(
|
3811
|
+
" void File.remove_block(unsigned long start, unsigned long length)\n"
|
3812
|
+
" void File.remove_block(unsigned long start)\n"
|
3770
3813
|
" void File.remove_block()\n");
|
3771
3814
|
|
3772
3815
|
return Qnil;
|
@@ -4111,7 +4154,7 @@ fail:
|
|
4111
4154
|
|
4112
4155
|
SWIGINTERN VALUE
|
4113
4156
|
_wrap_new_FileRef__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
4114
|
-
|
4157
|
+
TagLib::FileName arg1 ;
|
4115
4158
|
bool arg2 ;
|
4116
4159
|
TagLib::AudioProperties::ReadStyle arg3 ;
|
4117
4160
|
bool val2 ;
|
@@ -4150,7 +4193,7 @@ fail:
|
|
4150
4193
|
|
4151
4194
|
SWIGINTERN VALUE
|
4152
4195
|
_wrap_new_FileRef__SWIG_2(int argc, VALUE *argv, VALUE self) {
|
4153
|
-
|
4196
|
+
TagLib::FileName arg1 ;
|
4154
4197
|
bool arg2 ;
|
4155
4198
|
bool val2 ;
|
4156
4199
|
int ecode2 = 0 ;
|
@@ -4181,7 +4224,7 @@ fail:
|
|
4181
4224
|
|
4182
4225
|
SWIGINTERN VALUE
|
4183
4226
|
_wrap_new_FileRef__SWIG_3(int argc, VALUE *argv, VALUE self) {
|
4184
|
-
|
4227
|
+
TagLib::FileName arg1 ;
|
4185
4228
|
TagLib::FileRef *result = 0 ;
|
4186
4229
|
|
4187
4230
|
if ((argc < 1) || (argc > 1)) {
|
@@ -4571,7 +4614,7 @@ fail:
|
|
4571
4614
|
|
4572
4615
|
SWIGINTERN VALUE
|
4573
4616
|
_wrap_FileRef_create__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
4574
|
-
|
4617
|
+
TagLib::FileName arg1 ;
|
4575
4618
|
bool arg2 ;
|
4576
4619
|
TagLib::AudioProperties::ReadStyle arg3 ;
|
4577
4620
|
bool val2 ;
|
@@ -4610,7 +4653,7 @@ fail:
|
|
4610
4653
|
|
4611
4654
|
SWIGINTERN VALUE
|
4612
4655
|
_wrap_FileRef_create__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
4613
|
-
|
4656
|
+
TagLib::FileName arg1 ;
|
4614
4657
|
bool arg2 ;
|
4615
4658
|
bool val2 ;
|
4616
4659
|
int ecode2 = 0 ;
|
@@ -4641,7 +4684,7 @@ fail:
|
|
4641
4684
|
|
4642
4685
|
SWIGINTERN VALUE
|
4643
4686
|
_wrap_FileRef_create__SWIG_2(int argc, VALUE *argv, VALUE self) {
|
4644
|
-
|
4687
|
+
TagLib::FileName arg1 ;
|
4645
4688
|
TagLib::File *result = 0 ;
|
4646
4689
|
VALUE vresult = Qnil;
|
4647
4690
|
|
@@ -4806,18 +4849,18 @@ static swig_cast_info *swig_cast_initial[] = {
|
|
4806
4849
|
|
4807
4850
|
/* -----------------------------------------------------------------------------
|
4808
4851
|
* Type initialization:
|
4809
|
-
* This problem is tough by the requirement that no dynamic
|
4810
|
-
* memory is used. Also, since swig_type_info structures store pointers to
|
4852
|
+
* This problem is tough by the requirement that no dynamic
|
4853
|
+
* memory is used. Also, since swig_type_info structures store pointers to
|
4811
4854
|
* swig_cast_info structures and swig_cast_info structures store pointers back
|
4812
|
-
* to swig_type_info structures, we need some lookup code at initialization.
|
4813
|
-
* The idea is that swig generates all the structures that are needed.
|
4814
|
-
* The runtime then collects these partially filled structures.
|
4815
|
-
* The SWIG_InitializeModule function takes these initial arrays out of
|
4855
|
+
* to swig_type_info structures, we need some lookup code at initialization.
|
4856
|
+
* The idea is that swig generates all the structures that are needed.
|
4857
|
+
* The runtime then collects these partially filled structures.
|
4858
|
+
* The SWIG_InitializeModule function takes these initial arrays out of
|
4816
4859
|
* swig_module, and does all the lookup, filling in the swig_module.types
|
4817
4860
|
* array with the correct data and linking the correct swig_cast_info
|
4818
4861
|
* structures together.
|
4819
4862
|
*
|
4820
|
-
* The generated swig_type_info structures are assigned
|
4863
|
+
* The generated swig_type_info structures are assigned statically to an initial
|
4821
4864
|
* array. We just loop through that array, and handle each type individually.
|
4822
4865
|
* First we lookup if this type has been already loaded, and if so, use the
|
4823
4866
|
* loaded structure instead of the generated one. Then we have to fill in the
|
@@ -4827,17 +4870,17 @@ static swig_cast_info *swig_cast_initial[] = {
|
|
4827
4870
|
* a column is one of the swig_cast_info structures for that type.
|
4828
4871
|
* The cast_initial array is actually an array of arrays, because each row has
|
4829
4872
|
* a variable number of columns. So to actually build the cast linked list,
|
4830
|
-
* we find the array of casts associated with the type, and loop through it
|
4873
|
+
* we find the array of casts associated with the type, and loop through it
|
4831
4874
|
* adding the casts to the list. The one last trick we need to do is making
|
4832
4875
|
* sure the type pointer in the swig_cast_info struct is correct.
|
4833
4876
|
*
|
4834
|
-
* First off, we lookup the cast->type name to see if it is already loaded.
|
4877
|
+
* First off, we lookup the cast->type name to see if it is already loaded.
|
4835
4878
|
* There are three cases to handle:
|
4836
4879
|
* 1) If the cast->type has already been loaded AND the type we are adding
|
4837
4880
|
* casting info to has not been loaded (it is in this module), THEN we
|
4838
4881
|
* replace the cast->type pointer with the type pointer that has already
|
4839
4882
|
* been loaded.
|
4840
|
-
* 2) If BOTH types (the one we are adding casting info to, and the
|
4883
|
+
* 2) If BOTH types (the one we are adding casting info to, and the
|
4841
4884
|
* cast->type) are loaded, THEN the cast info has already been loaded by
|
4842
4885
|
* the previous module so we just ignore it.
|
4843
4886
|
* 3) Finally, if cast->type has not already been loaded, then we add that
|
@@ -4861,7 +4904,7 @@ SWIGRUNTIME void
|
|
4861
4904
|
SWIG_InitializeModule(void *clientdata) {
|
4862
4905
|
size_t i;
|
4863
4906
|
swig_module_info *module_head, *iter;
|
4864
|
-
int
|
4907
|
+
int init;
|
4865
4908
|
|
4866
4909
|
/* check to see if the circular list has been setup, if not, set it up */
|
4867
4910
|
if (swig_module.next==0) {
|
@@ -4880,27 +4923,23 @@ SWIG_InitializeModule(void *clientdata) {
|
|
4880
4923
|
/* This is the first module loaded for this interpreter */
|
4881
4924
|
/* so set the swig module into the interpreter */
|
4882
4925
|
SWIG_SetModule(clientdata, &swig_module);
|
4883
|
-
module_head = &swig_module;
|
4884
4926
|
} else {
|
4885
4927
|
/* the interpreter has loaded a SWIG module, but has it loaded this one? */
|
4886
|
-
found=0;
|
4887
4928
|
iter=module_head;
|
4888
4929
|
do {
|
4889
4930
|
if (iter==&swig_module) {
|
4890
|
-
|
4891
|
-
|
4931
|
+
/* Our module is already in the list, so there's nothing more to do. */
|
4932
|
+
return;
|
4892
4933
|
}
|
4893
4934
|
iter=iter->next;
|
4894
4935
|
} while (iter!= module_head);
|
4895
4936
|
|
4896
|
-
/*
|
4897
|
-
if (found) return;
|
4898
|
-
/* otherwise we must add out module into the list */
|
4937
|
+
/* otherwise we must add our module into the list */
|
4899
4938
|
swig_module.next = module_head->next;
|
4900
4939
|
module_head->next = &swig_module;
|
4901
4940
|
}
|
4902
4941
|
|
4903
|
-
/* When multiple
|
4942
|
+
/* When multiple interpreters are used, a module could have already been initialized in
|
4904
4943
|
a different interpreter, but not yet have a pointer in this interpreter.
|
4905
4944
|
In this case, we do not want to continue adding types... everything should be
|
4906
4945
|
set up already */
|
@@ -4914,7 +4953,7 @@ SWIG_InitializeModule(void *clientdata) {
|
|
4914
4953
|
swig_type_info *type = 0;
|
4915
4954
|
swig_type_info *ret;
|
4916
4955
|
swig_cast_info *cast;
|
4917
|
-
|
4956
|
+
|
4918
4957
|
#ifdef SWIGRUNTIME_DEBUG
|
4919
4958
|
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
|
4920
4959
|
#endif
|
@@ -4941,7 +4980,7 @@ SWIG_InitializeModule(void *clientdata) {
|
|
4941
4980
|
/* Insert casting types */
|
4942
4981
|
cast = swig_module.cast_initial[i];
|
4943
4982
|
while (cast->type) {
|
4944
|
-
|
4983
|
+
|
4945
4984
|
/* Don't need to add information already in the list */
|
4946
4985
|
ret = 0;
|
4947
4986
|
#ifdef SWIGRUNTIME_DEBUG
|
@@ -5103,7 +5142,8 @@ SWIGEXPORT void Init_taglib_base(void) {
|
|
5103
5142
|
rb_define_const(SwigClassAudioProperties.klass, "Fast", SWIG_From_int(static_cast< int >(TagLib::AudioProperties::Fast)));
|
5104
5143
|
rb_define_const(SwigClassAudioProperties.klass, "Average", SWIG_From_int(static_cast< int >(TagLib::AudioProperties::Average)));
|
5105
5144
|
rb_define_const(SwigClassAudioProperties.klass, "Accurate", SWIG_From_int(static_cast< int >(TagLib::AudioProperties::Accurate)));
|
5106
|
-
rb_define_method(SwigClassAudioProperties.klass, "
|
5145
|
+
rb_define_method(SwigClassAudioProperties.klass, "length_in_seconds", VALUEFUNC(_wrap_AudioProperties_length_in_seconds), -1);
|
5146
|
+
rb_define_method(SwigClassAudioProperties.klass, "length_in_milliseconds", VALUEFUNC(_wrap_AudioProperties_length_in_milliseconds), -1);
|
5107
5147
|
rb_define_method(SwigClassAudioProperties.klass, "bitrate", VALUEFUNC(_wrap_AudioProperties_bitrate), -1);
|
5108
5148
|
rb_define_method(SwigClassAudioProperties.klass, "sample_rate", VALUEFUNC(_wrap_AudioProperties_sample_rate), -1);
|
5109
5149
|
rb_define_method(SwigClassAudioProperties.klass, "channels", VALUEFUNC(_wrap_AudioProperties_channels), -1);
|