taglib-ruby 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES.md +9 -0
  3. data/README.md +40 -9
  4. data/Rakefile +1 -2
  5. data/docs/taglib/aiff.rb +63 -0
  6. data/docs/taglib/base.rb +22 -1
  7. data/docs/taglib/id3v2.rb +21 -2
  8. data/docs/taglib/riff.rb +3 -0
  9. data/docs/taglib/wav.rb +63 -0
  10. data/ext/extconf_common.rb +15 -1
  11. data/ext/taglib_aiff/extconf.rb +4 -0
  12. data/ext/taglib_aiff/taglib_aiff.i +68 -0
  13. data/ext/taglib_aiff/taglib_aiff_wrap.cxx +2920 -0
  14. data/ext/taglib_base/includes.i +7 -2
  15. data/ext/taglib_base/taglib_base_wrap.cxx +109 -115
  16. data/ext/taglib_flac/taglib_flac_wrap.cxx +108 -114
  17. data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +109 -115
  18. data/ext/taglib_id3v2/taglib_id3v2.i +3 -1
  19. data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +139 -119
  20. data/ext/taglib_mp4/taglib_mp4_wrap.cxx +109 -115
  21. data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +108 -114
  22. data/ext/taglib_ogg/taglib_ogg_wrap.cxx +109 -115
  23. data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +108 -114
  24. data/ext/taglib_wav/extconf.rb +4 -0
  25. data/ext/taglib_wav/taglib_wav.i +66 -0
  26. data/ext/taglib_wav/taglib_wav_wrap.cxx +3057 -0
  27. data/lib/taglib.rb +2 -0
  28. data/lib/taglib/aiff.rb +7 -0
  29. data/lib/taglib/version.rb +1 -1
  30. data/lib/taglib/wav.rb +7 -0
  31. data/taglib-ruby.gemspec +27 -2
  32. data/tasks/ext.rake +17 -10
  33. data/tasks/swig.rake +10 -0
  34. data/test/aiff_examples_test.rb +39 -0
  35. data/test/aiff_file_test.rb +94 -0
  36. data/test/aiff_file_write_test.rb +88 -0
  37. data/test/data/Makefile +8 -2
  38. data/test/data/aiff-sample.aiff +0 -0
  39. data/test/data/wav-create.cpp +55 -0
  40. data/test/data/wav-dump.cpp +74 -0
  41. data/test/data/wav-sample.wav +0 -0
  42. data/test/file_test.rb +21 -0
  43. data/test/id3v2_unknown_frames_test.rb +30 -0
  44. data/test/wav_examples_test.rb +42 -0
  45. data/test/wav_file_test.rb +96 -0
  46. data/test/wav_file_write_test.rb +88 -0
  47. metadata +49 -45
@@ -24,9 +24,11 @@
24
24
  #if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
25
25
  # include <ruby/encoding.h>
26
26
  # define ASSOCIATE_UTF8_ENCODING(value) rb_enc_associate(value, rb_utf8_encoding());
27
+ # define ASSOCIATE_FILESYSTEM_ENCODING(value) rb_enc_associate(value, rb_filesystem_encoding());
27
28
  # define CONVERT_TO_UTF8(value) rb_str_export_to_enc(value, rb_utf8_encoding())
28
29
  #else
29
30
  # define ASSOCIATE_UTF8_ENCODING(value) /* nothing */
31
+ # define ASSOCIATE_FILESYSTEM_ENCODING(value)
30
32
  # define CONVERT_TO_UTF8(value) value
31
33
  #endif
32
34
 
@@ -87,12 +89,15 @@ TagLib::StringList ruby_array_to_taglib_string_list(VALUE ary) {
87
89
  }
88
90
 
89
91
  VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
92
+ VALUE result;
90
93
  #ifdef _WIN32
91
94
  const char *s = (const char *) filename;
92
- return rb_tainted_str_new2(s);
95
+ result = rb_tainted_str_new2(s);
93
96
  #else
94
- return rb_tainted_str_new2(filename);
97
+ result = rb_tainted_str_new2(filename);
95
98
  #endif
99
+ ASSOCIATE_FILESYSTEM_ENCODING(result);
100
+ return result;
96
101
  }
97
102
 
98
103
  TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
@@ -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 2.0.12
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
6
  * coding conventions designed to improve portability and efficiency. Do not make
7
- * changes to this file unless you know what you are doing--modify the SWIG
8
- * interface file instead.
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
9
  * ----------------------------------------------------------------------------- */
10
10
 
11
11
  static void free_taglib_fileref(void *ptr);
@@ -68,28 +68,28 @@ template <typename T> T SwigValueInit() {
68
68
  #ifndef SWIGUNUSED
69
69
  # if defined(__GNUC__)
70
70
  # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
71
- # define SWIGUNUSED __attribute__ ((__unused__))
71
+ # define SWIGUNUSED __attribute__ ((__unused__))
72
72
  # else
73
73
  # define SWIGUNUSED
74
74
  # endif
75
75
  # elif defined(__ICC)
76
- # define SWIGUNUSED __attribute__ ((__unused__))
76
+ # define SWIGUNUSED __attribute__ ((__unused__))
77
77
  # else
78
- # define SWIGUNUSED
78
+ # define SWIGUNUSED
79
79
  # endif
80
80
  #endif
81
81
 
82
82
  #ifndef SWIG_MSC_UNSUPPRESS_4505
83
83
  # if defined(_MSC_VER)
84
84
  # pragma warning(disable : 4505) /* unreferenced local function has been removed */
85
- # endif
85
+ # endif
86
86
  #endif
87
87
 
88
88
  #ifndef SWIGUNUSEDPARM
89
89
  # ifdef __cplusplus
90
90
  # define SWIGUNUSEDPARM(p)
91
91
  # else
92
- # define SWIGUNUSEDPARM(p) p SWIGUNUSED
92
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
93
93
  # endif
94
94
  #endif
95
95
 
@@ -132,7 +132,7 @@ template <typename T> T SwigValueInit() {
132
132
  # define SWIGSTDCALL __stdcall
133
133
  # else
134
134
  # define SWIGSTDCALL
135
- # endif
135
+ # endif
136
136
  #endif
137
137
 
138
138
  /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -177,28 +177,28 @@ template <typename T> T SwigValueInit() {
177
177
  #ifndef SWIGUNUSED
178
178
  # if defined(__GNUC__)
179
179
  # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
180
- # define SWIGUNUSED __attribute__ ((__unused__))
180
+ # define SWIGUNUSED __attribute__ ((__unused__))
181
181
  # else
182
182
  # define SWIGUNUSED
183
183
  # endif
184
184
  # elif defined(__ICC)
185
- # define SWIGUNUSED __attribute__ ((__unused__))
185
+ # define SWIGUNUSED __attribute__ ((__unused__))
186
186
  # else
187
- # define SWIGUNUSED
187
+ # define SWIGUNUSED
188
188
  # endif
189
189
  #endif
190
190
 
191
191
  #ifndef SWIG_MSC_UNSUPPRESS_4505
192
192
  # if defined(_MSC_VER)
193
193
  # pragma warning(disable : 4505) /* unreferenced local function has been removed */
194
- # endif
194
+ # endif
195
195
  #endif
196
196
 
197
197
  #ifndef SWIGUNUSEDPARM
198
198
  # ifdef __cplusplus
199
199
  # define SWIGUNUSEDPARM(p)
200
200
  # else
201
- # define SWIGUNUSEDPARM(p) p SWIGUNUSED
201
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
202
202
  # endif
203
203
  #endif
204
204
 
@@ -241,7 +241,7 @@ template <typename T> T SwigValueInit() {
241
241
  # define SWIGSTDCALL __stdcall
242
242
  # else
243
243
  # define SWIGSTDCALL
244
- # endif
244
+ # endif
245
245
  #endif
246
246
 
247
247
  /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
@@ -279,7 +279,7 @@ template <typename T> T SwigValueInit() {
279
279
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
280
280
  creating a static or dynamic library from the SWIG runtime code.
281
281
  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
282
-
282
+
283
283
  But only do this if strictly necessary, ie, if you have problems
284
284
  with your compiler or suchlike.
285
285
  */
@@ -305,16 +305,16 @@ template <typename T> T SwigValueInit() {
305
305
  #define SWIG_POINTER_OWN 0x1
306
306
 
307
307
 
308
- /*
308
+ /*
309
309
  Flags/methods for returning states.
310
-
311
- The SWIG conversion methods, as ConvertPtr, return an integer
310
+
311
+ The SWIG conversion methods, as ConvertPtr, return an integer
312
312
  that tells if the conversion was successful or not. And if not,
313
313
  an error code can be returned (see swigerrors.swg for the codes).
314
-
314
+
315
315
  Use the following macros/flags to set or process the returning
316
316
  states.
317
-
317
+
318
318
  In old versions of SWIG, code such as the following was usually written:
319
319
 
320
320
  if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
@@ -347,23 +347,23 @@ template <typename T> T SwigValueInit() {
347
347
  } else {
348
348
  // fail code
349
349
  }
350
-
350
+
351
351
  I.e., now SWIG_ConvertPtr can return new objects and you can
352
352
  identify the case and take care of the deallocation. Of course that
353
353
  also requires SWIG_ConvertPtr to return new result values, such as
354
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
- }
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
367
  }
368
368
 
369
369
  Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
@@ -377,17 +377,17 @@ template <typename T> T SwigValueInit() {
377
377
  int fooi(int);
378
378
 
379
379
  and you call
380
-
380
+
381
381
  food(1) // cast rank '1' (1 -> 1.0)
382
382
  fooi(1) // cast rank '0'
383
383
 
384
384
  just use the SWIG_AddCast()/SWIG_CheckState()
385
385
  */
386
386
 
387
- #define SWIG_OK (0)
387
+ #define SWIG_OK (0)
388
388
  #define SWIG_ERROR (-1)
389
389
  #define SWIG_IsOK(r) (r >= 0)
390
- #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
390
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
391
391
 
392
392
  /* The CastRankLimit says how many bits are used for the cast rank */
393
393
  #define SWIG_CASTRANKLIMIT (1 << 8)
@@ -418,14 +418,14 @@ template <typename T> T SwigValueInit() {
418
418
  # endif
419
419
  # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
420
420
  # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
421
- SWIGINTERNINLINE int SWIG_AddCast(int r) {
421
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
422
422
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
423
423
  }
424
- SWIGINTERNINLINE int SWIG_CheckState(int r) {
425
- return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
424
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
425
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
426
426
  }
427
427
  #else /* no cast-rank mode */
428
- # define SWIG_AddCast
428
+ # define SWIG_AddCast(r) (r)
429
429
  # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
430
430
  #endif
431
431
 
@@ -469,7 +469,7 @@ typedef struct swig_module_info {
469
469
  void *clientdata; /* Language specific module data */
470
470
  } swig_module_info;
471
471
 
472
- /*
472
+ /*
473
473
  Compare two type names skipping the space characters, therefore
474
474
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
475
475
 
@@ -489,18 +489,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
489
489
 
490
490
  /*
491
491
  Check type equivalence in a name list like <name1>|<name2>|...
492
- Return 0 if not equal, 1 if equal
492
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
493
493
  */
494
494
  SWIGRUNTIME int
495
- SWIG_TypeEquiv(const char *nb, const char *tb) {
496
- int equiv = 0;
495
+ SWIG_TypeCmp(const char *nb, const char *tb) {
496
+ int equiv = 1;
497
497
  const char* te = tb + strlen(tb);
498
498
  const char* ne = nb;
499
- while (!equiv && *ne) {
499
+ while (equiv != 0 && *ne) {
500
500
  for (nb = ne; *ne; ++ne) {
501
501
  if (*ne == '|') break;
502
502
  }
503
- equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
503
+ equiv = SWIG_TypeNameComp(nb, ne, tb, te);
504
504
  if (*ne) ++ne;
505
505
  }
506
506
  return equiv;
@@ -508,24 +508,13 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
508
508
 
509
509
  /*
510
510
  Check type equivalence in a name list like <name1>|<name2>|...
511
- Return 0 if equal, -1 if nb < tb, 1 if nb > tb
511
+ Return 0 if not equal, 1 if equal
512
512
  */
513
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;
514
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
515
+ return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
526
516
  }
527
517
 
528
-
529
518
  /*
530
519
  Check the typename
531
520
  */
@@ -553,7 +542,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
553
542
  return 0;
554
543
  }
555
544
 
556
- /*
545
+ /*
557
546
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
558
547
  */
559
548
  SWIGRUNTIME swig_cast_info *
@@ -588,7 +577,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
588
577
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
589
578
  }
590
579
 
591
- /*
580
+ /*
592
581
  Dynamic pointer casting. Down an inheritance hierarchy
593
582
  */
594
583
  SWIGRUNTIME swig_type_info *
@@ -632,7 +621,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
632
621
  return type->name;
633
622
  }
634
623
 
635
- /*
624
+ /*
636
625
  Set the clientdata field for a type
637
626
  */
638
627
  SWIGRUNTIME void
@@ -640,14 +629,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
640
629
  swig_cast_info *cast = ti->cast;
641
630
  /* if (ti->clientdata == clientdata) return; */
642
631
  ti->clientdata = clientdata;
643
-
632
+
644
633
  while (cast) {
645
634
  if (!cast->converter) {
646
635
  swig_type_info *tc = cast->type;
647
636
  if (!tc->clientdata) {
648
637
  SWIG_TypeClientData(tc, clientdata);
649
638
  }
650
- }
639
+ }
651
640
  cast = cast->next;
652
641
  }
653
642
  }
@@ -656,18 +645,18 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
656
645
  SWIG_TypeClientData(ti, clientdata);
657
646
  ti->owndata = 1;
658
647
  }
659
-
648
+
660
649
  /*
661
650
  Search for a swig_type_info structure only by mangled name
662
651
  Search is a O(log #types)
663
-
664
- We start searching at module start, and finish searching when start == end.
652
+
653
+ We start searching at module start, and finish searching when start == end.
665
654
  Note: if start == end at the beginning of the function, we go all the way around
666
655
  the circular list.
667
656
  */
668
657
  SWIGRUNTIME swig_type_info *
669
- SWIG_MangledTypeQueryModule(swig_module_info *start,
670
- swig_module_info *end,
658
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
659
+ swig_module_info *end,
671
660
  const char *name) {
672
661
  swig_module_info *iter = start;
673
662
  do {
@@ -676,11 +665,11 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
676
665
  register size_t r = iter->size - 1;
677
666
  do {
678
667
  /* since l+r >= 0, we can (>> 1) instead (/ 2) */
679
- register size_t i = (l + r) >> 1;
668
+ register size_t i = (l + r) >> 1;
680
669
  const char *iname = iter->types[i]->name;
681
670
  if (iname) {
682
671
  register int compare = strcmp(name, iname);
683
- if (compare == 0) {
672
+ if (compare == 0) {
684
673
  return iter->types[i];
685
674
  } else if (compare < 0) {
686
675
  if (i) {
@@ -705,14 +694,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
705
694
  Search for a swig_type_info structure for either a mangled name or a human readable name.
706
695
  It first searches the mangled names of the types, which is a O(log #types)
707
696
  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.
697
+
698
+ We start searching at module start, and finish searching when start == end.
710
699
  Note: if start == end at the beginning of the function, we go all the way around
711
700
  the circular list.
712
701
  */
713
702
  SWIGRUNTIME swig_type_info *
714
- SWIG_TypeQueryModule(swig_module_info *start,
715
- swig_module_info *end,
703
+ SWIG_TypeQueryModule(swig_module_info *start,
704
+ swig_module_info *end,
716
705
  const char *name) {
717
706
  /* STEP 1: Search the name field using binary search */
718
707
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
@@ -731,12 +720,12 @@ SWIG_TypeQueryModule(swig_module_info *start,
731
720
  iter = iter->next;
732
721
  } while (iter != end);
733
722
  }
734
-
723
+
735
724
  /* neither found a match */
736
725
  return 0;
737
726
  }
738
727
 
739
- /*
728
+ /*
740
729
  Pack binary data into a string
741
730
  */
742
731
  SWIGRUNTIME char *
@@ -752,7 +741,7 @@ SWIG_PackData(char *c, void *ptr, size_t sz) {
752
741
  return c;
753
742
  }
754
743
 
755
- /*
744
+ /*
756
745
  Unpack binary data from a string
757
746
  */
758
747
  SWIGRUNTIME const char *
@@ -766,21 +755,21 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
766
755
  uu = ((d - '0') << 4);
767
756
  else if ((d >= 'a') && (d <= 'f'))
768
757
  uu = ((d - ('a'-10)) << 4);
769
- else
758
+ else
770
759
  return (char *) 0;
771
760
  d = *(c++);
772
761
  if ((d >= '0') && (d <= '9'))
773
762
  uu |= (d - '0');
774
763
  else if ((d >= 'a') && (d <= 'f'))
775
764
  uu |= (d - ('a'-10));
776
- else
765
+ else
777
766
  return (char *) 0;
778
767
  *u = uu;
779
768
  }
780
769
  return c;
781
770
  }
782
771
 
783
- /*
772
+ /*
784
773
  Pack 'void *' into a string buffer.
785
774
  */
786
775
  SWIGRUNTIME char *
@@ -840,18 +829,18 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
840
829
  #endif
841
830
 
842
831
  /* 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
832
+ #define SWIG_UnknownError -1
833
+ #define SWIG_IOError -2
834
+ #define SWIG_RuntimeError -3
835
+ #define SWIG_IndexError -4
836
+ #define SWIG_TypeError -5
837
+ #define SWIG_DivisionByZero -6
838
+ #define SWIG_OverflowError -7
839
+ #define SWIG_SyntaxError -8
840
+ #define SWIG_ValueError -9
852
841
  #define SWIG_SystemError -10
853
842
  #define SWIG_AttributeError -11
854
- #define SWIG_MemoryError -12
843
+ #define SWIG_MemoryError -12
855
844
  #define SWIG_NullReferenceError -13
856
845
 
857
846
 
@@ -1777,7 +1766,7 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
1777
1766
  SWIGINTERN
1778
1767
  int SWIG_Ruby_isCallable( VALUE proc )
1779
1768
  {
1780
- if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1769
+ if ( rb_respond_to( proc, swig_call_id ) )
1781
1770
  return 1;
1782
1771
  return 0;
1783
1772
  }
@@ -1790,7 +1779,7 @@ int SWIG_Ruby_isCallable( VALUE proc )
1790
1779
  SWIGINTERN
1791
1780
  int SWIG_Ruby_arity( VALUE proc, int minimal )
1792
1781
  {
1793
- if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1782
+ if ( rb_respond_to( proc, swig_arity_id ) )
1794
1783
  {
1795
1784
  VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1796
1785
  int arity = NUM2INT(num);
@@ -1843,7 +1832,7 @@ static VALUE mTagLib;
1843
1832
  #define SWIG_RUBY_THREAD_END_BLOCK
1844
1833
 
1845
1834
 
1846
- #define SWIGVERSION 0x020009
1835
+ #define SWIGVERSION 0x020012
1847
1836
  #define SWIG_VERSION SWIGVERSION
1848
1837
 
1849
1838
 
@@ -1868,9 +1857,11 @@ static VALUE mTagLib;
1868
1857
  #if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
1869
1858
  # include <ruby/encoding.h>
1870
1859
  # define ASSOCIATE_UTF8_ENCODING(value) rb_enc_associate(value, rb_utf8_encoding());
1860
+ # define ASSOCIATE_FILESYSTEM_ENCODING(value) rb_enc_associate(value, rb_filesystem_encoding());
1871
1861
  # define CONVERT_TO_UTF8(value) rb_str_export_to_enc(value, rb_utf8_encoding())
1872
1862
  #else
1873
1863
  # define ASSOCIATE_UTF8_ENCODING(value) /* nothing */
1864
+ # define ASSOCIATE_FILESYSTEM_ENCODING(value)
1874
1865
  # define CONVERT_TO_UTF8(value) value
1875
1866
  #endif
1876
1867
 
@@ -1931,12 +1922,15 @@ TagLib::StringList ruby_array_to_taglib_string_list(VALUE ary) {
1931
1922
  }
1932
1923
 
1933
1924
  VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
1925
+ VALUE result;
1934
1926
  #ifdef _WIN32
1935
1927
  const char *s = (const char *) filename;
1936
- return rb_tainted_str_new2(s);
1928
+ result = rb_tainted_str_new2(s);
1937
1929
  #else
1938
- return rb_tainted_str_new2(filename);
1930
+ result = rb_tainted_str_new2(filename);
1939
1931
  #endif
1932
+ ASSOCIATE_FILESYSTEM_ENCODING(result);
1933
+ return result;
1940
1934
  }
1941
1935
 
1942
1936
  TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
@@ -2059,7 +2053,7 @@ SWIG_ruby_failed(void)
2059
2053
  }
2060
2054
 
2061
2055
 
2062
- /*@SWIG:/usr/local/share/swig/2.0.9/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2056
+ /*@SWIG:/usr/local/share/swig/2.0.12/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2063
2057
  SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
2064
2058
  {
2065
2059
  VALUE obj = args[0];
@@ -2111,7 +2105,7 @@ SWIG_From_bool (bool value)
2111
2105
  }
2112
2106
 
2113
2107
 
2114
- /*@SWIG:/usr/local/share/swig/2.0.9/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2108
+ /*@SWIG:/usr/local/share/swig/2.0.12/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2115
2109
  SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
2116
2110
  {
2117
2111
  VALUE obj = args[0];
@@ -4806,18 +4800,18 @@ static swig_cast_info *swig_cast_initial[] = {
4806
4800
 
4807
4801
  /* -----------------------------------------------------------------------------
4808
4802
  * Type initialization:
4809
- * This problem is tough by the requirement that no dynamic
4810
- * memory is used. Also, since swig_type_info structures store pointers to
4803
+ * This problem is tough by the requirement that no dynamic
4804
+ * memory is used. Also, since swig_type_info structures store pointers to
4811
4805
  * swig_cast_info structures and swig_cast_info structures store pointers back
4812
- * to swig_type_info structures, we need some lookup code at initialization.
4813
- * The idea is that swig generates all the structures that are needed.
4814
- * The runtime then collects these partially filled structures.
4815
- * The SWIG_InitializeModule function takes these initial arrays out of
4806
+ * to swig_type_info structures, we need some lookup code at initialization.
4807
+ * The idea is that swig generates all the structures that are needed.
4808
+ * The runtime then collects these partially filled structures.
4809
+ * The SWIG_InitializeModule function takes these initial arrays out of
4816
4810
  * swig_module, and does all the lookup, filling in the swig_module.types
4817
4811
  * array with the correct data and linking the correct swig_cast_info
4818
4812
  * structures together.
4819
4813
  *
4820
- * The generated swig_type_info structures are assigned staticly to an initial
4814
+ * The generated swig_type_info structures are assigned staticly to an initial
4821
4815
  * array. We just loop through that array, and handle each type individually.
4822
4816
  * First we lookup if this type has been already loaded, and if so, use the
4823
4817
  * loaded structure instead of the generated one. Then we have to fill in the
@@ -4827,17 +4821,17 @@ static swig_cast_info *swig_cast_initial[] = {
4827
4821
  * a column is one of the swig_cast_info structures for that type.
4828
4822
  * The cast_initial array is actually an array of arrays, because each row has
4829
4823
  * a variable number of columns. So to actually build the cast linked list,
4830
- * we find the array of casts associated with the type, and loop through it
4824
+ * we find the array of casts associated with the type, and loop through it
4831
4825
  * adding the casts to the list. The one last trick we need to do is making
4832
4826
  * sure the type pointer in the swig_cast_info struct is correct.
4833
4827
  *
4834
- * First off, we lookup the cast->type name to see if it is already loaded.
4828
+ * First off, we lookup the cast->type name to see if it is already loaded.
4835
4829
  * There are three cases to handle:
4836
4830
  * 1) If the cast->type has already been loaded AND the type we are adding
4837
4831
  * casting info to has not been loaded (it is in this module), THEN we
4838
4832
  * replace the cast->type pointer with the type pointer that has already
4839
4833
  * been loaded.
4840
- * 2) If BOTH types (the one we are adding casting info to, and the
4834
+ * 2) If BOTH types (the one we are adding casting info to, and the
4841
4835
  * cast->type) are loaded, THEN the cast info has already been loaded by
4842
4836
  * the previous module so we just ignore it.
4843
4837
  * 3) Finally, if cast->type has not already been loaded, then we add that
@@ -4900,7 +4894,7 @@ SWIG_InitializeModule(void *clientdata) {
4900
4894
  module_head->next = &swig_module;
4901
4895
  }
4902
4896
 
4903
- /* When multiple interpeters are used, a module could have already been initialized in
4897
+ /* When multiple interpreters are used, a module could have already been initialized in
4904
4898
  a different interpreter, but not yet have a pointer in this interpreter.
4905
4899
  In this case, we do not want to continue adding types... everything should be
4906
4900
  set up already */
@@ -4914,7 +4908,7 @@ SWIG_InitializeModule(void *clientdata) {
4914
4908
  swig_type_info *type = 0;
4915
4909
  swig_type_info *ret;
4916
4910
  swig_cast_info *cast;
4917
-
4911
+
4918
4912
  #ifdef SWIGRUNTIME_DEBUG
4919
4913
  printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4920
4914
  #endif
@@ -4941,7 +4935,7 @@ SWIG_InitializeModule(void *clientdata) {
4941
4935
  /* Insert casting types */
4942
4936
  cast = swig_module.cast_initial[i];
4943
4937
  while (cast->type) {
4944
-
4938
+
4945
4939
  /* Don't need to add information already in the list */
4946
4940
  ret = 0;
4947
4941
  #ifdef SWIGRUNTIME_DEBUG