taglib-ruby 1.1.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/CHANGELOG.md +22 -0
  4. data/README.md +16 -12
  5. data/docs/taglib/mpeg.rb +1 -9
  6. data/ext/extconf_common.rb +21 -12
  7. data/ext/taglib_aiff/taglib_aiff.i +5 -0
  8. data/ext/taglib_aiff/taglib_aiff_wrap.cxx +327 -111
  9. data/ext/taglib_base/includes.i +14 -14
  10. data/ext/taglib_base/taglib_base.i +37 -4
  11. data/ext/taglib_base/taglib_base_wrap.cxx +414 -422
  12. data/ext/taglib_flac/taglib_flac.i +8 -3
  13. data/ext/taglib_flac/taglib_flac_wrap.cxx +356 -406
  14. data/ext/taglib_flac_picture/taglib_flac_picture.i +4 -0
  15. data/ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx +229 -122
  16. data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +196 -102
  17. data/ext/taglib_id3v2/taglib_id3v2.i +5 -0
  18. data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +727 -568
  19. data/ext/taglib_mp4/taglib_mp4.i +22 -18
  20. data/ext/taglib_mp4/taglib_mp4_wrap.cxx +2141 -1493
  21. data/ext/taglib_mpeg/taglib_mpeg.i +6 -0
  22. data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +546 -379
  23. data/ext/taglib_ogg/taglib_ogg.i +0 -2
  24. data/ext/taglib_ogg/taglib_ogg_wrap.cxx +162 -107
  25. data/ext/taglib_vorbis/taglib_vorbis.i +1 -0
  26. data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +141 -109
  27. data/ext/taglib_wav/taglib_wav.i +6 -2
  28. data/ext/taglib_wav/taglib_wav_wrap.cxx +290 -147
  29. data/lib/taglib/version.rb +3 -3
  30. data/taglib-ruby.gemspec +1 -0
  31. data/tasks/ext.rake +23 -39
  32. data/tasks/swig.rake +14 -4
  33. data/test/id3v2_write_test.rb +1 -1
  34. data/test/wav_examples_test.rb +1 -1
  35. data/test/wav_file_test.rb +1 -1
  36. data/test/wav_file_write_test.rb +6 -6
  37. metadata +4 -3
@@ -1,45 +1,17 @@
1
1
  /* ----------------------------------------------------------------------------
2
- * This file was automatically generated by SWIG (http://www.swig.org).
3
- * Version 4.0.2
2
+ * This file was automatically generated by SWIG (https://www.swig.org).
3
+ * Version 4.1.1
4
4
  *
5
- * This file is not intended to be easily readable and contains a number of
6
- * coding conventions designed to improve portability and efficiency. Do not make
7
- * changes to this file unless you know what you are doing--modify the SWIG
8
- * interface file instead.
5
+ * Do not make changes to this file unless you know what you are doing - modify
6
+ * the SWIG interface file instead.
9
7
  * ----------------------------------------------------------------------------- */
10
8
 
11
9
  static void free_taglib_vorbis_file(void *ptr);
12
10
 
13
11
 
14
12
 
15
- #ifndef SWIGRUBY
13
+ #define SWIG_VERSION 0x040101
16
14
  #define SWIGRUBY
17
- #endif
18
-
19
-
20
-
21
- #ifdef __cplusplus
22
- /* SwigValueWrapper is described in swig.swg */
23
- template<typename T> class SwigValueWrapper {
24
- struct SwigMovePointer {
25
- T *ptr;
26
- SwigMovePointer(T *p) : ptr(p) { }
27
- ~SwigMovePointer() { delete ptr; }
28
- SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
29
- } pointer;
30
- SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
31
- SwigValueWrapper(const SwigValueWrapper<T>& rhs);
32
- public:
33
- SwigValueWrapper() : pointer(0) { }
34
- SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
35
- operator T&() const { return *pointer.ptr; }
36
- T *operator&() { return pointer.ptr; }
37
- };
38
-
39
- template <typename T> T SwigValueInit() {
40
- return T();
41
- }
42
- #endif
43
15
 
44
16
  /* -----------------------------------------------------------------------------
45
17
  * This section contains generic SWIG labels for method/variable
@@ -335,6 +307,8 @@ template <typename T> T SwigValueInit() {
335
307
  #define SWIG_POINTER_DISOWN 0x1
336
308
  #define SWIG_CAST_NEW_MEMORY 0x2
337
309
  #define SWIG_POINTER_NO_NULL 0x4
310
+ #define SWIG_POINTER_CLEAR 0x8
311
+ #define SWIG_POINTER_RELEASE (SWIG_POINTER_CLEAR | SWIG_POINTER_DISOWN)
338
312
 
339
313
  /* Flags for new pointer objects */
340
314
  #define SWIG_POINTER_OWN 0x1
@@ -406,7 +380,7 @@ template <typename T> T SwigValueInit() {
406
380
  SWIG errors code.
407
381
 
408
382
  Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
409
- allows to return the 'cast rank', for example, if you have this
383
+ allows returning the 'cast rank', for example, if you have this
410
384
 
411
385
  int food(double)
412
386
  int fooi(int);
@@ -420,7 +394,13 @@ template <typename T> T SwigValueInit() {
420
394
  */
421
395
 
422
396
  #define SWIG_OK (0)
397
+ /* Runtime errors are < 0 */
423
398
  #define SWIG_ERROR (-1)
399
+ /* Errors in range -1 to -99 are in swigerrors.swg (errors for all languages including those not using the runtime) */
400
+ /* Errors in range -100 to -199 are language specific errors defined in *errors.swg */
401
+ /* Errors < -200 are generic runtime specific errors */
402
+ #define SWIG_ERROR_RELEASE_NOT_OWNED (-200)
403
+
424
404
  #define SWIG_IsOK(r) (r >= 0)
425
405
  #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
426
406
 
@@ -435,7 +415,7 @@ template <typename T> T SwigValueInit() {
435
415
  #define SWIG_OLDOBJ (SWIG_OK)
436
416
  #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
437
417
  #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
438
- /* Check, add and del mask methods */
418
+ /* Check, add and del object mask methods */
439
419
  #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
440
420
  #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
441
421
  #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
@@ -581,7 +561,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
581
561
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
582
562
  */
583
563
  SWIGRUNTIME swig_cast_info *
584
- SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
564
+ SWIG_TypeCheckStruct(const swig_type_info *from, swig_type_info *ty) {
585
565
  if (ty) {
586
566
  swig_cast_info *iter = ty->cast;
587
567
  while (iter) {
@@ -641,9 +621,9 @@ SWIG_TypeName(const swig_type_info *ty) {
641
621
  SWIGRUNTIME const char *
642
622
  SWIG_TypePrettyName(const swig_type_info *type) {
643
623
  /* The "str" field contains the equivalent pretty names of the
644
- type, separated by vertical-bar characters. We choose
645
- to print the last name, as it is often (?) the most
646
- specific. */
624
+ type, separated by vertical-bar characters. Choose the last
625
+ name. It should be the most specific; a fully resolved name
626
+ but not necessarily with default template parameters expanded. */
647
627
  if (!type) return NULL;
648
628
  if (type->str != NULL) {
649
629
  const char *last_name = type->str;
@@ -863,7 +843,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
863
843
  }
864
844
  #endif
865
845
 
866
- /* Errors in SWIG */
846
+ /* SWIG Errors applicable to all language modules, values are reserved from -1 to -99 */
867
847
  #define SWIG_UnknownError -1
868
848
  #define SWIG_IOError -2
869
849
  #define SWIG_RuntimeError -3
@@ -879,9 +859,25 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
879
859
  #define SWIG_NullReferenceError -13
880
860
 
881
861
 
862
+ #if __GNUC__ >= 7
863
+ #pragma GCC diagnostic push
864
+ #if defined(__cplusplus)
865
+ #pragma GCC diagnostic ignored "-Wregister"
866
+ #if __GNUC__ >= 10
867
+ #pragma GCC diagnostic ignored "-Wvolatile"
868
+ #if __GNUC__ >= 11
869
+ #pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion"
870
+ #endif
871
+ #endif
872
+ #endif
873
+ #endif
882
874
 
883
875
  #include <ruby.h>
884
876
 
877
+ #if __GNUC__ >= 7
878
+ #pragma GCC diagnostic pop
879
+ #endif
880
+
885
881
  /* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
886
882
  * breaks using rb_intern as an lvalue, as SWIG does. We work around this
887
883
  * issue for now by disabling this.
@@ -1661,6 +1657,11 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1661
1657
  own->own = 0;
1662
1658
  }
1663
1659
 
1660
+ if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE)) {
1661
+ if (!RDATA(obj)->dfree)
1662
+ return SWIG_ERROR_RELEASE_NOT_OWNED;
1663
+ }
1664
+
1664
1665
  /* Check to see if the input object is giving up ownership
1665
1666
  of the underlying C struct or C++ object. If so then we
1666
1667
  need to reset the destructor since the Ruby object no
@@ -1672,7 +1673,7 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1672
1673
  swig_class *sklass = (swig_class *) ty->clientdata;
1673
1674
  track = sklass->trackObjects;
1674
1675
  }
1675
-
1676
+
1676
1677
  if (track) {
1677
1678
  /* We are tracking objects for this class. Thus we change the destructor
1678
1679
  * to SWIG_RubyRemoveTracking. This allows us to
@@ -1686,6 +1687,10 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1686
1687
  }
1687
1688
  }
1688
1689
 
1690
+ if (flags & SWIG_POINTER_CLEAR) {
1691
+ DATA_PTR(obj) = 0;
1692
+ }
1693
+
1689
1694
  /* Do type-checking if type info was provided */
1690
1695
  if (ty) {
1691
1696
  if (ty->clientdata) {
@@ -1793,6 +1798,7 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
1793
1798
  {
1794
1799
  /* register a new class */
1795
1800
  VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1801
+ rb_undef_alloc_func(cl);
1796
1802
  /* create and store the structure pointer to a global variable */
1797
1803
  swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1798
1804
  rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
@@ -1823,7 +1829,7 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
1823
1829
  {
1824
1830
  if ( rb_respond_to( proc, swig_arity_id ) )
1825
1831
  {
1826
- VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1832
+ VALUE num = rb_funcall2( proc, swig_arity_id, 0, 0 );
1827
1833
  int arity = NUM2INT(num);
1828
1834
  if ( arity < 0 && (arity+1) < -minimal ) return 1;
1829
1835
  if ( arity == minimal ) return 1;
@@ -1841,7 +1847,7 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
1841
1847
 
1842
1848
  #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1843
1849
 
1844
- #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1850
+ #define SWIG_contract_assert(expr, msg) do { if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } } while (0)
1845
1851
 
1846
1852
 
1847
1853
 
@@ -1856,12 +1862,13 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
1856
1862
  #define SWIGTYPE_p_TagLib__Vorbis__File swig_types[6]
1857
1863
  #define SWIGTYPE_p_TagLib__Vorbis__Properties swig_types[7]
1858
1864
  #define SWIGTYPE_p_char swig_types[8]
1859
- #define SWIGTYPE_p_unsigned_char swig_types[9]
1860
- #define SWIGTYPE_p_unsigned_int swig_types[10]
1861
- #define SWIGTYPE_p_unsigned_long swig_types[11]
1862
- #define SWIGTYPE_p_wchar_t swig_types[12]
1863
- static swig_type_info *swig_types[14];
1864
- static swig_module_info swig_module = {swig_types, 13, 0, 0, 0, 0};
1865
+ #define SWIGTYPE_p_long_long swig_types[9]
1866
+ #define SWIGTYPE_p_unsigned_char swig_types[10]
1867
+ #define SWIGTYPE_p_unsigned_int swig_types[11]
1868
+ #define SWIGTYPE_p_unsigned_long swig_types[12]
1869
+ #define SWIGTYPE_p_wchar_t swig_types[13]
1870
+ static swig_type_info *swig_types[15];
1871
+ static swig_module_info swig_module = {swig_types, 14, 0, 0, 0, 0};
1865
1872
  #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1866
1873
  #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1867
1874
 
@@ -1872,12 +1879,56 @@ static swig_module_info swig_module = {swig_types, 13, 0, 0, 0, 0};
1872
1879
 
1873
1880
  static VALUE mVorbis;
1874
1881
 
1875
- #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1876
- #define SWIG_RUBY_THREAD_END_BLOCK
1882
+ #ifdef __cplusplus
1883
+ #include <utility>
1884
+ /* SwigValueWrapper is described in swig.swg */
1885
+ template<typename T> class SwigValueWrapper {
1886
+ struct SwigSmartPointer {
1887
+ T *ptr;
1888
+ SwigSmartPointer(T *p) : ptr(p) { }
1889
+ ~SwigSmartPointer() { delete ptr; }
1890
+ SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
1891
+ void reset(T *p) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = p; }
1892
+ } pointer;
1893
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
1894
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs);
1895
+ public:
1896
+ SwigValueWrapper() : pointer(0) { }
1897
+ SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; }
1898
+ #if __cplusplus >=201103L
1899
+ SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; }
1900
+ operator T&&() const { return std::move(*pointer.ptr); }
1901
+ #else
1902
+ operator T&() const { return *pointer.ptr; }
1903
+ #endif
1904
+ T *operator&() const { return pointer.ptr; }
1905
+ static void reset(SwigValueWrapper& t, T *p) { t.pointer.reset(p); }
1906
+ };
1877
1907
 
1908
+ /*
1909
+ * SwigValueInit() is a generic initialisation solution as the following approach:
1910
+ *
1911
+ * T c_result = T();
1912
+ *
1913
+ * doesn't compile for all types for example:
1914
+ *
1915
+ * unsigned int c_result = unsigned int();
1916
+ */
1917
+ template <typename T> T SwigValueInit() {
1918
+ return T();
1919
+ }
1878
1920
 
1879
- #define SWIGVERSION 0x040002
1880
- #define SWIG_VERSION SWIGVERSION
1921
+ #if __cplusplus >=201103L
1922
+ # define SWIG_STD_MOVE(OBJ) std::move(OBJ)
1923
+ #else
1924
+ # define SWIG_STD_MOVE(OBJ) OBJ
1925
+ #endif
1926
+
1927
+ #endif
1928
+
1929
+
1930
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1931
+ #define SWIG_RUBY_THREAD_END_BLOCK
1881
1932
 
1882
1933
 
1883
1934
  #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
@@ -1910,34 +1961,26 @@ static VALUE mVorbis;
1910
1961
  #endif
1911
1962
 
1912
1963
  VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
1913
- if (byteVector.isNull()) {
1914
- return Qnil;
1915
- } else {
1916
- return rb_str_new(byteVector.data(), byteVector.size());
1917
- }
1964
+ return rb_str_new(byteVector.data(), byteVector.size());
1918
1965
  }
1919
1966
 
1920
1967
  TagLib::ByteVector ruby_string_to_taglib_bytevector(VALUE s) {
1921
1968
  if (NIL_P(s)) {
1922
- return TagLib::ByteVector::null;
1969
+ return TagLib::ByteVector();
1923
1970
  } else {
1924
1971
  return TagLib::ByteVector(RSTRING_PTR(StringValue(s)), RSTRING_LEN(s));
1925
1972
  }
1926
1973
  }
1927
1974
 
1928
1975
  VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
1929
- if (string.isNull()) {
1930
- return Qnil;
1931
- } else {
1932
- VALUE result = rb_str_new2(string.toCString(true));
1933
- ASSOCIATE_UTF8_ENCODING(result);
1934
- return result;
1935
- }
1976
+ VALUE result = rb_str_new2(string.toCString(true));
1977
+ ASSOCIATE_UTF8_ENCODING(result);
1978
+ return result;
1936
1979
  }
1937
1980
 
1938
1981
  TagLib::String ruby_string_to_taglib_string(VALUE s) {
1939
1982
  if (NIL_P(s)) {
1940
- return TagLib::String::null;
1983
+ return TagLib::String();
1941
1984
  } else {
1942
1985
  return TagLib::String(RSTRING_PTR(CONVERT_TO_UTF8(StringValue(s))), TagLib::String::UTF8);
1943
1986
  }
@@ -2026,6 +2069,13 @@ TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
2026
2069
  #endif
2027
2070
  }
2028
2071
 
2072
+ VALUE taglib_offset_t_to_ruby_int(TagLib::offset_t off) {
2073
+ #ifdef _WIN32
2074
+ return LL2NUM(off);
2075
+ #else
2076
+ return OFFT2NUM(off);
2077
+ #endif
2078
+ }
2029
2079
 
2030
2080
 
2031
2081
  #include <limits.h>
@@ -2045,7 +2095,7 @@ SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
2045
2095
  }
2046
2096
 
2047
2097
 
2048
- /*@SWIG:/usr/local/Cellar/swig/4.0.2/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2098
+ /*@SWIG:/swig/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2049
2099
  SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE arg)
2050
2100
  {
2051
2101
  VALUE *args = (VALUE *)arg;
@@ -2286,7 +2336,7 @@ SWIGINTERN VALUE _wrap_new_Properties(int nargs, VALUE *args, VALUE self) {
2286
2336
  argv[ii] = args[ii];
2287
2337
  }
2288
2338
  if (argc == 1) {
2289
- int _v;
2339
+ int _v = 0;
2290
2340
  void *vptr = 0;
2291
2341
  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__Vorbis__File, 0);
2292
2342
  _v = SWIG_CheckState(res);
@@ -2295,7 +2345,7 @@ SWIGINTERN VALUE _wrap_new_Properties(int nargs, VALUE *args, VALUE self) {
2295
2345
  }
2296
2346
  }
2297
2347
  if (argc == 2) {
2298
- int _v;
2348
+ int _v = 0;
2299
2349
  void *vptr = 0;
2300
2350
  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_TagLib__Vorbis__File, 0);
2301
2351
  _v = SWIG_CheckState(res);
@@ -2326,30 +2376,6 @@ free_TagLib_Vorbis_Properties(void *self) {
2326
2376
  delete arg1;
2327
2377
  }
2328
2378
 
2329
- SWIGINTERN VALUE
2330
- _wrap_Properties_length_in_seconds(int argc, VALUE *argv, VALUE self) {
2331
- TagLib::Vorbis::Properties *arg1 = (TagLib::Vorbis::Properties *) 0 ;
2332
- void *argp1 = 0 ;
2333
- int res1 = 0 ;
2334
- int result;
2335
- VALUE vresult = Qnil;
2336
-
2337
- if ((argc < 0) || (argc > 0)) {
2338
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2339
- }
2340
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__Vorbis__Properties, 0 | 0 );
2341
- if (!SWIG_IsOK(res1)) {
2342
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::Vorbis::Properties const *","lengthInSeconds", 1, self ));
2343
- }
2344
- arg1 = reinterpret_cast< TagLib::Vorbis::Properties * >(argp1);
2345
- result = (int)((TagLib::Vorbis::Properties const *)arg1)->lengthInSeconds();
2346
- vresult = SWIG_From_int(static_cast< int >(result));
2347
- return vresult;
2348
- fail:
2349
- return Qnil;
2350
- }
2351
-
2352
-
2353
2379
  SWIGINTERN VALUE
2354
2380
  _wrap_Properties_length_in_milliseconds(int argc, VALUE *argv, VALUE self) {
2355
2381
  TagLib::Vorbis::Properties *arg1 = (TagLib::Vorbis::Properties *) 0 ;
@@ -2663,7 +2689,7 @@ SWIGINTERN VALUE _wrap_new_File(int nargs, VALUE *args, VALUE self) {
2663
2689
  argv[ii] = args[ii];
2664
2690
  }
2665
2691
  if (argc == 1) {
2666
- int _v;
2692
+ int _v = 0;
2667
2693
  int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
2668
2694
  _v = SWIG_CheckState(res);
2669
2695
  if (_v) {
@@ -2671,7 +2697,7 @@ SWIGINTERN VALUE _wrap_new_File(int nargs, VALUE *args, VALUE self) {
2671
2697
  }
2672
2698
  }
2673
2699
  if (argc == 2) {
2674
- int _v;
2700
+ int _v = 0;
2675
2701
  int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
2676
2702
  _v = SWIG_CheckState(res);
2677
2703
  if (_v) {
@@ -2685,7 +2711,7 @@ SWIGINTERN VALUE _wrap_new_File(int nargs, VALUE *args, VALUE self) {
2685
2711
  }
2686
2712
  }
2687
2713
  if (argc == 3) {
2688
- int _v;
2714
+ int _v = 0;
2689
2715
  int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
2690
2716
  _v = SWIG_CheckState(res);
2691
2717
  if (_v) {
@@ -2814,26 +2840,27 @@ fail:
2814
2840
  static void *_p_TagLib__Vorbis__PropertiesTo_p_TagLib__AudioProperties(void *x, int *SWIGUNUSEDPARM(newmemory)) {
2815
2841
  return (void *)((TagLib::AudioProperties *) ((TagLib::Vorbis::Properties *) x));
2816
2842
  }
2817
- static void *_p_TagLib__Vorbis__FileTo_p_TagLib__Ogg__File(void *x, int *SWIGUNUSEDPARM(newmemory)) {
2818
- return (void *)((TagLib::Ogg::File *) ((TagLib::Vorbis::File *) x));
2819
- }
2820
2843
  static void *_p_TagLib__Ogg__FileTo_p_TagLib__File(void *x, int *SWIGUNUSEDPARM(newmemory)) {
2821
2844
  return (void *)((TagLib::File *) ((TagLib::Ogg::File *) x));
2822
2845
  }
2823
2846
  static void *_p_TagLib__Vorbis__FileTo_p_TagLib__File(void *x, int *SWIGUNUSEDPARM(newmemory)) {
2824
2847
  return (void *)((TagLib::File *) (TagLib::Ogg::File *) ((TagLib::Vorbis::File *) x));
2825
2848
  }
2826
- static swig_type_info _swigt__p_MapT_TagLib__String_TagLib__StringList_t = {"_p_MapT_TagLib__String_TagLib__StringList_t", "Map< TagLib::String,TagLib::StringList > *|TagLib::Ogg::FieldListMap *", 0, 0, (void*)0, 0};
2827
- static swig_type_info _swigt__p_TagLib__AudioProperties = {"_p_TagLib__AudioProperties", "TagLib::AudioProperties *|TagLib::Ogg::Vorbis::AudioProperties *", 0, 0, (void*)0, 0};
2849
+ static void *_p_TagLib__Vorbis__FileTo_p_TagLib__Ogg__File(void *x, int *SWIGUNUSEDPARM(newmemory)) {
2850
+ return (void *)((TagLib::Ogg::File *) ((TagLib::Vorbis::File *) x));
2851
+ }
2852
+ static swig_type_info _swigt__p_MapT_TagLib__String_TagLib__StringList_t = {"_p_MapT_TagLib__String_TagLib__StringList_t", "TagLib::Ogg::FieldListMap *|Map< TagLib::String,TagLib::StringList > *", 0, 0, (void*)0, 0};
2853
+ static swig_type_info _swigt__p_TagLib__AudioProperties = {"_p_TagLib__AudioProperties", "TagLib::AudioProperties *", 0, 0, (void*)0, 0};
2828
2854
  static swig_type_info _swigt__p_TagLib__File = {"_p_TagLib__File", "TagLib::File *", 0, 0, (void*)0, 0};
2829
- static swig_type_info _swigt__p_TagLib__ListT_TagLib__FLAC__Picture_t = {"_p_TagLib__ListT_TagLib__FLAC__Picture_t", "TagLib::List< TagLib::FLAC::Picture > *|TagLib::FLAC::PictureList *", 0, 0, (void*)0, 0};
2855
+ static swig_type_info _swigt__p_TagLib__ListT_TagLib__FLAC__Picture_t = {"_p_TagLib__ListT_TagLib__FLAC__Picture_t", "TagLib::FLAC::PictureList *|TagLib::List< TagLib::FLAC::Picture > *", 0, 0, (void*)0, 0};
2830
2856
  static swig_type_info _swigt__p_TagLib__Ogg__File = {"_p_TagLib__Ogg__File", "TagLib::Ogg::File *", 0, 0, (void*)0, 0};
2831
2857
  static swig_type_info _swigt__p_TagLib__Ogg__XiphComment = {"_p_TagLib__Ogg__XiphComment", "TagLib::Ogg::XiphComment *", 0, 0, (void*)0, 0};
2832
- static swig_type_info _swigt__p_TagLib__Vorbis__File = {"_p_TagLib__Vorbis__File", "TagLib::Vorbis::File *|TagLib::Ogg::Vorbis::File *", 0, 0, (void*)0, 0};
2833
- static swig_type_info _swigt__p_TagLib__Vorbis__Properties = {"_p_TagLib__Vorbis__Properties", "TagLib::Vorbis::Properties *", 0, 0, (void*)0, 0};
2858
+ static swig_type_info _swigt__p_TagLib__Vorbis__File = {"_p_TagLib__Vorbis__File", "TagLib::Ogg::Vorbis::File *|TagLib::Vorbis::File *", 0, 0, (void*)0, 0};
2859
+ static swig_type_info _swigt__p_TagLib__Vorbis__Properties = {"_p_TagLib__Vorbis__Properties", "TagLib::Ogg::Vorbis::Properties *|TagLib::Vorbis::Properties *", 0, 0, (void*)0, 0};
2834
2860
  static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
2861
+ static swig_type_info _swigt__p_long_long = {"_p_long_long", "TagLib::offset_t *|long long *", 0, 0, (void*)0, 0};
2835
2862
  static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "TagLib::uchar *|unsigned char *", 0, 0, (void*)0, 0};
2836
- static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *|TagLib::uint *", 0, 0, (void*)0, 0};
2863
+ static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "TagLib::uint *|unsigned int *", 0, 0, (void*)0, 0};
2837
2864
  static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "TagLib::ulong *|unsigned long *", 0, 0, (void*)0, 0};
2838
2865
  static swig_type_info _swigt__p_wchar_t = {"_p_wchar_t", "TagLib::wchar *|wchar_t *", 0, 0, (void*)0, 0};
2839
2866
 
@@ -2847,6 +2874,7 @@ static swig_type_info *swig_type_initial[] = {
2847
2874
  &_swigt__p_TagLib__Vorbis__File,
2848
2875
  &_swigt__p_TagLib__Vorbis__Properties,
2849
2876
  &_swigt__p_char,
2877
+ &_swigt__p_long_long,
2850
2878
  &_swigt__p_unsigned_char,
2851
2879
  &_swigt__p_unsigned_int,
2852
2880
  &_swigt__p_unsigned_long,
@@ -2855,13 +2883,14 @@ static swig_type_info *swig_type_initial[] = {
2855
2883
 
2856
2884
  static swig_cast_info _swigc__p_MapT_TagLib__String_TagLib__StringList_t[] = { {&_swigt__p_MapT_TagLib__String_TagLib__StringList_t, 0, 0, 0},{0, 0, 0, 0}};
2857
2885
  static swig_cast_info _swigc__p_TagLib__AudioProperties[] = { {&_swigt__p_TagLib__AudioProperties, 0, 0, 0}, {&_swigt__p_TagLib__Vorbis__Properties, _p_TagLib__Vorbis__PropertiesTo_p_TagLib__AudioProperties, 0, 0},{0, 0, 0, 0}};
2858
- static swig_cast_info _swigc__p_TagLib__File[] = { {&_swigt__p_TagLib__Ogg__File, _p_TagLib__Ogg__FileTo_p_TagLib__File, 0, 0}, {&_swigt__p_TagLib__Vorbis__File, _p_TagLib__Vorbis__FileTo_p_TagLib__File, 0, 0}, {&_swigt__p_TagLib__File, 0, 0, 0},{0, 0, 0, 0}};
2886
+ static swig_cast_info _swigc__p_TagLib__File[] = { {&_swigt__p_TagLib__File, 0, 0, 0}, {&_swigt__p_TagLib__Ogg__File, _p_TagLib__Ogg__FileTo_p_TagLib__File, 0, 0}, {&_swigt__p_TagLib__Vorbis__File, _p_TagLib__Vorbis__FileTo_p_TagLib__File, 0, 0},{0, 0, 0, 0}};
2859
2887
  static swig_cast_info _swigc__p_TagLib__ListT_TagLib__FLAC__Picture_t[] = { {&_swigt__p_TagLib__ListT_TagLib__FLAC__Picture_t, 0, 0, 0},{0, 0, 0, 0}};
2860
2888
  static swig_cast_info _swigc__p_TagLib__Ogg__File[] = { {&_swigt__p_TagLib__Ogg__File, 0, 0, 0}, {&_swigt__p_TagLib__Vorbis__File, _p_TagLib__Vorbis__FileTo_p_TagLib__Ogg__File, 0, 0},{0, 0, 0, 0}};
2861
2889
  static swig_cast_info _swigc__p_TagLib__Ogg__XiphComment[] = { {&_swigt__p_TagLib__Ogg__XiphComment, 0, 0, 0},{0, 0, 0, 0}};
2862
2890
  static swig_cast_info _swigc__p_TagLib__Vorbis__File[] = { {&_swigt__p_TagLib__Vorbis__File, 0, 0, 0},{0, 0, 0, 0}};
2863
2891
  static swig_cast_info _swigc__p_TagLib__Vorbis__Properties[] = { {&_swigt__p_TagLib__Vorbis__Properties, 0, 0, 0},{0, 0, 0, 0}};
2864
2892
  static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
2893
+ static swig_cast_info _swigc__p_long_long[] = { {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}};
2865
2894
  static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
2866
2895
  static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
2867
2896
  static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
@@ -2877,6 +2906,7 @@ static swig_cast_info *swig_cast_initial[] = {
2877
2906
  _swigc__p_TagLib__Vorbis__File,
2878
2907
  _swigc__p_TagLib__Vorbis__Properties,
2879
2908
  _swigc__p_char,
2909
+ _swigc__p_long_long,
2880
2910
  _swigc__p_unsigned_char,
2881
2911
  _swigc__p_unsigned_int,
2882
2912
  _swigc__p_unsigned_long,
@@ -2938,9 +2968,12 @@ extern "C" {
2938
2968
  #define SWIGRUNTIME_DEBUG
2939
2969
  #endif
2940
2970
 
2971
+ #ifndef SWIG_INIT_CLIENT_DATA_TYPE
2972
+ #define SWIG_INIT_CLIENT_DATA_TYPE void *
2973
+ #endif
2941
2974
 
2942
2975
  SWIGRUNTIME void
2943
- SWIG_InitializeModule(void *clientdata) {
2976
+ SWIG_InitializeModule(SWIG_INIT_CLIENT_DATA_TYPE clientdata) {
2944
2977
  size_t i;
2945
2978
  swig_module_info *module_head, *iter;
2946
2979
  int init;
@@ -3145,7 +3178,6 @@ SWIGEXPORT void Init_taglib_vorbis(void) {
3145
3178
  SWIG_TypeClientData(SWIGTYPE_p_TagLib__Vorbis__Properties, (void *) &SwigClassProperties);
3146
3179
  rb_define_alloc_func(SwigClassProperties.klass, _wrap_Properties_allocate);
3147
3180
  rb_define_method(SwigClassProperties.klass, "initialize", VALUEFUNC(_wrap_new_Properties), -1);
3148
- rb_define_method(SwigClassProperties.klass, "length_in_seconds", VALUEFUNC(_wrap_Properties_length_in_seconds), -1);
3149
3181
  rb_define_method(SwigClassProperties.klass, "length_in_milliseconds", VALUEFUNC(_wrap_Properties_length_in_milliseconds), -1);
3150
3182
  rb_define_method(SwigClassProperties.klass, "bitrate", VALUEFUNC(_wrap_Properties_bitrate), -1);
3151
3183
  rb_define_method(SwigClassProperties.klass, "sample_rate", VALUEFUNC(_wrap_Properties_sample_rate), -1);
@@ -4,7 +4,6 @@
4
4
  #include <taglib/wavfile.h>
5
5
  #include <taglib/wavproperties.h>
6
6
  #include <taglib/id3v2tag.h>
7
- using namespace TagLib::RIFF;
8
7
  %}
9
8
 
10
9
  %include "../taglib_base/includes.i"
@@ -16,6 +15,9 @@ using namespace TagLib::RIFF;
16
15
  %ignore TagLib::RIFF::WAV::Properties::length;
17
16
  %ignore TagLib::RIFF::WAV::Properties::sampleWidth;
18
17
 
18
+ %ignore TagLib::RIFF::File;
19
+ %include <taglib/rifffile.h>
20
+
19
21
  %include <taglib/wavproperties.h>
20
22
 
21
23
  %freefunc TagLib::RIFF::WAV::File "free_taglib_riff_wav_file";
@@ -28,9 +30,11 @@ namespace TagLib {
28
30
 
29
31
  // Ignore IOStream and all the constructors using it.
30
32
  %ignore IOStream;
33
+ %ignore TagLib::RIFF::WAV::File::File(IOStream *, bool, Properties::ReadStyle, ID3v2::FrameFactory *f);
31
34
  %ignore TagLib::RIFF::WAV::File::File(IOStream *, bool, Properties::ReadStyle);
32
35
  %ignore TagLib::RIFF::WAV::File::File(IOStream *, bool);
33
36
  %ignore TagLib::RIFF::WAV::File::File(IOStream *);
37
+ %ignore TagLib::RIFF::WAV::File::isSupported(IOStream *);
34
38
 
35
39
  // Ignore the unified property interface.
36
40
  %ignore TagLib::RIFF::WAV::File::properties;
@@ -54,7 +58,7 @@ namespace TagLib {
54
58
  static void free_taglib_riff_wav_file(void *ptr) {
55
59
  TagLib::RIFF::WAV::File *file = (TagLib::RIFF::WAV::File *) ptr;
56
60
 
57
- TagLib::ID3v2::Tag *id3v2tag = file->tag();
61
+ TagLib::ID3v2::Tag *id3v2tag = file->ID3v2Tag();
58
62
  if (id3v2tag) {
59
63
  TagLib::ID3v2::FrameList frames = id3v2tag->frameList();
60
64
  for (TagLib::ID3v2::FrameList::ConstIterator it = frames.begin(); it != frames.end(); it++) {