taglib-ruby 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +33 -0
  3. data/CHANGELOG.md +6 -0
  4. data/Gemfile +2 -0
  5. data/Guardfile +4 -2
  6. data/README.md +55 -35
  7. data/Rakefile +5 -5
  8. data/docs/taglib/aiff.rb +0 -3
  9. data/docs/taglib/base.rb +0 -4
  10. data/docs/taglib/flac.rb +1 -3
  11. data/docs/taglib/id3v2.rb +1 -1
  12. data/docs/taglib/mp4.rb +2 -4
  13. data/docs/taglib/mpeg.rb +0 -1
  14. data/docs/taglib/ogg.rb +0 -4
  15. data/docs/taglib/vorbis.rb +0 -1
  16. data/docs/taglib/wav.rb +0 -4
  17. data/ext/extconf_common.rb +24 -28
  18. data/ext/taglib_aiff/extconf.rb +2 -0
  19. data/ext/taglib_aiff/taglib_aiff_wrap.cxx +217 -178
  20. data/ext/taglib_base/extconf.rb +2 -0
  21. data/ext/taglib_base/includes.i +1 -0
  22. data/ext/taglib_base/taglib_base_wrap.cxx +233 -191
  23. data/ext/taglib_flac/extconf.rb +2 -0
  24. data/ext/taglib_flac/taglib_flac_wrap.cxx +228 -189
  25. data/ext/taglib_flac_picture/extconf.rb +2 -0
  26. data/ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx +210 -168
  27. data/ext/taglib_id3v1/extconf.rb +2 -0
  28. data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +223 -182
  29. data/ext/taglib_id3v2/extconf.rb +2 -0
  30. data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +429 -407
  31. data/ext/taglib_mp4/extconf.rb +2 -0
  32. data/ext/taglib_mp4/taglib_mp4_wrap.cxx +295 -260
  33. data/ext/taglib_mpeg/extconf.rb +2 -0
  34. data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +243 -206
  35. data/ext/taglib_ogg/extconf.rb +2 -0
  36. data/ext/taglib_ogg/taglib_ogg_wrap.cxx +214 -171
  37. data/ext/taglib_vorbis/extconf.rb +2 -0
  38. data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +217 -178
  39. data/ext/taglib_wav/extconf.rb +2 -0
  40. data/ext/taglib_wav/taglib_wav_wrap.cxx +217 -178
  41. data/lib/taglib/aiff.rb +2 -0
  42. data/lib/taglib/base.rb +3 -1
  43. data/lib/taglib/flac.rb +2 -0
  44. data/lib/taglib/id3v1.rb +2 -0
  45. data/lib/taglib/id3v2.rb +2 -0
  46. data/lib/taglib/mp4.rb +10 -13
  47. data/lib/taglib/mpeg.rb +2 -0
  48. data/lib/taglib/ogg.rb +2 -0
  49. data/lib/taglib/version.rb +3 -1
  50. data/lib/taglib/vorbis.rb +2 -0
  51. data/lib/taglib/wav.rb +2 -1
  52. data/lib/taglib.rb +4 -3
  53. data/taglib-ruby.gemspec +164 -163
  54. data/tasks/docs_coverage.rake +10 -8
  55. data/tasks/ext.rake +26 -25
  56. data/tasks/gemspec_check.rake +6 -4
  57. data/tasks/swig.rake +10 -11
  58. data/test/aiff_examples_test.rb +8 -13
  59. data/test/aiff_file_test.rb +29 -29
  60. data/test/aiff_file_write_test.rb +19 -20
  61. data/test/base_test.rb +4 -2
  62. data/test/data/add-relative-volume.cpp +7 -3
  63. data/test/data/flac-create.cpp +15 -5
  64. data/test/data/get_picture_data.cpp +5 -1
  65. data/test/data/id3v1-create.cpp +6 -3
  66. data/test/data/mp4-create.cpp +12 -4
  67. data/test/data/vorbis-create.cpp +12 -5
  68. data/test/data/wav-create.cpp +18 -3
  69. data/test/file_test.rb +7 -5
  70. data/test/fileref_open_test.rb +12 -10
  71. data/test/fileref_properties_test.rb +6 -4
  72. data/test/fileref_write_test.rb +14 -13
  73. data/test/flac_file_test.rb +32 -27
  74. data/test/flac_file_write_test.rb +17 -18
  75. data/test/flac_picture_memory_test.rb +13 -17
  76. data/test/helper.rb +3 -1
  77. data/test/id3v1_genres_test.rb +14 -12
  78. data/test/id3v1_tag_test.rb +7 -5
  79. data/test/id3v2_frames_test.rb +34 -34
  80. data/test/id3v2_header_test.rb +14 -13
  81. data/test/id3v2_memory_test.rb +21 -20
  82. data/test/id3v2_relative_volume_test.rb +11 -9
  83. data/test/id3v2_tag_test.rb +16 -14
  84. data/test/id3v2_unicode_test.rb +12 -10
  85. data/test/id3v2_unknown_frames_test.rb +7 -5
  86. data/test/id3v2_write_test.rb +28 -29
  87. data/test/mp4_file_test.rb +27 -26
  88. data/test/mp4_file_write_test.rb +12 -13
  89. data/test/mp4_items_test.rb +78 -79
  90. data/test/mpeg_file_test.rb +32 -30
  91. data/test/tag_test.rb +5 -3
  92. data/test/unicode_filename_test.rb +7 -7
  93. data/test/vorbis_file_test.rb +14 -12
  94. data/test/vorbis_tag_test.rb +46 -44
  95. data/test/wav_examples_test.rb +8 -16
  96. data/test/wav_file_test.rb +29 -29
  97. data/test/wav_file_write_test.rb +22 -23
  98. metadata +19 -18
@@ -1,6 +1,6 @@
1
1
  /* ----------------------------------------------------------------------------
2
2
  * This file was automatically generated by SWIG (http://www.swig.org).
3
- * Version 3.0.7
3
+ * Version 4.0.2
4
4
  *
5
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
@@ -11,7 +11,11 @@
11
11
  static void free_taglib_mp4_file(void *ptr);
12
12
 
13
13
 
14
+
15
+ #ifndef SWIGRUBY
14
16
  #define SWIGRUBY
17
+ #endif
18
+
15
19
 
16
20
 
17
21
  #ifdef __cplusplus
@@ -104,9 +108,11 @@ template <typename T> T SwigValueInit() {
104
108
  #endif
105
109
 
106
110
  /* exporting methods */
107
- #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
108
- # ifndef GCC_HASCLASSVISIBILITY
109
- # define GCC_HASCLASSVISIBILITY
111
+ #if defined(__GNUC__)
112
+ # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
113
+ # ifndef GCC_HASCLASSVISIBILITY
114
+ # define GCC_HASCLASSVISIBILITY
115
+ # endif
110
116
  # endif
111
117
  #endif
112
118
 
@@ -226,9 +232,11 @@ template <typename T> T SwigValueInit() {
226
232
  #endif
227
233
 
228
234
  /* exporting methods */
229
- #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
230
- # ifndef GCC_HASCLASSVISIBILITY
231
- # define GCC_HASCLASSVISIBILITY
235
+ #if defined(__GNUC__)
236
+ # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
237
+ # ifndef GCC_HASCLASSVISIBILITY
238
+ # define GCC_HASCLASSVISIBILITY
239
+ # endif
232
240
  # endif
233
241
  #endif
234
242
 
@@ -326,6 +334,7 @@ template <typename T> T SwigValueInit() {
326
334
  /* Flags for pointer conversions */
327
335
  #define SWIG_POINTER_DISOWN 0x1
328
336
  #define SWIG_CAST_NEW_MEMORY 0x2
337
+ #define SWIG_POINTER_NO_NULL 0x4
329
338
 
330
339
  /* Flags for new pointer objects */
331
340
  #define SWIG_POINTER_OWN 0x1
@@ -778,16 +787,16 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
778
787
  char d = *(c++);
779
788
  unsigned char uu;
780
789
  if ((d >= '0') && (d <= '9'))
781
- uu = ((d - '0') << 4);
790
+ uu = (unsigned char)((d - '0') << 4);
782
791
  else if ((d >= 'a') && (d <= 'f'))
783
- uu = ((d - ('a'-10)) << 4);
792
+ uu = (unsigned char)((d - ('a'-10)) << 4);
784
793
  else
785
794
  return (char *) 0;
786
795
  d = *(c++);
787
796
  if ((d >= '0') && (d <= '9'))
788
- uu |= (d - '0');
797
+ uu |= (unsigned char)(d - '0');
789
798
  else if ((d >= 'a') && (d <= 'f'))
790
- uu |= (d - ('a'-10));
799
+ uu |= (unsigned char)(d - ('a'-10));
791
800
  else
792
801
  return (char *) 0;
793
802
  *u = uu;
@@ -964,42 +973,53 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
964
973
  #ifndef RSTRUCT_PTR
965
974
  # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
966
975
  #endif
976
+ #ifndef RTYPEDDATA_P
977
+ # define RTYPEDDATA_P(x) (TYPE(x) != T_DATA)
978
+ #endif
967
979
 
968
980
 
969
981
 
970
982
  /*
971
- * Need to be very careful about how these macros are defined, especially
972
- * when compiling C++ code or C code with an ANSI C compiler.
983
+ * The following macros are used for providing the correct type of a
984
+ * function pointer to the Ruby C API.
985
+ * Starting with Ruby 2.7 (corresponding to RB_METHOD_DEFINITION_DECL being
986
+ * defined) these macros act transparently due to Ruby's moving away from
987
+ * ANYARGS and instead employing strict function signatures.
988
+ *
989
+ * Note: In case of C (not C++) the macros are transparent even before
990
+ * Ruby 2.7 due to the fact that the Ruby C API used function declarators
991
+ * with empty parentheses, which allows for an unspecified number of
992
+ * arguments.
993
+ *
994
+ * PROTECTFUNC(f) is used for the function pointer argument of the Ruby
995
+ * C API function rb_protect().
973
996
  *
974
- * VALUEFUNC(f) is a macro used to typecast a C function that implements
975
- * a Ruby method so that it can be passed as an argument to API functions
976
- * like rb_define_method() and rb_define_singleton_method().
997
+ * VALUEFUNC(f) is used for the function pointer argument(s) of Ruby C API
998
+ * functions like rb_define_method() and rb_define_singleton_method().
977
999
  *
978
- * VOIDFUNC(f) is a macro used to typecast a C function that implements
979
- * either the "mark" or "free" stuff for a Ruby Data object, so that it
980
- * can be passed as an argument to API functions like Data_Wrap_Struct()
1000
+ * VOIDFUNC(f) is used to typecast a C function that implements either
1001
+ * the "mark" or "free" stuff for a Ruby Data object, so that it can be
1002
+ * passed as an argument to Ruby C API functions like Data_Wrap_Struct()
981
1003
  * and Data_Make_Struct().
1004
+ *
1005
+ * SWIG_RUBY_VOID_ANYARGS_FUNC(f) is used for the function pointer
1006
+ * argument(s) of Ruby C API functions like rb_define_virtual_variable().
1007
+ *
1008
+ * SWIG_RUBY_INT_ANYARGS_FUNC(f) is used for the function pointer
1009
+ * argument(s) of Ruby C API functions like st_foreach().
982
1010
  */
983
-
984
- #ifdef __cplusplus
985
- # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
986
- # define PROTECTFUNC(f) ((VALUE (*)()) f)
987
- # define VALUEFUNC(f) ((VALUE (*)()) f)
988
- # define VOIDFUNC(f) ((void (*)()) f)
989
- # else
990
- # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
991
- # define PROTECTFUNC(f) ((VALUE (*)()) f)
992
- # define VALUEFUNC(f) ((VALUE (*)()) f)
993
- # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
994
- # else /* These definitions should work for Ruby 1.7+ */
995
- # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
996
- # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
997
- # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
998
- # endif
999
- # endif
1011
+ #if defined(__cplusplus) && !defined(RB_METHOD_DEFINITION_DECL)
1012
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
1013
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
1014
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
1015
+ # define SWIG_RUBY_VOID_ANYARGS_FUNC(f) ((void (*)(ANYARGS))(f))
1016
+ # define SWIG_RUBY_INT_ANYARGS_FUNC(f) ((int (*)(ANYARGS))(f))
1000
1017
  #else
1018
+ # define PROTECTFUNC(f) (f)
1001
1019
  # define VALUEFUNC(f) (f)
1002
1020
  # define VOIDFUNC(f) (f)
1021
+ # define SWIG_RUBY_VOID_ANYARGS_FUNC(f) (f)
1022
+ # define SWIG_RUBY_INT_ANYARGS_FUNC(f) (f)
1003
1023
  #endif
1004
1024
 
1005
1025
  /* Don't use for expressions have side effect */
@@ -1187,7 +1207,7 @@ void Ruby_Format_OverloadedError(
1187
1207
  /* -----------------------------------------------------------------------------
1188
1208
  * rubytracking.swg
1189
1209
  *
1190
- * This file contains support for tracking mappings from
1210
+ * This file contains support for tracking mappings from
1191
1211
  * Ruby objects to C++ objects. This functionality is needed
1192
1212
  * to implement mark functions for Ruby's mark and sweep
1193
1213
  * garbage collector.
@@ -1197,6 +1217,11 @@ void Ruby_Format_OverloadedError(
1197
1217
  extern "C" {
1198
1218
  #endif
1199
1219
 
1220
+ #if !defined(ST_DATA_T_DEFINED)
1221
+ /* Needs to be explicitly included for Ruby 1.8 and earlier */
1222
+ #include <st.h>
1223
+ #endif
1224
+
1200
1225
  /* Ruby 1.8 actually assumes the first case. */
1201
1226
  #if SIZEOF_VOIDP == SIZEOF_LONG
1202
1227
  # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
@@ -1208,109 +1233,69 @@ extern "C" {
1208
1233
  # error sizeof(void*) is not the same as long or long long
1209
1234
  #endif
1210
1235
 
1211
-
1212
- /* Global Ruby hash table to store Trackings from C/C++
1213
- structs to Ruby Objects.
1236
+ /* Global hash table to store Trackings from C/C++
1237
+ structs to Ruby Objects.
1214
1238
  */
1215
- static VALUE swig_ruby_trackings = Qnil;
1239
+ static st_table* swig_ruby_trackings = NULL;
1240
+
1241
+ static VALUE swig_ruby_trackings_count(ID id, VALUE *var) {
1242
+ return SWIG2NUM(swig_ruby_trackings->num_entries);
1243
+ }
1216
1244
 
1217
- /* Global variable that stores a reference to the ruby
1218
- hash table delete function. */
1219
- static ID swig_ruby_hash_delete;
1220
1245
 
1221
- /* Setup a Ruby hash table to store Trackings */
1246
+ /* Setup a hash table to store Trackings */
1222
1247
  SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1223
- /* Create a ruby hash table to store Trackings from C++
1248
+ /* Create a hash table to store Trackings from C++
1224
1249
  objects to Ruby objects. */
1225
1250
 
1226
- /* Try to see if some other .so has already created a
1251
+ /* Try to see if some other .so has already created a
1227
1252
  tracking hash table, which we keep hidden in an instance var
1228
1253
  in the SWIG module.
1229
1254
  This is done to allow multiple DSOs to share the same
1230
1255
  tracking table.
1231
1256
  */
1232
- ID trackings_id = rb_intern( "@__trackings__" );
1257
+ VALUE trackings_value = Qnil;
1258
+ /* change the variable name so that we can mix modules
1259
+ compiled with older SWIG's - this used to be called "@__trackings__" */
1260
+ ID trackings_id = rb_intern( "@__safetrackings__" );
1233
1261
  VALUE verbose = rb_gv_get("VERBOSE");
1234
1262
  rb_gv_set("VERBOSE", Qfalse);
1235
- swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1263
+ trackings_value = rb_ivar_get( _mSWIG, trackings_id );
1236
1264
  rb_gv_set("VERBOSE", verbose);
1237
1265
 
1238
- /* No, it hasn't. Create one ourselves */
1239
- if ( swig_ruby_trackings == Qnil )
1240
- {
1241
- swig_ruby_trackings = rb_hash_new();
1242
- rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1243
- }
1244
-
1245
- /* Now store a reference to the hash table delete function
1246
- so that we only have to look it up once.*/
1247
- swig_ruby_hash_delete = rb_intern("delete");
1248
- }
1249
-
1250
- /* Get a Ruby number to reference a pointer */
1251
- SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1252
- /* We cast the pointer to an unsigned long
1253
- and then store a reference to it using
1254
- a Ruby number object. */
1255
-
1256
- /* Convert the pointer to a Ruby number */
1257
- return SWIG2NUM(ptr);
1258
- }
1259
-
1260
- /* Get a Ruby number to reference an object */
1261
- SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1262
- /* We cast the object to an unsigned long
1263
- and then store a reference to it using
1264
- a Ruby number object. */
1265
-
1266
- /* Convert the Object to a Ruby number */
1267
- return SWIG2NUM(object);
1268
- }
1269
-
1270
- /* Get a Ruby object from a previously stored reference */
1271
- SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1272
- /* The provided Ruby number object is a reference
1273
- to the Ruby object we want.*/
1266
+ /* The trick here is that we have to store the hash table
1267
+ pointer in a Ruby variable. We do not want Ruby's GC to
1268
+ treat this pointer as a Ruby object, so we convert it to
1269
+ a Ruby numeric value. */
1270
+ if (trackings_value == Qnil) {
1271
+ /* No, it hasn't. Create one ourselves */
1272
+ swig_ruby_trackings = st_init_numtable();
1273
+ rb_ivar_set( _mSWIG, trackings_id, SWIG2NUM(swig_ruby_trackings) );
1274
+ } else {
1275
+ swig_ruby_trackings = (st_table*)NUM2SWIG(trackings_value);
1276
+ }
1274
1277
 
1275
- /* Convert the Ruby number to a Ruby object */
1276
- return NUM2SWIG(reference);
1278
+ rb_define_virtual_variable("SWIG_TRACKINGS_COUNT",
1279
+ VALUEFUNC(swig_ruby_trackings_count),
1280
+ SWIG_RUBY_VOID_ANYARGS_FUNC((rb_gvar_setter_t*)NULL));
1277
1281
  }
1278
1282
 
1279
1283
  /* Add a Tracking from a C/C++ struct to a Ruby object */
1280
1284
  SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1281
- /* In a Ruby hash table we store the pointer and
1282
- the associated Ruby object. The trick here is
1283
- that we cannot store the Ruby object directly - if
1284
- we do then it cannot be garbage collected. So
1285
- instead we typecast it as a unsigned long and
1286
- convert it to a Ruby number object.*/
1287
-
1288
- /* Get a reference to the pointer as a Ruby number */
1289
- VALUE key = SWIG_RubyPtrToReference(ptr);
1290
-
1291
- /* Get a reference to the Ruby object as a Ruby number */
1292
- VALUE value = SWIG_RubyObjectToReference(object);
1293
-
1294
1285
  /* Store the mapping to the global hash table. */
1295
- rb_hash_aset(swig_ruby_trackings, key, value);
1286
+ st_insert(swig_ruby_trackings, (st_data_t)ptr, object);
1296
1287
  }
1297
1288
 
1298
1289
  /* Get the Ruby object that owns the specified C/C++ struct */
1299
1290
  SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1300
- /* Get a reference to the pointer as a Ruby number */
1301
- VALUE key = SWIG_RubyPtrToReference(ptr);
1302
-
1303
1291
  /* Now lookup the value stored in the global hash table */
1304
- VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1305
-
1306
- if (value == Qnil) {
1307
- /* No object exists - return nil. */
1292
+ VALUE value;
1293
+
1294
+ if (st_lookup(swig_ruby_trackings, (st_data_t)ptr, &value)) {
1295
+ return value;
1296
+ } else {
1308
1297
  return Qnil;
1309
1298
  }
1310
- else {
1311
- /* Convert this value to Ruby object */
1312
- return SWIG_RubyReferenceToObject(value);
1313
- }
1314
1299
  }
1315
1300
 
1316
1301
  /* Remove a Tracking from a C/C++ struct to a Ruby object. It
@@ -1318,25 +1303,39 @@ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1318
1303
  since the same memory address may be reused later to create
1319
1304
  a new object. */
1320
1305
  SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1321
- /* Get a reference to the pointer as a Ruby number */
1322
- VALUE key = SWIG_RubyPtrToReference(ptr);
1323
-
1324
- /* Delete the object from the hash table by calling Ruby's
1325
- do this we need to call the Hash.delete method.*/
1326
- rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1306
+ /* Delete the object from the hash table */
1307
+ st_delete(swig_ruby_trackings, (st_data_t *)&ptr, NULL);
1327
1308
  }
1328
1309
 
1329
1310
  /* This is a helper method that unlinks a Ruby object from its
1330
1311
  underlying C++ object. This is needed if the lifetime of the
1331
- Ruby object is longer than the C++ object */
1312
+ Ruby object is longer than the C++ object. */
1332
1313
  SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1333
1314
  VALUE object = SWIG_RubyInstanceFor(ptr);
1334
1315
 
1335
1316
  if (object != Qnil) {
1317
+ // object might have the T_ZOMBIE type, but that's just
1318
+ // because the GC has flagged it as such for a deferred
1319
+ // destruction. Until then, it's still a T_DATA object.
1336
1320
  DATA_PTR(object) = 0;
1337
1321
  }
1338
1322
  }
1339
1323
 
1324
+ /* This is a helper method that iterates over all the trackings
1325
+ passing the C++ object pointer and its related Ruby object
1326
+ to the passed callback function. */
1327
+
1328
+ /* Proxy method to abstract the internal trackings datatype */
1329
+ static int swig_ruby_internal_iterate_callback(st_data_t ptr, st_data_t obj, st_data_t meth) {
1330
+ ((void (*) (void *, VALUE))meth)((void *)ptr, (VALUE)obj);
1331
+ return ST_CONTINUE;
1332
+ }
1333
+
1334
+ SWIGRUNTIME void SWIG_RubyIterateTrackings( void(*meth)(void* ptr, VALUE obj) ) {
1335
+ st_foreach(swig_ruby_trackings,
1336
+ SWIG_RUBY_INT_ANYARGS_FUNC(swig_ruby_internal_iterate_callback),
1337
+ (st_data_t)meth);
1338
+ }
1340
1339
 
1341
1340
  #ifdef __cplusplus
1342
1341
  }
@@ -1395,7 +1394,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1395
1394
  #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1396
1395
  #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1397
1396
  #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1398
- #define swig_owntype ruby_owntype
1397
+ #define swig_owntype swig_ruby_owntype
1399
1398
 
1400
1399
  /* for raw packed data */
1401
1400
  #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
@@ -1552,10 +1551,11 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1552
1551
  swig_class *sklass;
1553
1552
  VALUE klass;
1554
1553
  VALUE obj;
1555
-
1554
+
1556
1555
  if (!ptr)
1557
1556
  return Qnil;
1558
-
1557
+
1558
+ assert(type);
1559
1559
  if (type->clientdata) {
1560
1560
  sklass = (swig_class *) type->clientdata;
1561
1561
 
@@ -1563,7 +1563,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1563
1563
  track = sklass->trackObjects;
1564
1564
  if (track) {
1565
1565
  obj = SWIG_RubyInstanceFor(ptr);
1566
-
1566
+
1567
1567
  /* Check the object's type and make sure it has the correct type.
1568
1568
  It might not in cases where methods do things like
1569
1569
  downcast methods. */
@@ -1595,7 +1595,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1595
1595
  obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1596
1596
  }
1597
1597
  rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1598
-
1598
+
1599
1599
  return obj;
1600
1600
  }
1601
1601
 
@@ -1615,26 +1615,30 @@ SWIGRUNTIMEINLINE char *
1615
1615
  SWIG_Ruby_MangleStr(VALUE obj)
1616
1616
  {
1617
1617
  VALUE stype = rb_iv_get(obj, "@__swigtype__");
1618
+ if (NIL_P(stype))
1619
+ return NULL;
1618
1620
  return StringValuePtr(stype);
1619
1621
  }
1620
1622
 
1621
1623
  /* Acquire a pointer value */
1622
- typedef void (*ruby_owntype)(void*);
1623
-
1624
- SWIGRUNTIME ruby_owntype
1625
- SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1626
- if (obj) {
1627
- ruby_owntype oldown = RDATA(obj)->dfree;
1628
- RDATA(obj)->dfree = own;
1629
- return oldown;
1630
- } else {
1631
- return 0;
1624
+ typedef struct {
1625
+ void (*datafree)(void *);
1626
+ int own;
1627
+ } swig_ruby_owntype;
1628
+
1629
+ SWIGRUNTIME swig_ruby_owntype
1630
+ SWIG_Ruby_AcquirePtr(VALUE obj, swig_ruby_owntype own) {
1631
+ swig_ruby_owntype oldown = {0, 0};
1632
+ if (TYPE(obj) == T_DATA && !RTYPEDDATA_P(obj)) {
1633
+ oldown.datafree = RDATA(obj)->dfree;
1634
+ RDATA(obj)->dfree = own.datafree;
1632
1635
  }
1636
+ return oldown;
1633
1637
  }
1634
1638
 
1635
1639
  /* Convert a pointer value */
1636
1640
  SWIGRUNTIME int
1637
- SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1641
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, swig_ruby_owntype *own)
1638
1642
  {
1639
1643
  char *c;
1640
1644
  swig_cast_info *tc;
@@ -1642,16 +1646,20 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1642
1646
 
1643
1647
  /* Grab the pointer */
1644
1648
  if (NIL_P(obj)) {
1645
- *ptr = 0;
1646
- return SWIG_OK;
1649
+ if (ptr)
1650
+ *ptr = 0;
1651
+ return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
1647
1652
  } else {
1648
- if (TYPE(obj) != T_DATA) {
1653
+ if (TYPE(obj) != T_DATA || (TYPE(obj) == T_DATA && RTYPEDDATA_P(obj))) {
1649
1654
  return SWIG_ERROR;
1650
1655
  }
1651
1656
  Data_Get_Struct(obj, void, vptr);
1652
1657
  }
1653
1658
 
1654
- if (own) *own = RDATA(obj)->dfree;
1659
+ if (own) {
1660
+ own->datafree = RDATA(obj)->dfree;
1661
+ own->own = 0;
1662
+ }
1655
1663
 
1656
1664
  /* Check to see if the input object is giving up ownership
1657
1665
  of the underlying C struct or C++ object. If so then we
@@ -1686,8 +1694,6 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1686
1694
  /* The object has already been deleted */
1687
1695
  return SWIG_ObjectPreviouslyDeletedError;
1688
1696
  }
1689
- *ptr = vptr;
1690
- return SWIG_OK;
1691
1697
  }
1692
1698
  }
1693
1699
  if ((c = SWIG_MangleStr(obj)) == NULL) {
@@ -1697,12 +1703,23 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1697
1703
  if (!tc) {
1698
1704
  return SWIG_ERROR;
1699
1705
  } else {
1700
- int newmemory = 0;
1701
- *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1702
- assert(!newmemory); /* newmemory handling not yet implemented */
1706
+ if (ptr) {
1707
+ if (tc->type == ty) {
1708
+ *ptr = vptr;
1709
+ } else {
1710
+ int newmemory = 0;
1711
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1712
+ if (newmemory == SWIG_CAST_NEW_MEMORY) {
1713
+ assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
1714
+ if (own)
1715
+ own->own = own->own | SWIG_CAST_NEW_MEMORY;
1716
+ }
1717
+ }
1718
+ }
1703
1719
  }
1704
1720
  } else {
1705
- *ptr = vptr;
1721
+ if (ptr)
1722
+ *ptr = vptr;
1706
1723
  }
1707
1724
 
1708
1725
  return SWIG_OK;
@@ -1728,7 +1745,7 @@ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1728
1745
  return rb_str_new2(result);
1729
1746
  }
1730
1747
 
1731
- /* Convert a packed value value */
1748
+ /* Convert a packed pointer value */
1732
1749
  SWIGRUNTIME int
1733
1750
  SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1734
1751
  swig_cast_info *tc;
@@ -1864,7 +1881,7 @@ static VALUE mMP4;
1864
1881
  #define SWIG_RUBY_THREAD_END_BLOCK
1865
1882
 
1866
1883
 
1867
- #define SWIGVERSION 0x030007
1884
+ #define SWIGVERSION 0x040002
1868
1885
  #define SWIG_VERSION SWIGVERSION
1869
1886
 
1870
1887
 
@@ -1886,6 +1903,8 @@ using namespace TagLib::MP4;
1886
1903
 
1887
1904
  #include <taglib/tstring.h>
1888
1905
  #include <taglib/tstringlist.h>
1906
+ #include <taglib/tbytevector.h>
1907
+ #include <taglib/tbytevectorlist.h>
1889
1908
  #include <taglib/tfile.h>
1890
1909
 
1891
1910
  #if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
@@ -1955,6 +1974,28 @@ TagLib::StringList ruby_array_to_taglib_string_list(VALUE ary) {
1955
1974
  return result;
1956
1975
  }
1957
1976
 
1977
+ VALUE taglib_bytevectorlist_to_ruby_array(const TagLib::ByteVectorList & list) {
1978
+ VALUE ary = rb_ary_new2(list.size());
1979
+ for (TagLib::ByteVectorList::ConstIterator it = list.begin(); it != list.end(); it++) {
1980
+ VALUE s = taglib_bytevector_to_ruby_string(*it);
1981
+ rb_ary_push(ary, s);
1982
+ }
1983
+ return ary;
1984
+ }
1985
+
1986
+ TagLib::ByteVectorList ruby_array_to_taglib_bytevectorlist(VALUE ary) {
1987
+ TagLib::ByteVectorList result = TagLib::ByteVectorList();
1988
+ if (NIL_P(ary)) {
1989
+ return result;
1990
+ }
1991
+ for (long i = 0; i < RARRAY_LEN(ary); i++) {
1992
+ VALUE e = rb_ary_entry(ary, i);
1993
+ TagLib::ByteVector s = ruby_string_to_taglib_bytevector(e);
1994
+ result.append(s);
1995
+ }
1996
+ return result;
1997
+ }
1998
+
1958
1999
  VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
1959
2000
  VALUE result;
1960
2001
  #ifdef _WIN32
@@ -2058,15 +2099,16 @@ SWIG_From_int (int value)
2058
2099
 
2059
2100
 
2060
2101
  SWIGINTERN VALUE
2061
- SWIG_ruby_failed(void)
2102
+ SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
2062
2103
  {
2063
2104
  return Qnil;
2064
2105
  }
2065
2106
 
2066
2107
 
2067
- /*@SWIG:/usr/local/share/swig/3.0.7/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2068
- SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
2108
+ /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2109
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE arg)
2069
2110
  {
2111
+ VALUE *args = (VALUE *)arg;
2070
2112
  VALUE obj = args[0];
2071
2113
  VALUE type = TYPE(obj);
2072
2114
  long *res = (long *)(args[1]);
@@ -2084,7 +2126,7 @@ SWIG_AsVal_long (VALUE obj, long* val)
2084
2126
  VALUE a[2];
2085
2127
  a[0] = obj;
2086
2128
  a[1] = (VALUE)(&v);
2087
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2129
+ if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
2088
2130
  if (val) *val = v;
2089
2131
  return SWIG_OK;
2090
2132
  }
@@ -2152,7 +2194,7 @@ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
2152
2194
  if (cptr) {
2153
2195
  if (alloc) {
2154
2196
  if (*alloc == SWIG_NEWOBJ) {
2155
- *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
2197
+ *cptr = reinterpret_cast< char* >(memcpy(new char[size], cstr, sizeof(char)*(size)));
2156
2198
  } else {
2157
2199
  *cptr = cstr;
2158
2200
  *alloc = SWIG_OLDOBJ;
@@ -2180,9 +2222,10 @@ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
2180
2222
 
2181
2223
 
2182
2224
 
2183
- /*@SWIG:/usr/local/share/swig/3.0.7/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2184
- SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
2225
+ /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2226
+ SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE arg)
2185
2227
  {
2228
+ VALUE *args = (VALUE *)arg;
2186
2229
  VALUE obj = args[0];
2187
2230
  VALUE type = TYPE(obj);
2188
2231
  unsigned long *res = (unsigned long *)(args[1]);
@@ -2200,7 +2243,7 @@ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
2200
2243
  VALUE a[2];
2201
2244
  a[0] = obj;
2202
2245
  a[1] = (VALUE)(&v);
2203
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2246
+ if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
2204
2247
  if (val) *val = v;
2205
2248
  return SWIG_OK;
2206
2249
  }
@@ -2257,9 +2300,16 @@ SWIG_AsVal_unsigned_SS_char (VALUE obj, unsigned char *val)
2257
2300
  }
2258
2301
 
2259
2302
 
2260
- /*@SWIG:/usr/local/share/swig/3.0.7/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2261
- SWIGINTERN VALUE SWIG_AUX_NUM2LL(VALUE *args)
2303
+ #if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
2304
+ # define SWIG_LONG_LONG_AVAILABLE
2305
+ #endif
2306
+
2307
+
2308
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2309
+ /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2310
+ SWIGINTERN VALUE SWIG_AUX_NUM2LL(VALUE arg)
2262
2311
  {
2312
+ VALUE *args = (VALUE *)arg;
2263
2313
  VALUE obj = args[0];
2264
2314
  VALUE type = TYPE(obj);
2265
2315
  long long *res = (long long *)(args[1]);
@@ -2277,13 +2327,14 @@ SWIG_AsVal_long_SS_long (VALUE obj, long long *val)
2277
2327
  VALUE a[2];
2278
2328
  a[0] = obj;
2279
2329
  a[1] = (VALUE)(&v);
2280
- if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
2330
+ if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
2281
2331
  if (val) *val = v;
2282
2332
  return SWIG_OK;
2283
2333
  }
2284
2334
  }
2285
2335
  return SWIG_TypeError;
2286
2336
  }
2337
+ #endif
2287
2338
 
2288
2339
 
2289
2340
  SWIGINTERN int
@@ -2313,11 +2364,13 @@ SWIG_From_unsigned_SS_char (unsigned char value)
2313
2364
  }
2314
2365
 
2315
2366
 
2367
+ #ifdef SWIG_LONG_LONG_AVAILABLE
2316
2368
  SWIGINTERNINLINE VALUE
2317
2369
  SWIG_From_long_SS_long (long long value)
2318
2370
  {
2319
2371
  return LL2NUM(value);
2320
2372
  }
2373
+ #endif
2321
2374
 
2322
2375
  SWIGINTERN TagLib::MP4::Item *TagLib_MP4_Item_from_bool(bool q){
2323
2376
  return new TagLib::MP4::Item(q);
@@ -2473,22 +2526,20 @@ fail:
2473
2526
  }
2474
2527
 
2475
2528
 
2476
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2477
2529
  SWIGINTERN VALUE
2478
- _wrap_Properties_allocate(VALUE self) {
2530
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2531
+ _wrap_Properties_allocate(VALUE self)
2479
2532
  #else
2480
- SWIGINTERN VALUE
2481
- _wrap_Properties_allocate(int argc, VALUE *argv, VALUE self) {
2533
+ _wrap_Properties_allocate(int argc, VALUE *argv, VALUE self)
2482
2534
  #endif
2483
-
2484
-
2485
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MP4__Properties);
2535
+ {
2536
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MP4__Properties);
2486
2537
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2487
- rb_obj_call_init(vresult, argc, argv);
2538
+ rb_obj_call_init(vresult, argc, argv);
2488
2539
  #endif
2489
- return vresult;
2490
- }
2491
-
2540
+ return vresult;
2541
+ }
2542
+
2492
2543
 
2493
2544
  SWIGINTERN VALUE
2494
2545
  _wrap_new_Properties__SWIG_1(int argc, VALUE *argv, VALUE self) {
@@ -2577,7 +2628,8 @@ fail:
2577
2628
 
2578
2629
 
2579
2630
  SWIGINTERN void
2580
- free_TagLib_MP4_Properties(TagLib::MP4::Properties *arg1) {
2631
+ free_TagLib_MP4_Properties(void *self) {
2632
+ TagLib::MP4::Properties *arg1 = (TagLib::MP4::Properties *)self;
2581
2633
  SWIG_RubyRemoveTracking(arg1);
2582
2634
  delete arg1;
2583
2635
  }
@@ -2792,22 +2844,20 @@ fail:
2792
2844
  }
2793
2845
 
2794
2846
 
2795
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2796
2847
  SWIGINTERN VALUE
2797
- _wrap_Tag_allocate(VALUE self) {
2848
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2849
+ _wrap_Tag_allocate(VALUE self)
2798
2850
  #else
2799
- SWIGINTERN VALUE
2800
- _wrap_Tag_allocate(int argc, VALUE *argv, VALUE self) {
2851
+ _wrap_Tag_allocate(int argc, VALUE *argv, VALUE self)
2801
2852
  #endif
2802
-
2803
-
2804
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MP4__Tag);
2853
+ {
2854
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MP4__Tag);
2805
2855
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2806
- rb_obj_call_init(vresult, argc, argv);
2856
+ rb_obj_call_init(vresult, argc, argv);
2807
2857
  #endif
2808
- return vresult;
2809
- }
2810
-
2858
+ return vresult;
2859
+ }
2860
+
2811
2861
 
2812
2862
  SWIGINTERN VALUE
2813
2863
  _wrap_new_Tag__SWIG_1(int argc, VALUE *argv, VALUE self) {
@@ -2879,7 +2929,8 @@ fail:
2879
2929
 
2880
2930
 
2881
2931
  SWIGINTERN void
2882
- free_TagLib_MP4_Tag(TagLib::MP4::Tag *arg1) {
2932
+ free_TagLib_MP4_Tag(void *self) {
2933
+ TagLib::MP4::Tag *arg1 = (TagLib::MP4::Tag *)self;
2883
2934
  SWIG_RubyRemoveTracking(arg1);
2884
2935
  delete arg1;
2885
2936
  }
@@ -3387,7 +3438,6 @@ fail:
3387
3438
  }
3388
3439
 
3389
3440
 
3390
-
3391
3441
  /*
3392
3442
  Document-method: TagLib::MP4::Tag.[]=
3393
3443
 
@@ -3500,27 +3550,26 @@ fail:
3500
3550
 
3501
3551
 
3502
3552
  SWIGINTERN void
3503
- free_TagLib_MP4_CoverArt(TagLib::MP4::CoverArt *arg1) {
3553
+ free_TagLib_MP4_CoverArt(void *self) {
3554
+ TagLib::MP4::CoverArt *arg1 = (TagLib::MP4::CoverArt *)self;
3504
3555
  SWIG_RubyRemoveTracking(arg1);
3505
3556
  delete arg1;
3506
3557
  }
3507
3558
 
3508
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
3509
3559
  SWIGINTERN VALUE
3510
- _wrap_CoverArt_allocate(VALUE self) {
3560
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
3561
+ _wrap_CoverArt_allocate(VALUE self)
3511
3562
  #else
3512
- SWIGINTERN VALUE
3513
- _wrap_CoverArt_allocate(int argc, VALUE *argv, VALUE self) {
3563
+ _wrap_CoverArt_allocate(int argc, VALUE *argv, VALUE self)
3514
3564
  #endif
3515
-
3516
-
3517
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MP4__CoverArt);
3565
+ {
3566
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MP4__CoverArt);
3518
3567
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
3519
- rb_obj_call_init(vresult, argc, argv);
3568
+ rb_obj_call_init(vresult, argc, argv);
3520
3569
  #endif
3521
- return vresult;
3522
- }
3523
-
3570
+ return vresult;
3571
+ }
3572
+
3524
3573
 
3525
3574
  SWIGINTERN VALUE
3526
3575
  _wrap_new_CoverArt__SWIG_1(int argc, VALUE *argv, VALUE self) {
@@ -3562,7 +3611,7 @@ SWIGINTERN VALUE _wrap_new_CoverArt(int nargs, VALUE *args, VALUE self) {
3562
3611
  if (argc == 1) {
3563
3612
  int _v;
3564
3613
  void *vptr = 0;
3565
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MP4__CoverArt, 0);
3614
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MP4__CoverArt, SWIG_POINTER_NO_NULL);
3566
3615
  _v = SWIG_CheckState(res);
3567
3616
  if (_v) {
3568
3617
  return _wrap_new_CoverArt__SWIG_1(nargs, args, self);
@@ -3688,7 +3737,8 @@ fail:
3688
3737
 
3689
3738
 
3690
3739
  SWIGINTERN void
3691
- free_TagLib_MP4_Item(TagLib::MP4::Item *arg1) {
3740
+ free_TagLib_MP4_Item(void *self) {
3741
+ TagLib::MP4::Item *arg1 = (TagLib::MP4::Item *)self;
3692
3742
  SWIG_RubyRemoveTracking(arg1);
3693
3743
  delete arg1;
3694
3744
  }
@@ -3870,21 +3920,16 @@ fail:
3870
3920
  SWIGINTERN VALUE
3871
3921
  _wrap_new_Item__SWIG_9(int argc, VALUE *argv, VALUE self) {
3872
3922
  TagLib::ByteVectorList *arg1 = 0 ;
3873
- void *argp1 ;
3874
- int res1 = 0 ;
3923
+ TagLib::ByteVectorList tmp1 ;
3875
3924
  TagLib::MP4::Item *result = 0 ;
3876
3925
 
3877
3926
  if ((argc < 1) || (argc > 1)) {
3878
3927
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3879
3928
  }
3880
- res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_TagLib__ByteVectorList, 0 );
3881
- if (!SWIG_IsOK(res1)) {
3882
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::ByteVectorList const &","Item", 1, argv[0] ));
3883
- }
3884
- if (!argp1) {
3885
- SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "TagLib::ByteVectorList const &","Item", 1, argv[0]));
3929
+ {
3930
+ tmp1 = ruby_array_to_taglib_bytevectorlist(argv[0]);
3931
+ arg1 = &tmp1;
3886
3932
  }
3887
- arg1 = reinterpret_cast< TagLib::ByteVectorList * >(argp1);
3888
3933
  result = (TagLib::MP4::Item *)new TagLib::MP4::Item((TagLib::ByteVectorList const &)*arg1);
3889
3934
  DATA_PTR(self) = result;
3890
3935
  SWIG_RubyAddTracking(result, self);
@@ -3894,22 +3939,20 @@ fail:
3894
3939
  }
3895
3940
 
3896
3941
 
3897
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
3898
3942
  SWIGINTERN VALUE
3899
- _wrap_Item_allocate(VALUE self) {
3943
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
3944
+ _wrap_Item_allocate(VALUE self)
3900
3945
  #else
3901
- SWIGINTERN VALUE
3902
- _wrap_Item_allocate(int argc, VALUE *argv, VALUE self) {
3946
+ _wrap_Item_allocate(int argc, VALUE *argv, VALUE self)
3903
3947
  #endif
3904
-
3905
-
3906
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MP4__Item);
3948
+ {
3949
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MP4__Item);
3907
3950
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
3908
- rb_obj_call_init(vresult, argc, argv);
3951
+ rb_obj_call_init(vresult, argc, argv);
3909
3952
  #endif
3910
- return vresult;
3911
- }
3912
-
3953
+ return vresult;
3954
+ }
3955
+
3913
3956
 
3914
3957
  SWIGINTERN VALUE
3915
3958
  _wrap_new_Item__SWIG_10(int argc, VALUE *argv, VALUE self) {
@@ -3949,7 +3992,7 @@ SWIGINTERN VALUE _wrap_new_Item(int nargs, VALUE *args, VALUE self) {
3949
3992
  if (argc == 1) {
3950
3993
  int _v;
3951
3994
  void *vptr = 0;
3952
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MP4__Item, 0);
3995
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MP4__Item, SWIG_POINTER_NO_NULL);
3953
3996
  _v = SWIG_CheckState(res);
3954
3997
  if (_v) {
3955
3998
  return _wrap_new_Item__SWIG_1(nargs, args, self);
@@ -3958,7 +4001,7 @@ SWIGINTERN VALUE _wrap_new_Item(int nargs, VALUE *args, VALUE self) {
3958
4001
  if (argc == 1) {
3959
4002
  int _v;
3960
4003
  void *vptr = 0;
3961
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__StringList, 0);
4004
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__StringList, SWIG_POINTER_NO_NULL);
3962
4005
  _v = SWIG_CheckState(res);
3963
4006
  if (_v) {
3964
4007
  return _wrap_new_Item__SWIG_8(nargs, args, self);
@@ -3967,7 +4010,7 @@ SWIGINTERN VALUE _wrap_new_Item(int nargs, VALUE *args, VALUE self) {
3967
4010
  if (argc == 1) {
3968
4011
  int _v;
3969
4012
  void *vptr = 0;
3970
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__ByteVectorList, 0);
4013
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__ByteVectorList, SWIG_POINTER_NO_NULL);
3971
4014
  _v = SWIG_CheckState(res);
3972
4015
  if (_v) {
3973
4016
  return _wrap_new_Item__SWIG_9(nargs, args, self);
@@ -3976,7 +4019,7 @@ SWIGINTERN VALUE _wrap_new_Item(int nargs, VALUE *args, VALUE self) {
3976
4019
  if (argc == 1) {
3977
4020
  int _v;
3978
4021
  void *vptr = 0;
3979
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MP4__CoverArtList, 0);
4022
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MP4__CoverArtList, SWIG_POINTER_NO_NULL);
3980
4023
  _v = SWIG_CheckState(res);
3981
4024
  if (_v) {
3982
4025
  return _wrap_new_Item__SWIG_10(nargs, args, self);
@@ -4256,7 +4299,9 @@ _wrap_Item_to_byte_vector_list(int argc, VALUE *argv, VALUE self) {
4256
4299
  }
4257
4300
  arg1 = reinterpret_cast< TagLib::MP4::Item * >(argp1);
4258
4301
  result = ((TagLib::MP4::Item const *)arg1)->toByteVectorList();
4259
- vresult = SWIG_NewPointerObj((new TagLib::ByteVectorList(static_cast< const TagLib::ByteVectorList& >(result))), SWIGTYPE_p_TagLib__ByteVectorList, SWIG_POINTER_OWN | 0 );
4302
+ {
4303
+ vresult = taglib_bytevectorlist_to_ruby_array(result);
4304
+ }
4260
4305
  return vresult;
4261
4306
  fail:
4262
4307
  return Qnil;
@@ -4480,22 +4525,17 @@ fail:
4480
4525
  SWIGINTERN VALUE
4481
4526
  _wrap_Item_from_byte_vector_list(int argc, VALUE *argv, VALUE self) {
4482
4527
  TagLib::ByteVectorList *arg1 = 0 ;
4483
- void *argp1 ;
4484
- int res1 = 0 ;
4528
+ TagLib::ByteVectorList tmp1 ;
4485
4529
  TagLib::MP4::Item *result = 0 ;
4486
4530
  VALUE vresult = Qnil;
4487
4531
 
4488
4532
  if ((argc < 1) || (argc > 1)) {
4489
4533
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
4490
4534
  }
4491
- res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_TagLib__ByteVectorList, 0 );
4492
- if (!SWIG_IsOK(res1)) {
4493
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::ByteVectorList const &","TagLib_MP4_Item_from_byte_vector_list", 1, argv[0] ));
4494
- }
4495
- if (!argp1) {
4496
- SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "TagLib::ByteVectorList const &","TagLib_MP4_Item_from_byte_vector_list", 1, argv[0]));
4535
+ {
4536
+ tmp1 = ruby_array_to_taglib_bytevectorlist(argv[0]);
4537
+ arg1 = &tmp1;
4497
4538
  }
4498
- arg1 = reinterpret_cast< TagLib::ByteVectorList * >(argp1);
4499
4539
  result = (TagLib::MP4::Item *)TagLib_MP4_Item_from_byte_vector_list((TagLib::ByteVectorList const &)*arg1);
4500
4540
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__MP4__Item, 0 | 0 );
4501
4541
  return vresult;
@@ -4576,22 +4616,20 @@ fail:
4576
4616
  }
4577
4617
 
4578
4618
 
4579
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
4580
4619
  SWIGINTERN VALUE
4581
- _wrap_File_allocate(VALUE self) {
4620
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
4621
+ _wrap_File_allocate(VALUE self)
4582
4622
  #else
4583
- SWIGINTERN VALUE
4584
- _wrap_File_allocate(int argc, VALUE *argv, VALUE self) {
4623
+ _wrap_File_allocate(int argc, VALUE *argv, VALUE self)
4585
4624
  #endif
4586
-
4587
-
4588
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MP4__File);
4625
+ {
4626
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MP4__File);
4589
4627
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
4590
- rb_obj_call_init(vresult, argc, argv);
4628
+ rb_obj_call_init(vresult, argc, argv);
4591
4629
  #endif
4592
- return vresult;
4593
- }
4594
-
4630
+ return vresult;
4631
+ }
4632
+
4595
4633
 
4596
4634
  SWIGINTERN VALUE
4597
4635
  _wrap_new_File__SWIG_2(int argc, VALUE *argv, VALUE self) {
@@ -4814,22 +4852,20 @@ fail:
4814
4852
  }
4815
4853
 
4816
4854
 
4817
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
4818
4855
  SWIGINTERN VALUE
4819
- _wrap_ItemMap_allocate(VALUE self) {
4856
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
4857
+ _wrap_ItemMap_allocate(VALUE self)
4820
4858
  #else
4821
- SWIGINTERN VALUE
4822
- _wrap_ItemMap_allocate(int argc, VALUE *argv, VALUE self) {
4859
+ _wrap_ItemMap_allocate(int argc, VALUE *argv, VALUE self)
4823
4860
  #endif
4824
-
4825
-
4826
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MapT_TagLib__String_TagLib__MP4__Item_t);
4861
+ {
4862
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__MapT_TagLib__String_TagLib__MP4__Item_t);
4827
4863
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
4828
- rb_obj_call_init(vresult, argc, argv);
4864
+ rb_obj_call_init(vresult, argc, argv);
4829
4865
  #endif
4830
- return vresult;
4831
- }
4832
-
4866
+ return vresult;
4867
+ }
4868
+
4833
4869
 
4834
4870
  SWIGINTERN VALUE
4835
4871
  _wrap_new_ItemMap__SWIG_1(int argc, VALUE *argv, VALUE self) {
@@ -4874,7 +4910,7 @@ SWIGINTERN VALUE _wrap_new_ItemMap(int nargs, VALUE *args, VALUE self) {
4874
4910
  if (argc == 1) {
4875
4911
  int _v;
4876
4912
  void *vptr = 0;
4877
- int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MapT_TagLib__String_TagLib__MP4__Item_t, 0);
4913
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__MapT_TagLib__String_TagLib__MP4__Item_t, SWIG_POINTER_NO_NULL);
4878
4914
  _v = SWIG_CheckState(res);
4879
4915
  if (_v) {
4880
4916
  return _wrap_new_ItemMap__SWIG_1(nargs, args, self);
@@ -4891,12 +4927,12 @@ fail:
4891
4927
 
4892
4928
 
4893
4929
  SWIGINTERN void
4894
- free_TagLib_Map_Sl_TagLib_String_Sc_TagLib_MP4_Item_Sg_(TagLib::Map< TagLib::String,TagLib::MP4::Item > *arg1) {
4930
+ free_TagLib_Map_Sl_TagLib_String_Sc_TagLib_MP4_Item_Sg_(void *self) {
4931
+ TagLib::Map< TagLib::String,TagLib::MP4::Item > *arg1 = (TagLib::Map< TagLib::String,TagLib::MP4::Item > *)self;
4895
4932
  SWIG_RubyRemoveTracking(arg1);
4896
4933
  delete arg1;
4897
4934
  }
4898
4935
 
4899
-
4900
4936
  /*
4901
4937
  Document-method: TagLib::MP4::ItemMap.size
4902
4938
 
@@ -4983,7 +5019,6 @@ fail:
4983
5019
  }
4984
5020
 
4985
5021
 
4986
-
4987
5022
  /*
4988
5023
  Document-method: TagLib::MP4::ItemMap.to_a
4989
5024
 
@@ -5360,7 +5395,7 @@ SWIG_InitializeModule(void *clientdata) {
5360
5395
 
5361
5396
  /* Now work on filling in swig_module.types */
5362
5397
  #ifdef SWIGRUNTIME_DEBUG
5363
- printf("SWIG_InitializeModule: size %d\n", swig_module.size);
5398
+ printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
5364
5399
  #endif
5365
5400
  for (i = 0; i < swig_module.size; ++i) {
5366
5401
  swig_type_info *type = 0;
@@ -5368,7 +5403,7 @@ SWIG_InitializeModule(void *clientdata) {
5368
5403
  swig_cast_info *cast;
5369
5404
 
5370
5405
  #ifdef SWIGRUNTIME_DEBUG
5371
- printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
5406
+ printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
5372
5407
  #endif
5373
5408
 
5374
5409
  /* if there is another module already loaded */
@@ -5444,7 +5479,7 @@ SWIG_InitializeModule(void *clientdata) {
5444
5479
  for (i = 0; i < swig_module.size; ++i) {
5445
5480
  int j = 0;
5446
5481
  swig_cast_info *cast = swig_module.cast_initial[i];
5447
- printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
5482
+ printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
5448
5483
  while (cast->type) {
5449
5484
  printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
5450
5485
  cast++;