taglib-ruby 0.6.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +1 -1
  3. data/{CHANGES.md → CHANGELOG.md} +46 -11
  4. data/README.md +61 -17
  5. data/Rakefile +12 -3
  6. data/docs/taglib/aiff.rb +95 -0
  7. data/docs/taglib/base.rb +30 -2
  8. data/docs/taglib/flac.rb +60 -4
  9. data/docs/taglib/id3v1.rb +29 -0
  10. data/docs/taglib/id3v2.rb +22 -3
  11. data/docs/taglib/mp4.rb +124 -13
  12. data/docs/taglib/mpeg.rb +30 -1
  13. data/docs/taglib/ogg.rb +47 -5
  14. data/docs/taglib/riff.rb +3 -0
  15. data/docs/taglib/vorbis.rb +1 -1
  16. data/docs/taglib/wav.rb +116 -0
  17. data/ext/extconf_common.rb +24 -3
  18. data/ext/taglib_aiff/extconf.rb +4 -0
  19. data/ext/taglib_aiff/taglib_aiff.i +84 -0
  20. data/ext/taglib_aiff/taglib_aiff_wrap.cxx +3111 -0
  21. data/ext/taglib_base/includes.i +34 -5
  22. data/ext/taglib_base/taglib_base.i +42 -2
  23. data/ext/taglib_base/taglib_base_wrap.cxx +226 -186
  24. data/ext/taglib_flac/taglib_flac.i +21 -18
  25. data/ext/taglib_flac/taglib_flac_wrap.cxx +519 -955
  26. data/ext/taglib_flac_picture/extconf.rb +4 -0
  27. data/ext/taglib_flac_picture/includes.i +15 -0
  28. data/ext/taglib_flac_picture/taglib_flac_picture.i +15 -0
  29. data/ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx +3087 -0
  30. data/ext/taglib_id3v1/taglib_id3v1.i +19 -0
  31. data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +391 -193
  32. data/ext/taglib_id3v2/relativevolumeframe.i +4 -17
  33. data/ext/taglib_id3v2/taglib_id3v2.i +72 -2
  34. data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +3051 -1113
  35. data/ext/taglib_mp4/taglib_mp4.i +101 -20
  36. data/ext/taglib_mp4/taglib_mp4_wrap.cxx +1088 -282
  37. data/ext/taglib_mpeg/taglib_mpeg.i +11 -16
  38. data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +646 -317
  39. data/ext/taglib_ogg/taglib_ogg.i +11 -0
  40. data/ext/taglib_ogg/taglib_ogg_wrap.cxx +478 -192
  41. data/ext/taglib_vorbis/taglib_vorbis.i +8 -0
  42. data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +202 -156
  43. data/ext/taglib_wav/extconf.rb +4 -0
  44. data/ext/taglib_wav/taglib_wav.i +90 -0
  45. data/ext/taglib_wav/taglib_wav_wrap.cxx +3423 -0
  46. data/lib/taglib.rb +2 -0
  47. data/lib/taglib/aiff.rb +7 -0
  48. data/lib/taglib/mp4.rb +2 -1
  49. data/lib/taglib/version.rb +2 -2
  50. data/lib/taglib/wav.rb +11 -0
  51. data/taglib-ruby.gemspec +42 -8
  52. data/tasks/ext.rake +48 -20
  53. data/tasks/gemspec_check.rake +1 -1
  54. data/tasks/swig.rake +36 -2
  55. data/test/aiff_examples_test.rb +39 -0
  56. data/test/aiff_file_test.rb +103 -0
  57. data/test/aiff_file_write_test.rb +88 -0
  58. data/test/data/Makefile +8 -2
  59. data/test/data/aiff-sample.aiff +0 -0
  60. data/test/data/flac_nopic.flac +0 -0
  61. data/test/data/vorbis-create.cpp +20 -1
  62. data/test/data/vorbis.oga +0 -0
  63. data/test/data/wav-create.cpp +55 -0
  64. data/test/data/wav-dump.cpp +74 -0
  65. data/test/data/wav-sample.wav +0 -0
  66. data/test/file_test.rb +21 -0
  67. data/test/fileref_properties_test.rb +1 -1
  68. data/test/flac_file_test.rb +45 -30
  69. data/test/flac_picture_memory_test.rb +43 -0
  70. data/test/id3v1_genres_test.rb +23 -0
  71. data/test/id3v1_tag_test.rb +1 -0
  72. data/test/id3v2_frames_test.rb +64 -0
  73. data/test/id3v2_tag_test.rb +6 -6
  74. data/test/id3v2_unknown_frames_test.rb +30 -0
  75. data/test/id3v2_write_test.rb +10 -13
  76. data/test/mp4_file_test.rb +33 -4
  77. data/test/mp4_file_write_test.rb +5 -5
  78. data/test/mp4_items_test.rb +83 -29
  79. data/test/mpeg_file_test.rb +120 -7
  80. data/test/vorbis_file_test.rb +2 -2
  81. data/test/vorbis_tag_test.rb +61 -7
  82. data/test/wav_examples_test.rb +42 -0
  83. data/test/wav_file_test.rb +108 -0
  84. data/test/wav_file_write_test.rb +113 -0
  85. metadata +86 -56
@@ -6,8 +6,6 @@
6
6
  #include <taglib/mpegproperties.h>
7
7
  #include <taglib/mpegfile.h>
8
8
  #include <taglib/id3v2tag.h>
9
-
10
- static bool taglib_ruby_mpeg_file_save(TagLib::MPEG::File *file, int tags, bool stripOthers, int id3v2Version);
11
9
  %}
12
10
 
13
11
  %include "../taglib_base/includes.i"
@@ -15,7 +13,10 @@ static bool taglib_ruby_mpeg_file_save(TagLib::MPEG::File *file, int tags, bool
15
13
 
16
14
  %ignore TagLib::MPEG::Header::operator=;
17
15
  %include <taglib/xingheader.h>
16
+
18
17
  %include <taglib/mpegheader.h>
18
+
19
+ %ignore TagLib::MPEG::length; // Deprecated.
19
20
  %include <taglib/mpegproperties.h>
20
21
 
21
22
  %rename(id3v1_tag) TagLib::MPEG::File::ID3v1Tag;
@@ -24,6 +25,14 @@ static bool taglib_ruby_mpeg_file_save(TagLib::MPEG::File *file, int tags, bool
24
25
 
25
26
  %freefunc TagLib::MPEG::File "free_taglib_mpeg_file";
26
27
 
28
+ // Ignore IOStream and all the constructors using it.
29
+ %ignore IOStream;
30
+ %ignore TagLib::MPEG::File::File(IOStream *, ID3v2::FrameFactory *, bool, Properties::ReadStyle);
31
+ %ignore TagLib::MPEG::File::File(IOStream *, ID3v2::FrameFactory *, bool);
32
+ %ignore TagLib::MPEG::File::File(IOStream *, ID3v2::FrameFactory *);
33
+ %rename("id3v1_tag?") TagLib::MPEG::File::hasID3v1Tag;
34
+ %rename("id3v2_tag?") TagLib::MPEG::File::hasID3v2Tag;
35
+ %rename("ape_tag?") TagLib::MPEG::File::hasAPETag;
27
36
  %include <taglib/mpegfile.h>
28
37
 
29
38
  // Unlink Ruby objects from the deleted C++ objects. Otherwise Ruby code
@@ -71,26 +80,12 @@ static bool taglib_ruby_mpeg_file_save(TagLib::MPEG::File *file, int tags, bool
71
80
 
72
81
  delete file;
73
82
  }
74
-
75
- static bool taglib_ruby_mpeg_file_save(TagLib::MPEG::File *file, int tags, bool stripOthers, int id3v2Version) {
76
- #if defined(TAGLIB_MAJOR_VERSION) && (TAGLIB_MAJOR_VERSION > 1 || (TAGLIB_MAJOR_VERSION == 1 && TAGLIB_MINOR_VERSION >= 8))
77
- return file->save(tags, stripOthers, id3v2Version);
78
- #else
79
- rb_raise(rb_eArgError, "Overloaded method save(int tags, bool stripOthers, int id3v2Version) on TagLib::MPEG::File is only available when compiled against TagLib >= 1.8");
80
- return false;
81
- #endif
82
- }
83
83
  %}
84
84
 
85
85
  %extend TagLib::MPEG::File {
86
86
  void close() {
87
87
  free_taglib_mpeg_file($self);
88
88
  }
89
-
90
- bool save(int tags, bool stripOthers, int id3v2Version) {
91
- return taglib_ruby_mpeg_file_save($self, tags, stripOthers, id3v2Version);
92
- }
93
89
  }
94
90
 
95
-
96
91
  // vim: set filetype=cpp sw=2 ts=2 expandtab:
@@ -1,11 +1,11 @@
1
1
  /* ----------------------------------------------------------------------------
2
2
  * This file was automatically generated by SWIG (http://www.swig.org).
3
- * Version 2.0.9
4
- *
5
- * This file is not intended to be easily readable and contains a number of
3
+ * Version 3.0.7
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
6
  * coding conventions designed to improve portability and efficiency. Do not make
7
- * changes to this file unless you know what you are doing--modify the SWIG
8
- * interface file instead.
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
9
  * ----------------------------------------------------------------------------- */
10
10
 
11
11
  static void free_taglib_mpeg_file(void *ptr);
@@ -68,28 +68,28 @@ template <typename T> T SwigValueInit() {
68
68
  #ifndef SWIGUNUSED
69
69
  # if defined(__GNUC__)
70
70
  # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
71
- # define SWIGUNUSED __attribute__ ((__unused__))
71
+ # define SWIGUNUSED __attribute__ ((__unused__))
72
72
  # else
73
73
  # define SWIGUNUSED
74
74
  # endif
75
75
  # elif defined(__ICC)
76
- # define SWIGUNUSED __attribute__ ((__unused__))
76
+ # define SWIGUNUSED __attribute__ ((__unused__))
77
77
  # else
78
- # define SWIGUNUSED
78
+ # define SWIGUNUSED
79
79
  # endif
80
80
  #endif
81
81
 
82
82
  #ifndef SWIG_MSC_UNSUPPRESS_4505
83
83
  # if defined(_MSC_VER)
84
84
  # pragma warning(disable : 4505) /* unreferenced local function has been removed */
85
- # endif
85
+ # endif
86
86
  #endif
87
87
 
88
88
  #ifndef SWIGUNUSEDPARM
89
89
  # ifdef __cplusplus
90
90
  # define SWIGUNUSEDPARM(p)
91
91
  # else
92
- # define SWIGUNUSEDPARM(p) p SWIGUNUSED
92
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
93
93
  # endif
94
94
  #endif
95
95
 
@@ -132,7 +132,7 @@ template <typename T> T SwigValueInit() {
132
132
  # define SWIGSTDCALL __stdcall
133
133
  # else
134
134
  # define SWIGSTDCALL
135
- # endif
135
+ # endif
136
136
  #endif
137
137
 
138
138
  /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -145,6 +145,19 @@ template <typename T> T SwigValueInit() {
145
145
  # define _SCL_SECURE_NO_DEPRECATE
146
146
  #endif
147
147
 
148
+ /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
149
+ #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
150
+ # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
151
+ #endif
152
+
153
+ /* Intel's compiler complains if a variable which was never initialised is
154
+ * cast to void, which is a common idiom which we use to indicate that we
155
+ * are aware a variable isn't used. So we just silence that warning.
156
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
157
+ */
158
+ #ifdef __INTEL_COMPILER
159
+ # pragma warning disable 592
160
+ #endif
148
161
 
149
162
  /* -----------------------------------------------------------------------------
150
163
  * This section contains generic SWIG labels for method/variable
@@ -177,28 +190,28 @@ template <typename T> T SwigValueInit() {
177
190
  #ifndef SWIGUNUSED
178
191
  # if defined(__GNUC__)
179
192
  # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
180
- # define SWIGUNUSED __attribute__ ((__unused__))
193
+ # define SWIGUNUSED __attribute__ ((__unused__))
181
194
  # else
182
195
  # define SWIGUNUSED
183
196
  # endif
184
197
  # elif defined(__ICC)
185
- # define SWIGUNUSED __attribute__ ((__unused__))
198
+ # define SWIGUNUSED __attribute__ ((__unused__))
186
199
  # else
187
- # define SWIGUNUSED
200
+ # define SWIGUNUSED
188
201
  # endif
189
202
  #endif
190
203
 
191
204
  #ifndef SWIG_MSC_UNSUPPRESS_4505
192
205
  # if defined(_MSC_VER)
193
206
  # pragma warning(disable : 4505) /* unreferenced local function has been removed */
194
- # endif
207
+ # endif
195
208
  #endif
196
209
 
197
210
  #ifndef SWIGUNUSEDPARM
198
211
  # ifdef __cplusplus
199
212
  # define SWIGUNUSEDPARM(p)
200
213
  # else
201
- # define SWIGUNUSEDPARM(p) p SWIGUNUSED
214
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
202
215
  # endif
203
216
  #endif
204
217
 
@@ -241,7 +254,7 @@ template <typename T> T SwigValueInit() {
241
254
  # define SWIGSTDCALL __stdcall
242
255
  # else
243
256
  # define SWIGSTDCALL
244
- # endif
257
+ # endif
245
258
  #endif
246
259
 
247
260
  /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -254,6 +267,19 @@ template <typename T> T SwigValueInit() {
254
267
  # define _SCL_SECURE_NO_DEPRECATE
255
268
  #endif
256
269
 
270
+ /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
271
+ #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
272
+ # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
273
+ #endif
274
+
275
+ /* Intel's compiler complains if a variable which was never initialised is
276
+ * cast to void, which is a common idiom which we use to indicate that we
277
+ * are aware a variable isn't used. So we just silence that warning.
278
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
279
+ */
280
+ #ifdef __INTEL_COMPILER
281
+ # pragma warning disable 592
282
+ #endif
257
283
 
258
284
  /* -----------------------------------------------------------------------------
259
285
  * swigrun.swg
@@ -279,7 +305,7 @@ template <typename T> T SwigValueInit() {
279
305
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
280
306
  creating a static or dynamic library from the SWIG runtime code.
281
307
  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
282
-
308
+
283
309
  But only do this if strictly necessary, ie, if you have problems
284
310
  with your compiler or suchlike.
285
311
  */
@@ -305,16 +331,16 @@ template <typename T> T SwigValueInit() {
305
331
  #define SWIG_POINTER_OWN 0x1
306
332
 
307
333
 
308
- /*
334
+ /*
309
335
  Flags/methods for returning states.
310
-
311
- The SWIG conversion methods, as ConvertPtr, return an integer
336
+
337
+ The SWIG conversion methods, as ConvertPtr, return an integer
312
338
  that tells if the conversion was successful or not. And if not,
313
339
  an error code can be returned (see swigerrors.swg for the codes).
314
-
340
+
315
341
  Use the following macros/flags to set or process the returning
316
342
  states.
317
-
343
+
318
344
  In old versions of SWIG, code such as the following was usually written:
319
345
 
320
346
  if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
@@ -347,23 +373,23 @@ template <typename T> T SwigValueInit() {
347
373
  } else {
348
374
  // fail code
349
375
  }
350
-
376
+
351
377
  I.e., now SWIG_ConvertPtr can return new objects and you can
352
378
  identify the case and take care of the deallocation. Of course that
353
379
  also requires SWIG_ConvertPtr to return new result values, such as
354
380
 
355
- int SWIG_ConvertPtr(obj, ptr,...) {
356
- if (<obj is ok>) {
357
- if (<need new object>) {
358
- *ptr = <ptr to new allocated object>;
359
- return SWIG_NEWOBJ;
360
- } else {
361
- *ptr = <ptr to old object>;
362
- return SWIG_OLDOBJ;
363
- }
364
- } else {
365
- return SWIG_BADOBJ;
366
- }
381
+ int SWIG_ConvertPtr(obj, ptr,...) {
382
+ if (<obj is ok>) {
383
+ if (<need new object>) {
384
+ *ptr = <ptr to new allocated object>;
385
+ return SWIG_NEWOBJ;
386
+ } else {
387
+ *ptr = <ptr to old object>;
388
+ return SWIG_OLDOBJ;
389
+ }
390
+ } else {
391
+ return SWIG_BADOBJ;
392
+ }
367
393
  }
368
394
 
369
395
  Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
@@ -377,17 +403,17 @@ template <typename T> T SwigValueInit() {
377
403
  int fooi(int);
378
404
 
379
405
  and you call
380
-
406
+
381
407
  food(1) // cast rank '1' (1 -> 1.0)
382
408
  fooi(1) // cast rank '0'
383
409
 
384
410
  just use the SWIG_AddCast()/SWIG_CheckState()
385
411
  */
386
412
 
387
- #define SWIG_OK (0)
413
+ #define SWIG_OK (0)
388
414
  #define SWIG_ERROR (-1)
389
415
  #define SWIG_IsOK(r) (r >= 0)
390
- #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
416
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
391
417
 
392
418
  /* The CastRankLimit says how many bits are used for the cast rank */
393
419
  #define SWIG_CASTRANKLIMIT (1 << 8)
@@ -418,14 +444,14 @@ template <typename T> T SwigValueInit() {
418
444
  # endif
419
445
  # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
420
446
  # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
421
- SWIGINTERNINLINE int SWIG_AddCast(int r) {
447
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
422
448
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
423
449
  }
424
- SWIGINTERNINLINE int SWIG_CheckState(int r) {
425
- return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
450
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
451
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
426
452
  }
427
453
  #else /* no cast-rank mode */
428
- # define SWIG_AddCast
454
+ # define SWIG_AddCast(r) (r)
429
455
  # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
430
456
  #endif
431
457
 
@@ -469,7 +495,7 @@ typedef struct swig_module_info {
469
495
  void *clientdata; /* Language specific module data */
470
496
  } swig_module_info;
471
497
 
472
- /*
498
+ /*
473
499
  Compare two type names skipping the space characters, therefore
474
500
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
475
501
 
@@ -489,18 +515,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
489
515
 
490
516
  /*
491
517
  Check type equivalence in a name list like <name1>|<name2>|...
492
- Return 0 if not equal, 1 if equal
518
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
493
519
  */
494
520
  SWIGRUNTIME int
495
- SWIG_TypeEquiv(const char *nb, const char *tb) {
496
- int equiv = 0;
521
+ SWIG_TypeCmp(const char *nb, const char *tb) {
522
+ int equiv = 1;
497
523
  const char* te = tb + strlen(tb);
498
524
  const char* ne = nb;
499
- while (!equiv && *ne) {
525
+ while (equiv != 0 && *ne) {
500
526
  for (nb = ne; *ne; ++ne) {
501
527
  if (*ne == '|') break;
502
528
  }
503
- equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
529
+ equiv = SWIG_TypeNameComp(nb, ne, tb, te);
504
530
  if (*ne) ++ne;
505
531
  }
506
532
  return equiv;
@@ -508,24 +534,13 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
508
534
 
509
535
  /*
510
536
  Check type equivalence in a name list like <name1>|<name2>|...
511
- Return 0 if equal, -1 if nb < tb, 1 if nb > tb
537
+ Return 0 if not equal, 1 if equal
512
538
  */
513
539
  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;
540
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
541
+ return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
526
542
  }
527
543
 
528
-
529
544
  /*
530
545
  Check the typename
531
546
  */
@@ -553,7 +568,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
553
568
  return 0;
554
569
  }
555
570
 
556
- /*
571
+ /*
557
572
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
558
573
  */
559
574
  SWIGRUNTIME swig_cast_info *
@@ -588,7 +603,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
588
603
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
589
604
  }
590
605
 
591
- /*
606
+ /*
592
607
  Dynamic pointer casting. Down an inheritance hierarchy
593
608
  */
594
609
  SWIGRUNTIME swig_type_info *
@@ -632,7 +647,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
632
647
  return type->name;
633
648
  }
634
649
 
635
- /*
650
+ /*
636
651
  Set the clientdata field for a type
637
652
  */
638
653
  SWIGRUNTIME void
@@ -640,14 +655,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
640
655
  swig_cast_info *cast = ti->cast;
641
656
  /* if (ti->clientdata == clientdata) return; */
642
657
  ti->clientdata = clientdata;
643
-
658
+
644
659
  while (cast) {
645
660
  if (!cast->converter) {
646
661
  swig_type_info *tc = cast->type;
647
662
  if (!tc->clientdata) {
648
663
  SWIG_TypeClientData(tc, clientdata);
649
664
  }
650
- }
665
+ }
651
666
  cast = cast->next;
652
667
  }
653
668
  }
@@ -656,31 +671,31 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
656
671
  SWIG_TypeClientData(ti, clientdata);
657
672
  ti->owndata = 1;
658
673
  }
659
-
674
+
660
675
  /*
661
676
  Search for a swig_type_info structure only by mangled name
662
677
  Search is a O(log #types)
663
-
664
- We start searching at module start, and finish searching when start == end.
678
+
679
+ We start searching at module start, and finish searching when start == end.
665
680
  Note: if start == end at the beginning of the function, we go all the way around
666
681
  the circular list.
667
682
  */
668
683
  SWIGRUNTIME swig_type_info *
669
- SWIG_MangledTypeQueryModule(swig_module_info *start,
670
- swig_module_info *end,
684
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
685
+ swig_module_info *end,
671
686
  const char *name) {
672
687
  swig_module_info *iter = start;
673
688
  do {
674
689
  if (iter->size) {
675
- register size_t l = 0;
676
- register size_t r = iter->size - 1;
690
+ size_t l = 0;
691
+ size_t r = iter->size - 1;
677
692
  do {
678
693
  /* since l+r >= 0, we can (>> 1) instead (/ 2) */
679
- register size_t i = (l + r) >> 1;
694
+ size_t i = (l + r) >> 1;
680
695
  const char *iname = iter->types[i]->name;
681
696
  if (iname) {
682
- register int compare = strcmp(name, iname);
683
- if (compare == 0) {
697
+ int compare = strcmp(name, iname);
698
+ if (compare == 0) {
684
699
  return iter->types[i];
685
700
  } else if (compare < 0) {
686
701
  if (i) {
@@ -705,14 +720,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
705
720
  Search for a swig_type_info structure for either a mangled name or a human readable name.
706
721
  It first searches the mangled names of the types, which is a O(log #types)
707
722
  If a type is not found it then searches the human readable names, which is O(#types).
708
-
709
- We start searching at module start, and finish searching when start == end.
723
+
724
+ We start searching at module start, and finish searching when start == end.
710
725
  Note: if start == end at the beginning of the function, we go all the way around
711
726
  the circular list.
712
727
  */
713
728
  SWIGRUNTIME swig_type_info *
714
- SWIG_TypeQueryModule(swig_module_info *start,
715
- swig_module_info *end,
729
+ SWIG_TypeQueryModule(swig_module_info *start,
730
+ swig_module_info *end,
716
731
  const char *name) {
717
732
  /* STEP 1: Search the name field using binary search */
718
733
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
@@ -723,7 +738,7 @@ SWIG_TypeQueryModule(swig_module_info *start,
723
738
  of the str field (the human readable name) */
724
739
  swig_module_info *iter = start;
725
740
  do {
726
- register size_t i = 0;
741
+ size_t i = 0;
727
742
  for (; i < iter->size; ++i) {
728
743
  if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
729
744
  return iter->types[i];
@@ -731,56 +746,56 @@ SWIG_TypeQueryModule(swig_module_info *start,
731
746
  iter = iter->next;
732
747
  } while (iter != end);
733
748
  }
734
-
749
+
735
750
  /* neither found a match */
736
751
  return 0;
737
752
  }
738
753
 
739
- /*
754
+ /*
740
755
  Pack binary data into a string
741
756
  */
742
757
  SWIGRUNTIME char *
743
758
  SWIG_PackData(char *c, void *ptr, size_t sz) {
744
759
  static const char hex[17] = "0123456789abcdef";
745
- register const unsigned char *u = (unsigned char *) ptr;
746
- register const unsigned char *eu = u + sz;
760
+ const unsigned char *u = (unsigned char *) ptr;
761
+ const unsigned char *eu = u + sz;
747
762
  for (; u != eu; ++u) {
748
- register unsigned char uu = *u;
763
+ unsigned char uu = *u;
749
764
  *(c++) = hex[(uu & 0xf0) >> 4];
750
765
  *(c++) = hex[uu & 0xf];
751
766
  }
752
767
  return c;
753
768
  }
754
769
 
755
- /*
770
+ /*
756
771
  Unpack binary data from a string
757
772
  */
758
773
  SWIGRUNTIME const char *
759
774
  SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
760
- register unsigned char *u = (unsigned char *) ptr;
761
- register const unsigned char *eu = u + sz;
775
+ unsigned char *u = (unsigned char *) ptr;
776
+ const unsigned char *eu = u + sz;
762
777
  for (; u != eu; ++u) {
763
- register char d = *(c++);
764
- register unsigned char uu;
778
+ char d = *(c++);
779
+ unsigned char uu;
765
780
  if ((d >= '0') && (d <= '9'))
766
781
  uu = ((d - '0') << 4);
767
782
  else if ((d >= 'a') && (d <= 'f'))
768
783
  uu = ((d - ('a'-10)) << 4);
769
- else
784
+ else
770
785
  return (char *) 0;
771
786
  d = *(c++);
772
787
  if ((d >= '0') && (d <= '9'))
773
788
  uu |= (d - '0');
774
789
  else if ((d >= 'a') && (d <= 'f'))
775
790
  uu |= (d - ('a'-10));
776
- else
791
+ else
777
792
  return (char *) 0;
778
793
  *u = uu;
779
794
  }
780
795
  return c;
781
796
  }
782
797
 
783
- /*
798
+ /*
784
799
  Pack 'void *' into a string buffer.
785
800
  */
786
801
  SWIGRUNTIME char *
@@ -840,18 +855,18 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
840
855
  #endif
841
856
 
842
857
  /* Errors in SWIG */
843
- #define SWIG_UnknownError -1
844
- #define SWIG_IOError -2
845
- #define SWIG_RuntimeError -3
846
- #define SWIG_IndexError -4
847
- #define SWIG_TypeError -5
848
- #define SWIG_DivisionByZero -6
849
- #define SWIG_OverflowError -7
850
- #define SWIG_SyntaxError -8
851
- #define SWIG_ValueError -9
858
+ #define SWIG_UnknownError -1
859
+ #define SWIG_IOError -2
860
+ #define SWIG_RuntimeError -3
861
+ #define SWIG_IndexError -4
862
+ #define SWIG_TypeError -5
863
+ #define SWIG_DivisionByZero -6
864
+ #define SWIG_OverflowError -7
865
+ #define SWIG_SyntaxError -8
866
+ #define SWIG_ValueError -9
852
867
  #define SWIG_SystemError -10
853
868
  #define SWIG_AttributeError -11
854
- #define SWIG_MemoryError -12
869
+ #define SWIG_MemoryError -12
855
870
  #define SWIG_NullReferenceError -13
856
871
 
857
872
 
@@ -1517,14 +1532,13 @@ SWIG_Ruby_InitRuntime(void)
1517
1532
  SWIGRUNTIME void
1518
1533
  SWIG_Ruby_define_class(swig_type_info *type)
1519
1534
  {
1520
- VALUE klass;
1521
1535
  char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1522
1536
  sprintf(klass_name, "TYPE%s", type->name);
1523
1537
  if (NIL_P(_cSWIG_Pointer)) {
1524
1538
  _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1525
1539
  rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1526
1540
  }
1527
- klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1541
+ rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1528
1542
  free((void *) klass_name);
1529
1543
  }
1530
1544
 
@@ -1777,7 +1791,7 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
1777
1791
  SWIGINTERN
1778
1792
  int SWIG_Ruby_isCallable( VALUE proc )
1779
1793
  {
1780
- if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1794
+ if ( rb_respond_to( proc, swig_call_id ) )
1781
1795
  return 1;
1782
1796
  return 0;
1783
1797
  }
@@ -1790,7 +1804,7 @@ int SWIG_Ruby_isCallable( VALUE proc )
1790
1804
  SWIGINTERN
1791
1805
  int SWIG_Ruby_arity( VALUE proc, int minimal )
1792
1806
  {
1793
- if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1807
+ if ( rb_respond_to( proc, swig_arity_id ) )
1794
1808
  {
1795
1809
  VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1796
1810
  int arity = NUM2INT(num);
@@ -1848,7 +1862,7 @@ static VALUE mMPEG;
1848
1862
  #define SWIG_RUBY_THREAD_END_BLOCK
1849
1863
 
1850
1864
 
1851
- #define SWIGVERSION 0x020009
1865
+ #define SWIGVERSION 0x030007
1852
1866
  #define SWIG_VERSION SWIGVERSION
1853
1867
 
1854
1868
 
@@ -1866,8 +1880,6 @@ static VALUE mMPEG;
1866
1880
  #include <taglib/mpegfile.h>
1867
1881
  #include <taglib/id3v2tag.h>
1868
1882
 
1869
- static bool taglib_ruby_mpeg_file_save(TagLib::MPEG::File *file, int tags, bool stripOthers, int id3v2Version);
1870
-
1871
1883
 
1872
1884
  #include <taglib/tstring.h>
1873
1885
  #include <taglib/tstringlist.h>
@@ -1876,9 +1888,11 @@ static bool taglib_ruby_mpeg_file_save(TagLib::MPEG::File *file, int tags, bool
1876
1888
  #if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
1877
1889
  # include <ruby/encoding.h>
1878
1890
  # define ASSOCIATE_UTF8_ENCODING(value) rb_enc_associate(value, rb_utf8_encoding());
1891
+ # define ASSOCIATE_FILESYSTEM_ENCODING(value) rb_enc_associate(value, rb_filesystem_encoding());
1879
1892
  # define CONVERT_TO_UTF8(value) rb_str_export_to_enc(value, rb_utf8_encoding())
1880
1893
  #else
1881
1894
  # define ASSOCIATE_UTF8_ENCODING(value) /* nothing */
1895
+ # define ASSOCIATE_FILESYSTEM_ENCODING(value)
1882
1896
  # define CONVERT_TO_UTF8(value) value
1883
1897
  #endif
1884
1898
 
@@ -1886,7 +1900,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
1886
1900
  if (byteVector.isNull()) {
1887
1901
  return Qnil;
1888
1902
  } else {
1889
- return rb_tainted_str_new(byteVector.data(), byteVector.size());
1903
+ return rb_str_new(byteVector.data(), byteVector.size());
1890
1904
  }
1891
1905
  }
1892
1906
 
@@ -1902,7 +1916,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
1902
1916
  if (string.isNull()) {
1903
1917
  return Qnil;
1904
1918
  } else {
1905
- VALUE result = rb_tainted_str_new2(string.toCString(true));
1919
+ VALUE result = rb_str_new2(string.toCString(true));
1906
1920
  ASSOCIATE_UTF8_ENCODING(result);
1907
1921
  return result;
1908
1922
  }
@@ -1931,7 +1945,7 @@ TagLib::StringList ruby_array_to_taglib_string_list(VALUE ary) {
1931
1945
  return result;
1932
1946
  }
1933
1947
  for (long i = 0; i < RARRAY_LEN(ary); i++) {
1934
- VALUE e = RARRAY_PTR(ary)[i];
1948
+ VALUE e = rb_ary_entry(ary, i);
1935
1949
  TagLib::String s = ruby_string_to_taglib_string(e);
1936
1950
  result.append(s);
1937
1951
  }
@@ -1939,12 +1953,15 @@ TagLib::StringList ruby_array_to_taglib_string_list(VALUE ary) {
1939
1953
  }
1940
1954
 
1941
1955
  VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
1956
+ VALUE result;
1942
1957
  #ifdef _WIN32
1943
1958
  const char *s = (const char *) filename;
1944
- return rb_tainted_str_new2(s);
1959
+ result = rb_str_new2(s);
1945
1960
  #else
1946
- return rb_tainted_str_new2(filename);
1961
+ result = rb_str_new2(filename);
1947
1962
  #endif
1963
+ ASSOCIATE_FILESYSTEM_ENCODING(result);
1964
+ return result;
1948
1965
  }
1949
1966
 
1950
1967
  TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
@@ -1976,6 +1993,26 @@ TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
1976
1993
 
1977
1994
 
1978
1995
 
1996
+ #include <limits.h>
1997
+ #if !defined(SWIG_NO_LLONG_MAX)
1998
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1999
+ # define LLONG_MAX __LONG_LONG_MAX__
2000
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
2001
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
2002
+ # endif
2003
+ #endif
2004
+
2005
+
2006
+ #define SWIG_From_long LONG2NUM
2007
+
2008
+
2009
+ SWIGINTERNINLINE VALUE
2010
+ SWIG_From_int (int value)
2011
+ {
2012
+ return SWIG_From_long (value);
2013
+ }
2014
+
2015
+
1979
2016
  SWIGINTERN swig_type_info*
1980
2017
  SWIG_pchar_descriptor(void)
1981
2018
  {
@@ -2033,19 +2070,6 @@ SWIG_From_bool (bool value)
2033
2070
  }
2034
2071
 
2035
2072
 
2036
- #include <limits.h>
2037
- #if !defined(SWIG_NO_LLONG_MAX)
2038
- # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
2039
- # define LLONG_MAX __LONG_LONG_MAX__
2040
- # define LLONG_MIN (-LLONG_MAX - 1LL)
2041
- # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
2042
- # endif
2043
- #endif
2044
-
2045
-
2046
- #define SWIG_From_long LONG2NUM
2047
-
2048
-
2049
2073
  SWIGINTERNINLINE VALUE
2050
2074
  SWIG_From_unsigned_SS_long (unsigned long value)
2051
2075
  {
@@ -2067,7 +2091,7 @@ SWIG_ruby_failed(void)
2067
2091
  }
2068
2092
 
2069
2093
 
2070
- /*@SWIG:/usr/local/share/swig/2.0.9/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2094
+ /*@SWIG:/usr/local/share/swig/3.0.7/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2071
2095
  SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
2072
2096
  {
2073
2097
  VALUE obj = args[0];
@@ -2112,13 +2136,6 @@ SWIG_AsVal_int (VALUE obj, int *val)
2112
2136
  }
2113
2137
 
2114
2138
 
2115
- SWIGINTERNINLINE VALUE
2116
- SWIG_From_int (int value)
2117
- {
2118
- return SWIG_From_long (value);
2119
- }
2120
-
2121
-
2122
2139
  SWIGINTERN int
2123
2140
  SWIG_AsVal_bool (VALUE obj, bool *val)
2124
2141
  {
@@ -2141,9 +2158,6 @@ SWIG_AsVal_bool (VALUE obj, bool *val)
2141
2158
  SWIGINTERN void TagLib_MPEG_File_close(TagLib::MPEG::File *self){
2142
2159
  free_taglib_mpeg_file(self);
2143
2160
  }
2144
- SWIGINTERN bool TagLib_MPEG_File_save__SWIG_3(TagLib::MPEG::File *self,int tags,bool stripOthers,int id3v2Version){
2145
- return taglib_ruby_mpeg_file_save(self, tags, stripOthers, id3v2Version);
2146
- }
2147
2161
 
2148
2162
  static void free_taglib_mpeg_file(void *ptr) {
2149
2163
  TagLib::MPEG::File *file = (TagLib::MPEG::File *) ptr;
@@ -2185,15 +2199,6 @@ SWIGINTERN bool TagLib_MPEG_File_save__SWIG_3(TagLib::MPEG::File *self,int tags,
2185
2199
  delete file;
2186
2200
  }
2187
2201
 
2188
- static bool taglib_ruby_mpeg_file_save(TagLib::MPEG::File *file, int tags, bool stripOthers, int id3v2Version) {
2189
- #if defined(TAGLIB_MAJOR_VERSION) && (TAGLIB_MAJOR_VERSION > 1 || (TAGLIB_MAJOR_VERSION == 1 && TAGLIB_MINOR_VERSION >= 8))
2190
- return file->save(tags, stripOthers, id3v2Version);
2191
- #else
2192
- rb_raise(rb_eArgError, "Overloaded method save(int tags, bool stripOthers, int id3v2Version) on TagLib::MPEG::File is only available when compiled against TagLib >= 1.8");
2193
- return false;
2194
- #endif
2195
- }
2196
-
2197
2202
  static swig_class SwigClassXingHeader;
2198
2203
 
2199
2204
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
@@ -2270,7 +2275,7 @@ _wrap_XingHeader_total_frames(int argc, VALUE *argv, VALUE self) {
2270
2275
  TagLib::MPEG::XingHeader *arg1 = (TagLib::MPEG::XingHeader *) 0 ;
2271
2276
  void *argp1 = 0 ;
2272
2277
  int res1 = 0 ;
2273
- TagLib::uint result;
2278
+ unsigned int result;
2274
2279
  VALUE vresult = Qnil;
2275
2280
 
2276
2281
  if ((argc < 0) || (argc > 0)) {
@@ -2281,7 +2286,7 @@ _wrap_XingHeader_total_frames(int argc, VALUE *argv, VALUE self) {
2281
2286
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::XingHeader const *","totalFrames", 1, self ));
2282
2287
  }
2283
2288
  arg1 = reinterpret_cast< TagLib::MPEG::XingHeader * >(argp1);
2284
- result = (TagLib::uint)((TagLib::MPEG::XingHeader const *)arg1)->totalFrames();
2289
+ result = (unsigned int)((TagLib::MPEG::XingHeader const *)arg1)->totalFrames();
2285
2290
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2286
2291
  return vresult;
2287
2292
  fail:
@@ -2294,7 +2299,7 @@ _wrap_XingHeader_total_size(int argc, VALUE *argv, VALUE self) {
2294
2299
  TagLib::MPEG::XingHeader *arg1 = (TagLib::MPEG::XingHeader *) 0 ;
2295
2300
  void *argp1 = 0 ;
2296
2301
  int res1 = 0 ;
2297
- TagLib::uint result;
2302
+ unsigned int result;
2298
2303
  VALUE vresult = Qnil;
2299
2304
 
2300
2305
  if ((argc < 0) || (argc > 0)) {
@@ -2305,7 +2310,7 @@ _wrap_XingHeader_total_size(int argc, VALUE *argv, VALUE self) {
2305
2310
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::XingHeader const *","totalSize", 1, self ));
2306
2311
  }
2307
2312
  arg1 = reinterpret_cast< TagLib::MPEG::XingHeader * >(argp1);
2308
- result = (TagLib::uint)((TagLib::MPEG::XingHeader const *)arg1)->totalSize();
2313
+ result = (unsigned int)((TagLib::MPEG::XingHeader const *)arg1)->totalSize();
2309
2314
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2310
2315
  return vresult;
2311
2316
  fail:
@@ -2313,6 +2318,30 @@ fail:
2313
2318
  }
2314
2319
 
2315
2320
 
2321
+ SWIGINTERN VALUE
2322
+ _wrap_XingHeader_type(int argc, VALUE *argv, VALUE self) {
2323
+ TagLib::MPEG::XingHeader *arg1 = (TagLib::MPEG::XingHeader *) 0 ;
2324
+ void *argp1 = 0 ;
2325
+ int res1 = 0 ;
2326
+ TagLib::MPEG::XingHeader::HeaderType result;
2327
+ VALUE vresult = Qnil;
2328
+
2329
+ if ((argc < 0) || (argc > 0)) {
2330
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2331
+ }
2332
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__XingHeader, 0 | 0 );
2333
+ if (!SWIG_IsOK(res1)) {
2334
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::XingHeader const *","type", 1, self ));
2335
+ }
2336
+ arg1 = reinterpret_cast< TagLib::MPEG::XingHeader * >(argp1);
2337
+ result = (TagLib::MPEG::XingHeader::HeaderType)((TagLib::MPEG::XingHeader const *)arg1)->type();
2338
+ vresult = SWIG_From_int(static_cast< int >(result));
2339
+ return vresult;
2340
+ fail:
2341
+ return Qnil;
2342
+ }
2343
+
2344
+
2316
2345
  SWIGINTERN VALUE
2317
2346
  _wrap_XingHeader_xing_header_offset(int argc, VALUE *argv, VALUE self) {
2318
2347
  TagLib::MPEG::Header::Version arg1 ;
@@ -2369,6 +2398,78 @@ fail:
2369
2398
  }
2370
2399
 
2371
2400
 
2401
+ SWIGINTERN VALUE
2402
+ _wrap_new_Header__SWIG_1(int argc, VALUE *argv, VALUE self) {
2403
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
2404
+ long arg2 ;
2405
+ bool arg3 ;
2406
+ void *argp1 = 0 ;
2407
+ int res1 = 0 ;
2408
+ long val2 ;
2409
+ int ecode2 = 0 ;
2410
+ bool val3 ;
2411
+ int ecode3 = 0 ;
2412
+ TagLib::MPEG::Header *result = 0 ;
2413
+
2414
+ if ((argc < 3) || (argc > 3)) {
2415
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
2416
+ }
2417
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
2418
+ if (!SWIG_IsOK(res1)) {
2419
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","Header", 1, argv[0] ));
2420
+ }
2421
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
2422
+ ecode2 = SWIG_AsVal_long(argv[1], &val2);
2423
+ if (!SWIG_IsOK(ecode2)) {
2424
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "long","Header", 2, argv[1] ));
2425
+ }
2426
+ arg2 = static_cast< long >(val2);
2427
+ ecode3 = SWIG_AsVal_bool(argv[2], &val3);
2428
+ if (!SWIG_IsOK(ecode3)) {
2429
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","Header", 3, argv[2] ));
2430
+ }
2431
+ arg3 = static_cast< bool >(val3);
2432
+ result = (TagLib::MPEG::Header *)new TagLib::MPEG::Header(arg1,arg2,arg3);
2433
+ DATA_PTR(self) = result;
2434
+ SWIG_RubyAddTracking(result, self);
2435
+ return self;
2436
+ fail:
2437
+ return Qnil;
2438
+ }
2439
+
2440
+
2441
+ SWIGINTERN VALUE
2442
+ _wrap_new_Header__SWIG_2(int argc, VALUE *argv, VALUE self) {
2443
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
2444
+ long arg2 ;
2445
+ void *argp1 = 0 ;
2446
+ int res1 = 0 ;
2447
+ long val2 ;
2448
+ int ecode2 = 0 ;
2449
+ TagLib::MPEG::Header *result = 0 ;
2450
+
2451
+ if ((argc < 2) || (argc > 2)) {
2452
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2453
+ }
2454
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
2455
+ if (!SWIG_IsOK(res1)) {
2456
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","Header", 1, argv[0] ));
2457
+ }
2458
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
2459
+ ecode2 = SWIG_AsVal_long(argv[1], &val2);
2460
+ if (!SWIG_IsOK(ecode2)) {
2461
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "long","Header", 2, argv[1] ));
2462
+ }
2463
+ arg2 = static_cast< long >(val2);
2464
+ result = (TagLib::MPEG::Header *)new TagLib::MPEG::Header(arg1,arg2);
2465
+ DATA_PTR(self) = result;
2466
+ SWIG_RubyAddTracking(result, self);
2467
+ return self;
2468
+ fail:
2469
+ return Qnil;
2470
+ }
2471
+
2472
+
2372
2473
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2373
2474
  SWIGINTERN VALUE
2374
2475
  _wrap_Header_allocate(VALUE self) {
@@ -2387,7 +2488,7 @@ _wrap_Header_allocate(VALUE self) {
2387
2488
 
2388
2489
 
2389
2490
  SWIGINTERN VALUE
2390
- _wrap_new_Header__SWIG_1(int argc, VALUE *argv, VALUE self) {
2491
+ _wrap_new_Header__SWIG_3(int argc, VALUE *argv, VALUE self) {
2391
2492
  TagLib::MPEG::Header *arg1 = 0 ;
2392
2493
  void *argp1 ;
2393
2494
  int res1 = 0 ;
@@ -2415,11 +2516,11 @@ fail:
2415
2516
 
2416
2517
  SWIGINTERN VALUE _wrap_new_Header(int nargs, VALUE *args, VALUE self) {
2417
2518
  int argc;
2418
- VALUE argv[1];
2519
+ VALUE argv[3];
2419
2520
  int ii;
2420
2521
 
2421
2522
  argc = nargs;
2422
- if (argc > 1) SWIG_fail;
2523
+ if (argc > 3) SWIG_fail;
2423
2524
  for (ii = 0; (ii < argc); ++ii) {
2424
2525
  argv[ii] = args[ii];
2425
2526
  }
@@ -2429,7 +2530,7 @@ SWIGINTERN VALUE _wrap_new_Header(int nargs, VALUE *args, VALUE self) {
2429
2530
  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__Header, 0);
2430
2531
  _v = SWIG_CheckState(res);
2431
2532
  if (_v) {
2432
- return _wrap_new_Header__SWIG_1(nargs, args, self);
2533
+ return _wrap_new_Header__SWIG_3(nargs, args, self);
2433
2534
  }
2434
2535
  }
2435
2536
  if (argc == 1) {
@@ -2440,10 +2541,48 @@ SWIGINTERN VALUE _wrap_new_Header(int nargs, VALUE *args, VALUE self) {
2440
2541
  return _wrap_new_Header__SWIG_0(nargs, args, self);
2441
2542
  }
2442
2543
  }
2544
+ if (argc == 2) {
2545
+ int _v;
2546
+ void *vptr = 0;
2547
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
2548
+ _v = SWIG_CheckState(res);
2549
+ if (_v) {
2550
+ {
2551
+ int res = SWIG_AsVal_long(argv[1], NULL);
2552
+ _v = SWIG_CheckState(res);
2553
+ }
2554
+ if (_v) {
2555
+ return _wrap_new_Header__SWIG_2(nargs, args, self);
2556
+ }
2557
+ }
2558
+ }
2559
+ if (argc == 3) {
2560
+ int _v;
2561
+ void *vptr = 0;
2562
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
2563
+ _v = SWIG_CheckState(res);
2564
+ if (_v) {
2565
+ {
2566
+ int res = SWIG_AsVal_long(argv[1], NULL);
2567
+ _v = SWIG_CheckState(res);
2568
+ }
2569
+ if (_v) {
2570
+ {
2571
+ int res = SWIG_AsVal_bool(argv[2], NULL);
2572
+ _v = SWIG_CheckState(res);
2573
+ }
2574
+ if (_v) {
2575
+ return _wrap_new_Header__SWIG_1(nargs, args, self);
2576
+ }
2577
+ }
2578
+ }
2579
+ }
2443
2580
 
2444
2581
  fail:
2445
- Ruby_Format_OverloadedError( argc, 1, "Header.new",
2582
+ Ruby_Format_OverloadedError( argc, 3, "Header.new",
2446
2583
  " Header.new(TagLib::ByteVector const &data)\n"
2584
+ " Header.new(TagLib::MPEG::File *file, long offset, bool checkLength)\n"
2585
+ " Header.new(TagLib::MPEG::File *file, long offset)\n"
2447
2586
  " Header.new(TagLib::MPEG::Header const &h)\n");
2448
2587
 
2449
2588
  return Qnil;
@@ -2870,7 +3009,31 @@ free_TagLib_MPEG_Properties(TagLib::MPEG::Properties *arg1) {
2870
3009
  }
2871
3010
 
2872
3011
  SWIGINTERN VALUE
2873
- _wrap_Properties_length(int argc, VALUE *argv, VALUE self) {
3012
+ _wrap_Properties_length_in_seconds(int argc, VALUE *argv, VALUE self) {
3013
+ TagLib::MPEG::Properties *arg1 = (TagLib::MPEG::Properties *) 0 ;
3014
+ void *argp1 = 0 ;
3015
+ int res1 = 0 ;
3016
+ int result;
3017
+ VALUE vresult = Qnil;
3018
+
3019
+ if ((argc < 0) || (argc > 0)) {
3020
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
3021
+ }
3022
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
3023
+ if (!SWIG_IsOK(res1)) {
3024
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","lengthInSeconds", 1, self ));
3025
+ }
3026
+ arg1 = reinterpret_cast< TagLib::MPEG::Properties * >(argp1);
3027
+ result = (int)((TagLib::MPEG::Properties const *)arg1)->lengthInSeconds();
3028
+ vresult = SWIG_From_int(static_cast< int >(result));
3029
+ return vresult;
3030
+ fail:
3031
+ return Qnil;
3032
+ }
3033
+
3034
+
3035
+ SWIGINTERN VALUE
3036
+ _wrap_Properties_length_in_milliseconds(int argc, VALUE *argv, VALUE self) {
2874
3037
  TagLib::MPEG::Properties *arg1 = (TagLib::MPEG::Properties *) 0 ;
2875
3038
  void *argp1 = 0 ;
2876
3039
  int res1 = 0 ;
@@ -2882,10 +3045,10 @@ _wrap_Properties_length(int argc, VALUE *argv, VALUE self) {
2882
3045
  }
2883
3046
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__Properties, 0 | 0 );
2884
3047
  if (!SWIG_IsOK(res1)) {
2885
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","length", 1, self ));
3048
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::Properties const *","lengthInMilliseconds", 1, self ));
2886
3049
  }
2887
3050
  arg1 = reinterpret_cast< TagLib::MPEG::Properties * >(argp1);
2888
- result = (int)((TagLib::MPEG::Properties const *)arg1)->length();
3051
+ result = (int)((TagLib::MPEG::Properties const *)arg1)->lengthInMilliseconds();
2889
3052
  vresult = SWIG_From_int(static_cast< int >(result));
2890
3053
  return vresult;
2891
3054
  fail:
@@ -3137,7 +3300,7 @@ static swig_class SwigClassFile;
3137
3300
 
3138
3301
  SWIGINTERN VALUE
3139
3302
  _wrap_new_File__SWIG_0(int argc, VALUE *argv, VALUE self) {
3140
- SwigValueWrapper< TagLib::FileName > arg1 ;
3303
+ TagLib::FileName arg1 ;
3141
3304
  bool arg2 ;
3142
3305
  TagLib::MPEG::Properties::ReadStyle arg3 ;
3143
3306
  bool val2 ;
@@ -3176,7 +3339,7 @@ fail:
3176
3339
 
3177
3340
  SWIGINTERN VALUE
3178
3341
  _wrap_new_File__SWIG_1(int argc, VALUE *argv, VALUE self) {
3179
- SwigValueWrapper< TagLib::FileName > arg1 ;
3342
+ TagLib::FileName arg1 ;
3180
3343
  bool arg2 ;
3181
3344
  bool val2 ;
3182
3345
  int ecode2 = 0 ;
@@ -3207,7 +3370,7 @@ fail:
3207
3370
 
3208
3371
  SWIGINTERN VALUE
3209
3372
  _wrap_new_File__SWIG_2(int argc, VALUE *argv, VALUE self) {
3210
- SwigValueWrapper< TagLib::FileName > arg1 ;
3373
+ TagLib::FileName arg1 ;
3211
3374
  TagLib::MPEG::File *result = 0 ;
3212
3375
 
3213
3376
  if ((argc < 1) || (argc > 1)) {
@@ -3230,7 +3393,7 @@ fail:
3230
3393
 
3231
3394
  SWIGINTERN VALUE
3232
3395
  _wrap_new_File__SWIG_3(int argc, VALUE *argv, VALUE self) {
3233
- SwigValueWrapper< TagLib::FileName > arg1 ;
3396
+ TagLib::FileName arg1 ;
3234
3397
  TagLib::ID3v2::FrameFactory *arg2 = (TagLib::ID3v2::FrameFactory *) 0 ;
3235
3398
  bool arg3 ;
3236
3399
  TagLib::MPEG::Properties::ReadStyle arg4 ;
@@ -3277,7 +3440,7 @@ fail:
3277
3440
 
3278
3441
  SWIGINTERN VALUE
3279
3442
  _wrap_new_File__SWIG_4(int argc, VALUE *argv, VALUE self) {
3280
- SwigValueWrapper< TagLib::FileName > arg1 ;
3443
+ TagLib::FileName arg1 ;
3281
3444
  TagLib::ID3v2::FrameFactory *arg2 = (TagLib::ID3v2::FrameFactory *) 0 ;
3282
3445
  bool arg3 ;
3283
3446
  void *argp2 = 0 ;
@@ -3333,7 +3496,7 @@ _wrap_File_allocate(VALUE self) {
3333
3496
 
3334
3497
  SWIGINTERN VALUE
3335
3498
  _wrap_new_File__SWIG_5(int argc, VALUE *argv, VALUE self) {
3336
- SwigValueWrapper< TagLib::FileName > arg1 ;
3499
+ TagLib::FileName arg1 ;
3337
3500
  TagLib::ID3v2::FrameFactory *arg2 = (TagLib::ID3v2::FrameFactory *) 0 ;
3338
3501
  void *argp2 = 0 ;
3339
3502
  int res2 = 0 ;
@@ -3630,17 +3793,250 @@ fail:
3630
3793
 
3631
3794
 
3632
3795
  SWIGINTERN VALUE
3633
- _wrap_File_id3v2_tag__SWIG_0(int argc, VALUE *argv, VALUE self) {
3796
+ _wrap_File_save__SWIG_3(int argc, VALUE *argv, VALUE self) {
3634
3797
  TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3635
- bool arg2 ;
3798
+ int arg2 ;
3799
+ bool arg3 ;
3800
+ int arg4 ;
3636
3801
  void *argp1 = 0 ;
3637
3802
  int res1 = 0 ;
3638
- bool val2 ;
3803
+ int val2 ;
3639
3804
  int ecode2 = 0 ;
3640
- TagLib::ID3v2::Tag *result = 0 ;
3641
- VALUE vresult = Qnil;
3642
-
3643
- if ((argc < 1) || (argc > 1)) {
3805
+ bool val3 ;
3806
+ int ecode3 = 0 ;
3807
+ int val4 ;
3808
+ int ecode4 = 0 ;
3809
+ bool result;
3810
+ VALUE vresult = Qnil;
3811
+
3812
+ if ((argc < 3) || (argc > 3)) {
3813
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
3814
+ }
3815
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3816
+ if (!SWIG_IsOK(res1)) {
3817
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","save", 1, self ));
3818
+ }
3819
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3820
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3821
+ if (!SWIG_IsOK(ecode2)) {
3822
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","save", 2, argv[0] ));
3823
+ }
3824
+ arg2 = static_cast< int >(val2);
3825
+ ecode3 = SWIG_AsVal_bool(argv[1], &val3);
3826
+ if (!SWIG_IsOK(ecode3)) {
3827
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","save", 3, argv[1] ));
3828
+ }
3829
+ arg3 = static_cast< bool >(val3);
3830
+ ecode4 = SWIG_AsVal_int(argv[2], &val4);
3831
+ if (!SWIG_IsOK(ecode4)) {
3832
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","save", 4, argv[2] ));
3833
+ }
3834
+ arg4 = static_cast< int >(val4);
3835
+ result = (bool)(arg1)->save(arg2,arg3,arg4);
3836
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3837
+ return vresult;
3838
+ fail:
3839
+ return Qnil;
3840
+ }
3841
+
3842
+
3843
+ SWIGINTERN VALUE
3844
+ _wrap_File_save__SWIG_4(int argc, VALUE *argv, VALUE self) {
3845
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
3846
+ int arg2 ;
3847
+ bool arg3 ;
3848
+ int arg4 ;
3849
+ bool arg5 ;
3850
+ void *argp1 = 0 ;
3851
+ int res1 = 0 ;
3852
+ int val2 ;
3853
+ int ecode2 = 0 ;
3854
+ bool val3 ;
3855
+ int ecode3 = 0 ;
3856
+ int val4 ;
3857
+ int ecode4 = 0 ;
3858
+ bool val5 ;
3859
+ int ecode5 = 0 ;
3860
+ bool result;
3861
+ VALUE vresult = Qnil;
3862
+
3863
+ if ((argc < 4) || (argc > 4)) {
3864
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
3865
+ }
3866
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
3867
+ if (!SWIG_IsOK(res1)) {
3868
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","save", 1, self ));
3869
+ }
3870
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
3871
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
3872
+ if (!SWIG_IsOK(ecode2)) {
3873
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","save", 2, argv[0] ));
3874
+ }
3875
+ arg2 = static_cast< int >(val2);
3876
+ ecode3 = SWIG_AsVal_bool(argv[1], &val3);
3877
+ if (!SWIG_IsOK(ecode3)) {
3878
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","save", 3, argv[1] ));
3879
+ }
3880
+ arg3 = static_cast< bool >(val3);
3881
+ ecode4 = SWIG_AsVal_int(argv[2], &val4);
3882
+ if (!SWIG_IsOK(ecode4)) {
3883
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","save", 4, argv[2] ));
3884
+ }
3885
+ arg4 = static_cast< int >(val4);
3886
+ ecode5 = SWIG_AsVal_bool(argv[3], &val5);
3887
+ if (!SWIG_IsOK(ecode5)) {
3888
+ SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "bool","save", 5, argv[3] ));
3889
+ }
3890
+ arg5 = static_cast< bool >(val5);
3891
+ result = (bool)(arg1)->save(arg2,arg3,arg4,arg5);
3892
+ vresult = SWIG_From_bool(static_cast< bool >(result));
3893
+ return vresult;
3894
+ fail:
3895
+ return Qnil;
3896
+ }
3897
+
3898
+
3899
+ SWIGINTERN VALUE _wrap_File_save(int nargs, VALUE *args, VALUE self) {
3900
+ int argc;
3901
+ VALUE argv[6];
3902
+ int ii;
3903
+
3904
+ argc = nargs + 1;
3905
+ argv[0] = self;
3906
+ if (argc > 6) SWIG_fail;
3907
+ for (ii = 1; (ii < argc); ++ii) {
3908
+ argv[ii] = args[ii-1];
3909
+ }
3910
+ if (argc == 1) {
3911
+ int _v;
3912
+ void *vptr = 0;
3913
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3914
+ _v = SWIG_CheckState(res);
3915
+ if (_v) {
3916
+ return _wrap_File_save__SWIG_0(nargs, args, self);
3917
+ }
3918
+ }
3919
+ if (argc == 2) {
3920
+ int _v;
3921
+ void *vptr = 0;
3922
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3923
+ _v = SWIG_CheckState(res);
3924
+ if (_v) {
3925
+ {
3926
+ int res = SWIG_AsVal_int(argv[1], NULL);
3927
+ _v = SWIG_CheckState(res);
3928
+ }
3929
+ if (_v) {
3930
+ return _wrap_File_save__SWIG_1(nargs, args, self);
3931
+ }
3932
+ }
3933
+ }
3934
+ if (argc == 3) {
3935
+ int _v;
3936
+ void *vptr = 0;
3937
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3938
+ _v = SWIG_CheckState(res);
3939
+ if (_v) {
3940
+ {
3941
+ int res = SWIG_AsVal_int(argv[1], NULL);
3942
+ _v = SWIG_CheckState(res);
3943
+ }
3944
+ if (_v) {
3945
+ {
3946
+ int res = SWIG_AsVal_bool(argv[2], NULL);
3947
+ _v = SWIG_CheckState(res);
3948
+ }
3949
+ if (_v) {
3950
+ return _wrap_File_save__SWIG_2(nargs, args, self);
3951
+ }
3952
+ }
3953
+ }
3954
+ }
3955
+ if (argc == 4) {
3956
+ int _v;
3957
+ void *vptr = 0;
3958
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3959
+ _v = SWIG_CheckState(res);
3960
+ if (_v) {
3961
+ {
3962
+ int res = SWIG_AsVal_int(argv[1], NULL);
3963
+ _v = SWIG_CheckState(res);
3964
+ }
3965
+ if (_v) {
3966
+ {
3967
+ int res = SWIG_AsVal_bool(argv[2], NULL);
3968
+ _v = SWIG_CheckState(res);
3969
+ }
3970
+ if (_v) {
3971
+ {
3972
+ int res = SWIG_AsVal_int(argv[3], NULL);
3973
+ _v = SWIG_CheckState(res);
3974
+ }
3975
+ if (_v) {
3976
+ return _wrap_File_save__SWIG_3(nargs, args, self);
3977
+ }
3978
+ }
3979
+ }
3980
+ }
3981
+ }
3982
+ if (argc == 5) {
3983
+ int _v;
3984
+ void *vptr = 0;
3985
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
3986
+ _v = SWIG_CheckState(res);
3987
+ if (_v) {
3988
+ {
3989
+ int res = SWIG_AsVal_int(argv[1], NULL);
3990
+ _v = SWIG_CheckState(res);
3991
+ }
3992
+ if (_v) {
3993
+ {
3994
+ int res = SWIG_AsVal_bool(argv[2], NULL);
3995
+ _v = SWIG_CheckState(res);
3996
+ }
3997
+ if (_v) {
3998
+ {
3999
+ int res = SWIG_AsVal_int(argv[3], NULL);
4000
+ _v = SWIG_CheckState(res);
4001
+ }
4002
+ if (_v) {
4003
+ {
4004
+ int res = SWIG_AsVal_bool(argv[4], NULL);
4005
+ _v = SWIG_CheckState(res);
4006
+ }
4007
+ if (_v) {
4008
+ return _wrap_File_save__SWIG_4(nargs, args, self);
4009
+ }
4010
+ }
4011
+ }
4012
+ }
4013
+ }
4014
+ }
4015
+
4016
+ fail:
4017
+ Ruby_Format_OverloadedError( argc, 6, "File.save",
4018
+ " bool File.save()\n"
4019
+ " bool File.save(int tags)\n"
4020
+ " bool File.save(int tags, bool stripOthers)\n"
4021
+ " bool File.save(int tags, bool stripOthers, int id3v2Version)\n"
4022
+ " bool File.save(int tags, bool stripOthers, int id3v2Version, bool duplicateTags)\n");
4023
+
4024
+ return Qnil;
4025
+ }
4026
+
4027
+
4028
+ SWIGINTERN VALUE
4029
+ _wrap_File_id3v2_tag__SWIG_0(int argc, VALUE *argv, VALUE self) {
4030
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
4031
+ bool arg2 ;
4032
+ void *argp1 = 0 ;
4033
+ int res1 = 0 ;
4034
+ bool val2 ;
4035
+ int ecode2 = 0 ;
4036
+ TagLib::ID3v2::Tag *result = 0 ;
4037
+ VALUE vresult = Qnil;
4038
+
4039
+ if ((argc < 1) || (argc > 1)) {
3644
4040
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3645
4041
  }
3646
4042
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
@@ -4237,67 +4633,46 @@ fail:
4237
4633
 
4238
4634
 
4239
4635
  SWIGINTERN VALUE
4240
- _wrap_File_close(int argc, VALUE *argv, VALUE self) {
4636
+ _wrap_File_id3v1_tagq___(int argc, VALUE *argv, VALUE self) {
4241
4637
  TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
4242
4638
  void *argp1 = 0 ;
4243
4639
  int res1 = 0 ;
4640
+ bool result;
4641
+ VALUE vresult = Qnil;
4244
4642
 
4245
4643
  if ((argc < 0) || (argc > 0)) {
4246
4644
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
4247
4645
  }
4248
4646
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
4249
4647
  if (!SWIG_IsOK(res1)) {
4250
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","close", 1, self ));
4648
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File const *","hasID3v1Tag", 1, self ));
4251
4649
  }
4252
4650
  arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
4253
- TagLib_MPEG_File_close(arg1);
4254
- return Qnil;
4651
+ result = (bool)((TagLib::MPEG::File const *)arg1)->hasID3v1Tag();
4652
+ vresult = SWIG_From_bool(static_cast< bool >(result));
4653
+ return vresult;
4255
4654
  fail:
4256
4655
  return Qnil;
4257
4656
  }
4258
4657
 
4259
4658
 
4260
4659
  SWIGINTERN VALUE
4261
- _wrap_File_save__SWIG_3(int argc, VALUE *argv, VALUE self) {
4660
+ _wrap_File_id3v2_tagq___(int argc, VALUE *argv, VALUE self) {
4262
4661
  TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
4263
- int arg2 ;
4264
- bool arg3 ;
4265
- int arg4 ;
4266
4662
  void *argp1 = 0 ;
4267
4663
  int res1 = 0 ;
4268
- int val2 ;
4269
- int ecode2 = 0 ;
4270
- bool val3 ;
4271
- int ecode3 = 0 ;
4272
- int val4 ;
4273
- int ecode4 = 0 ;
4274
4664
  bool result;
4275
4665
  VALUE vresult = Qnil;
4276
4666
 
4277
- if ((argc < 3) || (argc > 3)) {
4278
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
4667
+ if ((argc < 0) || (argc > 0)) {
4668
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
4279
4669
  }
4280
4670
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
4281
4671
  if (!SWIG_IsOK(res1)) {
4282
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","save", 1, self ));
4672
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File const *","hasID3v2Tag", 1, self ));
4283
4673
  }
4284
4674
  arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
4285
- ecode2 = SWIG_AsVal_int(argv[0], &val2);
4286
- if (!SWIG_IsOK(ecode2)) {
4287
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","save", 2, argv[0] ));
4288
- }
4289
- arg2 = static_cast< int >(val2);
4290
- ecode3 = SWIG_AsVal_bool(argv[1], &val3);
4291
- if (!SWIG_IsOK(ecode3)) {
4292
- SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","save", 3, argv[1] ));
4293
- }
4294
- arg3 = static_cast< bool >(val3);
4295
- ecode4 = SWIG_AsVal_int(argv[2], &val4);
4296
- if (!SWIG_IsOK(ecode4)) {
4297
- SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","save", 4, argv[2] ));
4298
- }
4299
- arg4 = static_cast< int >(val4);
4300
- result = (bool)TagLib_MPEG_File_save__SWIG_3(arg1,arg2,arg3,arg4);
4675
+ result = (bool)((TagLib::MPEG::File const *)arg1)->hasID3v2Tag();
4301
4676
  vresult = SWIG_From_bool(static_cast< bool >(result));
4302
4677
  return vresult;
4303
4678
  fail:
@@ -4305,97 +4680,47 @@ fail:
4305
4680
  }
4306
4681
 
4307
4682
 
4308
- SWIGINTERN VALUE _wrap_File_save(int nargs, VALUE *args, VALUE self) {
4309
- int argc;
4310
- VALUE argv[5];
4311
- int ii;
4683
+ SWIGINTERN VALUE
4684
+ _wrap_File_ape_tagq___(int argc, VALUE *argv, VALUE self) {
4685
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
4686
+ void *argp1 = 0 ;
4687
+ int res1 = 0 ;
4688
+ bool result;
4689
+ VALUE vresult = Qnil;
4312
4690
 
4313
- argc = nargs + 1;
4314
- argv[0] = self;
4315
- if (argc > 5) SWIG_fail;
4316
- for (ii = 1; (ii < argc); ++ii) {
4317
- argv[ii] = args[ii-1];
4318
- }
4319
- if (argc == 1) {
4320
- int _v;
4321
- void *vptr = 0;
4322
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
4323
- _v = SWIG_CheckState(res);
4324
- if (_v) {
4325
- return _wrap_File_save__SWIG_0(nargs, args, self);
4326
- }
4691
+ if ((argc < 0) || (argc > 0)) {
4692
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
4327
4693
  }
4328
- if (argc == 2) {
4329
- int _v;
4330
- void *vptr = 0;
4331
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
4332
- _v = SWIG_CheckState(res);
4333
- if (_v) {
4334
- {
4335
- int res = SWIG_AsVal_int(argv[1], NULL);
4336
- _v = SWIG_CheckState(res);
4337
- }
4338
- if (_v) {
4339
- return _wrap_File_save__SWIG_1(nargs, args, self);
4340
- }
4341
- }
4694
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
4695
+ if (!SWIG_IsOK(res1)) {
4696
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File const *","hasAPETag", 1, self ));
4342
4697
  }
4343
- if (argc == 3) {
4344
- int _v;
4345
- void *vptr = 0;
4346
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
4347
- _v = SWIG_CheckState(res);
4348
- if (_v) {
4349
- {
4350
- int res = SWIG_AsVal_int(argv[1], NULL);
4351
- _v = SWIG_CheckState(res);
4352
- }
4353
- if (_v) {
4354
- {
4355
- int res = SWIG_AsVal_bool(argv[2], NULL);
4356
- _v = SWIG_CheckState(res);
4357
- }
4358
- if (_v) {
4359
- return _wrap_File_save__SWIG_2(nargs, args, self);
4360
- }
4361
- }
4362
- }
4698
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
4699
+ result = (bool)((TagLib::MPEG::File const *)arg1)->hasAPETag();
4700
+ vresult = SWIG_From_bool(static_cast< bool >(result));
4701
+ return vresult;
4702
+ fail:
4703
+ return Qnil;
4704
+ }
4705
+
4706
+
4707
+ SWIGINTERN VALUE
4708
+ _wrap_File_close(int argc, VALUE *argv, VALUE self) {
4709
+ TagLib::MPEG::File *arg1 = (TagLib::MPEG::File *) 0 ;
4710
+ void *argp1 = 0 ;
4711
+ int res1 = 0 ;
4712
+
4713
+ if ((argc < 0) || (argc > 0)) {
4714
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
4363
4715
  }
4364
- if (argc == 4) {
4365
- int _v;
4366
- void *vptr = 0;
4367
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MPEG__File, 0);
4368
- _v = SWIG_CheckState(res);
4369
- if (_v) {
4370
- {
4371
- int res = SWIG_AsVal_int(argv[1], NULL);
4372
- _v = SWIG_CheckState(res);
4373
- }
4374
- if (_v) {
4375
- {
4376
- int res = SWIG_AsVal_bool(argv[2], NULL);
4377
- _v = SWIG_CheckState(res);
4378
- }
4379
- if (_v) {
4380
- {
4381
- int res = SWIG_AsVal_int(argv[3], NULL);
4382
- _v = SWIG_CheckState(res);
4383
- }
4384
- if (_v) {
4385
- return _wrap_File_save__SWIG_3(nargs, args, self);
4386
- }
4387
- }
4388
- }
4389
- }
4716
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__MPEG__File, 0 | 0 );
4717
+ if (!SWIG_IsOK(res1)) {
4718
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::MPEG::File *","close", 1, self ));
4390
4719
  }
4391
-
4720
+ arg1 = reinterpret_cast< TagLib::MPEG::File * >(argp1);
4721
+ TagLib_MPEG_File_close(arg1);
4722
+ return Qnil;
4392
4723
  fail:
4393
- Ruby_Format_OverloadedError( argc, 5, "File.save",
4394
- " bool File.save()\n"
4395
- " bool File.save(int tags)\n"
4396
- " bool File.save(int tags, bool stripOthers)\n"
4397
- " bool File.save(int tags, bool stripOthers, int id3v2Version)\n");
4398
-
4399
4724
  return Qnil;
4400
4725
  }
4401
4726
 
@@ -4486,18 +4811,18 @@ static swig_cast_info *swig_cast_initial[] = {
4486
4811
 
4487
4812
  /* -----------------------------------------------------------------------------
4488
4813
  * Type initialization:
4489
- * This problem is tough by the requirement that no dynamic
4490
- * memory is used. Also, since swig_type_info structures store pointers to
4814
+ * This problem is tough by the requirement that no dynamic
4815
+ * memory is used. Also, since swig_type_info structures store pointers to
4491
4816
  * swig_cast_info structures and swig_cast_info structures store pointers back
4492
- * to swig_type_info structures, we need some lookup code at initialization.
4493
- * The idea is that swig generates all the structures that are needed.
4494
- * The runtime then collects these partially filled structures.
4495
- * The SWIG_InitializeModule function takes these initial arrays out of
4817
+ * to swig_type_info structures, we need some lookup code at initialization.
4818
+ * The idea is that swig generates all the structures that are needed.
4819
+ * The runtime then collects these partially filled structures.
4820
+ * The SWIG_InitializeModule function takes these initial arrays out of
4496
4821
  * swig_module, and does all the lookup, filling in the swig_module.types
4497
4822
  * array with the correct data and linking the correct swig_cast_info
4498
4823
  * structures together.
4499
4824
  *
4500
- * The generated swig_type_info structures are assigned staticly to an initial
4825
+ * The generated swig_type_info structures are assigned statically to an initial
4501
4826
  * array. We just loop through that array, and handle each type individually.
4502
4827
  * First we lookup if this type has been already loaded, and if so, use the
4503
4828
  * loaded structure instead of the generated one. Then we have to fill in the
@@ -4507,17 +4832,17 @@ static swig_cast_info *swig_cast_initial[] = {
4507
4832
  * a column is one of the swig_cast_info structures for that type.
4508
4833
  * The cast_initial array is actually an array of arrays, because each row has
4509
4834
  * a variable number of columns. So to actually build the cast linked list,
4510
- * we find the array of casts associated with the type, and loop through it
4835
+ * we find the array of casts associated with the type, and loop through it
4511
4836
  * adding the casts to the list. The one last trick we need to do is making
4512
4837
  * sure the type pointer in the swig_cast_info struct is correct.
4513
4838
  *
4514
- * First off, we lookup the cast->type name to see if it is already loaded.
4839
+ * First off, we lookup the cast->type name to see if it is already loaded.
4515
4840
  * There are three cases to handle:
4516
4841
  * 1) If the cast->type has already been loaded AND the type we are adding
4517
4842
  * casting info to has not been loaded (it is in this module), THEN we
4518
4843
  * replace the cast->type pointer with the type pointer that has already
4519
4844
  * been loaded.
4520
- * 2) If BOTH types (the one we are adding casting info to, and the
4845
+ * 2) If BOTH types (the one we are adding casting info to, and the
4521
4846
  * cast->type) are loaded, THEN the cast info has already been loaded by
4522
4847
  * the previous module so we just ignore it.
4523
4848
  * 3) Finally, if cast->type has not already been loaded, then we add that
@@ -4541,7 +4866,7 @@ SWIGRUNTIME void
4541
4866
  SWIG_InitializeModule(void *clientdata) {
4542
4867
  size_t i;
4543
4868
  swig_module_info *module_head, *iter;
4544
- int found, init;
4869
+ int init;
4545
4870
 
4546
4871
  /* check to see if the circular list has been setup, if not, set it up */
4547
4872
  if (swig_module.next==0) {
@@ -4560,27 +4885,23 @@ SWIG_InitializeModule(void *clientdata) {
4560
4885
  /* This is the first module loaded for this interpreter */
4561
4886
  /* so set the swig module into the interpreter */
4562
4887
  SWIG_SetModule(clientdata, &swig_module);
4563
- module_head = &swig_module;
4564
4888
  } else {
4565
4889
  /* the interpreter has loaded a SWIG module, but has it loaded this one? */
4566
- found=0;
4567
4890
  iter=module_head;
4568
4891
  do {
4569
4892
  if (iter==&swig_module) {
4570
- found=1;
4571
- break;
4893
+ /* Our module is already in the list, so there's nothing more to do. */
4894
+ return;
4572
4895
  }
4573
4896
  iter=iter->next;
4574
4897
  } while (iter!= module_head);
4575
4898
 
4576
- /* if the is found in the list, then all is done and we may leave */
4577
- if (found) return;
4578
- /* otherwise we must add out module into the list */
4899
+ /* otherwise we must add our module into the list */
4579
4900
  swig_module.next = module_head->next;
4580
4901
  module_head->next = &swig_module;
4581
4902
  }
4582
4903
 
4583
- /* When multiple interpeters are used, a module could have already been initialized in
4904
+ /* When multiple interpreters are used, a module could have already been initialized in
4584
4905
  a different interpreter, but not yet have a pointer in this interpreter.
4585
4906
  In this case, we do not want to continue adding types... everything should be
4586
4907
  set up already */
@@ -4594,7 +4915,7 @@ SWIG_InitializeModule(void *clientdata) {
4594
4915
  swig_type_info *type = 0;
4595
4916
  swig_type_info *ret;
4596
4917
  swig_cast_info *cast;
4597
-
4918
+
4598
4919
  #ifdef SWIGRUNTIME_DEBUG
4599
4920
  printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4600
4921
  #endif
@@ -4621,7 +4942,7 @@ SWIG_InitializeModule(void *clientdata) {
4621
4942
  /* Insert casting types */
4622
4943
  cast = swig_module.cast_initial[i];
4623
4944
  while (cast->type) {
4624
-
4945
+
4625
4946
  /* Don't need to add information already in the list */
4626
4947
  ret = 0;
4627
4948
  #ifdef SWIGRUNTIME_DEBUG
@@ -4744,9 +5065,13 @@ SWIGEXPORT void Init_taglib_mpeg(void) {
4744
5065
  SWIG_TypeClientData(SWIGTYPE_p_TagLib__MPEG__XingHeader, (void *) &SwigClassXingHeader);
4745
5066
  rb_define_alloc_func(SwigClassXingHeader.klass, _wrap_XingHeader_allocate);
4746
5067
  rb_define_method(SwigClassXingHeader.klass, "initialize", VALUEFUNC(_wrap_new_XingHeader), -1);
5068
+ rb_define_const(SwigClassXingHeader.klass, "Invalid", SWIG_From_int(static_cast< int >(TagLib::MPEG::XingHeader::Invalid)));
5069
+ rb_define_const(SwigClassXingHeader.klass, "Xing", SWIG_From_int(static_cast< int >(TagLib::MPEG::XingHeader::Xing)));
5070
+ rb_define_const(SwigClassXingHeader.klass, "VBRI", SWIG_From_int(static_cast< int >(TagLib::MPEG::XingHeader::VBRI)));
4747
5071
  rb_define_method(SwigClassXingHeader.klass, "valid?", VALUEFUNC(_wrap_XingHeader_validq___), -1);
4748
5072
  rb_define_method(SwigClassXingHeader.klass, "total_frames", VALUEFUNC(_wrap_XingHeader_total_frames), -1);
4749
5073
  rb_define_method(SwigClassXingHeader.klass, "total_size", VALUEFUNC(_wrap_XingHeader_total_size), -1);
5074
+ rb_define_method(SwigClassXingHeader.klass, "type", VALUEFUNC(_wrap_XingHeader_type), -1);
4750
5075
  rb_define_singleton_method(SwigClassXingHeader.klass, "xing_header_offset", VALUEFUNC(_wrap_XingHeader_xing_header_offset), -1);
4751
5076
  SwigClassXingHeader.mark = 0;
4752
5077
  SwigClassXingHeader.destroy = (void (*)(void *)) free_TagLib_MPEG_XingHeader;
@@ -4783,7 +5108,8 @@ SWIGEXPORT void Init_taglib_mpeg(void) {
4783
5108
  SWIG_TypeClientData(SWIGTYPE_p_TagLib__MPEG__Properties, (void *) &SwigClassProperties);
4784
5109
  rb_define_alloc_func(SwigClassProperties.klass, _wrap_Properties_allocate);
4785
5110
  rb_define_method(SwigClassProperties.klass, "initialize", VALUEFUNC(_wrap_new_Properties), -1);
4786
- rb_define_method(SwigClassProperties.klass, "length", VALUEFUNC(_wrap_Properties_length), -1);
5111
+ rb_define_method(SwigClassProperties.klass, "length_in_seconds", VALUEFUNC(_wrap_Properties_length_in_seconds), -1);
5112
+ rb_define_method(SwigClassProperties.klass, "length_in_milliseconds", VALUEFUNC(_wrap_Properties_length_in_milliseconds), -1);
4787
5113
  rb_define_method(SwigClassProperties.klass, "bitrate", VALUEFUNC(_wrap_Properties_bitrate), -1);
4788
5114
  rb_define_method(SwigClassProperties.klass, "sample_rate", VALUEFUNC(_wrap_Properties_sample_rate), -1);
4789
5115
  rb_define_method(SwigClassProperties.klass, "channels", VALUEFUNC(_wrap_Properties_channels), -1);
@@ -4809,6 +5135,7 @@ SWIGEXPORT void Init_taglib_mpeg(void) {
4809
5135
  rb_define_const(SwigClassFile.klass, "AllTags", SWIG_From_int(static_cast< int >(TagLib::MPEG::File::AllTags)));
4810
5136
  rb_define_method(SwigClassFile.klass, "tag", VALUEFUNC(_wrap_File_tag), -1);
4811
5137
  rb_define_method(SwigClassFile.klass, "audio_properties", VALUEFUNC(_wrap_File_audio_properties), -1);
5138
+ rb_define_method(SwigClassFile.klass, "save", VALUEFUNC(_wrap_File_save), -1);
4812
5139
  rb_define_method(SwigClassFile.klass, "id3v2_tag", VALUEFUNC(_wrap_File_id3v2_tag), -1);
4813
5140
  rb_define_method(SwigClassFile.klass, "id3v1_tag", VALUEFUNC(_wrap_File_id3v1_tag), -1);
4814
5141
  rb_define_method(SwigClassFile.klass, "apetag", VALUEFUNC(_wrap_File_apetag), -1);
@@ -4818,8 +5145,10 @@ SWIGEXPORT void Init_taglib_mpeg(void) {
4818
5145
  rb_define_method(SwigClassFile.klass, "next_frame_offset", VALUEFUNC(_wrap_File_next_frame_offset), -1);
4819
5146
  rb_define_method(SwigClassFile.klass, "previous_frame_offset", VALUEFUNC(_wrap_File_previous_frame_offset), -1);
4820
5147
  rb_define_method(SwigClassFile.klass, "last_frame_offset", VALUEFUNC(_wrap_File_last_frame_offset), -1);
5148
+ rb_define_method(SwigClassFile.klass, "id3v1_tag?", VALUEFUNC(_wrap_File_id3v1_tagq___), -1);
5149
+ rb_define_method(SwigClassFile.klass, "id3v2_tag?", VALUEFUNC(_wrap_File_id3v2_tagq___), -1);
5150
+ rb_define_method(SwigClassFile.klass, "ape_tag?", VALUEFUNC(_wrap_File_ape_tagq___), -1);
4821
5151
  rb_define_method(SwigClassFile.klass, "close", VALUEFUNC(_wrap_File_close), -1);
4822
- rb_define_method(SwigClassFile.klass, "save", VALUEFUNC(_wrap_File_save), -1);
4823
5152
  SwigClassFile.mark = 0;
4824
5153
  SwigClassFile.destroy = (void (*)(void *)) free_taglib_mpeg_file;
4825
5154
  SwigClassFile.trackObjects = 1;