taglib-ruby 0.4.0-x86-mingw32 → 0.5.0-x86-mingw32

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