taglib-ruby 1.1.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1854,16 +1854,22 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
1854
1854
  /* -------- TYPES TABLE (BEGIN) -------- */
1855
1855
 
1856
1856
  #define SWIGTYPE_p_TagLib__AudioProperties swig_types[0]
1857
- #define SWIGTYPE_p_TagLib__ID3v2__Tag swig_types[1]
1858
- #define SWIGTYPE_p_TagLib__RIFF__WAV__File swig_types[2]
1859
- #define SWIGTYPE_p_TagLib__RIFF__WAV__Properties swig_types[3]
1860
- #define SWIGTYPE_p_char swig_types[4]
1861
- #define SWIGTYPE_p_unsigned_char swig_types[5]
1862
- #define SWIGTYPE_p_unsigned_int swig_types[6]
1863
- #define SWIGTYPE_p_unsigned_long swig_types[7]
1864
- #define SWIGTYPE_p_wchar_t swig_types[8]
1865
- static swig_type_info *swig_types[10];
1866
- static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0};
1857
+ #define SWIGTYPE_p_TagLib__File swig_types[1]
1858
+ #define SWIGTYPE_p_TagLib__ID3v2__FrameFactory swig_types[2]
1859
+ #define SWIGTYPE_p_TagLib__ID3v2__Tag swig_types[3]
1860
+ #define SWIGTYPE_p_TagLib__ID3v2__Version swig_types[4]
1861
+ #define SWIGTYPE_p_TagLib__RIFF__File swig_types[5]
1862
+ #define SWIGTYPE_p_TagLib__RIFF__WAV__File swig_types[6]
1863
+ #define SWIGTYPE_p_TagLib__RIFF__WAV__Properties swig_types[7]
1864
+ #define SWIGTYPE_p_TagLib__Tag swig_types[8]
1865
+ #define SWIGTYPE_p_char swig_types[9]
1866
+ #define SWIGTYPE_p_long_long swig_types[10]
1867
+ #define SWIGTYPE_p_unsigned_char swig_types[11]
1868
+ #define SWIGTYPE_p_unsigned_int swig_types[12]
1869
+ #define SWIGTYPE_p_unsigned_long swig_types[13]
1870
+ #define SWIGTYPE_p_wchar_t swig_types[14]
1871
+ static swig_type_info *swig_types[16];
1872
+ static swig_module_info swig_module = {swig_types, 15, 0, 0, 0, 0};
1867
1873
  #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1868
1874
  #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1869
1875
 
@@ -1937,7 +1943,6 @@ template <typename T> T SwigValueInit() {
1937
1943
  #include <taglib/wavfile.h>
1938
1944
  #include <taglib/wavproperties.h>
1939
1945
  #include <taglib/id3v2tag.h>
1940
- using namespace TagLib::RIFF;
1941
1946
 
1942
1947
 
1943
1948
  #include <taglib/tstring.h>
@@ -1958,34 +1963,26 @@ using namespace TagLib::RIFF;
1958
1963
  #endif
1959
1964
 
1960
1965
  VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
1961
- if (byteVector.isNull()) {
1962
- return Qnil;
1963
- } else {
1964
- return rb_str_new(byteVector.data(), byteVector.size());
1965
- }
1966
+ return rb_str_new(byteVector.data(), byteVector.size());
1966
1967
  }
1967
1968
 
1968
1969
  TagLib::ByteVector ruby_string_to_taglib_bytevector(VALUE s) {
1969
1970
  if (NIL_P(s)) {
1970
- return TagLib::ByteVector::null;
1971
+ return TagLib::ByteVector();
1971
1972
  } else {
1972
1973
  return TagLib::ByteVector(RSTRING_PTR(StringValue(s)), RSTRING_LEN(s));
1973
1974
  }
1974
1975
  }
1975
1976
 
1976
1977
  VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
1977
- if (string.isNull()) {
1978
- return Qnil;
1979
- } else {
1980
- VALUE result = rb_str_new2(string.toCString(true));
1981
- ASSOCIATE_UTF8_ENCODING(result);
1982
- return result;
1983
- }
1978
+ VALUE result = rb_str_new2(string.toCString(true));
1979
+ ASSOCIATE_UTF8_ENCODING(result);
1980
+ return result;
1984
1981
  }
1985
1982
 
1986
1983
  TagLib::String ruby_string_to_taglib_string(VALUE s) {
1987
1984
  if (NIL_P(s)) {
1988
- return TagLib::String::null;
1985
+ return TagLib::String();
1989
1986
  } else {
1990
1987
  return TagLib::String(RSTRING_PTR(CONVERT_TO_UTF8(StringValue(s))), TagLib::String::UTF8);
1991
1988
  }
@@ -2074,6 +2071,13 @@ TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
2074
2071
  #endif
2075
2072
  }
2076
2073
 
2074
+ VALUE taglib_offset_t_to_ruby_int(TagLib::offset_t off) {
2075
+ #ifdef _WIN32
2076
+ return LL2NUM(off);
2077
+ #else
2078
+ return OFFT2NUM(off);
2079
+ #endif
2080
+ }
2077
2081
 
2078
2082
 
2079
2083
  #include <limits.h>
@@ -2093,7 +2097,7 @@ SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
2093
2097
  }
2094
2098
 
2095
2099
 
2096
- /*@SWIG:/usr/local/Cellar/swig/4.1.1/share/swig/4.1.1/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2100
+ /*@SWIG:/swig/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2097
2101
  SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE arg)
2098
2102
  {
2099
2103
  VALUE *args = (VALUE *)arg;
@@ -2246,7 +2250,7 @@ SWIGINTERN void TagLib_RIFF_WAV_File_close(TagLib::RIFF::WAV::File *self){
2246
2250
  static void free_taglib_riff_wav_file(void *ptr) {
2247
2251
  TagLib::RIFF::WAV::File *file = (TagLib::RIFF::WAV::File *) ptr;
2248
2252
 
2249
- TagLib::ID3v2::Tag *id3v2tag = file->tag();
2253
+ TagLib::ID3v2::Tag *id3v2tag = file->ID3v2Tag();
2250
2254
  if (id3v2tag) {
2251
2255
  TagLib::ID3v2::FrameList frames = id3v2tag->frameList();
2252
2256
  for (TagLib::ID3v2::FrameList::ConstIterator it = frames.begin(); it != frames.end(); it++) {
@@ -2327,30 +2331,6 @@ free_TagLib_RIFF_WAV_Properties(void *self) {
2327
2331
  delete arg1;
2328
2332
  }
2329
2333
 
2330
- SWIGINTERN VALUE
2331
- _wrap_Properties_length_in_seconds(int argc, VALUE *argv, VALUE self) {
2332
- TagLib::RIFF::WAV::Properties *arg1 = (TagLib::RIFF::WAV::Properties *) 0 ;
2333
- void *argp1 = 0 ;
2334
- int res1 = 0 ;
2335
- int result;
2336
- VALUE vresult = Qnil;
2337
-
2338
- if ((argc < 0) || (argc > 0)) {
2339
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2340
- }
2341
- res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__WAV__Properties, 0 | 0 );
2342
- if (!SWIG_IsOK(res1)) {
2343
- SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::Properties const *","lengthInSeconds", 1, self ));
2344
- }
2345
- arg1 = reinterpret_cast< TagLib::RIFF::WAV::Properties * >(argp1);
2346
- result = (int)((TagLib::RIFF::WAV::Properties const *)arg1)->lengthInSeconds();
2347
- vresult = SWIG_From_int(static_cast< int >(result));
2348
- return vresult;
2349
- fail:
2350
- return Qnil;
2351
- }
2352
-
2353
-
2354
2334
  SWIGINTERN VALUE
2355
2335
  _wrap_Properties_length_in_milliseconds(int argc, VALUE *argv, VALUE self) {
2356
2336
  TagLib::RIFF::WAV::Properties *arg1 = (TagLib::RIFF::WAV::Properties *) 0 ;
@@ -2523,6 +2503,53 @@ static swig_class SwigClassFile;
2523
2503
 
2524
2504
  SWIGINTERN VALUE
2525
2505
  _wrap_new_File__SWIG_0(int argc, VALUE *argv, VALUE self) {
2506
+ TagLib::FileName arg1 ;
2507
+ bool arg2 ;
2508
+ TagLib::RIFF::WAV::Properties::ReadStyle arg3 ;
2509
+ TagLib::ID3v2::FrameFactory *arg4 = (TagLib::ID3v2::FrameFactory *) 0 ;
2510
+ bool val2 ;
2511
+ int ecode2 = 0 ;
2512
+ int val3 ;
2513
+ int ecode3 = 0 ;
2514
+ void *argp4 = 0 ;
2515
+ int res4 = 0 ;
2516
+ TagLib::RIFF::WAV::File *result = 0 ;
2517
+
2518
+ if ((argc < 4) || (argc > 4)) {
2519
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
2520
+ }
2521
+ {
2522
+ arg1 = ruby_string_to_taglib_filename(argv[0]);
2523
+ if ((const char *)(TagLib::FileName)(arg1) == NULL) {
2524
+ SWIG_exception_fail(SWIG_MemoryError, "Failed to allocate memory for file name.");
2525
+ }
2526
+ }
2527
+ ecode2 = SWIG_AsVal_bool(argv[1], &val2);
2528
+ if (!SWIG_IsOK(ecode2)) {
2529
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","File", 2, argv[1] ));
2530
+ }
2531
+ arg2 = static_cast< bool >(val2);
2532
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
2533
+ if (!SWIG_IsOK(ecode3)) {
2534
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::Properties::ReadStyle","File", 3, argv[2] ));
2535
+ }
2536
+ arg3 = static_cast< TagLib::RIFF::WAV::Properties::ReadStyle >(val3);
2537
+ res4 = SWIG_ConvertPtr(argv[3], &argp4,SWIGTYPE_p_TagLib__ID3v2__FrameFactory, 0 | 0 );
2538
+ if (!SWIG_IsOK(res4)) {
2539
+ SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "TagLib::ID3v2::FrameFactory *","File", 4, argv[3] ));
2540
+ }
2541
+ arg4 = reinterpret_cast< TagLib::ID3v2::FrameFactory * >(argp4);
2542
+ result = (TagLib::RIFF::WAV::File *)new TagLib::RIFF::WAV::File(arg1,arg2,arg3,arg4);
2543
+ DATA_PTR(self) = result;
2544
+ SWIG_RubyAddTracking(result, self);
2545
+ return self;
2546
+ fail:
2547
+ return Qnil;
2548
+ }
2549
+
2550
+
2551
+ SWIGINTERN VALUE
2552
+ _wrap_new_File__SWIG_1(int argc, VALUE *argv, VALUE self) {
2526
2553
  TagLib::FileName arg1 ;
2527
2554
  bool arg2 ;
2528
2555
  TagLib::RIFF::WAV::Properties::ReadStyle arg3 ;
@@ -2561,7 +2588,7 @@ fail:
2561
2588
 
2562
2589
 
2563
2590
  SWIGINTERN VALUE
2564
- _wrap_new_File__SWIG_1(int argc, VALUE *argv, VALUE self) {
2591
+ _wrap_new_File__SWIG_2(int argc, VALUE *argv, VALUE self) {
2565
2592
  TagLib::FileName arg1 ;
2566
2593
  bool arg2 ;
2567
2594
  bool val2 ;
@@ -2607,7 +2634,7 @@ _wrap_File_allocate(int argc, VALUE *argv, VALUE self)
2607
2634
 
2608
2635
 
2609
2636
  SWIGINTERN VALUE
2610
- _wrap_new_File__SWIG_2(int argc, VALUE *argv, VALUE self) {
2637
+ _wrap_new_File__SWIG_3(int argc, VALUE *argv, VALUE self) {
2611
2638
  TagLib::FileName arg1 ;
2612
2639
  TagLib::RIFF::WAV::File *result = 0 ;
2613
2640
 
@@ -2631,11 +2658,11 @@ fail:
2631
2658
 
2632
2659
  SWIGINTERN VALUE _wrap_new_File(int nargs, VALUE *args, VALUE self) {
2633
2660
  int argc;
2634
- VALUE argv[3];
2661
+ VALUE argv[4];
2635
2662
  int ii;
2636
2663
 
2637
2664
  argc = nargs;
2638
- if (argc > 3) SWIG_fail;
2665
+ if (argc > 4) SWIG_fail;
2639
2666
  for (ii = 0; (ii < argc); ++ii) {
2640
2667
  argv[ii] = args[ii];
2641
2668
  }
@@ -2644,7 +2671,7 @@ SWIGINTERN VALUE _wrap_new_File(int nargs, VALUE *args, VALUE self) {
2644
2671
  int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
2645
2672
  _v = SWIG_CheckState(res);
2646
2673
  if (_v) {
2647
- return _wrap_new_File__SWIG_2(nargs, args, self);
2674
+ return _wrap_new_File__SWIG_3(nargs, args, self);
2648
2675
  }
2649
2676
  }
2650
2677
  if (argc == 2) {
@@ -2657,7 +2684,7 @@ SWIGINTERN VALUE _wrap_new_File(int nargs, VALUE *args, VALUE self) {
2657
2684
  _v = SWIG_CheckState(res);
2658
2685
  }
2659
2686
  if (_v) {
2660
- return _wrap_new_File__SWIG_1(nargs, args, self);
2687
+ return _wrap_new_File__SWIG_2(nargs, args, self);
2661
2688
  }
2662
2689
  }
2663
2690
  }
@@ -2676,14 +2703,40 @@ SWIGINTERN VALUE _wrap_new_File(int nargs, VALUE *args, VALUE self) {
2676
2703
  _v = SWIG_CheckState(res);
2677
2704
  }
2678
2705
  if (_v) {
2679
- return _wrap_new_File__SWIG_0(nargs, args, self);
2706
+ return _wrap_new_File__SWIG_1(nargs, args, self);
2707
+ }
2708
+ }
2709
+ }
2710
+ }
2711
+ if (argc == 4) {
2712
+ int _v = 0;
2713
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
2714
+ _v = SWIG_CheckState(res);
2715
+ if (_v) {
2716
+ {
2717
+ int res = SWIG_AsVal_bool(argv[1], NULL);
2718
+ _v = SWIG_CheckState(res);
2719
+ }
2720
+ if (_v) {
2721
+ {
2722
+ int res = SWIG_AsVal_int(argv[2], NULL);
2723
+ _v = SWIG_CheckState(res);
2724
+ }
2725
+ if (_v) {
2726
+ void *vptr = 0;
2727
+ int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_TagLib__ID3v2__FrameFactory, 0);
2728
+ _v = SWIG_CheckState(res);
2729
+ if (_v) {
2730
+ return _wrap_new_File__SWIG_0(nargs, args, self);
2731
+ }
2680
2732
  }
2681
2733
  }
2682
2734
  }
2683
2735
  }
2684
2736
 
2685
2737
  fail:
2686
- Ruby_Format_OverloadedError( argc, 3, "File.new",
2738
+ Ruby_Format_OverloadedError( argc, 4, "File.new",
2739
+ " File.new(TagLib::FileName file, bool readProperties, TagLib::RIFF::WAV::Properties::ReadStyle propertiesStyle, TagLib::ID3v2::FrameFactory *frameFactory)\n"
2687
2740
  " File.new(TagLib::FileName file, bool readProperties, TagLib::RIFF::WAV::Properties::ReadStyle propertiesStyle)\n"
2688
2741
  " File.new(TagLib::FileName file, bool readProperties)\n"
2689
2742
  " File.new(TagLib::FileName file)\n");
@@ -2697,7 +2750,7 @@ _wrap_File_tag(int argc, VALUE *argv, VALUE self) {
2697
2750
  TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
2698
2751
  void *argp1 = 0 ;
2699
2752
  int res1 = 0 ;
2700
- TagLib::ID3v2::Tag *result = 0 ;
2753
+ TagLib::Tag *result = 0 ;
2701
2754
  VALUE vresult = Qnil;
2702
2755
 
2703
2756
  if ((argc < 0) || (argc > 0)) {
@@ -2708,8 +2761,8 @@ _wrap_File_tag(int argc, VALUE *argv, VALUE self) {
2708
2761
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File const *","tag", 1, self ));
2709
2762
  }
2710
2763
  arg1 = reinterpret_cast< TagLib::RIFF::WAV::File * >(argp1);
2711
- result = (TagLib::ID3v2::Tag *)((TagLib::RIFF::WAV::File const *)arg1)->tag();
2712
- vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__ID3v2__Tag, 0 | 0 );
2764
+ result = (TagLib::Tag *)((TagLib::RIFF::WAV::File const *)arg1)->tag();
2765
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_TagLib__Tag, 0 | 0 );
2713
2766
  return vresult;
2714
2767
  fail:
2715
2768
  return Qnil;
@@ -2887,16 +2940,16 @@ SWIGINTERN VALUE
2887
2940
  _wrap_File_save__SWIG_1(int argc, VALUE *argv, VALUE self) {
2888
2941
  TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
2889
2942
  TagLib::RIFF::WAV::File::TagTypes arg2 ;
2890
- bool arg3 ;
2891
- int arg4 ;
2943
+ TagLib::File::StripTags arg3 ;
2944
+ TagLib::ID3v2::Version arg4 ;
2892
2945
  void *argp1 = 0 ;
2893
2946
  int res1 = 0 ;
2894
2947
  int val2 ;
2895
2948
  int ecode2 = 0 ;
2896
- bool val3 ;
2949
+ int val3 ;
2897
2950
  int ecode3 = 0 ;
2898
- int val4 ;
2899
- int ecode4 = 0 ;
2951
+ void *argp4 ;
2952
+ int res4 = 0 ;
2900
2953
  bool result;
2901
2954
  VALUE vresult = Qnil;
2902
2955
 
@@ -2913,16 +2966,22 @@ _wrap_File_save__SWIG_1(int argc, VALUE *argv, VALUE self) {
2913
2966
  SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File::TagTypes","save", 2, argv[0] ));
2914
2967
  }
2915
2968
  arg2 = static_cast< TagLib::RIFF::WAV::File::TagTypes >(val2);
2916
- ecode3 = SWIG_AsVal_bool(argv[1], &val3);
2969
+ ecode3 = SWIG_AsVal_int(argv[1], &val3);
2917
2970
  if (!SWIG_IsOK(ecode3)) {
2918
- SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","save", 3, argv[1] ));
2919
- }
2920
- arg3 = static_cast< bool >(val3);
2921
- ecode4 = SWIG_AsVal_int(argv[2], &val4);
2922
- if (!SWIG_IsOK(ecode4)) {
2923
- SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","save", 4, argv[2] ));
2971
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "TagLib::File::StripTags","save", 3, argv[1] ));
2924
2972
  }
2925
- arg4 = static_cast< int >(val4);
2973
+ arg3 = static_cast< TagLib::File::StripTags >(val3);
2974
+ {
2975
+ res4 = SWIG_ConvertPtr(argv[2], &argp4, SWIGTYPE_p_TagLib__ID3v2__Version, 0 );
2976
+ if (!SWIG_IsOK(res4)) {
2977
+ SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "TagLib::ID3v2::Version","save", 4, argv[2] ));
2978
+ }
2979
+ if (!argp4) {
2980
+ SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "TagLib::ID3v2::Version","save", 4, argv[2]));
2981
+ } else {
2982
+ arg4 = *(reinterpret_cast< TagLib::ID3v2::Version * >(argp4));
2983
+ }
2984
+ }
2926
2985
  result = (bool)(arg1)->save(arg2,arg3,arg4);
2927
2986
  vresult = SWIG_From_bool(static_cast< bool >(result));
2928
2987
  return vresult;
@@ -2935,12 +2994,12 @@ SWIGINTERN VALUE
2935
2994
  _wrap_File_save__SWIG_2(int argc, VALUE *argv, VALUE self) {
2936
2995
  TagLib::RIFF::WAV::File *arg1 = (TagLib::RIFF::WAV::File *) 0 ;
2937
2996
  TagLib::RIFF::WAV::File::TagTypes arg2 ;
2938
- bool arg3 ;
2997
+ TagLib::File::StripTags arg3 ;
2939
2998
  void *argp1 = 0 ;
2940
2999
  int res1 = 0 ;
2941
3000
  int val2 ;
2942
3001
  int ecode2 = 0 ;
2943
- bool val3 ;
3002
+ int val3 ;
2944
3003
  int ecode3 = 0 ;
2945
3004
  bool result;
2946
3005
  VALUE vresult = Qnil;
@@ -2958,11 +3017,11 @@ _wrap_File_save__SWIG_2(int argc, VALUE *argv, VALUE self) {
2958
3017
  SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "TagLib::RIFF::WAV::File::TagTypes","save", 2, argv[0] ));
2959
3018
  }
2960
3019
  arg2 = static_cast< TagLib::RIFF::WAV::File::TagTypes >(val2);
2961
- ecode3 = SWIG_AsVal_bool(argv[1], &val3);
3020
+ ecode3 = SWIG_AsVal_int(argv[1], &val3);
2962
3021
  if (!SWIG_IsOK(ecode3)) {
2963
- SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","save", 3, argv[1] ));
3022
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "TagLib::File::StripTags","save", 3, argv[1] ));
2964
3023
  }
2965
- arg3 = static_cast< bool >(val3);
3024
+ arg3 = static_cast< TagLib::File::StripTags >(val3);
2966
3025
  result = (bool)(arg1)->save(arg2,arg3);
2967
3026
  vresult = SWIG_From_bool(static_cast< bool >(result));
2968
3027
  return vresult;
@@ -3050,7 +3109,7 @@ SWIGINTERN VALUE _wrap_File_save(int nargs, VALUE *args, VALUE self) {
3050
3109
  }
3051
3110
  if (_v) {
3052
3111
  {
3053
- int res = SWIG_AsVal_bool(argv[2], NULL);
3112
+ int res = SWIG_AsVal_int(argv[2], NULL);
3054
3113
  _v = SWIG_CheckState(res);
3055
3114
  }
3056
3115
  if (_v) {
@@ -3071,14 +3130,13 @@ SWIGINTERN VALUE _wrap_File_save(int nargs, VALUE *args, VALUE self) {
3071
3130
  }
3072
3131
  if (_v) {
3073
3132
  {
3074
- int res = SWIG_AsVal_bool(argv[2], NULL);
3133
+ int res = SWIG_AsVal_int(argv[2], NULL);
3075
3134
  _v = SWIG_CheckState(res);
3076
3135
  }
3077
3136
  if (_v) {
3078
- {
3079
- int res = SWIG_AsVal_int(argv[3], NULL);
3080
- _v = SWIG_CheckState(res);
3081
- }
3137
+ void *vptr = 0;
3138
+ int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_TagLib__ID3v2__Version, SWIG_POINTER_NO_NULL);
3139
+ _v = SWIG_CheckState(res);
3082
3140
  if (_v) {
3083
3141
  return _wrap_File_save__SWIG_1(nargs, args, self);
3084
3142
  }
@@ -3090,8 +3148,8 @@ SWIGINTERN VALUE _wrap_File_save(int nargs, VALUE *args, VALUE self) {
3090
3148
  fail:
3091
3149
  Ruby_Format_OverloadedError( argc, 5, "File.save",
3092
3150
  " bool File.save()\n"
3093
- " bool File.save(TagLib::RIFF::WAV::File::TagTypes tags, bool stripOthers, int id3v2Version)\n"
3094
- " bool File.save(TagLib::RIFF::WAV::File::TagTypes tags, bool stripOthers)\n"
3151
+ " bool File.save(TagLib::RIFF::WAV::File::TagTypes tags, TagLib::File::StripTags strip, TagLib::ID3v2::Version version)\n"
3152
+ " bool File.save(TagLib::RIFF::WAV::File::TagTypes tags, TagLib::File::StripTags strip)\n"
3095
3153
  " bool File.save(TagLib::RIFF::WAV::File::TagTypes tags)\n");
3096
3154
 
3097
3155
  return Qnil;
@@ -3173,11 +3231,26 @@ fail:
3173
3231
  static void *_p_TagLib__RIFF__WAV__PropertiesTo_p_TagLib__AudioProperties(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3174
3232
  return (void *)((TagLib::AudioProperties *) ((TagLib::RIFF::WAV::Properties *) x));
3175
3233
  }
3234
+ static void *_p_TagLib__RIFF__FileTo_p_TagLib__File(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3235
+ return (void *)((TagLib::File *) ((TagLib::RIFF::File *) x));
3236
+ }
3237
+ static void *_p_TagLib__RIFF__WAV__FileTo_p_TagLib__File(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3238
+ return (void *)((TagLib::File *) (TagLib::RIFF::File *) ((TagLib::RIFF::WAV::File *) x));
3239
+ }
3240
+ static void *_p_TagLib__RIFF__WAV__FileTo_p_TagLib__RIFF__File(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3241
+ return (void *)((TagLib::RIFF::File *) ((TagLib::RIFF::WAV::File *) x));
3242
+ }
3176
3243
  static swig_type_info _swigt__p_TagLib__AudioProperties = {"_p_TagLib__AudioProperties", "TagLib::AudioProperties *", 0, 0, (void*)0, 0};
3244
+ static swig_type_info _swigt__p_TagLib__File = {"_p_TagLib__File", "TagLib::File *", 0, 0, (void*)0, 0};
3245
+ static swig_type_info _swigt__p_TagLib__ID3v2__FrameFactory = {"_p_TagLib__ID3v2__FrameFactory", "TagLib::ID3v2::FrameFactory *", 0, 0, (void*)0, 0};
3177
3246
  static swig_type_info _swigt__p_TagLib__ID3v2__Tag = {"_p_TagLib__ID3v2__Tag", "TagLib::ID3v2::Tag *", 0, 0, (void*)0, 0};
3247
+ static swig_type_info _swigt__p_TagLib__ID3v2__Version = {"_p_TagLib__ID3v2__Version", "TagLib::ID3v2::Version *", 0, 0, (void*)0, 0};
3248
+ static swig_type_info _swigt__p_TagLib__RIFF__File = {"_p_TagLib__RIFF__File", "TagLib::RIFF::File *", 0, 0, (void*)0, 0};
3178
3249
  static swig_type_info _swigt__p_TagLib__RIFF__WAV__File = {"_p_TagLib__RIFF__WAV__File", "TagLib::RIFF::WAV::File *", 0, 0, (void*)0, 0};
3179
3250
  static swig_type_info _swigt__p_TagLib__RIFF__WAV__Properties = {"_p_TagLib__RIFF__WAV__Properties", "TagLib::RIFF::WAV::Properties *", 0, 0, (void*)0, 0};
3251
+ static swig_type_info _swigt__p_TagLib__Tag = {"_p_TagLib__Tag", "TagLib::Tag *", 0, 0, (void*)0, 0};
3180
3252
  static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
3253
+ static swig_type_info _swigt__p_long_long = {"_p_long_long", "TagLib::offset_t *|long long *", 0, 0, (void*)0, 0};
3181
3254
  static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "TagLib::uchar *|unsigned char *", 0, 0, (void*)0, 0};
3182
3255
  static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "TagLib::uint *|unsigned int *", 0, 0, (void*)0, 0};
3183
3256
  static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "TagLib::ulong *|unsigned long *", 0, 0, (void*)0, 0};
@@ -3185,10 +3258,16 @@ static swig_type_info _swigt__p_wchar_t = {"_p_wchar_t", "TagLib::wchar *|wchar_
3185
3258
 
3186
3259
  static swig_type_info *swig_type_initial[] = {
3187
3260
  &_swigt__p_TagLib__AudioProperties,
3261
+ &_swigt__p_TagLib__File,
3262
+ &_swigt__p_TagLib__ID3v2__FrameFactory,
3188
3263
  &_swigt__p_TagLib__ID3v2__Tag,
3264
+ &_swigt__p_TagLib__ID3v2__Version,
3265
+ &_swigt__p_TagLib__RIFF__File,
3189
3266
  &_swigt__p_TagLib__RIFF__WAV__File,
3190
3267
  &_swigt__p_TagLib__RIFF__WAV__Properties,
3268
+ &_swigt__p_TagLib__Tag,
3191
3269
  &_swigt__p_char,
3270
+ &_swigt__p_long_long,
3192
3271
  &_swigt__p_unsigned_char,
3193
3272
  &_swigt__p_unsigned_int,
3194
3273
  &_swigt__p_unsigned_long,
@@ -3196,10 +3275,16 @@ static swig_type_info *swig_type_initial[] = {
3196
3275
  };
3197
3276
 
3198
3277
  static swig_cast_info _swigc__p_TagLib__AudioProperties[] = { {&_swigt__p_TagLib__AudioProperties, 0, 0, 0}, {&_swigt__p_TagLib__RIFF__WAV__Properties, _p_TagLib__RIFF__WAV__PropertiesTo_p_TagLib__AudioProperties, 0, 0},{0, 0, 0, 0}};
3278
+ static swig_cast_info _swigc__p_TagLib__File[] = { {&_swigt__p_TagLib__File, 0, 0, 0}, {&_swigt__p_TagLib__RIFF__File, _p_TagLib__RIFF__FileTo_p_TagLib__File, 0, 0}, {&_swigt__p_TagLib__RIFF__WAV__File, _p_TagLib__RIFF__WAV__FileTo_p_TagLib__File, 0, 0},{0, 0, 0, 0}};
3279
+ static swig_cast_info _swigc__p_TagLib__ID3v2__FrameFactory[] = { {&_swigt__p_TagLib__ID3v2__FrameFactory, 0, 0, 0},{0, 0, 0, 0}};
3199
3280
  static swig_cast_info _swigc__p_TagLib__ID3v2__Tag[] = { {&_swigt__p_TagLib__ID3v2__Tag, 0, 0, 0},{0, 0, 0, 0}};
3281
+ static swig_cast_info _swigc__p_TagLib__ID3v2__Version[] = { {&_swigt__p_TagLib__ID3v2__Version, 0, 0, 0},{0, 0, 0, 0}};
3282
+ static swig_cast_info _swigc__p_TagLib__RIFF__File[] = { {&_swigt__p_TagLib__RIFF__File, 0, 0, 0}, {&_swigt__p_TagLib__RIFF__WAV__File, _p_TagLib__RIFF__WAV__FileTo_p_TagLib__RIFF__File, 0, 0},{0, 0, 0, 0}};
3200
3283
  static swig_cast_info _swigc__p_TagLib__RIFF__WAV__File[] = { {&_swigt__p_TagLib__RIFF__WAV__File, 0, 0, 0},{0, 0, 0, 0}};
3201
3284
  static swig_cast_info _swigc__p_TagLib__RIFF__WAV__Properties[] = { {&_swigt__p_TagLib__RIFF__WAV__Properties, 0, 0, 0},{0, 0, 0, 0}};
3285
+ static swig_cast_info _swigc__p_TagLib__Tag[] = { {&_swigt__p_TagLib__Tag, 0, 0, 0},{0, 0, 0, 0}};
3202
3286
  static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
3287
+ static swig_cast_info _swigc__p_long_long[] = { {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}};
3203
3288
  static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
3204
3289
  static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
3205
3290
  static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
@@ -3207,10 +3292,16 @@ static swig_cast_info _swigc__p_wchar_t[] = { {&_swigt__p_wchar_t, 0, 0, 0},{0,
3207
3292
 
3208
3293
  static swig_cast_info *swig_cast_initial[] = {
3209
3294
  _swigc__p_TagLib__AudioProperties,
3295
+ _swigc__p_TagLib__File,
3296
+ _swigc__p_TagLib__ID3v2__FrameFactory,
3210
3297
  _swigc__p_TagLib__ID3v2__Tag,
3298
+ _swigc__p_TagLib__ID3v2__Version,
3299
+ _swigc__p_TagLib__RIFF__File,
3211
3300
  _swigc__p_TagLib__RIFF__WAV__File,
3212
3301
  _swigc__p_TagLib__RIFF__WAV__Properties,
3302
+ _swigc__p_TagLib__Tag,
3213
3303
  _swigc__p_char,
3304
+ _swigc__p_long_long,
3214
3305
  _swigc__p_unsigned_char,
3215
3306
  _swigc__p_unsigned_int,
3216
3307
  _swigc__p_unsigned_long,
@@ -3480,7 +3571,6 @@ SWIGEXPORT void Init_taglib_wav(void) {
3480
3571
  SWIG_TypeClientData(SWIGTYPE_p_TagLib__RIFF__WAV__Properties, (void *) &SwigClassProperties);
3481
3572
  rb_define_alloc_func(SwigClassProperties.klass, _wrap_Properties_allocate);
3482
3573
  rb_define_method(SwigClassProperties.klass, "initialize", VALUEFUNC(_wrap_new_Properties), -1);
3483
- rb_define_method(SwigClassProperties.klass, "length_in_seconds", VALUEFUNC(_wrap_Properties_length_in_seconds), -1);
3484
3574
  rb_define_method(SwigClassProperties.klass, "length_in_milliseconds", VALUEFUNC(_wrap_Properties_length_in_milliseconds), -1);
3485
3575
  rb_define_method(SwigClassProperties.klass, "bitrate", VALUEFUNC(_wrap_Properties_bitrate), -1);
3486
3576
  rb_define_method(SwigClassProperties.klass, "sample_rate", VALUEFUNC(_wrap_Properties_sample_rate), -1);
@@ -2,9 +2,9 @@
2
2
 
3
3
  module TagLib
4
4
  module Version
5
- MAJOR = 1
6
- MINOR = 1
7
- PATCH = 3
5
+ MAJOR = 2
6
+ MINOR = 0
7
+ PATCH = 0
8
8
  BUILD = nil
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
data/tasks/ext.rake CHANGED
@@ -1,25 +1,19 @@
1
1
  # frozen-string-literal: true
2
2
 
3
+ require_relative 'build'
4
+
3
5
  # Extension tasks and cross-compiling
4
6
 
5
7
  host = 'i686-w64-mingw32'
6
- $plat = ENV['PLATFORM'] || 'i386-mingw32'
7
-
8
- taglib_version = ENV['TAGLIB_VERSION'] || '1.9.1'
9
- taglib = "taglib-#{taglib_version}"
10
-
11
- tmp = "#{Dir.pwd}/tmp"
12
- tmp_arch = "#{tmp}/#{$plat}"
13
8
  toolchain_file = "#{Dir.pwd}/ext/win.cmake"
14
- install_dir = "#{tmp_arch}/#{taglib}"
15
- install_dll = "#{install_dir}/bin/libtag.dll"
16
- install_so = "#{install_dir}/lib/libtag.so"
17
- $cross_config_options = ["--with-opt-dir=#{install_dir}"]
9
+ install_dll = "#{Build.install_dir}/bin/libtag.dll"
10
+ $cross_config_options = ["--with-opt-dir=#{Build.install_dir}"]
18
11
 
19
- taglib_url = "https://github.com/taglib/taglib/archive/v#{taglib_version}.tar.gz"
12
+ taglib_url = "https://github.com/taglib/taglib/archive/v#{Build.version}.tar.gz"
20
13
  taglib_options = ['-DCMAKE_BUILD_TYPE=Release',
21
14
  '-DBUILD_EXAMPLES=OFF',
22
15
  '-DBUILD_TESTS=OFF',
16
+ '-DBUILD_TESTING=OFF', # used since 1.13 instead of BUILD_TESTS
23
17
  '-DBUILD_BINDINGS=OFF', # 1.11 builds bindings by default
24
18
  '-DBUILD_SHARED_LIBS=ON', # 1.11 builds static by default
25
19
  '-DWITH_MP4=ON', # WITH_MP4, WITH_ASF only needed with taglib 1.7, will be default in 1.8
@@ -27,7 +21,7 @@ taglib_options = ['-DCMAKE_BUILD_TYPE=Release',
27
21
 
28
22
  def configure_cross_compile(ext)
29
23
  ext.cross_compile = true
30
- ext.cross_platform = $plat
24
+ ext.cross_platform = Build.plat
31
25
  ext.cross_config_options.concat($cross_config_options)
32
26
  ext.cross_compiling do |gem|
33
27
  gem.files << 'lib/libtag.dll'
@@ -75,43 +69,33 @@ task :cross do
75
69
  ENV['CXX'] = "#{host}-g++"
76
70
  end
77
71
 
78
- file "#{tmp_arch}/stage/lib/libtag.dll" => [install_dll] do |f|
72
+ file "#{Build.tmp_arch}/stage/lib/libtag.dll" => [install_dll] do |f|
79
73
  install install_dll, f
80
74
  end
81
75
 
82
- file install_dll => ["#{tmp}/#{taglib}"] do
83
- chdir "#{tmp}/#{taglib}" do
84
- sh %(cmake -DCMAKE_INSTALL_PREFIX=#{install_dir} -DCMAKE_TOOLCHAIN_FILE=#{toolchain_file} #{taglib_options})
76
+ file install_dll => [Build.source] do
77
+ chdir Build.source do
78
+ sh %(cmake -DCMAKE_INSTALL_PREFIX=#{Build.install_dir} -DCMAKE_TOOLCHAIN_FILE=#{toolchain_file} #{taglib_options})
85
79
  sh 'make VERBOSE=1'
86
80
  sh 'make install'
87
81
  end
88
82
  end
89
83
 
90
- task vendor: [install_so]
84
+ task vendor: [Build.library]
91
85
 
92
- file install_so => ["#{tmp_arch}/#{taglib}", "#{tmp_arch}/#{taglib}-build", "#{tmp}/#{taglib}"] do
93
- chdir "#{tmp_arch}/#{taglib}-build" do
94
- sh %(cmake -DCMAKE_INSTALL_PREFIX=#{install_dir} #{taglib_options} #{tmp}/#{taglib})
95
- sh 'make install VERBOSE=1'
86
+ file Build.library => [Build.install_dir, Build.build_dir, Build.source] do
87
+ chdir Build.build_dir do
88
+ sh %(cmake -DCMAKE_INSTALL_PREFIX=#{Build.install_dir} #{taglib_options} #{Build.source})
89
+ sh 'make install -j 4 VERBOSE=1'
96
90
  end
97
91
  end
98
92
 
99
- directory "#{tmp_arch}/#{taglib}"
100
- directory "#{tmp_arch}/#{taglib}-build"
93
+ directory Build.install_dir
94
+ directory Build.build_dir
95
+ directory Build.tmp
101
96
 
102
- file "#{tmp}/#{taglib}" => ["#{tmp}/#{taglib}.tar.gz"] do
103
- chdir tmp do
104
- sh "tar xzf #{taglib}.tar.gz"
105
- end
97
+ file Build.source do
98
+ sh "git clone --depth=1 --branch=v#{Build.version} https://github.com/taglib/taglib.git #{Build.source}"
99
+ sh "git -C #{Build.source} submodule init"
100
+ sh "git -C #{Build.source} submodule update --depth=1"
106
101
  end
107
-
108
- file "#{tmp}/#{taglib}.tar.gz" => [tmp] do |t|
109
- require 'open-uri'
110
- puts "Downloading #{taglib_url}"
111
-
112
- File.open(t.name, 'wb') do |f|
113
- IO.copy_stream(open(taglib_url), f)
114
- end
115
- end
116
-
117
- directory tmp
data/tasks/swig.rake CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen-string-literal: true
2
2
 
3
+ require_relative 'build'
4
+
3
5
  # Tasks for generating SWIG wrappers in ext
4
6
 
5
7
  # Execute SWIG for the specified extension.
@@ -11,9 +13,11 @@
11
13
  def run_swig(mod)
12
14
  swig = `which swig`.chomp
13
15
  swig = `which swig2.0`.chomp if swig.empty?
16
+ swiglib = `swig -swiglib`.chomp
17
+ abort 'swig failed' unless $?.success?
14
18
 
15
19
  # Standard search location for headers
16
- include_args = %w[-I/usr/local/include -I/usr/include]
20
+ include_args = "-I#{Build.install_dir}/include"
17
21
 
18
22
  if ENV.key?('TAGLIB_DIR')
19
23
  unless File.directory?(ENV['TAGLIB_DIR'])
@@ -21,14 +25,20 @@ def run_swig(mod)
21
25
  end
22
26
 
23
27
  # Push it in front to get it searched first.
24
- include_args.unshift("-I#{ENV['TAGLIB_DIR']}/include")
28
+ include_args = "-I#{ENV['TAGLIB_DIR']}/include"
25
29
  end
26
30
 
27
- sh "cd ext/#{mod} && #{swig} -c++ -ruby -autorename -initname #{mod} #{include_args.join(' ')} #{mod}.i"
31
+ Dir.chdir("ext/#{mod}") do
32
+ sh "#{swig} -c++ -ruby -autorename -initname #{mod} #{include_args} #{mod}.i"
33
+ wrap = "#{mod}_wrap.cxx"
34
+ wrapdata = File.read(wrap)
35
+ File.write(wrap, wrapdata.gsub(swiglib, '/swig'))
36
+ end
28
37
  end
29
38
 
30
39
  task swig:
31
- ['ext/taglib_base/taglib_base_wrap.cxx',
40
+ [Build.library,
41
+ 'ext/taglib_base/taglib_base_wrap.cxx',
32
42
  'ext/taglib_mpeg/taglib_mpeg_wrap.cxx',
33
43
  'ext/taglib_id3v1/taglib_id3v1_wrap.cxx',
34
44
  'ext/taglib_id3v2/taglib_id3v2_wrap.cxx',