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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +15 -11
- data/docs/taglib/mpeg.rb +1 -9
- data/ext/extconf_common.rb +21 -12
- data/ext/taglib_aiff/taglib_aiff.i +4 -0
- data/ext/taglib_aiff/taglib_aiff_wrap.cxx +222 -59
- data/ext/taglib_base/includes.i +14 -14
- data/ext/taglib_base/taglib_base.i +21 -0
- data/ext/taglib_base/taglib_base_wrap.cxx +289 -350
- data/ext/taglib_flac/taglib_flac.i +7 -3
- data/ext/taglib_flac/taglib_flac_wrap.cxx +233 -336
- data/ext/taglib_flac_picture/taglib_flac_picture.i +4 -0
- data/ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx +125 -71
- data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +92 -51
- data/ext/taglib_id3v2/taglib_id3v2.i +5 -0
- data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +524 -414
- data/ext/taglib_mp4/taglib_mp4.i +21 -18
- data/ext/taglib_mp4/taglib_mp4_wrap.cxx +2062 -1467
- data/ext/taglib_mpeg/taglib_mpeg.i +5 -0
- data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +414 -300
- data/ext/taglib_ogg/taglib_ogg.i +0 -2
- data/ext/taglib_ogg/taglib_ogg_wrap.cxx +44 -42
- data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +27 -48
- data/ext/taglib_wav/taglib_wav.i +5 -2
- data/ext/taglib_wav/taglib_wav_wrap.cxx +179 -89
- data/lib/taglib/version.rb +3 -3
- data/tasks/ext.rake +23 -39
- data/tasks/swig.rake +14 -4
- data/test/id3v2_write_test.rb +1 -1
- data/test/wav_examples_test.rb +1 -1
- data/test/wav_file_test.rb +1 -1
- data/test/wav_file_write_test.rb +6 -6
- metadata +3 -3
@@ -11,5 +11,9 @@
|
|
11
11
|
%ignore TagLib::FLAC::MetadataBlock::render; // Only useful internally.
|
12
12
|
%include <taglib/flacmetadatablock.h>
|
13
13
|
|
14
|
+
%ignore TagLib::Utils::pictureTypeToString;
|
15
|
+
%ignore TagLib::Utils::pictureTypeFromString;
|
16
|
+
%include <taglib/tpicturetype.h>
|
17
|
+
|
14
18
|
%ignore TagLib::FLAC::Picture::render; // Only useful internally.
|
15
19
|
%include <taglib/flacpicture.h>
|
@@ -1854,12 +1854,13 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
|
|
1854
1854
|
#define SWIGTYPE_p_TagLib__FLAC__Picture swig_types[1]
|
1855
1855
|
#define SWIGTYPE_p_TagLib__ListT_TagLib__FLAC__Picture_t swig_types[2]
|
1856
1856
|
#define SWIGTYPE_p_char swig_types[3]
|
1857
|
-
#define
|
1858
|
-
#define
|
1859
|
-
#define
|
1860
|
-
#define
|
1861
|
-
|
1862
|
-
static
|
1857
|
+
#define SWIGTYPE_p_long_long swig_types[4]
|
1858
|
+
#define SWIGTYPE_p_unsigned_char swig_types[5]
|
1859
|
+
#define SWIGTYPE_p_unsigned_int swig_types[6]
|
1860
|
+
#define SWIGTYPE_p_unsigned_long swig_types[7]
|
1861
|
+
#define SWIGTYPE_p_wchar_t swig_types[8]
|
1862
|
+
static swig_type_info *swig_types[10];
|
1863
|
+
static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0};
|
1863
1864
|
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
|
1864
1865
|
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
|
1865
1866
|
|
@@ -1951,34 +1952,26 @@ template <typename T> T SwigValueInit() {
|
|
1951
1952
|
#endif
|
1952
1953
|
|
1953
1954
|
VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
|
1954
|
-
|
1955
|
-
return Qnil;
|
1956
|
-
} else {
|
1957
|
-
return rb_str_new(byteVector.data(), byteVector.size());
|
1958
|
-
}
|
1955
|
+
return rb_str_new(byteVector.data(), byteVector.size());
|
1959
1956
|
}
|
1960
1957
|
|
1961
1958
|
TagLib::ByteVector ruby_string_to_taglib_bytevector(VALUE s) {
|
1962
1959
|
if (NIL_P(s)) {
|
1963
|
-
return TagLib::ByteVector
|
1960
|
+
return TagLib::ByteVector();
|
1964
1961
|
} else {
|
1965
1962
|
return TagLib::ByteVector(RSTRING_PTR(StringValue(s)), RSTRING_LEN(s));
|
1966
1963
|
}
|
1967
1964
|
}
|
1968
1965
|
|
1969
1966
|
VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
|
1970
|
-
|
1971
|
-
|
1972
|
-
|
1973
|
-
VALUE result = rb_str_new2(string.toCString(true));
|
1974
|
-
ASSOCIATE_UTF8_ENCODING(result);
|
1975
|
-
return result;
|
1976
|
-
}
|
1967
|
+
VALUE result = rb_str_new2(string.toCString(true));
|
1968
|
+
ASSOCIATE_UTF8_ENCODING(result);
|
1969
|
+
return result;
|
1977
1970
|
}
|
1978
1971
|
|
1979
1972
|
TagLib::String ruby_string_to_taglib_string(VALUE s) {
|
1980
1973
|
if (NIL_P(s)) {
|
1981
|
-
return TagLib::String
|
1974
|
+
return TagLib::String();
|
1982
1975
|
} else {
|
1983
1976
|
return TagLib::String(RSTRING_PTR(CONVERT_TO_UTF8(StringValue(s))), TagLib::String::UTF8);
|
1984
1977
|
}
|
@@ -2067,6 +2060,13 @@ TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
|
|
2067
2060
|
#endif
|
2068
2061
|
}
|
2069
2062
|
|
2063
|
+
VALUE taglib_offset_t_to_ruby_int(TagLib::offset_t off) {
|
2064
|
+
#ifdef _WIN32
|
2065
|
+
return LL2NUM(off);
|
2066
|
+
#else
|
2067
|
+
return OFFT2NUM(off);
|
2068
|
+
#endif
|
2069
|
+
}
|
2070
2070
|
|
2071
2071
|
|
2072
2072
|
VALUE taglib_flac_picturelist_to_ruby_array(const TagLib::List<TagLib::FLAC::Picture *> & list) {
|
@@ -2100,56 +2100,6 @@ SWIG_From_int (int value)
|
|
2100
2100
|
}
|
2101
2101
|
|
2102
2102
|
|
2103
|
-
SWIGINTERN swig_type_info*
|
2104
|
-
SWIG_pchar_descriptor(void)
|
2105
|
-
{
|
2106
|
-
static int init = 0;
|
2107
|
-
static swig_type_info* info = 0;
|
2108
|
-
if (!init) {
|
2109
|
-
info = SWIG_TypeQuery("_p_char");
|
2110
|
-
init = 1;
|
2111
|
-
}
|
2112
|
-
return info;
|
2113
|
-
}
|
2114
|
-
|
2115
|
-
|
2116
|
-
SWIGINTERN int
|
2117
|
-
SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
|
2118
|
-
{
|
2119
|
-
if (TYPE(obj) == T_STRING) {
|
2120
|
-
char *cstr = StringValuePtr(obj);
|
2121
|
-
size_t size = RSTRING_LEN(obj) + 1;
|
2122
|
-
if (cptr) {
|
2123
|
-
if (alloc) {
|
2124
|
-
if (*alloc == SWIG_NEWOBJ) {
|
2125
|
-
*cptr = reinterpret_cast< char* >(memcpy(new char[size], cstr, sizeof(char)*(size)));
|
2126
|
-
} else {
|
2127
|
-
*cptr = cstr;
|
2128
|
-
*alloc = SWIG_OLDOBJ;
|
2129
|
-
}
|
2130
|
-
}
|
2131
|
-
}
|
2132
|
-
if (psize) *psize = size;
|
2133
|
-
return SWIG_OK;
|
2134
|
-
} else {
|
2135
|
-
swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
|
2136
|
-
if (pchar_descriptor) {
|
2137
|
-
void* vptr = 0;
|
2138
|
-
if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
|
2139
|
-
if (cptr) *cptr = (char *)vptr;
|
2140
|
-
if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
|
2141
|
-
if (alloc) *alloc = SWIG_OLDOBJ;
|
2142
|
-
return SWIG_OK;
|
2143
|
-
}
|
2144
|
-
}
|
2145
|
-
}
|
2146
|
-
return SWIG_TypeError;
|
2147
|
-
}
|
2148
|
-
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2152
|
-
|
2153
2103
|
SWIGINTERN VALUE
|
2154
2104
|
SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
|
2155
2105
|
{
|
@@ -2157,7 +2107,7 @@ SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
|
|
2157
2107
|
}
|
2158
2108
|
|
2159
2109
|
|
2160
|
-
/*@SWIG:/
|
2110
|
+
/*@SWIG:/swig/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2161
2111
|
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE arg)
|
2162
2112
|
{
|
2163
2113
|
VALUE *args = (VALUE *)arg;
|
@@ -2203,6 +2153,56 @@ SWIG_AsVal_int (VALUE obj, int *val)
|
|
2203
2153
|
}
|
2204
2154
|
|
2205
2155
|
|
2156
|
+
SWIGINTERN swig_type_info*
|
2157
|
+
SWIG_pchar_descriptor(void)
|
2158
|
+
{
|
2159
|
+
static int init = 0;
|
2160
|
+
static swig_type_info* info = 0;
|
2161
|
+
if (!init) {
|
2162
|
+
info = SWIG_TypeQuery("_p_char");
|
2163
|
+
init = 1;
|
2164
|
+
}
|
2165
|
+
return info;
|
2166
|
+
}
|
2167
|
+
|
2168
|
+
|
2169
|
+
SWIGINTERN int
|
2170
|
+
SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
|
2171
|
+
{
|
2172
|
+
if (TYPE(obj) == T_STRING) {
|
2173
|
+
char *cstr = StringValuePtr(obj);
|
2174
|
+
size_t size = RSTRING_LEN(obj) + 1;
|
2175
|
+
if (cptr) {
|
2176
|
+
if (alloc) {
|
2177
|
+
if (*alloc == SWIG_NEWOBJ) {
|
2178
|
+
*cptr = reinterpret_cast< char* >(memcpy(new char[size], cstr, sizeof(char)*(size)));
|
2179
|
+
} else {
|
2180
|
+
*cptr = cstr;
|
2181
|
+
*alloc = SWIG_OLDOBJ;
|
2182
|
+
}
|
2183
|
+
}
|
2184
|
+
}
|
2185
|
+
if (psize) *psize = size;
|
2186
|
+
return SWIG_OK;
|
2187
|
+
} else {
|
2188
|
+
swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
|
2189
|
+
if (pchar_descriptor) {
|
2190
|
+
void* vptr = 0;
|
2191
|
+
if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
|
2192
|
+
if (cptr) *cptr = (char *)vptr;
|
2193
|
+
if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
|
2194
|
+
if (alloc) *alloc = SWIG_OLDOBJ;
|
2195
|
+
return SWIG_OK;
|
2196
|
+
}
|
2197
|
+
}
|
2198
|
+
}
|
2199
|
+
return SWIG_TypeError;
|
2200
|
+
}
|
2201
|
+
|
2202
|
+
|
2203
|
+
|
2204
|
+
|
2205
|
+
|
2206
2206
|
SWIGINTERNINLINE VALUE
|
2207
2207
|
SWIG_From_bool (bool value)
|
2208
2208
|
{
|
@@ -2244,6 +2244,54 @@ fail:
|
|
2244
2244
|
|
2245
2245
|
static swig_class SwigClassPicture;
|
2246
2246
|
|
2247
|
+
SWIGINTERN VALUE
|
2248
|
+
_wrap_Picture_type_to_string(int argc, VALUE *argv, VALUE self) {
|
2249
|
+
TagLib::FLAC::Picture::Type arg1 ;
|
2250
|
+
int val1 ;
|
2251
|
+
int ecode1 = 0 ;
|
2252
|
+
TagLib::String result;
|
2253
|
+
VALUE vresult = Qnil;
|
2254
|
+
|
2255
|
+
if ((argc < 1) || (argc > 1)) {
|
2256
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2257
|
+
}
|
2258
|
+
ecode1 = SWIG_AsVal_int(argv[0], &val1);
|
2259
|
+
if (!SWIG_IsOK(ecode1)) {
|
2260
|
+
SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "TagLib::FLAC::Picture::Type","TagLib::FLAC::Picture::typeToString", 1, argv[0] ));
|
2261
|
+
}
|
2262
|
+
arg1 = static_cast< TagLib::FLAC::Picture::Type >(val1);
|
2263
|
+
result = TagLib::FLAC::Picture::typeToString(arg1);
|
2264
|
+
{
|
2265
|
+
vresult = taglib_string_to_ruby_string(result);
|
2266
|
+
}
|
2267
|
+
return vresult;
|
2268
|
+
fail:
|
2269
|
+
return Qnil;
|
2270
|
+
}
|
2271
|
+
|
2272
|
+
|
2273
|
+
SWIGINTERN VALUE
|
2274
|
+
_wrap_Picture_type_from_string(int argc, VALUE *argv, VALUE self) {
|
2275
|
+
TagLib::String *arg1 = 0 ;
|
2276
|
+
TagLib::String tmp1 ;
|
2277
|
+
TagLib::FLAC::Picture::Type result;
|
2278
|
+
VALUE vresult = Qnil;
|
2279
|
+
|
2280
|
+
if ((argc < 1) || (argc > 1)) {
|
2281
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2282
|
+
}
|
2283
|
+
{
|
2284
|
+
tmp1 = ruby_string_to_taglib_string(argv[0]);
|
2285
|
+
arg1 = &tmp1;
|
2286
|
+
}
|
2287
|
+
result = (TagLib::FLAC::Picture::Type)TagLib::FLAC::Picture::typeFromString((TagLib::String const &)*arg1);
|
2288
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
2289
|
+
return vresult;
|
2290
|
+
fail:
|
2291
|
+
return Qnil;
|
2292
|
+
}
|
2293
|
+
|
2294
|
+
|
2247
2295
|
SWIGINTERN VALUE
|
2248
2296
|
_wrap_new_Picture__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
2249
2297
|
TagLib::FLAC::Picture *result = 0 ;
|
@@ -2823,6 +2871,7 @@ static swig_type_info _swigt__p_TagLib__FLAC__MetadataBlock = {"_p_TagLib__FLAC_
|
|
2823
2871
|
static swig_type_info _swigt__p_TagLib__FLAC__Picture = {"_p_TagLib__FLAC__Picture", "TagLib::FLAC::Picture *", 0, 0, (void*)0, 0};
|
2824
2872
|
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};
|
2825
2873
|
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
|
2874
|
+
static swig_type_info _swigt__p_long_long = {"_p_long_long", "TagLib::offset_t *|long long *", 0, 0, (void*)0, 0};
|
2826
2875
|
static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "TagLib::uchar *|unsigned char *", 0, 0, (void*)0, 0};
|
2827
2876
|
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "TagLib::uint *|unsigned int *", 0, 0, (void*)0, 0};
|
2828
2877
|
static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "TagLib::ulong *|unsigned long *", 0, 0, (void*)0, 0};
|
@@ -2833,6 +2882,7 @@ static swig_type_info *swig_type_initial[] = {
|
|
2833
2882
|
&_swigt__p_TagLib__FLAC__Picture,
|
2834
2883
|
&_swigt__p_TagLib__ListT_TagLib__FLAC__Picture_t,
|
2835
2884
|
&_swigt__p_char,
|
2885
|
+
&_swigt__p_long_long,
|
2836
2886
|
&_swigt__p_unsigned_char,
|
2837
2887
|
&_swigt__p_unsigned_int,
|
2838
2888
|
&_swigt__p_unsigned_long,
|
@@ -2843,6 +2893,7 @@ static swig_cast_info _swigc__p_TagLib__FLAC__MetadataBlock[] = { {&_swigt__p_T
|
|
2843
2893
|
static swig_cast_info _swigc__p_TagLib__FLAC__Picture[] = { {&_swigt__p_TagLib__FLAC__Picture, 0, 0, 0},{0, 0, 0, 0}};
|
2844
2894
|
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}};
|
2845
2895
|
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
|
2896
|
+
static swig_cast_info _swigc__p_long_long[] = { {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}};
|
2846
2897
|
static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
|
2847
2898
|
static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
|
2848
2899
|
static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
|
@@ -2853,6 +2904,7 @@ static swig_cast_info *swig_cast_initial[] = {
|
|
2853
2904
|
_swigc__p_TagLib__FLAC__Picture,
|
2854
2905
|
_swigc__p_TagLib__ListT_TagLib__FLAC__Picture_t,
|
2855
2906
|
_swigc__p_char,
|
2907
|
+
_swigc__p_long_long,
|
2856
2908
|
_swigc__p_unsigned_char,
|
2857
2909
|
_swigc__p_unsigned_int,
|
2858
2910
|
_swigc__p_unsigned_long,
|
@@ -3157,6 +3209,8 @@ SWIGEXPORT void Init_taglib_flac_picture(void) {
|
|
3157
3209
|
rb_define_const(SwigClassPicture.klass, "Illustration", SWIG_From_int(static_cast< int >(TagLib::FLAC::Picture::Illustration)));
|
3158
3210
|
rb_define_const(SwigClassPicture.klass, "BandLogo", SWIG_From_int(static_cast< int >(TagLib::FLAC::Picture::BandLogo)));
|
3159
3211
|
rb_define_const(SwigClassPicture.klass, "PublisherLogo", SWIG_From_int(static_cast< int >(TagLib::FLAC::Picture::PublisherLogo)));
|
3212
|
+
rb_define_singleton_method(SwigClassPicture.klass, "type_to_string", VALUEFUNC(_wrap_Picture_type_to_string), -1);
|
3213
|
+
rb_define_singleton_method(SwigClassPicture.klass, "type_from_string", VALUEFUNC(_wrap_Picture_type_from_string), -1);
|
3160
3214
|
rb_define_method(SwigClassPicture.klass, "type", VALUEFUNC(_wrap_Picture_type), -1);
|
3161
3215
|
rb_define_method(SwigClassPicture.klass, "type=", VALUEFUNC(_wrap_Picture_typee___), -1);
|
3162
3216
|
rb_define_method(SwigClassPicture.klass, "mime_type", VALUEFUNC(_wrap_Picture_mime_type), -1);
|
@@ -1856,12 +1856,13 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
|
|
1856
1856
|
#define SWIGTYPE_p_TagLib__ID3v1__Tag swig_types[3]
|
1857
1857
|
#define SWIGTYPE_p_TagLib__Tag swig_types[4]
|
1858
1858
|
#define SWIGTYPE_p_char swig_types[5]
|
1859
|
-
#define
|
1860
|
-
#define
|
1861
|
-
#define
|
1862
|
-
#define
|
1863
|
-
|
1864
|
-
static
|
1859
|
+
#define SWIGTYPE_p_long_long swig_types[6]
|
1860
|
+
#define SWIGTYPE_p_unsigned_char swig_types[7]
|
1861
|
+
#define SWIGTYPE_p_unsigned_int swig_types[8]
|
1862
|
+
#define SWIGTYPE_p_unsigned_long swig_types[9]
|
1863
|
+
#define SWIGTYPE_p_wchar_t swig_types[10]
|
1864
|
+
static swig_type_info *swig_types[12];
|
1865
|
+
static swig_module_info swig_module = {swig_types, 11, 0, 0, 0, 0};
|
1865
1866
|
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
|
1866
1867
|
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
|
1867
1868
|
|
@@ -1953,34 +1954,26 @@ template <typename T> T SwigValueInit() {
|
|
1953
1954
|
#endif
|
1954
1955
|
|
1955
1956
|
VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
|
1956
|
-
|
1957
|
-
return Qnil;
|
1958
|
-
} else {
|
1959
|
-
return rb_str_new(byteVector.data(), byteVector.size());
|
1960
|
-
}
|
1957
|
+
return rb_str_new(byteVector.data(), byteVector.size());
|
1961
1958
|
}
|
1962
1959
|
|
1963
1960
|
TagLib::ByteVector ruby_string_to_taglib_bytevector(VALUE s) {
|
1964
1961
|
if (NIL_P(s)) {
|
1965
|
-
return TagLib::ByteVector
|
1962
|
+
return TagLib::ByteVector();
|
1966
1963
|
} else {
|
1967
1964
|
return TagLib::ByteVector(RSTRING_PTR(StringValue(s)), RSTRING_LEN(s));
|
1968
1965
|
}
|
1969
1966
|
}
|
1970
1967
|
|
1971
1968
|
VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
|
1972
|
-
|
1973
|
-
|
1974
|
-
|
1975
|
-
VALUE result = rb_str_new2(string.toCString(true));
|
1976
|
-
ASSOCIATE_UTF8_ENCODING(result);
|
1977
|
-
return result;
|
1978
|
-
}
|
1969
|
+
VALUE result = rb_str_new2(string.toCString(true));
|
1970
|
+
ASSOCIATE_UTF8_ENCODING(result);
|
1971
|
+
return result;
|
1979
1972
|
}
|
1980
1973
|
|
1981
1974
|
TagLib::String ruby_string_to_taglib_string(VALUE s) {
|
1982
1975
|
if (NIL_P(s)) {
|
1983
|
-
return TagLib::String
|
1976
|
+
return TagLib::String();
|
1984
1977
|
} else {
|
1985
1978
|
return TagLib::String(RSTRING_PTR(CONVERT_TO_UTF8(StringValue(s))), TagLib::String::UTF8);
|
1986
1979
|
}
|
@@ -2069,6 +2062,13 @@ TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
|
|
2069
2062
|
#endif
|
2070
2063
|
}
|
2071
2064
|
|
2065
|
+
VALUE taglib_offset_t_to_ruby_int(TagLib::offset_t off) {
|
2066
|
+
#ifdef _WIN32
|
2067
|
+
return LL2NUM(off);
|
2068
|
+
#else
|
2069
|
+
return OFFT2NUM(off);
|
2070
|
+
#endif
|
2071
|
+
}
|
2072
2072
|
|
2073
2073
|
|
2074
2074
|
SWIGINTERN swig_type_info*
|
@@ -2128,43 +2128,50 @@ SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
|
|
2128
2128
|
}
|
2129
2129
|
|
2130
2130
|
|
2131
|
-
|
2132
|
-
|
2131
|
+
#include <limits.h>
|
2132
|
+
#if !defined(SWIG_NO_LLONG_MAX)
|
2133
|
+
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
|
2134
|
+
# define LLONG_MAX __LONG_LONG_MAX__
|
2135
|
+
# define LLONG_MIN (-LLONG_MAX - 1LL)
|
2136
|
+
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
|
2137
|
+
# endif
|
2138
|
+
#endif
|
2139
|
+
|
2140
|
+
|
2141
|
+
#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
|
2142
|
+
# define SWIG_LONG_LONG_AVAILABLE
|
2143
|
+
#endif
|
2144
|
+
|
2145
|
+
|
2146
|
+
#ifdef SWIG_LONG_LONG_AVAILABLE
|
2147
|
+
/*@SWIG:/swig/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2148
|
+
SWIGINTERN VALUE SWIG_AUX_NUM2LL(VALUE arg)
|
2133
2149
|
{
|
2134
2150
|
VALUE *args = (VALUE *)arg;
|
2135
2151
|
VALUE obj = args[0];
|
2136
2152
|
VALUE type = TYPE(obj);
|
2137
|
-
long *res = (long *)(args[1]);
|
2138
|
-
*res = type == T_FIXNUM ?
|
2153
|
+
long long *res = (long long *)(args[1]);
|
2154
|
+
*res = type == T_FIXNUM ? NUM2LL(obj) : rb_big2ll(obj);
|
2139
2155
|
return obj;
|
2140
2156
|
}
|
2141
2157
|
/*@SWIG@*/
|
2142
2158
|
|
2143
2159
|
SWIGINTERN int
|
2144
|
-
|
2160
|
+
SWIG_AsVal_long_SS_long (VALUE obj, long long *val)
|
2145
2161
|
{
|
2146
2162
|
VALUE type = TYPE(obj);
|
2147
2163
|
if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
|
2148
|
-
long v;
|
2164
|
+
long long v;
|
2149
2165
|
VALUE a[2];
|
2150
2166
|
a[0] = obj;
|
2151
2167
|
a[1] = (VALUE)(&v);
|
2152
|
-
if (rb_rescue(VALUEFUNC(
|
2168
|
+
if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LL), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
|
2153
2169
|
if (val) *val = v;
|
2154
2170
|
return SWIG_OK;
|
2155
2171
|
}
|
2156
2172
|
}
|
2157
2173
|
return SWIG_TypeError;
|
2158
2174
|
}
|
2159
|
-
|
2160
|
-
|
2161
|
-
#include <limits.h>
|
2162
|
-
#if !defined(SWIG_NO_LLONG_MAX)
|
2163
|
-
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
|
2164
|
-
# define LLONG_MAX __LONG_LONG_MAX__
|
2165
|
-
# define LLONG_MIN (-LLONG_MAX - 1LL)
|
2166
|
-
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
|
2167
|
-
# endif
|
2168
2175
|
#endif
|
2169
2176
|
|
2170
2177
|
|
@@ -2185,7 +2192,7 @@ SWIG_From_unsigned_SS_int (unsigned int value)
|
|
2185
2192
|
}
|
2186
2193
|
|
2187
2194
|
|
2188
|
-
/*@SWIG:/
|
2195
|
+
/*@SWIG:/swig/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2189
2196
|
SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE arg)
|
2190
2197
|
{
|
2191
2198
|
VALUE *args = (VALUE *)arg;
|
@@ -2231,6 +2238,36 @@ SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val)
|
|
2231
2238
|
}
|
2232
2239
|
|
2233
2240
|
|
2241
|
+
/*@SWIG:/swig/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2242
|
+
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE arg)
|
2243
|
+
{
|
2244
|
+
VALUE *args = (VALUE *)arg;
|
2245
|
+
VALUE obj = args[0];
|
2246
|
+
VALUE type = TYPE(obj);
|
2247
|
+
long *res = (long *)(args[1]);
|
2248
|
+
*res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
|
2249
|
+
return obj;
|
2250
|
+
}
|
2251
|
+
/*@SWIG@*/
|
2252
|
+
|
2253
|
+
SWIGINTERN int
|
2254
|
+
SWIG_AsVal_long (VALUE obj, long* val)
|
2255
|
+
{
|
2256
|
+
VALUE type = TYPE(obj);
|
2257
|
+
if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
|
2258
|
+
long v;
|
2259
|
+
VALUE a[2];
|
2260
|
+
a[0] = obj;
|
2261
|
+
a[1] = (VALUE)(&v);
|
2262
|
+
if (rb_rescue(VALUEFUNC(SWIG_AUX_NUM2LONG), (VALUE)a, VALUEFUNC(SWIG_ruby_failed), 0) != Qnil) {
|
2263
|
+
if (val) *val = v;
|
2264
|
+
return SWIG_OK;
|
2265
|
+
}
|
2266
|
+
}
|
2267
|
+
return SWIG_TypeError;
|
2268
|
+
}
|
2269
|
+
|
2270
|
+
|
2234
2271
|
SWIGINTERN int
|
2235
2272
|
SWIG_AsVal_int (VALUE obj, int *val)
|
2236
2273
|
{
|
@@ -2297,6 +2334,13 @@ fail:
|
|
2297
2334
|
}
|
2298
2335
|
|
2299
2336
|
|
2337
|
+
SWIGINTERN void
|
2338
|
+
free_TagLib_ID3v1_StringHandler(void *self) {
|
2339
|
+
TagLib::ID3v1::StringHandler *arg1 = (TagLib::ID3v1::StringHandler *)self;
|
2340
|
+
SWIG_RubyRemoveTracking(arg1);
|
2341
|
+
delete arg1;
|
2342
|
+
}
|
2343
|
+
|
2300
2344
|
SWIGINTERN VALUE
|
2301
2345
|
_wrap_StringHandler_parse(int argc, VALUE *argv, VALUE self) {
|
2302
2346
|
TagLib::ID3v1::StringHandler *arg1 = (TagLib::ID3v1::StringHandler *) 0 ;
|
@@ -2361,13 +2405,6 @@ fail:
|
|
2361
2405
|
}
|
2362
2406
|
|
2363
2407
|
|
2364
|
-
SWIGINTERN void
|
2365
|
-
free_TagLib_ID3v1_StringHandler(void *self) {
|
2366
|
-
TagLib::ID3v1::StringHandler *arg1 = (TagLib::ID3v1::StringHandler *)self;
|
2367
|
-
SWIG_RubyRemoveTracking(arg1);
|
2368
|
-
delete arg1;
|
2369
|
-
}
|
2370
|
-
|
2371
2408
|
static swig_class SwigClassTag;
|
2372
2409
|
|
2373
2410
|
SWIGINTERN VALUE
|
@@ -2404,10 +2441,10 @@ _wrap_Tag_allocate(int argc, VALUE *argv, VALUE self)
|
|
2404
2441
|
SWIGINTERN VALUE
|
2405
2442
|
_wrap_new_Tag__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
2406
2443
|
TagLib::File *arg1 = (TagLib::File *) 0 ;
|
2407
|
-
|
2444
|
+
TagLib::offset_t arg2 ;
|
2408
2445
|
void *argp1 = 0 ;
|
2409
2446
|
int res1 = 0 ;
|
2410
|
-
long val2 ;
|
2447
|
+
long long val2 ;
|
2411
2448
|
int ecode2 = 0 ;
|
2412
2449
|
TagLib::ID3v1::Tag *result = 0 ;
|
2413
2450
|
|
@@ -2419,11 +2456,11 @@ _wrap_new_Tag__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
|
2419
2456
|
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::File *","Tag", 1, argv[0] ));
|
2420
2457
|
}
|
2421
2458
|
arg1 = reinterpret_cast< TagLib::File * >(argp1);
|
2422
|
-
ecode2 =
|
2459
|
+
ecode2 = SWIG_AsVal_long_SS_long(argv[1], &val2);
|
2423
2460
|
if (!SWIG_IsOK(ecode2)) {
|
2424
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "
|
2461
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "TagLib::offset_t","Tag", 2, argv[1] ));
|
2425
2462
|
}
|
2426
|
-
arg2 = static_cast<
|
2463
|
+
arg2 = static_cast< TagLib::offset_t >(val2);
|
2427
2464
|
result = (TagLib::ID3v1::Tag *)new TagLib::ID3v1::Tag(arg1,arg2);
|
2428
2465
|
DATA_PTR(self) = result;
|
2429
2466
|
SWIG_RubyAddTracking(result, self);
|
@@ -2453,7 +2490,7 @@ SWIGINTERN VALUE _wrap_new_Tag(int nargs, VALUE *args, VALUE self) {
|
|
2453
2490
|
_v = SWIG_CheckState(res);
|
2454
2491
|
if (_v) {
|
2455
2492
|
{
|
2456
|
-
int res =
|
2493
|
+
int res = SWIG_AsVal_long_SS_long(argv[1], NULL);
|
2457
2494
|
_v = SWIG_CheckState(res);
|
2458
2495
|
}
|
2459
2496
|
if (_v) {
|
@@ -2465,7 +2502,7 @@ SWIGINTERN VALUE _wrap_new_Tag(int nargs, VALUE *args, VALUE self) {
|
|
2465
2502
|
fail:
|
2466
2503
|
Ruby_Format_OverloadedError( argc, 2, "Tag.new",
|
2467
2504
|
" Tag.new()\n"
|
2468
|
-
" Tag.new(TagLib::File *file,
|
2505
|
+
" Tag.new(TagLib::File *file, TagLib::offset_t tagOffset)\n");
|
2469
2506
|
|
2470
2507
|
return Qnil;
|
2471
2508
|
}
|
@@ -3063,6 +3100,7 @@ static swig_type_info _swigt__p_TagLib__ID3v1__StringHandler = {"_p_TagLib__ID3v
|
|
3063
3100
|
static swig_type_info _swigt__p_TagLib__ID3v1__Tag = {"_p_TagLib__ID3v1__Tag", "TagLib::ID3v1::Tag *", 0, 0, (void*)0, 0};
|
3064
3101
|
static swig_type_info _swigt__p_TagLib__Tag = {"_p_TagLib__Tag", "TagLib::Tag *", 0, 0, (void*)0, 0};
|
3065
3102
|
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
|
3103
|
+
static swig_type_info _swigt__p_long_long = {"_p_long_long", "TagLib::offset_t *|long long *", 0, 0, (void*)0, 0};
|
3066
3104
|
static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "TagLib::uchar *|unsigned char *", 0, 0, (void*)0, 0};
|
3067
3105
|
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "TagLib::uint *|unsigned int *", 0, 0, (void*)0, 0};
|
3068
3106
|
static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "TagLib::ulong *|unsigned long *", 0, 0, (void*)0, 0};
|
@@ -3075,6 +3113,7 @@ static swig_type_info *swig_type_initial[] = {
|
|
3075
3113
|
&_swigt__p_TagLib__ID3v1__Tag,
|
3076
3114
|
&_swigt__p_TagLib__Tag,
|
3077
3115
|
&_swigt__p_char,
|
3116
|
+
&_swigt__p_long_long,
|
3078
3117
|
&_swigt__p_unsigned_char,
|
3079
3118
|
&_swigt__p_unsigned_int,
|
3080
3119
|
&_swigt__p_unsigned_long,
|
@@ -3087,6 +3126,7 @@ static swig_cast_info _swigc__p_TagLib__ID3v1__StringHandler[] = { {&_swigt__p_
|
|
3087
3126
|
static swig_cast_info _swigc__p_TagLib__ID3v1__Tag[] = { {&_swigt__p_TagLib__ID3v1__Tag, 0, 0, 0},{0, 0, 0, 0}};
|
3088
3127
|
static swig_cast_info _swigc__p_TagLib__Tag[] = { {&_swigt__p_TagLib__Tag, 0, 0, 0}, {&_swigt__p_TagLib__ID3v1__Tag, _p_TagLib__ID3v1__TagTo_p_TagLib__Tag, 0, 0},{0, 0, 0, 0}};
|
3089
3128
|
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
|
3129
|
+
static swig_cast_info _swigc__p_long_long[] = { {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}};
|
3090
3130
|
static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
|
3091
3131
|
static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
|
3092
3132
|
static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
|
@@ -3099,6 +3139,7 @@ static swig_cast_info *swig_cast_initial[] = {
|
|
3099
3139
|
_swigc__p_TagLib__ID3v1__Tag,
|
3100
3140
|
_swigc__p_TagLib__Tag,
|
3101
3141
|
_swigc__p_char,
|
3142
|
+
_swigc__p_long_long,
|
3102
3143
|
_swigc__p_unsigned_char,
|
3103
3144
|
_swigc__p_unsigned_int,
|
3104
3145
|
_swigc__p_unsigned_long,
|
@@ -81,6 +81,7 @@ VALUE taglib_id3v2_framelist_to_ruby_array(TagLib::ID3v2::FrameList *list) {
|
|
81
81
|
}
|
82
82
|
%}
|
83
83
|
|
84
|
+
%include <taglib/id3v2.h>
|
84
85
|
%include <taglib/id3v2header.h>
|
85
86
|
|
86
87
|
// Only useful internally.
|
@@ -131,6 +132,10 @@ VALUE taglib_id3v2_framelist_to_ruby_array(TagLib::ID3v2::FrameList *list) {
|
|
131
132
|
|
132
133
|
%include "relativevolumeframe.i"
|
133
134
|
|
135
|
+
%ignore TagLib::Utils::pictureTypeToString;
|
136
|
+
%ignore TagLib::Utils::pictureTypeFromString;
|
137
|
+
%include <taglib/tpicturetype.h>
|
138
|
+
|
134
139
|
%include <taglib/attachedpictureframe.h>
|
135
140
|
|
136
141
|
// Ignore the unified property interface.
|