taglib-ruby 0.7.1 → 1.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 (66) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGES.md +7 -0
  3. data/README.md +25 -10
  4. data/Rakefile +11 -1
  5. data/docs/taglib/aiff.rb +35 -3
  6. data/docs/taglib/base.rb +8 -1
  7. data/docs/taglib/flac.rb +60 -4
  8. data/docs/taglib/id3v1.rb +29 -0
  9. data/docs/taglib/id3v2.rb +1 -1
  10. data/docs/taglib/mp4.rb +124 -13
  11. data/docs/taglib/mpeg.rb +30 -1
  12. data/docs/taglib/ogg.rb +47 -5
  13. data/docs/taglib/vorbis.rb +1 -1
  14. data/docs/taglib/wav.rb +56 -3
  15. data/ext/extconf_common.rb +9 -2
  16. data/ext/taglib_aiff/taglib_aiff.i +16 -0
  17. data/ext/taglib_aiff/taglib_aiff_wrap.cxx +228 -58
  18. data/ext/taglib_base/includes.i +4 -4
  19. data/ext/taglib_base/taglib_base.i +24 -2
  20. data/ext/taglib_base/taglib_base_wrap.cxx +76 -51
  21. data/ext/taglib_flac/taglib_flac.i +14 -18
  22. data/ext/taglib_flac/taglib_flac_wrap.cxx +341 -799
  23. data/ext/taglib_flac_picture/extconf.rb +4 -0
  24. data/ext/taglib_flac_picture/includes.i +15 -0
  25. data/ext/taglib_flac_picture/taglib_flac_picture.i +15 -0
  26. data/ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx +3087 -0
  27. data/ext/taglib_id3v1/taglib_id3v1.i +19 -0
  28. data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +241 -58
  29. data/ext/taglib_id3v2/taglib_id3v2.i +52 -1
  30. data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +152 -155
  31. data/ext/taglib_mp4/taglib_mp4.i +100 -19
  32. data/ext/taglib_mp4/taglib_mp4_wrap.cxx +939 -148
  33. data/ext/taglib_mpeg/taglib_mpeg.i +11 -16
  34. data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +522 -208
  35. data/ext/taglib_ogg/taglib_ogg.i +11 -0
  36. data/ext/taglib_ogg/taglib_ogg_wrap.cxx +328 -57
  37. data/ext/taglib_vorbis/taglib_vorbis.i +8 -0
  38. data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +53 -22
  39. data/ext/taglib_wav/taglib_wav.i +24 -0
  40. data/ext/taglib_wav/taglib_wav_wrap.cxx +543 -198
  41. data/lib/taglib/mp4.rb +2 -1
  42. data/lib/taglib/version.rb +3 -3
  43. data/lib/taglib/wav.rb +4 -0
  44. data/taglib-ruby.gemspec +15 -9
  45. data/tasks/ext.rake +36 -15
  46. data/tasks/swig.rake +26 -2
  47. data/test/aiff_examples_test.rb +1 -1
  48. data/test/aiff_file_test.rb +12 -3
  49. data/test/data/vorbis-create.cpp +20 -1
  50. data/test/data/vorbis.oga +0 -0
  51. data/test/fileref_properties_test.rb +1 -1
  52. data/test/flac_file_test.rb +45 -30
  53. data/test/id3v1_genres_test.rb +23 -0
  54. data/test/id3v1_tag_test.rb +1 -0
  55. data/test/id3v2_tag_test.rb +6 -6
  56. data/test/id3v2_write_test.rb +10 -13
  57. data/test/mp4_file_test.rb +33 -4
  58. data/test/mp4_file_write_test.rb +5 -5
  59. data/test/mp4_items_test.rb +83 -29
  60. data/test/mpeg_file_test.rb +120 -7
  61. data/test/vorbis_file_test.rb +2 -2
  62. data/test/vorbis_tag_test.rb +61 -7
  63. data/test/wav_examples_test.rb +1 -1
  64. data/test/wav_file_test.rb +53 -41
  65. data/test/wav_file_write_test.rb +25 -0
  66. metadata +19 -9
@@ -1,6 +1,7 @@
1
1
  %module "TagLib::ID3v1"
2
2
  %{
3
3
  #include <taglib/id3v1tag.h>
4
+ #include <taglib/id3v1genres.h>
4
5
  %}
5
6
 
6
7
  %include "../taglib_base/includes.i"
@@ -8,4 +9,22 @@
8
9
 
9
10
  %include <taglib/id3v1tag.h>
10
11
 
12
+ %typemap(out) TagLib::ID3v1::GenreMap {
13
+ $result = taglib_id3v1_genre_map_to_ruby_hash($1);
14
+ }
15
+
16
+ %include <taglib/id3v1genres.h>
17
+
18
+ %{
19
+ VALUE taglib_id3v1_genre_map_to_ruby_hash(const TagLib::ID3v1::GenreMap &map) {
20
+ VALUE hsh = rb_hash_new();
21
+ for (TagLib::ID3v1::GenreMap::ConstIterator it = map.begin(); it != map.end(); it++) {
22
+ rb_hash_aset(hsh,
23
+ taglib_string_to_ruby_string(it->first),
24
+ INT2NUM(it->second));
25
+ }
26
+ return hsh;
27
+ }
28
+ %}
29
+
11
30
  // vim: set filetype=cpp sw=2 ts=2 expandtab:
@@ -1827,17 +1827,18 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
1827
1827
 
1828
1828
  /* -------- TYPES TABLE (BEGIN) -------- */
1829
1829
 
1830
- #define SWIGTYPE_p_TagLib__File swig_types[0]
1831
- #define SWIGTYPE_p_TagLib__ID3v1__StringHandler swig_types[1]
1832
- #define SWIGTYPE_p_TagLib__ID3v1__Tag swig_types[2]
1833
- #define SWIGTYPE_p_TagLib__Tag swig_types[3]
1834
- #define SWIGTYPE_p_char swig_types[4]
1835
- #define SWIGTYPE_p_unsigned_char swig_types[5]
1836
- #define SWIGTYPE_p_unsigned_int swig_types[6]
1837
- #define SWIGTYPE_p_unsigned_long swig_types[7]
1838
- #define SWIGTYPE_p_wchar_t swig_types[8]
1839
- static swig_type_info *swig_types[10];
1840
- static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0};
1830
+ #define SWIGTYPE_p_MapT_TagLib__String_int_t swig_types[0]
1831
+ #define SWIGTYPE_p_TagLib__File swig_types[1]
1832
+ #define SWIGTYPE_p_TagLib__ID3v1__StringHandler swig_types[2]
1833
+ #define SWIGTYPE_p_TagLib__ID3v1__Tag swig_types[3]
1834
+ #define SWIGTYPE_p_TagLib__Tag swig_types[4]
1835
+ #define SWIGTYPE_p_char swig_types[5]
1836
+ #define SWIGTYPE_p_unsigned_char swig_types[6]
1837
+ #define SWIGTYPE_p_unsigned_int swig_types[7]
1838
+ #define SWIGTYPE_p_unsigned_long swig_types[8]
1839
+ #define SWIGTYPE_p_wchar_t swig_types[9]
1840
+ static swig_type_info *swig_types[11];
1841
+ static swig_module_info swig_module = {swig_types, 10, 0, 0, 0, 0};
1841
1842
  #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1842
1843
  #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1843
1844
 
@@ -1864,6 +1865,7 @@ static VALUE mID3v1;
1864
1865
 
1865
1866
 
1866
1867
  #include <taglib/id3v1tag.h>
1868
+ #include <taglib/id3v1genres.h>
1867
1869
 
1868
1870
 
1869
1871
  #include <taglib/tstring.h>
@@ -1885,7 +1887,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
1885
1887
  if (byteVector.isNull()) {
1886
1888
  return Qnil;
1887
1889
  } else {
1888
- return rb_tainted_str_new(byteVector.data(), byteVector.size());
1890
+ return rb_str_new(byteVector.data(), byteVector.size());
1889
1891
  }
1890
1892
  }
1891
1893
 
@@ -1901,7 +1903,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
1901
1903
  if (string.isNull()) {
1902
1904
  return Qnil;
1903
1905
  } else {
1904
- VALUE result = rb_tainted_str_new2(string.toCString(true));
1906
+ VALUE result = rb_str_new2(string.toCString(true));
1905
1907
  ASSOCIATE_UTF8_ENCODING(result);
1906
1908
  return result;
1907
1909
  }
@@ -1941,9 +1943,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
1941
1943
  VALUE result;
1942
1944
  #ifdef _WIN32
1943
1945
  const char *s = (const char *) filename;
1944
- result = rb_tainted_str_new2(s);
1946
+ result = rb_str_new2(s);
1945
1947
  #else
1946
- result = rb_tainted_str_new2(filename);
1948
+ result = rb_str_new2(filename);
1947
1949
  #endif
1948
1950
  ASSOCIATE_FILESYSTEM_ENCODING(result);
1949
1951
  return result;
@@ -2135,8 +2137,75 @@ SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val)
2135
2137
  return res;
2136
2138
  }
2137
2139
 
2140
+
2141
+ SWIGINTERN int
2142
+ SWIG_AsVal_int (VALUE obj, int *val)
2143
+ {
2144
+ long v;
2145
+ int res = SWIG_AsVal_long (obj, &v);
2146
+ if (SWIG_IsOK(res)) {
2147
+ if ((v < INT_MIN || v > INT_MAX)) {
2148
+ return SWIG_OverflowError;
2149
+ } else {
2150
+ if (val) *val = static_cast< int >(v);
2151
+ }
2152
+ }
2153
+ return res;
2154
+ }
2155
+
2156
+
2157
+ SWIGINTERNINLINE VALUE
2158
+ SWIG_From_int (int value)
2159
+ {
2160
+ return SWIG_From_long (value);
2161
+ }
2162
+
2163
+
2164
+ VALUE taglib_id3v1_genre_map_to_ruby_hash(const TagLib::ID3v1::GenreMap &map) {
2165
+ VALUE hsh = rb_hash_new();
2166
+ for (TagLib::ID3v1::GenreMap::ConstIterator it = map.begin(); it != map.end(); it++) {
2167
+ rb_hash_aset(hsh,
2168
+ taglib_string_to_ruby_string(it->first),
2169
+ INT2NUM(it->second));
2170
+ }
2171
+ return hsh;
2172
+ }
2173
+
2138
2174
  static swig_class SwigClassStringHandler;
2139
2175
 
2176
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2177
+ SWIGINTERN VALUE
2178
+ _wrap_StringHandler_allocate(VALUE self) {
2179
+ #else
2180
+ SWIGINTERN VALUE
2181
+ _wrap_StringHandler_allocate(int argc, VALUE *argv, VALUE self) {
2182
+ #endif
2183
+
2184
+
2185
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__ID3v1__StringHandler);
2186
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2187
+ rb_obj_call_init(vresult, argc, argv);
2188
+ #endif
2189
+ return vresult;
2190
+ }
2191
+
2192
+
2193
+ SWIGINTERN VALUE
2194
+ _wrap_new_StringHandler(int argc, VALUE *argv, VALUE self) {
2195
+ TagLib::ID3v1::StringHandler *result = 0 ;
2196
+
2197
+ if ((argc < 0) || (argc > 0)) {
2198
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2199
+ }
2200
+ result = (TagLib::ID3v1::StringHandler *)new TagLib::ID3v1::StringHandler();
2201
+ DATA_PTR(self) = result;
2202
+ SWIG_RubyAddTracking(result, self);
2203
+ return self;
2204
+ fail:
2205
+ return Qnil;
2206
+ }
2207
+
2208
+
2140
2209
  SWIGINTERN VALUE
2141
2210
  _wrap_StringHandler_parse(int argc, VALUE *argv, VALUE self) {
2142
2211
  TagLib::ID3v1::StringHandler *arg1 = (TagLib::ID3v1::StringHandler *) 0 ;
@@ -2201,39 +2270,6 @@ fail:
2201
2270
  }
2202
2271
 
2203
2272
 
2204
- #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2205
- SWIGINTERN VALUE
2206
- _wrap_StringHandler_allocate(VALUE self) {
2207
- #else
2208
- SWIGINTERN VALUE
2209
- _wrap_StringHandler_allocate(int argc, VALUE *argv, VALUE self) {
2210
- #endif
2211
-
2212
-
2213
- VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_TagLib__ID3v1__StringHandler);
2214
- #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2215
- rb_obj_call_init(vresult, argc, argv);
2216
- #endif
2217
- return vresult;
2218
- }
2219
-
2220
-
2221
- SWIGINTERN VALUE
2222
- _wrap_new_StringHandler(int argc, VALUE *argv, VALUE self) {
2223
- TagLib::ID3v1::StringHandler *result = 0 ;
2224
-
2225
- if ((argc < 0) || (argc > 0)) {
2226
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2227
- }
2228
- result = (TagLib::ID3v1::StringHandler *)new TagLib::ID3v1::StringHandler();
2229
- DATA_PTR(self) = result;
2230
- SWIG_RubyAddTracking(result, self);
2231
- return self;
2232
- fail:
2233
- return Qnil;
2234
- }
2235
-
2236
-
2237
2273
  SWIGINTERN void
2238
2274
  free_TagLib_ID3v1_StringHandler(TagLib::ID3v1::StringHandler *arg1) {
2239
2275
  SWIG_RubyRemoveTracking(arg1);
@@ -2530,7 +2566,7 @@ _wrap_Tag_year(int argc, VALUE *argv, VALUE self) {
2530
2566
  TagLib::ID3v1::Tag *arg1 = (TagLib::ID3v1::Tag *) 0 ;
2531
2567
  void *argp1 = 0 ;
2532
2568
  int res1 = 0 ;
2533
- TagLib::uint result;
2569
+ unsigned int result;
2534
2570
  VALUE vresult = Qnil;
2535
2571
 
2536
2572
  if ((argc < 0) || (argc > 0)) {
@@ -2541,7 +2577,7 @@ _wrap_Tag_year(int argc, VALUE *argv, VALUE self) {
2541
2577
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::ID3v1::Tag const *","year", 1, self ));
2542
2578
  }
2543
2579
  arg1 = reinterpret_cast< TagLib::ID3v1::Tag * >(argp1);
2544
- result = (TagLib::uint)((TagLib::ID3v1::Tag const *)arg1)->year();
2580
+ result = (unsigned int)((TagLib::ID3v1::Tag const *)arg1)->year();
2545
2581
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2546
2582
  return vresult;
2547
2583
  fail:
@@ -2554,7 +2590,7 @@ _wrap_Tag_track(int argc, VALUE *argv, VALUE self) {
2554
2590
  TagLib::ID3v1::Tag *arg1 = (TagLib::ID3v1::Tag *) 0 ;
2555
2591
  void *argp1 = 0 ;
2556
2592
  int res1 = 0 ;
2557
- TagLib::uint result;
2593
+ unsigned int result;
2558
2594
  VALUE vresult = Qnil;
2559
2595
 
2560
2596
  if ((argc < 0) || (argc > 0)) {
@@ -2565,7 +2601,7 @@ _wrap_Tag_track(int argc, VALUE *argv, VALUE self) {
2565
2601
  SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::ID3v1::Tag const *","track", 1, self ));
2566
2602
  }
2567
2603
  arg1 = reinterpret_cast< TagLib::ID3v1::Tag * >(argp1);
2568
- result = (TagLib::uint)((TagLib::ID3v1::Tag const *)arg1)->track();
2604
+ result = (unsigned int)((TagLib::ID3v1::Tag const *)arg1)->track();
2569
2605
  vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2570
2606
  return vresult;
2571
2607
  fail:
@@ -2711,7 +2747,7 @@ fail:
2711
2747
  SWIGINTERN VALUE
2712
2748
  _wrap_Tag_yeare___(int argc, VALUE *argv, VALUE self) {
2713
2749
  TagLib::ID3v1::Tag *arg1 = (TagLib::ID3v1::Tag *) 0 ;
2714
- TagLib::uint arg2 ;
2750
+ unsigned int arg2 ;
2715
2751
  void *argp1 = 0 ;
2716
2752
  int res1 = 0 ;
2717
2753
  unsigned int val2 ;
@@ -2727,9 +2763,9 @@ _wrap_Tag_yeare___(int argc, VALUE *argv, VALUE self) {
2727
2763
  arg1 = reinterpret_cast< TagLib::ID3v1::Tag * >(argp1);
2728
2764
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
2729
2765
  if (!SWIG_IsOK(ecode2)) {
2730
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "TagLib::uint","setYear", 2, argv[0] ));
2766
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setYear", 2, argv[0] ));
2731
2767
  }
2732
- arg2 = static_cast< TagLib::uint >(val2);
2768
+ arg2 = static_cast< unsigned int >(val2);
2733
2769
  (arg1)->setYear(arg2);
2734
2770
  return Qnil;
2735
2771
  fail:
@@ -2740,7 +2776,7 @@ fail:
2740
2776
  SWIGINTERN VALUE
2741
2777
  _wrap_Tag_tracke___(int argc, VALUE *argv, VALUE self) {
2742
2778
  TagLib::ID3v1::Tag *arg1 = (TagLib::ID3v1::Tag *) 0 ;
2743
- TagLib::uint arg2 ;
2779
+ unsigned int arg2 ;
2744
2780
  void *argp1 = 0 ;
2745
2781
  int res1 = 0 ;
2746
2782
  unsigned int val2 ;
@@ -2756,9 +2792,9 @@ _wrap_Tag_tracke___(int argc, VALUE *argv, VALUE self) {
2756
2792
  arg1 = reinterpret_cast< TagLib::ID3v1::Tag * >(argp1);
2757
2793
  ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
2758
2794
  if (!SWIG_IsOK(ecode2)) {
2759
- SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "TagLib::uint","setTrack", 2, argv[0] ));
2795
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setTrack", 2, argv[0] ));
2760
2796
  }
2761
- arg2 = static_cast< TagLib::uint >(val2);
2797
+ arg2 = static_cast< unsigned int >(val2);
2762
2798
  (arg1)->setTrack(arg2);
2763
2799
  return Qnil;
2764
2800
  fail:
@@ -2766,6 +2802,59 @@ fail:
2766
2802
  }
2767
2803
 
2768
2804
 
2805
+ SWIGINTERN VALUE
2806
+ _wrap_Tag_genre_number(int argc, VALUE *argv, VALUE self) {
2807
+ TagLib::ID3v1::Tag *arg1 = (TagLib::ID3v1::Tag *) 0 ;
2808
+ void *argp1 = 0 ;
2809
+ int res1 = 0 ;
2810
+ unsigned int result;
2811
+ VALUE vresult = Qnil;
2812
+
2813
+ if ((argc < 0) || (argc > 0)) {
2814
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2815
+ }
2816
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__ID3v1__Tag, 0 | 0 );
2817
+ if (!SWIG_IsOK(res1)) {
2818
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::ID3v1::Tag const *","genreNumber", 1, self ));
2819
+ }
2820
+ arg1 = reinterpret_cast< TagLib::ID3v1::Tag * >(argp1);
2821
+ result = (unsigned int)((TagLib::ID3v1::Tag const *)arg1)->genreNumber();
2822
+ vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
2823
+ return vresult;
2824
+ fail:
2825
+ return Qnil;
2826
+ }
2827
+
2828
+
2829
+ SWIGINTERN VALUE
2830
+ _wrap_Tag_genre_numbere___(int argc, VALUE *argv, VALUE self) {
2831
+ TagLib::ID3v1::Tag *arg1 = (TagLib::ID3v1::Tag *) 0 ;
2832
+ unsigned int arg2 ;
2833
+ void *argp1 = 0 ;
2834
+ int res1 = 0 ;
2835
+ unsigned int val2 ;
2836
+ int ecode2 = 0 ;
2837
+
2838
+ if ((argc < 1) || (argc > 1)) {
2839
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2840
+ }
2841
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__ID3v1__Tag, 0 | 0 );
2842
+ if (!SWIG_IsOK(res1)) {
2843
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::ID3v1::Tag *","setGenreNumber", 1, self ));
2844
+ }
2845
+ arg1 = reinterpret_cast< TagLib::ID3v1::Tag * >(argp1);
2846
+ ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
2847
+ if (!SWIG_IsOK(ecode2)) {
2848
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setGenreNumber", 2, argv[0] ));
2849
+ }
2850
+ arg2 = static_cast< unsigned int >(val2);
2851
+ (arg1)->setGenreNumber(arg2);
2852
+ return Qnil;
2853
+ fail:
2854
+ return Qnil;
2855
+ }
2856
+
2857
+
2769
2858
  SWIGINTERN VALUE
2770
2859
  _wrap_Tag_string_handlere___(int argc, VALUE *argv, VALUE self) {
2771
2860
  TagLib::ID3v1::StringHandler *arg1 = (TagLib::ID3v1::StringHandler *) 0 ;
@@ -2787,12 +2876,97 @@ fail:
2787
2876
  }
2788
2877
 
2789
2878
 
2879
+ SWIGINTERN VALUE
2880
+ _wrap_genre_list(int argc, VALUE *argv, VALUE self) {
2881
+ TagLib::StringList result;
2882
+ VALUE vresult = Qnil;
2883
+
2884
+ if ((argc < 0) || (argc > 0)) {
2885
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2886
+ }
2887
+ result = TagLib::ID3v1::genreList();
2888
+ {
2889
+ vresult = taglib_string_list_to_ruby_array(result);
2890
+ }
2891
+ return vresult;
2892
+ fail:
2893
+ return Qnil;
2894
+ }
2895
+
2896
+
2897
+ SWIGINTERN VALUE
2898
+ _wrap_genre_map(int argc, VALUE *argv, VALUE self) {
2899
+ TagLib::ID3v1::GenreMap result;
2900
+ VALUE vresult = Qnil;
2901
+
2902
+ if ((argc < 0) || (argc > 0)) {
2903
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2904
+ }
2905
+ result = TagLib::ID3v1::genreMap();
2906
+ {
2907
+ vresult = taglib_id3v1_genre_map_to_ruby_hash(result);
2908
+ }
2909
+ return vresult;
2910
+ fail:
2911
+ return Qnil;
2912
+ }
2913
+
2914
+
2915
+ SWIGINTERN VALUE
2916
+ _wrap_genre(int argc, VALUE *argv, VALUE self) {
2917
+ int arg1 ;
2918
+ int val1 ;
2919
+ int ecode1 = 0 ;
2920
+ TagLib::String result;
2921
+ VALUE vresult = Qnil;
2922
+
2923
+ if ((argc < 1) || (argc > 1)) {
2924
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2925
+ }
2926
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2927
+ if (!SWIG_IsOK(ecode1)) {
2928
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","TagLib::ID3v1::genre", 1, argv[0] ));
2929
+ }
2930
+ arg1 = static_cast< int >(val1);
2931
+ result = TagLib::ID3v1::genre(arg1);
2932
+ {
2933
+ vresult = taglib_string_to_ruby_string(result);
2934
+ }
2935
+ return vresult;
2936
+ fail:
2937
+ return Qnil;
2938
+ }
2939
+
2940
+
2941
+ SWIGINTERN VALUE
2942
+ _wrap_genre_index(int argc, VALUE *argv, VALUE self) {
2943
+ TagLib::String *arg1 = 0 ;
2944
+ TagLib::String tmp1 ;
2945
+ int result;
2946
+ VALUE vresult = Qnil;
2947
+
2948
+ if ((argc < 1) || (argc > 1)) {
2949
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2950
+ }
2951
+ {
2952
+ tmp1 = ruby_string_to_taglib_string(argv[0]);
2953
+ arg1 = &tmp1;
2954
+ }
2955
+ result = (int)TagLib::ID3v1::genreIndex((TagLib::String const &)*arg1);
2956
+ vresult = SWIG_From_int(static_cast< int >(result));
2957
+ return vresult;
2958
+ fail:
2959
+ return Qnil;
2960
+ }
2961
+
2962
+
2790
2963
 
2791
2964
  /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
2792
2965
 
2793
2966
  static void *_p_TagLib__ID3v1__TagTo_p_TagLib__Tag(void *x, int *SWIGUNUSEDPARM(newmemory)) {
2794
2967
  return (void *)((TagLib::Tag *) ((TagLib::ID3v1::Tag *) x));
2795
2968
  }
2969
+ static swig_type_info _swigt__p_MapT_TagLib__String_int_t = {"_p_MapT_TagLib__String_int_t", "TagLib::ID3v1::GenreMap *|Map< TagLib::String,int > *", 0, 0, (void*)0, 0};
2796
2970
  static swig_type_info _swigt__p_TagLib__File = {"_p_TagLib__File", "TagLib::File *", 0, 0, (void*)0, 0};
2797
2971
  static swig_type_info _swigt__p_TagLib__ID3v1__StringHandler = {"_p_TagLib__ID3v1__StringHandler", "TagLib::ID3v1::StringHandler *", 0, 0, (void*)0, 0};
2798
2972
  static swig_type_info _swigt__p_TagLib__ID3v1__Tag = {"_p_TagLib__ID3v1__Tag", "TagLib::ID3v1::Tag *", 0, 0, (void*)0, 0};
@@ -2804,6 +2978,7 @@ static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "TagLib::ul
2804
2978
  static swig_type_info _swigt__p_wchar_t = {"_p_wchar_t", "TagLib::wchar *|wchar_t *", 0, 0, (void*)0, 0};
2805
2979
 
2806
2980
  static swig_type_info *swig_type_initial[] = {
2981
+ &_swigt__p_MapT_TagLib__String_int_t,
2807
2982
  &_swigt__p_TagLib__File,
2808
2983
  &_swigt__p_TagLib__ID3v1__StringHandler,
2809
2984
  &_swigt__p_TagLib__ID3v1__Tag,
@@ -2815,6 +2990,7 @@ static swig_type_info *swig_type_initial[] = {
2815
2990
  &_swigt__p_wchar_t,
2816
2991
  };
2817
2992
 
2993
+ static swig_cast_info _swigc__p_MapT_TagLib__String_int_t[] = { {&_swigt__p_MapT_TagLib__String_int_t, 0, 0, 0},{0, 0, 0, 0}};
2818
2994
  static swig_cast_info _swigc__p_TagLib__File[] = { {&_swigt__p_TagLib__File, 0, 0, 0},{0, 0, 0, 0}};
2819
2995
  static swig_cast_info _swigc__p_TagLib__ID3v1__StringHandler[] = { {&_swigt__p_TagLib__ID3v1__StringHandler, 0, 0, 0},{0, 0, 0, 0}};
2820
2996
  static swig_cast_info _swigc__p_TagLib__ID3v1__Tag[] = { {&_swigt__p_TagLib__ID3v1__Tag, 0, 0, 0},{0, 0, 0, 0}};
@@ -2826,6 +3002,7 @@ static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long,
2826
3002
  static swig_cast_info _swigc__p_wchar_t[] = { {&_swigt__p_wchar_t, 0, 0, 0},{0, 0, 0, 0}};
2827
3003
 
2828
3004
  static swig_cast_info *swig_cast_initial[] = {
3005
+ _swigc__p_MapT_TagLib__String_int_t,
2829
3006
  _swigc__p_TagLib__File,
2830
3007
  _swigc__p_TagLib__ID3v1__StringHandler,
2831
3008
  _swigc__p_TagLib__ID3v1__Tag,
@@ -3122,9 +3299,15 @@ SWIGEXPORT void Init_taglib_id3v1(void) {
3122
3299
  rb_define_method(SwigClassTag.klass, "genre=", VALUEFUNC(_wrap_Tag_genree___), -1);
3123
3300
  rb_define_method(SwigClassTag.klass, "year=", VALUEFUNC(_wrap_Tag_yeare___), -1);
3124
3301
  rb_define_method(SwigClassTag.klass, "track=", VALUEFUNC(_wrap_Tag_tracke___), -1);
3302
+ rb_define_method(SwigClassTag.klass, "genre_number", VALUEFUNC(_wrap_Tag_genre_number), -1);
3303
+ rb_define_method(SwigClassTag.klass, "genre_number=", VALUEFUNC(_wrap_Tag_genre_numbere___), -1);
3125
3304
  rb_define_singleton_method(SwigClassTag.klass, "string_handler=", VALUEFUNC(_wrap_Tag_string_handlere___), -1);
3126
3305
  SwigClassTag.mark = 0;
3127
3306
  SwigClassTag.destroy = (void (*)(void *)) free_TagLib_ID3v1_Tag;
3128
3307
  SwigClassTag.trackObjects = 1;
3308
+ rb_define_module_function(mID3v1, "genre_list", VALUEFUNC(_wrap_genre_list), -1);
3309
+ rb_define_module_function(mID3v1, "genre_map", VALUEFUNC(_wrap_genre_map), -1);
3310
+ rb_define_module_function(mID3v1, "genre", VALUEFUNC(_wrap_genre), -1);
3311
+ rb_define_module_function(mID3v1, "genre_index", VALUEFUNC(_wrap_genre_index), -1);
3129
3312
  }
3130
3313