taglib-ruby 1.1.2 → 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/.github/FUNDING.yml +1 -0
- data/CHANGELOG.md +22 -0
- data/README.md +16 -12
- data/docs/taglib/mpeg.rb +1 -9
- data/ext/extconf_common.rb +21 -12
- data/ext/taglib_aiff/taglib_aiff.i +5 -0
- data/ext/taglib_aiff/taglib_aiff_wrap.cxx +327 -111
- data/ext/taglib_base/includes.i +14 -14
- data/ext/taglib_base/taglib_base.i +37 -4
- data/ext/taglib_base/taglib_base_wrap.cxx +414 -422
- data/ext/taglib_flac/taglib_flac.i +8 -3
- data/ext/taglib_flac/taglib_flac_wrap.cxx +356 -406
- data/ext/taglib_flac_picture/taglib_flac_picture.i +4 -0
- data/ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx +229 -122
- data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +196 -102
- data/ext/taglib_id3v2/taglib_id3v2.i +5 -0
- data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +727 -568
- data/ext/taglib_mp4/taglib_mp4.i +22 -18
- data/ext/taglib_mp4/taglib_mp4_wrap.cxx +2141 -1493
- data/ext/taglib_mpeg/taglib_mpeg.i +6 -0
- data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +546 -379
- data/ext/taglib_ogg/taglib_ogg.i +0 -2
- data/ext/taglib_ogg/taglib_ogg_wrap.cxx +162 -107
- data/ext/taglib_vorbis/taglib_vorbis.i +1 -0
- data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +141 -109
- data/ext/taglib_wav/taglib_wav.i +6 -2
- data/ext/taglib_wav/taglib_wav_wrap.cxx +290 -147
- data/lib/taglib/version.rb +3 -3
- data/taglib-ruby.gemspec +1 -0
- 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 +4 -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>
|
@@ -1,42 +1,14 @@
|
|
1
1
|
/* ----------------------------------------------------------------------------
|
2
|
-
* This file was automatically generated by SWIG (
|
3
|
-
* Version 4.
|
2
|
+
* This file was automatically generated by SWIG (https://www.swig.org).
|
3
|
+
* Version 4.1.1
|
4
4
|
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
* changes to this file unless you know what you are doing--modify the SWIG
|
8
|
-
* interface file instead.
|
5
|
+
* Do not make changes to this file unless you know what you are doing - modify
|
6
|
+
* the SWIG interface file instead.
|
9
7
|
* ----------------------------------------------------------------------------- */
|
10
8
|
|
11
9
|
|
12
|
-
#
|
10
|
+
#define SWIG_VERSION 0x040101
|
13
11
|
#define SWIGRUBY
|
14
|
-
#endif
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
#ifdef __cplusplus
|
19
|
-
/* SwigValueWrapper is described in swig.swg */
|
20
|
-
template<typename T> class SwigValueWrapper {
|
21
|
-
struct SwigMovePointer {
|
22
|
-
T *ptr;
|
23
|
-
SwigMovePointer(T *p) : ptr(p) { }
|
24
|
-
~SwigMovePointer() { delete ptr; }
|
25
|
-
SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
|
26
|
-
} pointer;
|
27
|
-
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
|
28
|
-
SwigValueWrapper(const SwigValueWrapper<T>& rhs);
|
29
|
-
public:
|
30
|
-
SwigValueWrapper() : pointer(0) { }
|
31
|
-
SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
|
32
|
-
operator T&() const { return *pointer.ptr; }
|
33
|
-
T *operator&() { return pointer.ptr; }
|
34
|
-
};
|
35
|
-
|
36
|
-
template <typename T> T SwigValueInit() {
|
37
|
-
return T();
|
38
|
-
}
|
39
|
-
#endif
|
40
12
|
|
41
13
|
/* -----------------------------------------------------------------------------
|
42
14
|
* This section contains generic SWIG labels for method/variable
|
@@ -332,6 +304,8 @@ template <typename T> T SwigValueInit() {
|
|
332
304
|
#define SWIG_POINTER_DISOWN 0x1
|
333
305
|
#define SWIG_CAST_NEW_MEMORY 0x2
|
334
306
|
#define SWIG_POINTER_NO_NULL 0x4
|
307
|
+
#define SWIG_POINTER_CLEAR 0x8
|
308
|
+
#define SWIG_POINTER_RELEASE (SWIG_POINTER_CLEAR | SWIG_POINTER_DISOWN)
|
335
309
|
|
336
310
|
/* Flags for new pointer objects */
|
337
311
|
#define SWIG_POINTER_OWN 0x1
|
@@ -403,7 +377,7 @@ template <typename T> T SwigValueInit() {
|
|
403
377
|
SWIG errors code.
|
404
378
|
|
405
379
|
Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
|
406
|
-
allows
|
380
|
+
allows returning the 'cast rank', for example, if you have this
|
407
381
|
|
408
382
|
int food(double)
|
409
383
|
int fooi(int);
|
@@ -417,7 +391,13 @@ template <typename T> T SwigValueInit() {
|
|
417
391
|
*/
|
418
392
|
|
419
393
|
#define SWIG_OK (0)
|
394
|
+
/* Runtime errors are < 0 */
|
420
395
|
#define SWIG_ERROR (-1)
|
396
|
+
/* Errors in range -1 to -99 are in swigerrors.swg (errors for all languages including those not using the runtime) */
|
397
|
+
/* Errors in range -100 to -199 are language specific errors defined in *errors.swg */
|
398
|
+
/* Errors < -200 are generic runtime specific errors */
|
399
|
+
#define SWIG_ERROR_RELEASE_NOT_OWNED (-200)
|
400
|
+
|
421
401
|
#define SWIG_IsOK(r) (r >= 0)
|
422
402
|
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
|
423
403
|
|
@@ -432,7 +412,7 @@ template <typename T> T SwigValueInit() {
|
|
432
412
|
#define SWIG_OLDOBJ (SWIG_OK)
|
433
413
|
#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
|
434
414
|
#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
|
435
|
-
/* Check, add and del mask methods */
|
415
|
+
/* Check, add and del object mask methods */
|
436
416
|
#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
|
437
417
|
#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
|
438
418
|
#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
|
@@ -578,7 +558,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
|
|
578
558
|
Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
|
579
559
|
*/
|
580
560
|
SWIGRUNTIME swig_cast_info *
|
581
|
-
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
|
561
|
+
SWIG_TypeCheckStruct(const swig_type_info *from, swig_type_info *ty) {
|
582
562
|
if (ty) {
|
583
563
|
swig_cast_info *iter = ty->cast;
|
584
564
|
while (iter) {
|
@@ -638,9 +618,9 @@ SWIG_TypeName(const swig_type_info *ty) {
|
|
638
618
|
SWIGRUNTIME const char *
|
639
619
|
SWIG_TypePrettyName(const swig_type_info *type) {
|
640
620
|
/* The "str" field contains the equivalent pretty names of the
|
641
|
-
type, separated by vertical-bar characters.
|
642
|
-
|
643
|
-
|
621
|
+
type, separated by vertical-bar characters. Choose the last
|
622
|
+
name. It should be the most specific; a fully resolved name
|
623
|
+
but not necessarily with default template parameters expanded. */
|
644
624
|
if (!type) return NULL;
|
645
625
|
if (type->str != NULL) {
|
646
626
|
const char *last_name = type->str;
|
@@ -860,7 +840,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
|
|
860
840
|
}
|
861
841
|
#endif
|
862
842
|
|
863
|
-
/*
|
843
|
+
/* SWIG Errors applicable to all language modules, values are reserved from -1 to -99 */
|
864
844
|
#define SWIG_UnknownError -1
|
865
845
|
#define SWIG_IOError -2
|
866
846
|
#define SWIG_RuntimeError -3
|
@@ -876,9 +856,25 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
|
|
876
856
|
#define SWIG_NullReferenceError -13
|
877
857
|
|
878
858
|
|
859
|
+
#if __GNUC__ >= 7
|
860
|
+
#pragma GCC diagnostic push
|
861
|
+
#if defined(__cplusplus)
|
862
|
+
#pragma GCC diagnostic ignored "-Wregister"
|
863
|
+
#if __GNUC__ >= 10
|
864
|
+
#pragma GCC diagnostic ignored "-Wvolatile"
|
865
|
+
#if __GNUC__ >= 11
|
866
|
+
#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion"
|
867
|
+
#endif
|
868
|
+
#endif
|
869
|
+
#endif
|
870
|
+
#endif
|
879
871
|
|
880
872
|
#include <ruby.h>
|
881
873
|
|
874
|
+
#if __GNUC__ >= 7
|
875
|
+
#pragma GCC diagnostic pop
|
876
|
+
#endif
|
877
|
+
|
882
878
|
/* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
|
883
879
|
* breaks using rb_intern as an lvalue, as SWIG does. We work around this
|
884
880
|
* issue for now by disabling this.
|
@@ -1658,6 +1654,11 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
|
|
1658
1654
|
own->own = 0;
|
1659
1655
|
}
|
1660
1656
|
|
1657
|
+
if (((flags & SWIG_POINTER_RELEASE) == SWIG_POINTER_RELEASE)) {
|
1658
|
+
if (!RDATA(obj)->dfree)
|
1659
|
+
return SWIG_ERROR_RELEASE_NOT_OWNED;
|
1660
|
+
}
|
1661
|
+
|
1661
1662
|
/* Check to see if the input object is giving up ownership
|
1662
1663
|
of the underlying C struct or C++ object. If so then we
|
1663
1664
|
need to reset the destructor since the Ruby object no
|
@@ -1669,7 +1670,7 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
|
|
1669
1670
|
swig_class *sklass = (swig_class *) ty->clientdata;
|
1670
1671
|
track = sklass->trackObjects;
|
1671
1672
|
}
|
1672
|
-
|
1673
|
+
|
1673
1674
|
if (track) {
|
1674
1675
|
/* We are tracking objects for this class. Thus we change the destructor
|
1675
1676
|
* to SWIG_RubyRemoveTracking. This allows us to
|
@@ -1683,6 +1684,10 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
|
|
1683
1684
|
}
|
1684
1685
|
}
|
1685
1686
|
|
1687
|
+
if (flags & SWIG_POINTER_CLEAR) {
|
1688
|
+
DATA_PTR(obj) = 0;
|
1689
|
+
}
|
1690
|
+
|
1686
1691
|
/* Do type-checking if type info was provided */
|
1687
1692
|
if (ty) {
|
1688
1693
|
if (ty->clientdata) {
|
@@ -1790,6 +1795,7 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
|
|
1790
1795
|
{
|
1791
1796
|
/* register a new class */
|
1792
1797
|
VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
|
1798
|
+
rb_undef_alloc_func(cl);
|
1793
1799
|
/* create and store the structure pointer to a global variable */
|
1794
1800
|
swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
|
1795
1801
|
rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
|
@@ -1820,7 +1826,7 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
|
|
1820
1826
|
{
|
1821
1827
|
if ( rb_respond_to( proc, swig_arity_id ) )
|
1822
1828
|
{
|
1823
|
-
VALUE num =
|
1829
|
+
VALUE num = rb_funcall2( proc, swig_arity_id, 0, 0 );
|
1824
1830
|
int arity = NUM2INT(num);
|
1825
1831
|
if ( arity < 0 && (arity+1) < -minimal ) return 1;
|
1826
1832
|
if ( arity == minimal ) return 1;
|
@@ -1838,7 +1844,7 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
|
|
1838
1844
|
|
1839
1845
|
#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
|
1840
1846
|
|
1841
|
-
#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; }
|
1847
|
+
#define SWIG_contract_assert(expr, msg) do { if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } } while (0)
|
1842
1848
|
|
1843
1849
|
|
1844
1850
|
|
@@ -1848,12 +1854,13 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
|
|
1848
1854
|
#define SWIGTYPE_p_TagLib__FLAC__Picture swig_types[1]
|
1849
1855
|
#define SWIGTYPE_p_TagLib__ListT_TagLib__FLAC__Picture_t swig_types[2]
|
1850
1856
|
#define SWIGTYPE_p_char swig_types[3]
|
1851
|
-
#define
|
1852
|
-
#define
|
1853
|
-
#define
|
1854
|
-
#define
|
1855
|
-
|
1856
|
-
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};
|
1857
1864
|
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
|
1858
1865
|
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
|
1859
1866
|
|
@@ -1864,12 +1871,56 @@ static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0};
|
|
1864
1871
|
|
1865
1872
|
static VALUE mFLAC;
|
1866
1873
|
|
1867
|
-
#
|
1868
|
-
#
|
1874
|
+
#ifdef __cplusplus
|
1875
|
+
#include <utility>
|
1876
|
+
/* SwigValueWrapper is described in swig.swg */
|
1877
|
+
template<typename T> class SwigValueWrapper {
|
1878
|
+
struct SwigSmartPointer {
|
1879
|
+
T *ptr;
|
1880
|
+
SwigSmartPointer(T *p) : ptr(p) { }
|
1881
|
+
~SwigSmartPointer() { delete ptr; }
|
1882
|
+
SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
|
1883
|
+
void reset(T *p) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = p; }
|
1884
|
+
} pointer;
|
1885
|
+
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
|
1886
|
+
SwigValueWrapper(const SwigValueWrapper<T>& rhs);
|
1887
|
+
public:
|
1888
|
+
SwigValueWrapper() : pointer(0) { }
|
1889
|
+
SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; }
|
1890
|
+
#if __cplusplus >=201103L
|
1891
|
+
SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; }
|
1892
|
+
operator T&&() const { return std::move(*pointer.ptr); }
|
1893
|
+
#else
|
1894
|
+
operator T&() const { return *pointer.ptr; }
|
1895
|
+
#endif
|
1896
|
+
T *operator&() const { return pointer.ptr; }
|
1897
|
+
static void reset(SwigValueWrapper& t, T *p) { t.pointer.reset(p); }
|
1898
|
+
};
|
1899
|
+
|
1900
|
+
/*
|
1901
|
+
* SwigValueInit() is a generic initialisation solution as the following approach:
|
1902
|
+
*
|
1903
|
+
* T c_result = T();
|
1904
|
+
*
|
1905
|
+
* doesn't compile for all types for example:
|
1906
|
+
*
|
1907
|
+
* unsigned int c_result = unsigned int();
|
1908
|
+
*/
|
1909
|
+
template <typename T> T SwigValueInit() {
|
1910
|
+
return T();
|
1911
|
+
}
|
1869
1912
|
|
1913
|
+
#if __cplusplus >=201103L
|
1914
|
+
# define SWIG_STD_MOVE(OBJ) std::move(OBJ)
|
1915
|
+
#else
|
1916
|
+
# define SWIG_STD_MOVE(OBJ) OBJ
|
1917
|
+
#endif
|
1870
1918
|
|
1871
|
-
#
|
1872
|
-
|
1919
|
+
#endif
|
1920
|
+
|
1921
|
+
|
1922
|
+
#define SWIG_RUBY_THREAD_BEGIN_BLOCK
|
1923
|
+
#define SWIG_RUBY_THREAD_END_BLOCK
|
1873
1924
|
|
1874
1925
|
|
1875
1926
|
#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
|
@@ -1901,34 +1952,26 @@ static VALUE mFLAC;
|
|
1901
1952
|
#endif
|
1902
1953
|
|
1903
1954
|
VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
|
1904
|
-
|
1905
|
-
return Qnil;
|
1906
|
-
} else {
|
1907
|
-
return rb_str_new(byteVector.data(), byteVector.size());
|
1908
|
-
}
|
1955
|
+
return rb_str_new(byteVector.data(), byteVector.size());
|
1909
1956
|
}
|
1910
1957
|
|
1911
1958
|
TagLib::ByteVector ruby_string_to_taglib_bytevector(VALUE s) {
|
1912
1959
|
if (NIL_P(s)) {
|
1913
|
-
return TagLib::ByteVector
|
1960
|
+
return TagLib::ByteVector();
|
1914
1961
|
} else {
|
1915
1962
|
return TagLib::ByteVector(RSTRING_PTR(StringValue(s)), RSTRING_LEN(s));
|
1916
1963
|
}
|
1917
1964
|
}
|
1918
1965
|
|
1919
1966
|
VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
|
1920
|
-
|
1921
|
-
|
1922
|
-
|
1923
|
-
VALUE result = rb_str_new2(string.toCString(true));
|
1924
|
-
ASSOCIATE_UTF8_ENCODING(result);
|
1925
|
-
return result;
|
1926
|
-
}
|
1967
|
+
VALUE result = rb_str_new2(string.toCString(true));
|
1968
|
+
ASSOCIATE_UTF8_ENCODING(result);
|
1969
|
+
return result;
|
1927
1970
|
}
|
1928
1971
|
|
1929
1972
|
TagLib::String ruby_string_to_taglib_string(VALUE s) {
|
1930
1973
|
if (NIL_P(s)) {
|
1931
|
-
return TagLib::String
|
1974
|
+
return TagLib::String();
|
1932
1975
|
} else {
|
1933
1976
|
return TagLib::String(RSTRING_PTR(CONVERT_TO_UTF8(StringValue(s))), TagLib::String::UTF8);
|
1934
1977
|
}
|
@@ -2017,6 +2060,13 @@ TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
|
|
2017
2060
|
#endif
|
2018
2061
|
}
|
2019
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
|
+
}
|
2020
2070
|
|
2021
2071
|
|
2022
2072
|
VALUE taglib_flac_picturelist_to_ruby_array(const TagLib::List<TagLib::FLAC::Picture *> & list) {
|
@@ -2050,56 +2100,6 @@ SWIG_From_int (int value)
|
|
2050
2100
|
}
|
2051
2101
|
|
2052
2102
|
|
2053
|
-
SWIGINTERN swig_type_info*
|
2054
|
-
SWIG_pchar_descriptor(void)
|
2055
|
-
{
|
2056
|
-
static int init = 0;
|
2057
|
-
static swig_type_info* info = 0;
|
2058
|
-
if (!init) {
|
2059
|
-
info = SWIG_TypeQuery("_p_char");
|
2060
|
-
init = 1;
|
2061
|
-
}
|
2062
|
-
return info;
|
2063
|
-
}
|
2064
|
-
|
2065
|
-
|
2066
|
-
SWIGINTERN int
|
2067
|
-
SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
|
2068
|
-
{
|
2069
|
-
if (TYPE(obj) == T_STRING) {
|
2070
|
-
char *cstr = StringValuePtr(obj);
|
2071
|
-
size_t size = RSTRING_LEN(obj) + 1;
|
2072
|
-
if (cptr) {
|
2073
|
-
if (alloc) {
|
2074
|
-
if (*alloc == SWIG_NEWOBJ) {
|
2075
|
-
*cptr = reinterpret_cast< char* >(memcpy(new char[size], cstr, sizeof(char)*(size)));
|
2076
|
-
} else {
|
2077
|
-
*cptr = cstr;
|
2078
|
-
*alloc = SWIG_OLDOBJ;
|
2079
|
-
}
|
2080
|
-
}
|
2081
|
-
}
|
2082
|
-
if (psize) *psize = size;
|
2083
|
-
return SWIG_OK;
|
2084
|
-
} else {
|
2085
|
-
swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
|
2086
|
-
if (pchar_descriptor) {
|
2087
|
-
void* vptr = 0;
|
2088
|
-
if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
|
2089
|
-
if (cptr) *cptr = (char *)vptr;
|
2090
|
-
if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
|
2091
|
-
if (alloc) *alloc = SWIG_OLDOBJ;
|
2092
|
-
return SWIG_OK;
|
2093
|
-
}
|
2094
|
-
}
|
2095
|
-
}
|
2096
|
-
return SWIG_TypeError;
|
2097
|
-
}
|
2098
|
-
|
2099
|
-
|
2100
|
-
|
2101
|
-
|
2102
|
-
|
2103
2103
|
SWIGINTERN VALUE
|
2104
2104
|
SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
|
2105
2105
|
{
|
@@ -2107,7 +2107,7 @@ SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
|
|
2107
2107
|
}
|
2108
2108
|
|
2109
2109
|
|
2110
|
-
/*@SWIG:/
|
2110
|
+
/*@SWIG:/swig/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2111
2111
|
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE arg)
|
2112
2112
|
{
|
2113
2113
|
VALUE *args = (VALUE *)arg;
|
@@ -2153,6 +2153,56 @@ SWIG_AsVal_int (VALUE obj, int *val)
|
|
2153
2153
|
}
|
2154
2154
|
|
2155
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
|
+
|
2156
2206
|
SWIGINTERNINLINE VALUE
|
2157
2207
|
SWIG_From_bool (bool value)
|
2158
2208
|
{
|
@@ -2194,6 +2244,54 @@ fail:
|
|
2194
2244
|
|
2195
2245
|
static swig_class SwigClassPicture;
|
2196
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
|
+
|
2197
2295
|
SWIGINTERN VALUE
|
2198
2296
|
_wrap_new_Picture__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
2199
2297
|
TagLib::FLAC::Picture *result = 0 ;
|
@@ -2261,7 +2359,7 @@ SWIGINTERN VALUE _wrap_new_Picture(int nargs, VALUE *args, VALUE self) {
|
|
2261
2359
|
return _wrap_new_Picture__SWIG_0(nargs, args, self);
|
2262
2360
|
}
|
2263
2361
|
if (argc == 1) {
|
2264
|
-
int _v;
|
2362
|
+
int _v = 0;
|
2265
2363
|
int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
|
2266
2364
|
_v = SWIG_CheckState(res);
|
2267
2365
|
if (_v) {
|
@@ -2771,10 +2869,11 @@ static void *_p_TagLib__FLAC__PictureTo_p_TagLib__FLAC__MetadataBlock(void *x, i
|
|
2771
2869
|
}
|
2772
2870
|
static swig_type_info _swigt__p_TagLib__FLAC__MetadataBlock = {"_p_TagLib__FLAC__MetadataBlock", "TagLib::FLAC::MetadataBlock *", 0, 0, (void*)0, 0};
|
2773
2871
|
static swig_type_info _swigt__p_TagLib__FLAC__Picture = {"_p_TagLib__FLAC__Picture", "TagLib::FLAC::Picture *", 0, 0, (void*)0, 0};
|
2774
|
-
static swig_type_info _swigt__p_TagLib__ListT_TagLib__FLAC__Picture_t = {"_p_TagLib__ListT_TagLib__FLAC__Picture_t", "TagLib::List< TagLib::FLAC::Picture >
|
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};
|
2775
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};
|
2776
2875
|
static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "TagLib::uchar *|unsigned char *", 0, 0, (void*)0, 0};
|
2777
|
-
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int
|
2876
|
+
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "TagLib::uint *|unsigned int *", 0, 0, (void*)0, 0};
|
2778
2877
|
static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "TagLib::ulong *|unsigned long *", 0, 0, (void*)0, 0};
|
2779
2878
|
static swig_type_info _swigt__p_wchar_t = {"_p_wchar_t", "TagLib::wchar *|wchar_t *", 0, 0, (void*)0, 0};
|
2780
2879
|
|
@@ -2783,6 +2882,7 @@ static swig_type_info *swig_type_initial[] = {
|
|
2783
2882
|
&_swigt__p_TagLib__FLAC__Picture,
|
2784
2883
|
&_swigt__p_TagLib__ListT_TagLib__FLAC__Picture_t,
|
2785
2884
|
&_swigt__p_char,
|
2885
|
+
&_swigt__p_long_long,
|
2786
2886
|
&_swigt__p_unsigned_char,
|
2787
2887
|
&_swigt__p_unsigned_int,
|
2788
2888
|
&_swigt__p_unsigned_long,
|
@@ -2793,6 +2893,7 @@ static swig_cast_info _swigc__p_TagLib__FLAC__MetadataBlock[] = { {&_swigt__p_T
|
|
2793
2893
|
static swig_cast_info _swigc__p_TagLib__FLAC__Picture[] = { {&_swigt__p_TagLib__FLAC__Picture, 0, 0, 0},{0, 0, 0, 0}};
|
2794
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}};
|
2795
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}};
|
2796
2897
|
static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
|
2797
2898
|
static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
|
2798
2899
|
static swig_cast_info _swigc__p_unsigned_long[] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};
|
@@ -2803,6 +2904,7 @@ static swig_cast_info *swig_cast_initial[] = {
|
|
2803
2904
|
_swigc__p_TagLib__FLAC__Picture,
|
2804
2905
|
_swigc__p_TagLib__ListT_TagLib__FLAC__Picture_t,
|
2805
2906
|
_swigc__p_char,
|
2907
|
+
_swigc__p_long_long,
|
2806
2908
|
_swigc__p_unsigned_char,
|
2807
2909
|
_swigc__p_unsigned_int,
|
2808
2910
|
_swigc__p_unsigned_long,
|
@@ -2864,9 +2966,12 @@ extern "C" {
|
|
2864
2966
|
#define SWIGRUNTIME_DEBUG
|
2865
2967
|
#endif
|
2866
2968
|
|
2969
|
+
#ifndef SWIG_INIT_CLIENT_DATA_TYPE
|
2970
|
+
#define SWIG_INIT_CLIENT_DATA_TYPE void *
|
2971
|
+
#endif
|
2867
2972
|
|
2868
2973
|
SWIGRUNTIME void
|
2869
|
-
SWIG_InitializeModule(
|
2974
|
+
SWIG_InitializeModule(SWIG_INIT_CLIENT_DATA_TYPE clientdata) {
|
2870
2975
|
size_t i;
|
2871
2976
|
swig_module_info *module_head, *iter;
|
2872
2977
|
int init;
|
@@ -3104,6 +3209,8 @@ SWIGEXPORT void Init_taglib_flac_picture(void) {
|
|
3104
3209
|
rb_define_const(SwigClassPicture.klass, "Illustration", SWIG_From_int(static_cast< int >(TagLib::FLAC::Picture::Illustration)));
|
3105
3210
|
rb_define_const(SwigClassPicture.klass, "BandLogo", SWIG_From_int(static_cast< int >(TagLib::FLAC::Picture::BandLogo)));
|
3106
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);
|
3107
3214
|
rb_define_method(SwigClassPicture.klass, "type", VALUEFUNC(_wrap_Picture_type), -1);
|
3108
3215
|
rb_define_method(SwigClassPicture.klass, "type=", VALUEFUNC(_wrap_Picture_typee___), -1);
|
3109
3216
|
rb_define_method(SwigClassPicture.klass, "mime_type", VALUEFUNC(_wrap_Picture_mime_type), -1);
|