taglib-ruby 0.7.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES.md +7 -0
- data/README.md +25 -10
- data/Rakefile +11 -1
- data/docs/taglib/aiff.rb +35 -3
- data/docs/taglib/base.rb +8 -1
- data/docs/taglib/flac.rb +60 -4
- data/docs/taglib/id3v1.rb +29 -0
- data/docs/taglib/id3v2.rb +1 -1
- data/docs/taglib/mp4.rb +124 -13
- data/docs/taglib/mpeg.rb +30 -1
- data/docs/taglib/ogg.rb +47 -5
- data/docs/taglib/vorbis.rb +1 -1
- data/docs/taglib/wav.rb +56 -3
- data/ext/extconf_common.rb +9 -2
- data/ext/taglib_aiff/taglib_aiff.i +16 -0
- data/ext/taglib_aiff/taglib_aiff_wrap.cxx +228 -58
- data/ext/taglib_base/includes.i +4 -4
- data/ext/taglib_base/taglib_base.i +24 -2
- data/ext/taglib_base/taglib_base_wrap.cxx +76 -51
- data/ext/taglib_flac/taglib_flac.i +14 -18
- data/ext/taglib_flac/taglib_flac_wrap.cxx +341 -799
- data/ext/taglib_flac_picture/extconf.rb +4 -0
- data/ext/taglib_flac_picture/includes.i +15 -0
- data/ext/taglib_flac_picture/taglib_flac_picture.i +15 -0
- data/ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx +3087 -0
- data/ext/taglib_id3v1/taglib_id3v1.i +19 -0
- data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +241 -58
- data/ext/taglib_id3v2/taglib_id3v2.i +52 -1
- data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +152 -155
- data/ext/taglib_mp4/taglib_mp4.i +100 -19
- data/ext/taglib_mp4/taglib_mp4_wrap.cxx +939 -148
- data/ext/taglib_mpeg/taglib_mpeg.i +11 -16
- data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +522 -208
- data/ext/taglib_ogg/taglib_ogg.i +11 -0
- data/ext/taglib_ogg/taglib_ogg_wrap.cxx +328 -57
- data/ext/taglib_vorbis/taglib_vorbis.i +8 -0
- data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +53 -22
- data/ext/taglib_wav/taglib_wav.i +24 -0
- data/ext/taglib_wav/taglib_wav_wrap.cxx +543 -198
- data/lib/taglib/mp4.rb +2 -1
- data/lib/taglib/version.rb +3 -3
- data/lib/taglib/wav.rb +4 -0
- data/taglib-ruby.gemspec +15 -9
- data/tasks/ext.rake +36 -15
- data/tasks/swig.rake +26 -2
- data/test/aiff_examples_test.rb +1 -1
- data/test/aiff_file_test.rb +12 -3
- data/test/data/vorbis-create.cpp +20 -1
- data/test/data/vorbis.oga +0 -0
- data/test/fileref_properties_test.rb +1 -1
- data/test/flac_file_test.rb +45 -30
- data/test/id3v1_genres_test.rb +23 -0
- data/test/id3v1_tag_test.rb +1 -0
- data/test/id3v2_tag_test.rb +6 -6
- data/test/id3v2_write_test.rb +10 -13
- data/test/mp4_file_test.rb +33 -4
- data/test/mp4_file_write_test.rb +5 -5
- data/test/mp4_items_test.rb +83 -29
- data/test/mpeg_file_test.rb +120 -7
- data/test/vorbis_file_test.rb +2 -2
- data/test/vorbis_tag_test.rb +61 -7
- data/test/wav_examples_test.rb +1 -1
- data/test/wav_file_test.rb +53 -41
- data/test/wav_file_write_test.rb +25 -0
- metadata +19 -9
data/ext/taglib_base/includes.i
CHANGED
@@ -36,7 +36,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
|
|
36
36
|
if (byteVector.isNull()) {
|
37
37
|
return Qnil;
|
38
38
|
} else {
|
39
|
-
return
|
39
|
+
return rb_str_new(byteVector.data(), byteVector.size());
|
40
40
|
}
|
41
41
|
}
|
42
42
|
|
@@ -52,7 +52,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
|
|
52
52
|
if (string.isNull()) {
|
53
53
|
return Qnil;
|
54
54
|
} else {
|
55
|
-
VALUE result =
|
55
|
+
VALUE result = rb_str_new2(string.toCString(true));
|
56
56
|
ASSOCIATE_UTF8_ENCODING(result);
|
57
57
|
return result;
|
58
58
|
}
|
@@ -92,9 +92,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
|
|
92
92
|
VALUE result;
|
93
93
|
#ifdef _WIN32
|
94
94
|
const char *s = (const char *) filename;
|
95
|
-
result =
|
95
|
+
result = rb_str_new2(s);
|
96
96
|
#else
|
97
|
-
result =
|
97
|
+
result = rb_str_new2(filename);
|
98
98
|
#endif
|
99
99
|
ASSOCIATE_FILESYSTEM_ENCODING(result);
|
100
100
|
return result;
|
@@ -32,11 +32,12 @@ namespace TagLib {
|
|
32
32
|
|
33
33
|
// Rename setters to Ruby convention (combining SWIG rename functions
|
34
34
|
// does not seem to be possible, thus resort to some magic)
|
35
|
-
|
35
|
+
// setFoo -> foo=
|
36
|
+
%rename("%(command: perl -e \"print lc(join('_', split(/(?=[A-Z])/, substr(@ARGV[0], 3)))), '='\" )s",
|
36
37
|
regexmatch$name="^set[A-Z]") "";
|
37
38
|
|
38
39
|
// isFoo -> foo?
|
39
|
-
%rename("%(command:
|
40
|
+
%rename("%(command: perl -e \"print lc(join('_', split(/(?=[A-Z])/, substr(@ARGV[0], 2)))), '?'\" )s",
|
40
41
|
regexmatch$name="^is[A-Z]") "";
|
41
42
|
|
42
43
|
// ByteVector
|
@@ -93,15 +94,36 @@ namespace TagLib {
|
|
93
94
|
|
94
95
|
%ignore TagLib::List::operator[];
|
95
96
|
%ignore TagLib::List::operator=;
|
97
|
+
%ignore TagLib::List::operator!=;
|
96
98
|
%include <taglib/tlist.h>
|
97
99
|
|
100
|
+
// Ignore the unified property interface.
|
101
|
+
%ignore TagLib::Tag::properties;
|
102
|
+
%ignore TagLib::Tag::setProperties;
|
103
|
+
%ignore TagLib::Tag::removeUnsupportedProperties;
|
104
|
+
|
98
105
|
%include <taglib/tag.h>
|
99
106
|
|
107
|
+
%ignore TagLib::AudioProperties::length; // Deprecated.
|
100
108
|
%include <taglib/audioproperties.h>
|
101
109
|
|
102
110
|
%ignore TagLib::FileName;
|
111
|
+
|
112
|
+
// Ignore the unified property interface.
|
113
|
+
%ignore TagLib::File::properties;
|
114
|
+
%ignore TagLib::File::setProperties;
|
115
|
+
%ignore TagLib::File::removeUnsupportedProperties;
|
116
|
+
|
103
117
|
%include <taglib/tfile.h>
|
104
118
|
|
119
|
+
// Ignore IOStream and all the constructors using it.
|
120
|
+
%ignore IOStream;
|
121
|
+
%ignore TagLib::FileRef::FileRef(IOStream*, bool, AudioProperties::ReadStyle);
|
122
|
+
%ignore TagLib::FileRef::FileRef(IOStream*, bool);
|
123
|
+
%ignore TagLib::FileRef::FileRef(IOStream*);
|
124
|
+
|
125
|
+
%ignore TagLib::FileRef::swap; // Only useful internally.
|
126
|
+
|
105
127
|
%ignore TagLib::FileRef::operator=;
|
106
128
|
%ignore TagLib::FileRef::operator!=;
|
107
129
|
%warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) TagLib::FileRef::FileTypeResolver;
|
@@ -1894,7 +1894,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
|
|
1894
1894
|
if (byteVector.isNull()) {
|
1895
1895
|
return Qnil;
|
1896
1896
|
} else {
|
1897
|
-
return
|
1897
|
+
return rb_str_new(byteVector.data(), byteVector.size());
|
1898
1898
|
}
|
1899
1899
|
}
|
1900
1900
|
|
@@ -1910,7 +1910,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
|
|
1910
1910
|
if (string.isNull()) {
|
1911
1911
|
return Qnil;
|
1912
1912
|
} else {
|
1913
|
-
VALUE result =
|
1913
|
+
VALUE result = rb_str_new2(string.toCString(true));
|
1914
1914
|
ASSOCIATE_UTF8_ENCODING(result);
|
1915
1915
|
return result;
|
1916
1916
|
}
|
@@ -1950,9 +1950,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
|
|
1950
1950
|
VALUE result;
|
1951
1951
|
#ifdef _WIN32
|
1952
1952
|
const char *s = (const char *) filename;
|
1953
|
-
result =
|
1953
|
+
result = rb_str_new2(s);
|
1954
1954
|
#else
|
1955
|
-
result =
|
1955
|
+
result = rb_str_new2(filename);
|
1956
1956
|
#endif
|
1957
1957
|
ASSOCIATE_FILESYSTEM_ENCODING(result);
|
1958
1958
|
return result;
|
@@ -2403,7 +2403,7 @@ _wrap_Tag_year(int argc, VALUE *argv, VALUE self) {
|
|
2403
2403
|
TagLib::Tag *arg1 = (TagLib::Tag *) 0 ;
|
2404
2404
|
void *argp1 = 0 ;
|
2405
2405
|
int res1 = 0 ;
|
2406
|
-
|
2406
|
+
unsigned int result;
|
2407
2407
|
VALUE vresult = Qnil;
|
2408
2408
|
|
2409
2409
|
if ((argc < 0) || (argc > 0)) {
|
@@ -2414,7 +2414,7 @@ _wrap_Tag_year(int argc, VALUE *argv, VALUE self) {
|
|
2414
2414
|
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::Tag const *","year", 1, self ));
|
2415
2415
|
}
|
2416
2416
|
arg1 = reinterpret_cast< TagLib::Tag * >(argp1);
|
2417
|
-
result = (
|
2417
|
+
result = (unsigned int)((TagLib::Tag const *)arg1)->year();
|
2418
2418
|
vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
2419
2419
|
return vresult;
|
2420
2420
|
fail:
|
@@ -2427,7 +2427,7 @@ _wrap_Tag_track(int argc, VALUE *argv, VALUE self) {
|
|
2427
2427
|
TagLib::Tag *arg1 = (TagLib::Tag *) 0 ;
|
2428
2428
|
void *argp1 = 0 ;
|
2429
2429
|
int res1 = 0 ;
|
2430
|
-
|
2430
|
+
unsigned int result;
|
2431
2431
|
VALUE vresult = Qnil;
|
2432
2432
|
|
2433
2433
|
if ((argc < 0) || (argc > 0)) {
|
@@ -2438,7 +2438,7 @@ _wrap_Tag_track(int argc, VALUE *argv, VALUE self) {
|
|
2438
2438
|
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::Tag const *","track", 1, self ));
|
2439
2439
|
}
|
2440
2440
|
arg1 = reinterpret_cast< TagLib::Tag * >(argp1);
|
2441
|
-
result = (
|
2441
|
+
result = (unsigned int)((TagLib::Tag const *)arg1)->track();
|
2442
2442
|
vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
2443
2443
|
return vresult;
|
2444
2444
|
fail:
|
@@ -2584,7 +2584,7 @@ fail:
|
|
2584
2584
|
SWIGINTERN VALUE
|
2585
2585
|
_wrap_Tag_yeare___(int argc, VALUE *argv, VALUE self) {
|
2586
2586
|
TagLib::Tag *arg1 = (TagLib::Tag *) 0 ;
|
2587
|
-
|
2587
|
+
unsigned int arg2 ;
|
2588
2588
|
void *argp1 = 0 ;
|
2589
2589
|
int res1 = 0 ;
|
2590
2590
|
unsigned int val2 ;
|
@@ -2600,9 +2600,9 @@ _wrap_Tag_yeare___(int argc, VALUE *argv, VALUE self) {
|
|
2600
2600
|
arg1 = reinterpret_cast< TagLib::Tag * >(argp1);
|
2601
2601
|
ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
|
2602
2602
|
if (!SWIG_IsOK(ecode2)) {
|
2603
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "
|
2603
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setYear", 2, argv[0] ));
|
2604
2604
|
}
|
2605
|
-
arg2 = static_cast<
|
2605
|
+
arg2 = static_cast< unsigned int >(val2);
|
2606
2606
|
(arg1)->setYear(arg2);
|
2607
2607
|
return Qnil;
|
2608
2608
|
fail:
|
@@ -2613,7 +2613,7 @@ fail:
|
|
2613
2613
|
SWIGINTERN VALUE
|
2614
2614
|
_wrap_Tag_tracke___(int argc, VALUE *argv, VALUE self) {
|
2615
2615
|
TagLib::Tag *arg1 = (TagLib::Tag *) 0 ;
|
2616
|
-
|
2616
|
+
unsigned int arg2 ;
|
2617
2617
|
void *argp1 = 0 ;
|
2618
2618
|
int res1 = 0 ;
|
2619
2619
|
unsigned int val2 ;
|
@@ -2629,9 +2629,9 @@ _wrap_Tag_tracke___(int argc, VALUE *argv, VALUE self) {
|
|
2629
2629
|
arg1 = reinterpret_cast< TagLib::Tag * >(argp1);
|
2630
2630
|
ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
|
2631
2631
|
if (!SWIG_IsOK(ecode2)) {
|
2632
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "
|
2632
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned int","setTrack", 2, argv[0] ));
|
2633
2633
|
}
|
2634
|
-
arg2 = static_cast<
|
2634
|
+
arg2 = static_cast< unsigned int >(val2);
|
2635
2635
|
(arg1)->setTrack(arg2);
|
2636
2636
|
return Qnil;
|
2637
2637
|
fail:
|
@@ -2792,7 +2792,7 @@ free_TagLib_AudioProperties(TagLib::AudioProperties *arg1) {
|
|
2792
2792
|
}
|
2793
2793
|
|
2794
2794
|
SWIGINTERN VALUE
|
2795
|
-
|
2795
|
+
_wrap_AudioProperties_length_in_seconds(int argc, VALUE *argv, VALUE self) {
|
2796
2796
|
TagLib::AudioProperties *arg1 = (TagLib::AudioProperties *) 0 ;
|
2797
2797
|
void *argp1 = 0 ;
|
2798
2798
|
int res1 = 0 ;
|
@@ -2804,10 +2804,34 @@ _wrap_AudioProperties_length(int argc, VALUE *argv, VALUE self) {
|
|
2804
2804
|
}
|
2805
2805
|
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__AudioProperties, 0 | 0 );
|
2806
2806
|
if (!SWIG_IsOK(res1)) {
|
2807
|
-
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::AudioProperties const *","
|
2807
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::AudioProperties const *","lengthInSeconds", 1, self ));
|
2808
2808
|
}
|
2809
2809
|
arg1 = reinterpret_cast< TagLib::AudioProperties * >(argp1);
|
2810
|
-
result = (int)((TagLib::AudioProperties const *)arg1)->
|
2810
|
+
result = (int)((TagLib::AudioProperties const *)arg1)->lengthInSeconds();
|
2811
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
2812
|
+
return vresult;
|
2813
|
+
fail:
|
2814
|
+
return Qnil;
|
2815
|
+
}
|
2816
|
+
|
2817
|
+
|
2818
|
+
SWIGINTERN VALUE
|
2819
|
+
_wrap_AudioProperties_length_in_milliseconds(int argc, VALUE *argv, VALUE self) {
|
2820
|
+
TagLib::AudioProperties *arg1 = (TagLib::AudioProperties *) 0 ;
|
2821
|
+
void *argp1 = 0 ;
|
2822
|
+
int res1 = 0 ;
|
2823
|
+
int result;
|
2824
|
+
VALUE vresult = Qnil;
|
2825
|
+
|
2826
|
+
if ((argc < 0) || (argc > 0)) {
|
2827
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2828
|
+
}
|
2829
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__AudioProperties, 0 | 0 );
|
2830
|
+
if (!SWIG_IsOK(res1)) {
|
2831
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::AudioProperties const *","lengthInMilliseconds", 1, self ));
|
2832
|
+
}
|
2833
|
+
arg1 = reinterpret_cast< TagLib::AudioProperties * >(argp1);
|
2834
|
+
result = (int)((TagLib::AudioProperties const *)arg1)->lengthInMilliseconds();
|
2811
2835
|
vresult = SWIG_From_int(static_cast< int >(result));
|
2812
2836
|
return vresult;
|
2813
2837
|
fail:
|
@@ -2900,7 +2924,7 @@ _wrap_File_name(int argc, VALUE *argv, VALUE self) {
|
|
2900
2924
|
TagLib::File *arg1 = (TagLib::File *) 0 ;
|
2901
2925
|
void *argp1 = 0 ;
|
2902
2926
|
int res1 = 0 ;
|
2903
|
-
|
2927
|
+
TagLib::FileName result;
|
2904
2928
|
VALUE vresult = Qnil;
|
2905
2929
|
|
2906
2930
|
if ((argc < 0) || (argc > 0)) {
|
@@ -2996,7 +3020,7 @@ fail:
|
|
2996
3020
|
SWIGINTERN VALUE
|
2997
3021
|
_wrap_File_read_block(int argc, VALUE *argv, VALUE self) {
|
2998
3022
|
TagLib::File *arg1 = (TagLib::File *) 0 ;
|
2999
|
-
|
3023
|
+
unsigned long arg2 ;
|
3000
3024
|
void *argp1 = 0 ;
|
3001
3025
|
int res1 = 0 ;
|
3002
3026
|
unsigned long val2 ;
|
@@ -3014,9 +3038,9 @@ _wrap_File_read_block(int argc, VALUE *argv, VALUE self) {
|
|
3014
3038
|
arg1 = reinterpret_cast< TagLib::File * >(argp1);
|
3015
3039
|
ecode2 = SWIG_AsVal_unsigned_SS_long(argv[0], &val2);
|
3016
3040
|
if (!SWIG_IsOK(ecode2)) {
|
3017
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "
|
3041
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned long","readBlock", 2, argv[0] ));
|
3018
3042
|
}
|
3019
|
-
arg2 = static_cast<
|
3043
|
+
arg2 = static_cast< unsigned long >(val2);
|
3020
3044
|
result = (arg1)->readBlock(arg2);
|
3021
3045
|
{
|
3022
3046
|
vresult = taglib_bytevector_to_ruby_string(result);
|
@@ -3059,7 +3083,7 @@ fail:
|
|
3059
3083
|
Document-method: TagLib::File.find
|
3060
3084
|
|
3061
3085
|
call-seq:
|
3062
|
-
find(pattern, fromOffset=0, before=ByteVector
|
3086
|
+
find(pattern, fromOffset=0, before=TagLib::ByteVector()) -> long
|
3063
3087
|
find(pattern, fromOffset=0) -> long
|
3064
3088
|
find(pattern) -> long
|
3065
3089
|
|
@@ -3458,8 +3482,8 @@ SWIGINTERN VALUE
|
|
3458
3482
|
_wrap_File_insert__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
3459
3483
|
TagLib::File *arg1 = (TagLib::File *) 0 ;
|
3460
3484
|
TagLib::ByteVector *arg2 = 0 ;
|
3461
|
-
|
3462
|
-
|
3485
|
+
unsigned long arg3 ;
|
3486
|
+
unsigned long arg4 ;
|
3463
3487
|
void *argp1 = 0 ;
|
3464
3488
|
int res1 = 0 ;
|
3465
3489
|
TagLib::ByteVector tmp2 ;
|
@@ -3482,14 +3506,14 @@ _wrap_File_insert__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
|
3482
3506
|
}
|
3483
3507
|
ecode3 = SWIG_AsVal_unsigned_SS_long(argv[1], &val3);
|
3484
3508
|
if (!SWIG_IsOK(ecode3)) {
|
3485
|
-
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "
|
3509
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned long","insert", 3, argv[1] ));
|
3486
3510
|
}
|
3487
|
-
arg3 = static_cast<
|
3511
|
+
arg3 = static_cast< unsigned long >(val3);
|
3488
3512
|
ecode4 = SWIG_AsVal_unsigned_SS_long(argv[2], &val4);
|
3489
3513
|
if (!SWIG_IsOK(ecode4)) {
|
3490
|
-
SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "
|
3514
|
+
SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned long","insert", 4, argv[2] ));
|
3491
3515
|
}
|
3492
|
-
arg4 = static_cast<
|
3516
|
+
arg4 = static_cast< unsigned long >(val4);
|
3493
3517
|
(arg1)->insert((TagLib::ByteVector const &)*arg2,arg3,arg4);
|
3494
3518
|
return Qnil;
|
3495
3519
|
fail:
|
@@ -3501,7 +3525,7 @@ SWIGINTERN VALUE
|
|
3501
3525
|
_wrap_File_insert__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
3502
3526
|
TagLib::File *arg1 = (TagLib::File *) 0 ;
|
3503
3527
|
TagLib::ByteVector *arg2 = 0 ;
|
3504
|
-
|
3528
|
+
unsigned long arg3 ;
|
3505
3529
|
void *argp1 = 0 ;
|
3506
3530
|
int res1 = 0 ;
|
3507
3531
|
TagLib::ByteVector tmp2 ;
|
@@ -3522,9 +3546,9 @@ _wrap_File_insert__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
|
3522
3546
|
}
|
3523
3547
|
ecode3 = SWIG_AsVal_unsigned_SS_long(argv[1], &val3);
|
3524
3548
|
if (!SWIG_IsOK(ecode3)) {
|
3525
|
-
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "
|
3549
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned long","insert", 3, argv[1] ));
|
3526
3550
|
}
|
3527
|
-
arg3 = static_cast<
|
3551
|
+
arg3 = static_cast< unsigned long >(val3);
|
3528
3552
|
(arg1)->insert((TagLib::ByteVector const &)*arg2,arg3);
|
3529
3553
|
return Qnil;
|
3530
3554
|
fail:
|
@@ -3630,8 +3654,8 @@ SWIGINTERN VALUE _wrap_File_insert(int nargs, VALUE *args, VALUE self) {
|
|
3630
3654
|
|
3631
3655
|
fail:
|
3632
3656
|
Ruby_Format_OverloadedError( argc, 5, "File.insert",
|
3633
|
-
" void File.insert(TagLib::ByteVector const &data,
|
3634
|
-
" void File.insert(TagLib::ByteVector const &data,
|
3657
|
+
" void File.insert(TagLib::ByteVector const &data, unsigned long start, unsigned long replace)\n"
|
3658
|
+
" void File.insert(TagLib::ByteVector const &data, unsigned long start)\n"
|
3635
3659
|
" void File.insert(TagLib::ByteVector const &data)\n");
|
3636
3660
|
|
3637
3661
|
return Qnil;
|
@@ -3641,8 +3665,8 @@ fail:
|
|
3641
3665
|
SWIGINTERN VALUE
|
3642
3666
|
_wrap_File_remove_block__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
3643
3667
|
TagLib::File *arg1 = (TagLib::File *) 0 ;
|
3644
|
-
|
3645
|
-
|
3668
|
+
unsigned long arg2 ;
|
3669
|
+
unsigned long arg3 ;
|
3646
3670
|
void *argp1 = 0 ;
|
3647
3671
|
int res1 = 0 ;
|
3648
3672
|
unsigned long val2 ;
|
@@ -3660,14 +3684,14 @@ _wrap_File_remove_block__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
|
3660
3684
|
arg1 = reinterpret_cast< TagLib::File * >(argp1);
|
3661
3685
|
ecode2 = SWIG_AsVal_unsigned_SS_long(argv[0], &val2);
|
3662
3686
|
if (!SWIG_IsOK(ecode2)) {
|
3663
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "
|
3687
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned long","removeBlock", 2, argv[0] ));
|
3664
3688
|
}
|
3665
|
-
arg2 = static_cast<
|
3689
|
+
arg2 = static_cast< unsigned long >(val2);
|
3666
3690
|
ecode3 = SWIG_AsVal_unsigned_SS_long(argv[1], &val3);
|
3667
3691
|
if (!SWIG_IsOK(ecode3)) {
|
3668
|
-
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "
|
3692
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "unsigned long","removeBlock", 3, argv[1] ));
|
3669
3693
|
}
|
3670
|
-
arg3 = static_cast<
|
3694
|
+
arg3 = static_cast< unsigned long >(val3);
|
3671
3695
|
(arg1)->removeBlock(arg2,arg3);
|
3672
3696
|
return Qnil;
|
3673
3697
|
fail:
|
@@ -3678,7 +3702,7 @@ fail:
|
|
3678
3702
|
SWIGINTERN VALUE
|
3679
3703
|
_wrap_File_remove_block__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
3680
3704
|
TagLib::File *arg1 = (TagLib::File *) 0 ;
|
3681
|
-
|
3705
|
+
unsigned long arg2 ;
|
3682
3706
|
void *argp1 = 0 ;
|
3683
3707
|
int res1 = 0 ;
|
3684
3708
|
unsigned long val2 ;
|
@@ -3694,9 +3718,9 @@ _wrap_File_remove_block__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
|
3694
3718
|
arg1 = reinterpret_cast< TagLib::File * >(argp1);
|
3695
3719
|
ecode2 = SWIG_AsVal_unsigned_SS_long(argv[0], &val2);
|
3696
3720
|
if (!SWIG_IsOK(ecode2)) {
|
3697
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "
|
3721
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned long","removeBlock", 2, argv[0] ));
|
3698
3722
|
}
|
3699
|
-
arg2 = static_cast<
|
3723
|
+
arg2 = static_cast< unsigned long >(val2);
|
3700
3724
|
(arg1)->removeBlock(arg2);
|
3701
3725
|
return Qnil;
|
3702
3726
|
fail:
|
@@ -3784,8 +3808,8 @@ SWIGINTERN VALUE _wrap_File_remove_block(int nargs, VALUE *args, VALUE self) {
|
|
3784
3808
|
|
3785
3809
|
fail:
|
3786
3810
|
Ruby_Format_OverloadedError( argc, 4, "File.remove_block",
|
3787
|
-
" void File.remove_block(
|
3788
|
-
" void File.remove_block(
|
3811
|
+
" void File.remove_block(unsigned long start, unsigned long length)\n"
|
3812
|
+
" void File.remove_block(unsigned long start)\n"
|
3789
3813
|
" void File.remove_block()\n");
|
3790
3814
|
|
3791
3815
|
return Qnil;
|
@@ -4130,7 +4154,7 @@ fail:
|
|
4130
4154
|
|
4131
4155
|
SWIGINTERN VALUE
|
4132
4156
|
_wrap_new_FileRef__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
4133
|
-
|
4157
|
+
TagLib::FileName arg1 ;
|
4134
4158
|
bool arg2 ;
|
4135
4159
|
TagLib::AudioProperties::ReadStyle arg3 ;
|
4136
4160
|
bool val2 ;
|
@@ -4169,7 +4193,7 @@ fail:
|
|
4169
4193
|
|
4170
4194
|
SWIGINTERN VALUE
|
4171
4195
|
_wrap_new_FileRef__SWIG_2(int argc, VALUE *argv, VALUE self) {
|
4172
|
-
|
4196
|
+
TagLib::FileName arg1 ;
|
4173
4197
|
bool arg2 ;
|
4174
4198
|
bool val2 ;
|
4175
4199
|
int ecode2 = 0 ;
|
@@ -4200,7 +4224,7 @@ fail:
|
|
4200
4224
|
|
4201
4225
|
SWIGINTERN VALUE
|
4202
4226
|
_wrap_new_FileRef__SWIG_3(int argc, VALUE *argv, VALUE self) {
|
4203
|
-
|
4227
|
+
TagLib::FileName arg1 ;
|
4204
4228
|
TagLib::FileRef *result = 0 ;
|
4205
4229
|
|
4206
4230
|
if ((argc < 1) || (argc > 1)) {
|
@@ -4590,7 +4614,7 @@ fail:
|
|
4590
4614
|
|
4591
4615
|
SWIGINTERN VALUE
|
4592
4616
|
_wrap_FileRef_create__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
4593
|
-
|
4617
|
+
TagLib::FileName arg1 ;
|
4594
4618
|
bool arg2 ;
|
4595
4619
|
TagLib::AudioProperties::ReadStyle arg3 ;
|
4596
4620
|
bool val2 ;
|
@@ -4629,7 +4653,7 @@ fail:
|
|
4629
4653
|
|
4630
4654
|
SWIGINTERN VALUE
|
4631
4655
|
_wrap_FileRef_create__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
4632
|
-
|
4656
|
+
TagLib::FileName arg1 ;
|
4633
4657
|
bool arg2 ;
|
4634
4658
|
bool val2 ;
|
4635
4659
|
int ecode2 = 0 ;
|
@@ -4660,7 +4684,7 @@ fail:
|
|
4660
4684
|
|
4661
4685
|
SWIGINTERN VALUE
|
4662
4686
|
_wrap_FileRef_create__SWIG_2(int argc, VALUE *argv, VALUE self) {
|
4663
|
-
|
4687
|
+
TagLib::FileName arg1 ;
|
4664
4688
|
TagLib::File *result = 0 ;
|
4665
4689
|
VALUE vresult = Qnil;
|
4666
4690
|
|
@@ -5118,7 +5142,8 @@ SWIGEXPORT void Init_taglib_base(void) {
|
|
5118
5142
|
rb_define_const(SwigClassAudioProperties.klass, "Fast", SWIG_From_int(static_cast< int >(TagLib::AudioProperties::Fast)));
|
5119
5143
|
rb_define_const(SwigClassAudioProperties.klass, "Average", SWIG_From_int(static_cast< int >(TagLib::AudioProperties::Average)));
|
5120
5144
|
rb_define_const(SwigClassAudioProperties.klass, "Accurate", SWIG_From_int(static_cast< int >(TagLib::AudioProperties::Accurate)));
|
5121
|
-
rb_define_method(SwigClassAudioProperties.klass, "
|
5145
|
+
rb_define_method(SwigClassAudioProperties.klass, "length_in_seconds", VALUEFUNC(_wrap_AudioProperties_length_in_seconds), -1);
|
5146
|
+
rb_define_method(SwigClassAudioProperties.klass, "length_in_milliseconds", VALUEFUNC(_wrap_AudioProperties_length_in_milliseconds), -1);
|
5122
5147
|
rb_define_method(SwigClassAudioProperties.klass, "bitrate", VALUEFUNC(_wrap_AudioProperties_bitrate), -1);
|
5123
5148
|
rb_define_method(SwigClassAudioProperties.klass, "sample_rate", VALUEFUNC(_wrap_AudioProperties_sample_rate), -1);
|
5124
5149
|
rb_define_method(SwigClassAudioProperties.klass, "channels", VALUEFUNC(_wrap_AudioProperties_channels), -1);
|
@@ -3,45 +3,41 @@
|
|
3
3
|
#include <taglib/taglib.h>
|
4
4
|
#include <taglib/flacfile.h>
|
5
5
|
#include <taglib/flacproperties.h>
|
6
|
-
#include <taglib/flacpicture.h>
|
7
6
|
#include <taglib/id3v1tag.h>
|
8
7
|
#include <taglib/id3v2tag.h>
|
9
8
|
%}
|
10
9
|
|
11
10
|
%include "../taglib_base/includes.i"
|
12
11
|
%import(module="taglib_base") "../taglib_base/taglib_base.i"
|
12
|
+
%include "../taglib_flac_picture/includes.i"
|
13
|
+
%import(module="taglib_flac_picture") "../taglib_flac_picture/taglib_flac_picture.i"
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
for (TagLib::List<TagLib::FLAC::Picture *>::ConstIterator it = list.begin(); it != list.end(); it++) {
|
18
|
-
TagLib::FLAC::Picture *picture = *it;
|
19
|
-
VALUE p = SWIG_NewPointerObj(picture, SWIGTYPE_p_TagLib__FLAC__Picture, 0);
|
20
|
-
rb_ary_push(ary, p);
|
21
|
-
}
|
22
|
-
return ary;
|
23
|
-
}
|
24
|
-
%}
|
15
|
+
// Deprecated
|
16
|
+
%ignore TagLib::FLAC::Properties::length;
|
17
|
+
%ignore TagLib::FLAC::Properties::sampleWidth;
|
25
18
|
|
26
19
|
%include <taglib/flacproperties.h>
|
27
20
|
|
28
|
-
|
29
|
-
%
|
21
|
+
// Ignore IOStream and all the constructors using it.
|
22
|
+
%ignore IOStream;
|
23
|
+
%ignore TagLib::FLAC::File::File(IOStream*, ID3v2::FrameFactory*, bool, Properties::ReadStyle);
|
24
|
+
%ignore TagLib::FLAC::File::File(IOStream*, ID3v2::FrameFactory*, bool);
|
25
|
+
%ignore TagLib::FLAC::File::File(IOStream*, ID3v2::FrameFactory*);
|
30
26
|
|
31
27
|
%rename(id3v1_tag) TagLib::FLAC::File::ID3v1Tag;
|
32
28
|
%rename(id3v2_tag) TagLib::FLAC::File::ID3v2Tag;
|
33
29
|
%rename(set_id3v2_frame_factory) TagLib::FLAC::File::setID3v2FrameFactory;
|
34
30
|
|
35
|
-
%typemap(out) TagLib::List<TagLib::FLAC::Picture *> {
|
36
|
-
$result = taglib_flac_picturelist_to_ruby_array($1);
|
37
|
-
}
|
38
|
-
|
39
31
|
%freefunc TagLib::FLAC::File "free_taglib_flac_file";
|
40
32
|
|
41
33
|
%apply SWIGTYPE *DISOWN { TagLib::FLAC::Picture *picture };
|
42
34
|
// Don't expose second parameter, memory should be freed by TagLib
|
43
35
|
%ignore TagLib::FLAC::File::removePicture(Picture *, bool);
|
44
36
|
|
37
|
+
%rename("xiph_comment?") TagLib::FLAC::File::hasXiphComment;
|
38
|
+
%rename("id3v1_tag?") TagLib::FLAC::File::hasID3v1Tag;
|
39
|
+
%rename("id3v2_tag?") TagLib::FLAC::File::hasID3v2Tag;
|
40
|
+
|
45
41
|
%include <taglib/flacfile.h>
|
46
42
|
|
47
43
|
// Unlink Ruby objects from the deleted C++ objects. Otherwise Ruby code
|