taglib-ruby 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGES.md +9 -0
- data/README.md +40 -9
- data/Rakefile +1 -2
- data/docs/taglib/aiff.rb +63 -0
- data/docs/taglib/base.rb +22 -1
- data/docs/taglib/id3v2.rb +21 -2
- data/docs/taglib/riff.rb +3 -0
- data/docs/taglib/wav.rb +63 -0
- data/ext/extconf_common.rb +15 -1
- data/ext/taglib_aiff/extconf.rb +4 -0
- data/ext/taglib_aiff/taglib_aiff.i +68 -0
- data/ext/taglib_aiff/taglib_aiff_wrap.cxx +2920 -0
- data/ext/taglib_base/includes.i +7 -2
- data/ext/taglib_base/taglib_base_wrap.cxx +109 -115
- data/ext/taglib_flac/taglib_flac_wrap.cxx +108 -114
- data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +109 -115
- data/ext/taglib_id3v2/taglib_id3v2.i +3 -1
- data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +139 -119
- data/ext/taglib_mp4/taglib_mp4_wrap.cxx +109 -115
- data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +108 -114
- data/ext/taglib_ogg/taglib_ogg_wrap.cxx +109 -115
- data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +108 -114
- data/ext/taglib_wav/extconf.rb +4 -0
- data/ext/taglib_wav/taglib_wav.i +66 -0
- data/ext/taglib_wav/taglib_wav_wrap.cxx +3057 -0
- data/lib/taglib.rb +2 -0
- data/lib/taglib/aiff.rb +7 -0
- data/lib/taglib/version.rb +1 -1
- data/lib/taglib/wav.rb +7 -0
- data/taglib-ruby.gemspec +27 -2
- data/tasks/ext.rake +17 -10
- data/tasks/swig.rake +10 -0
- data/test/aiff_examples_test.rb +39 -0
- data/test/aiff_file_test.rb +94 -0
- data/test/aiff_file_write_test.rb +88 -0
- data/test/data/Makefile +8 -2
- data/test/data/aiff-sample.aiff +0 -0
- data/test/data/wav-create.cpp +55 -0
- data/test/data/wav-dump.cpp +74 -0
- data/test/data/wav-sample.wav +0 -0
- data/test/file_test.rb +21 -0
- data/test/id3v2_unknown_frames_test.rb +30 -0
- data/test/wav_examples_test.rb +42 -0
- data/test/wav_file_test.rb +96 -0
- data/test/wav_file_write_test.rb +88 -0
- metadata +49 -45
@@ -32,7 +32,9 @@ VALUE taglib_id3v2_frame_to_ruby_object(const TagLib::ID3v2::Frame *frame) {
|
|
32
32
|
TagLib::ByteVector id = frame->frameID();
|
33
33
|
void *f = SWIG_as_voidptr(frame);
|
34
34
|
swig_type_info *ti;
|
35
|
-
if (
|
35
|
+
if (dynamic_cast<const TagLib::ID3v2::UnknownFrame *>(frame))
|
36
|
+
ti = SWIGTYPE_p_TagLib__ID3v2__UnknownFrame;
|
37
|
+
else if (id == "APIC")
|
36
38
|
ti = SWIGTYPE_p_TagLib__ID3v2__AttachedPictureFrame;
|
37
39
|
else if (id == "COMM")
|
38
40
|
ti = SWIGTYPE_p_TagLib__ID3v2__CommentsFrame;
|
@@ -1,11 +1,11 @@
|
|
1
1
|
/* ----------------------------------------------------------------------------
|
2
2
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
3
|
-
* Version 2.0.
|
4
|
-
*
|
5
|
-
* This file is not intended to be easily readable and contains a number of
|
3
|
+
* Version 2.0.12
|
4
|
+
*
|
5
|
+
* This file is not intended to be easily readable and contains a number of
|
6
6
|
* coding conventions designed to improve portability and efficiency. Do not make
|
7
|
-
* changes to this file unless you know what you are doing--modify the SWIG
|
8
|
-
* interface file instead.
|
7
|
+
* changes to this file unless you know what you are doing--modify the SWIG
|
8
|
+
* interface file instead.
|
9
9
|
* ----------------------------------------------------------------------------- */
|
10
10
|
|
11
11
|
#define SWIGRUBY
|
@@ -65,28 +65,28 @@ template <typename T> T SwigValueInit() {
|
|
65
65
|
#ifndef SWIGUNUSED
|
66
66
|
# if defined(__GNUC__)
|
67
67
|
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
68
|
-
# define SWIGUNUSED __attribute__ ((__unused__))
|
68
|
+
# define SWIGUNUSED __attribute__ ((__unused__))
|
69
69
|
# else
|
70
70
|
# define SWIGUNUSED
|
71
71
|
# endif
|
72
72
|
# elif defined(__ICC)
|
73
|
-
# define SWIGUNUSED __attribute__ ((__unused__))
|
73
|
+
# define SWIGUNUSED __attribute__ ((__unused__))
|
74
74
|
# else
|
75
|
-
# define SWIGUNUSED
|
75
|
+
# define SWIGUNUSED
|
76
76
|
# endif
|
77
77
|
#endif
|
78
78
|
|
79
79
|
#ifndef SWIG_MSC_UNSUPPRESS_4505
|
80
80
|
# if defined(_MSC_VER)
|
81
81
|
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
|
82
|
-
# endif
|
82
|
+
# endif
|
83
83
|
#endif
|
84
84
|
|
85
85
|
#ifndef SWIGUNUSEDPARM
|
86
86
|
# ifdef __cplusplus
|
87
87
|
# define SWIGUNUSEDPARM(p)
|
88
88
|
# else
|
89
|
-
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
|
89
|
+
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
|
90
90
|
# endif
|
91
91
|
#endif
|
92
92
|
|
@@ -129,7 +129,7 @@ template <typename T> T SwigValueInit() {
|
|
129
129
|
# define SWIGSTDCALL __stdcall
|
130
130
|
# else
|
131
131
|
# define SWIGSTDCALL
|
132
|
-
# endif
|
132
|
+
# endif
|
133
133
|
#endif
|
134
134
|
|
135
135
|
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
|
@@ -174,28 +174,28 @@ template <typename T> T SwigValueInit() {
|
|
174
174
|
#ifndef SWIGUNUSED
|
175
175
|
# if defined(__GNUC__)
|
176
176
|
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
177
|
-
# define SWIGUNUSED __attribute__ ((__unused__))
|
177
|
+
# define SWIGUNUSED __attribute__ ((__unused__))
|
178
178
|
# else
|
179
179
|
# define SWIGUNUSED
|
180
180
|
# endif
|
181
181
|
# elif defined(__ICC)
|
182
|
-
# define SWIGUNUSED __attribute__ ((__unused__))
|
182
|
+
# define SWIGUNUSED __attribute__ ((__unused__))
|
183
183
|
# else
|
184
|
-
# define SWIGUNUSED
|
184
|
+
# define SWIGUNUSED
|
185
185
|
# endif
|
186
186
|
#endif
|
187
187
|
|
188
188
|
#ifndef SWIG_MSC_UNSUPPRESS_4505
|
189
189
|
# if defined(_MSC_VER)
|
190
190
|
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
|
191
|
-
# endif
|
191
|
+
# endif
|
192
192
|
#endif
|
193
193
|
|
194
194
|
#ifndef SWIGUNUSEDPARM
|
195
195
|
# ifdef __cplusplus
|
196
196
|
# define SWIGUNUSEDPARM(p)
|
197
197
|
# else
|
198
|
-
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
|
198
|
+
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
|
199
199
|
# endif
|
200
200
|
#endif
|
201
201
|
|
@@ -238,7 +238,7 @@ template <typename T> T SwigValueInit() {
|
|
238
238
|
# define SWIGSTDCALL __stdcall
|
239
239
|
# else
|
240
240
|
# define SWIGSTDCALL
|
241
|
-
# endif
|
241
|
+
# endif
|
242
242
|
#endif
|
243
243
|
|
244
244
|
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
|
@@ -276,7 +276,7 @@ template <typename T> T SwigValueInit() {
|
|
276
276
|
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
|
277
277
|
creating a static or dynamic library from the SWIG runtime code.
|
278
278
|
In 99.9% of the cases, SWIG just needs to declare them as 'static'.
|
279
|
-
|
279
|
+
|
280
280
|
But only do this if strictly necessary, ie, if you have problems
|
281
281
|
with your compiler or suchlike.
|
282
282
|
*/
|
@@ -302,16 +302,16 @@ template <typename T> T SwigValueInit() {
|
|
302
302
|
#define SWIG_POINTER_OWN 0x1
|
303
303
|
|
304
304
|
|
305
|
-
/*
|
305
|
+
/*
|
306
306
|
Flags/methods for returning states.
|
307
|
-
|
308
|
-
The SWIG conversion methods, as ConvertPtr, return an integer
|
307
|
+
|
308
|
+
The SWIG conversion methods, as ConvertPtr, return an integer
|
309
309
|
that tells if the conversion was successful or not. And if not,
|
310
310
|
an error code can be returned (see swigerrors.swg for the codes).
|
311
|
-
|
311
|
+
|
312
312
|
Use the following macros/flags to set or process the returning
|
313
313
|
states.
|
314
|
-
|
314
|
+
|
315
315
|
In old versions of SWIG, code such as the following was usually written:
|
316
316
|
|
317
317
|
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
|
@@ -344,23 +344,23 @@ template <typename T> T SwigValueInit() {
|
|
344
344
|
} else {
|
345
345
|
// fail code
|
346
346
|
}
|
347
|
-
|
347
|
+
|
348
348
|
I.e., now SWIG_ConvertPtr can return new objects and you can
|
349
349
|
identify the case and take care of the deallocation. Of course that
|
350
350
|
also requires SWIG_ConvertPtr to return new result values, such as
|
351
351
|
|
352
|
-
int SWIG_ConvertPtr(obj, ptr,...) {
|
353
|
-
if (<obj is ok>) {
|
354
|
-
if (<need new object>) {
|
355
|
-
*ptr = <ptr to new allocated object>;
|
356
|
-
return SWIG_NEWOBJ;
|
357
|
-
} else {
|
358
|
-
*ptr = <ptr to old object>;
|
359
|
-
return SWIG_OLDOBJ;
|
360
|
-
}
|
361
|
-
} else {
|
362
|
-
return SWIG_BADOBJ;
|
363
|
-
}
|
352
|
+
int SWIG_ConvertPtr(obj, ptr,...) {
|
353
|
+
if (<obj is ok>) {
|
354
|
+
if (<need new object>) {
|
355
|
+
*ptr = <ptr to new allocated object>;
|
356
|
+
return SWIG_NEWOBJ;
|
357
|
+
} else {
|
358
|
+
*ptr = <ptr to old object>;
|
359
|
+
return SWIG_OLDOBJ;
|
360
|
+
}
|
361
|
+
} else {
|
362
|
+
return SWIG_BADOBJ;
|
363
|
+
}
|
364
364
|
}
|
365
365
|
|
366
366
|
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
|
@@ -374,17 +374,17 @@ template <typename T> T SwigValueInit() {
|
|
374
374
|
int fooi(int);
|
375
375
|
|
376
376
|
and you call
|
377
|
-
|
377
|
+
|
378
378
|
food(1) // cast rank '1' (1 -> 1.0)
|
379
379
|
fooi(1) // cast rank '0'
|
380
380
|
|
381
381
|
just use the SWIG_AddCast()/SWIG_CheckState()
|
382
382
|
*/
|
383
383
|
|
384
|
-
#define SWIG_OK (0)
|
384
|
+
#define SWIG_OK (0)
|
385
385
|
#define SWIG_ERROR (-1)
|
386
386
|
#define SWIG_IsOK(r) (r >= 0)
|
387
|
-
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
|
387
|
+
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
|
388
388
|
|
389
389
|
/* The CastRankLimit says how many bits are used for the cast rank */
|
390
390
|
#define SWIG_CASTRANKLIMIT (1 << 8)
|
@@ -415,14 +415,14 @@ template <typename T> T SwigValueInit() {
|
|
415
415
|
# endif
|
416
416
|
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
|
417
417
|
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
|
418
|
-
SWIGINTERNINLINE int SWIG_AddCast(int r) {
|
418
|
+
SWIGINTERNINLINE int SWIG_AddCast(int r) {
|
419
419
|
return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
|
420
420
|
}
|
421
|
-
SWIGINTERNINLINE int SWIG_CheckState(int r) {
|
422
|
-
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
|
421
|
+
SWIGINTERNINLINE int SWIG_CheckState(int r) {
|
422
|
+
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
|
423
423
|
}
|
424
424
|
#else /* no cast-rank mode */
|
425
|
-
# define SWIG_AddCast
|
425
|
+
# define SWIG_AddCast(r) (r)
|
426
426
|
# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
|
427
427
|
#endif
|
428
428
|
|
@@ -466,7 +466,7 @@ typedef struct swig_module_info {
|
|
466
466
|
void *clientdata; /* Language specific module data */
|
467
467
|
} swig_module_info;
|
468
468
|
|
469
|
-
/*
|
469
|
+
/*
|
470
470
|
Compare two type names skipping the space characters, therefore
|
471
471
|
"char*" == "char *" and "Class<int>" == "Class<int >", etc.
|
472
472
|
|
@@ -486,18 +486,18 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
|
|
486
486
|
|
487
487
|
/*
|
488
488
|
Check type equivalence in a name list like <name1>|<name2>|...
|
489
|
-
Return 0 if
|
489
|
+
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
|
490
490
|
*/
|
491
491
|
SWIGRUNTIME int
|
492
|
-
|
493
|
-
int equiv =
|
492
|
+
SWIG_TypeCmp(const char *nb, const char *tb) {
|
493
|
+
int equiv = 1;
|
494
494
|
const char* te = tb + strlen(tb);
|
495
495
|
const char* ne = nb;
|
496
|
-
while (
|
496
|
+
while (equiv != 0 && *ne) {
|
497
497
|
for (nb = ne; *ne; ++ne) {
|
498
498
|
if (*ne == '|') break;
|
499
499
|
}
|
500
|
-
equiv =
|
500
|
+
equiv = SWIG_TypeNameComp(nb, ne, tb, te);
|
501
501
|
if (*ne) ++ne;
|
502
502
|
}
|
503
503
|
return equiv;
|
@@ -505,24 +505,13 @@ SWIG_TypeEquiv(const char *nb, const char *tb) {
|
|
505
505
|
|
506
506
|
/*
|
507
507
|
Check type equivalence in a name list like <name1>|<name2>|...
|
508
|
-
Return 0 if equal,
|
508
|
+
Return 0 if not equal, 1 if equal
|
509
509
|
*/
|
510
510
|
SWIGRUNTIME int
|
511
|
-
|
512
|
-
|
513
|
-
const char* te = tb + strlen(tb);
|
514
|
-
const char* ne = nb;
|
515
|
-
while (!equiv && *ne) {
|
516
|
-
for (nb = ne; *ne; ++ne) {
|
517
|
-
if (*ne == '|') break;
|
518
|
-
}
|
519
|
-
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
|
520
|
-
if (*ne) ++ne;
|
521
|
-
}
|
522
|
-
return equiv;
|
511
|
+
SWIG_TypeEquiv(const char *nb, const char *tb) {
|
512
|
+
return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
|
523
513
|
}
|
524
514
|
|
525
|
-
|
526
515
|
/*
|
527
516
|
Check the typename
|
528
517
|
*/
|
@@ -550,7 +539,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
|
|
550
539
|
return 0;
|
551
540
|
}
|
552
541
|
|
553
|
-
/*
|
542
|
+
/*
|
554
543
|
Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
|
555
544
|
*/
|
556
545
|
SWIGRUNTIME swig_cast_info *
|
@@ -585,7 +574,7 @@ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
|
|
585
574
|
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
|
586
575
|
}
|
587
576
|
|
588
|
-
/*
|
577
|
+
/*
|
589
578
|
Dynamic pointer casting. Down an inheritance hierarchy
|
590
579
|
*/
|
591
580
|
SWIGRUNTIME swig_type_info *
|
@@ -629,7 +618,7 @@ SWIG_TypePrettyName(const swig_type_info *type) {
|
|
629
618
|
return type->name;
|
630
619
|
}
|
631
620
|
|
632
|
-
/*
|
621
|
+
/*
|
633
622
|
Set the clientdata field for a type
|
634
623
|
*/
|
635
624
|
SWIGRUNTIME void
|
@@ -637,14 +626,14 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
|
|
637
626
|
swig_cast_info *cast = ti->cast;
|
638
627
|
/* if (ti->clientdata == clientdata) return; */
|
639
628
|
ti->clientdata = clientdata;
|
640
|
-
|
629
|
+
|
641
630
|
while (cast) {
|
642
631
|
if (!cast->converter) {
|
643
632
|
swig_type_info *tc = cast->type;
|
644
633
|
if (!tc->clientdata) {
|
645
634
|
SWIG_TypeClientData(tc, clientdata);
|
646
635
|
}
|
647
|
-
}
|
636
|
+
}
|
648
637
|
cast = cast->next;
|
649
638
|
}
|
650
639
|
}
|
@@ -653,18 +642,18 @@ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
|
|
653
642
|
SWIG_TypeClientData(ti, clientdata);
|
654
643
|
ti->owndata = 1;
|
655
644
|
}
|
656
|
-
|
645
|
+
|
657
646
|
/*
|
658
647
|
Search for a swig_type_info structure only by mangled name
|
659
648
|
Search is a O(log #types)
|
660
|
-
|
661
|
-
We start searching at module start, and finish searching when start == end.
|
649
|
+
|
650
|
+
We start searching at module start, and finish searching when start == end.
|
662
651
|
Note: if start == end at the beginning of the function, we go all the way around
|
663
652
|
the circular list.
|
664
653
|
*/
|
665
654
|
SWIGRUNTIME swig_type_info *
|
666
|
-
SWIG_MangledTypeQueryModule(swig_module_info *start,
|
667
|
-
swig_module_info *end,
|
655
|
+
SWIG_MangledTypeQueryModule(swig_module_info *start,
|
656
|
+
swig_module_info *end,
|
668
657
|
const char *name) {
|
669
658
|
swig_module_info *iter = start;
|
670
659
|
do {
|
@@ -673,11 +662,11 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
|
|
673
662
|
register size_t r = iter->size - 1;
|
674
663
|
do {
|
675
664
|
/* since l+r >= 0, we can (>> 1) instead (/ 2) */
|
676
|
-
register size_t i = (l + r) >> 1;
|
665
|
+
register size_t i = (l + r) >> 1;
|
677
666
|
const char *iname = iter->types[i]->name;
|
678
667
|
if (iname) {
|
679
668
|
register int compare = strcmp(name, iname);
|
680
|
-
if (compare == 0) {
|
669
|
+
if (compare == 0) {
|
681
670
|
return iter->types[i];
|
682
671
|
} else if (compare < 0) {
|
683
672
|
if (i) {
|
@@ -702,14 +691,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start,
|
|
702
691
|
Search for a swig_type_info structure for either a mangled name or a human readable name.
|
703
692
|
It first searches the mangled names of the types, which is a O(log #types)
|
704
693
|
If a type is not found it then searches the human readable names, which is O(#types).
|
705
|
-
|
706
|
-
We start searching at module start, and finish searching when start == end.
|
694
|
+
|
695
|
+
We start searching at module start, and finish searching when start == end.
|
707
696
|
Note: if start == end at the beginning of the function, we go all the way around
|
708
697
|
the circular list.
|
709
698
|
*/
|
710
699
|
SWIGRUNTIME swig_type_info *
|
711
|
-
SWIG_TypeQueryModule(swig_module_info *start,
|
712
|
-
swig_module_info *end,
|
700
|
+
SWIG_TypeQueryModule(swig_module_info *start,
|
701
|
+
swig_module_info *end,
|
713
702
|
const char *name) {
|
714
703
|
/* STEP 1: Search the name field using binary search */
|
715
704
|
swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
|
@@ -728,12 +717,12 @@ SWIG_TypeQueryModule(swig_module_info *start,
|
|
728
717
|
iter = iter->next;
|
729
718
|
} while (iter != end);
|
730
719
|
}
|
731
|
-
|
720
|
+
|
732
721
|
/* neither found a match */
|
733
722
|
return 0;
|
734
723
|
}
|
735
724
|
|
736
|
-
/*
|
725
|
+
/*
|
737
726
|
Pack binary data into a string
|
738
727
|
*/
|
739
728
|
SWIGRUNTIME char *
|
@@ -749,7 +738,7 @@ SWIG_PackData(char *c, void *ptr, size_t sz) {
|
|
749
738
|
return c;
|
750
739
|
}
|
751
740
|
|
752
|
-
/*
|
741
|
+
/*
|
753
742
|
Unpack binary data from a string
|
754
743
|
*/
|
755
744
|
SWIGRUNTIME const char *
|
@@ -763,21 +752,21 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
|
|
763
752
|
uu = ((d - '0') << 4);
|
764
753
|
else if ((d >= 'a') && (d <= 'f'))
|
765
754
|
uu = ((d - ('a'-10)) << 4);
|
766
|
-
else
|
755
|
+
else
|
767
756
|
return (char *) 0;
|
768
757
|
d = *(c++);
|
769
758
|
if ((d >= '0') && (d <= '9'))
|
770
759
|
uu |= (d - '0');
|
771
760
|
else if ((d >= 'a') && (d <= 'f'))
|
772
761
|
uu |= (d - ('a'-10));
|
773
|
-
else
|
762
|
+
else
|
774
763
|
return (char *) 0;
|
775
764
|
*u = uu;
|
776
765
|
}
|
777
766
|
return c;
|
778
767
|
}
|
779
768
|
|
780
|
-
/*
|
769
|
+
/*
|
781
770
|
Pack 'void *' into a string buffer.
|
782
771
|
*/
|
783
772
|
SWIGRUNTIME char *
|
@@ -837,18 +826,18 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
|
|
837
826
|
#endif
|
838
827
|
|
839
828
|
/* Errors in SWIG */
|
840
|
-
#define SWIG_UnknownError -1
|
841
|
-
#define SWIG_IOError -2
|
842
|
-
#define SWIG_RuntimeError -3
|
843
|
-
#define SWIG_IndexError -4
|
844
|
-
#define SWIG_TypeError -5
|
845
|
-
#define SWIG_DivisionByZero -6
|
846
|
-
#define SWIG_OverflowError -7
|
847
|
-
#define SWIG_SyntaxError -8
|
848
|
-
#define SWIG_ValueError -9
|
829
|
+
#define SWIG_UnknownError -1
|
830
|
+
#define SWIG_IOError -2
|
831
|
+
#define SWIG_RuntimeError -3
|
832
|
+
#define SWIG_IndexError -4
|
833
|
+
#define SWIG_TypeError -5
|
834
|
+
#define SWIG_DivisionByZero -6
|
835
|
+
#define SWIG_OverflowError -7
|
836
|
+
#define SWIG_SyntaxError -8
|
837
|
+
#define SWIG_ValueError -9
|
849
838
|
#define SWIG_SystemError -10
|
850
839
|
#define SWIG_AttributeError -11
|
851
|
-
#define SWIG_MemoryError -12
|
840
|
+
#define SWIG_MemoryError -12
|
852
841
|
#define SWIG_NullReferenceError -13
|
853
842
|
|
854
843
|
|
@@ -1774,7 +1763,7 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
|
|
1774
1763
|
SWIGINTERN
|
1775
1764
|
int SWIG_Ruby_isCallable( VALUE proc )
|
1776
1765
|
{
|
1777
|
-
if ( rb_respond_to( proc, swig_call_id )
|
1766
|
+
if ( rb_respond_to( proc, swig_call_id ) )
|
1778
1767
|
return 1;
|
1779
1768
|
return 0;
|
1780
1769
|
}
|
@@ -1787,7 +1776,7 @@ int SWIG_Ruby_isCallable( VALUE proc )
|
|
1787
1776
|
SWIGINTERN
|
1788
1777
|
int SWIG_Ruby_arity( VALUE proc, int minimal )
|
1789
1778
|
{
|
1790
|
-
if ( rb_respond_to( proc, swig_arity_id )
|
1779
|
+
if ( rb_respond_to( proc, swig_arity_id ) )
|
1791
1780
|
{
|
1792
1781
|
VALUE num = rb_funcall( proc, swig_arity_id, 0 );
|
1793
1782
|
int arity = NUM2INT(num);
|
@@ -1861,7 +1850,7 @@ static VALUE mID3v2;
|
|
1861
1850
|
#define SWIG_RUBY_THREAD_END_BLOCK
|
1862
1851
|
|
1863
1852
|
|
1864
|
-
#define SWIGVERSION
|
1853
|
+
#define SWIGVERSION 0x020012
|
1865
1854
|
#define SWIG_VERSION SWIGVERSION
|
1866
1855
|
|
1867
1856
|
|
@@ -1897,9 +1886,11 @@ static VALUE mID3v2;
|
|
1897
1886
|
#if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
|
1898
1887
|
# include <ruby/encoding.h>
|
1899
1888
|
# define ASSOCIATE_UTF8_ENCODING(value) rb_enc_associate(value, rb_utf8_encoding());
|
1889
|
+
# define ASSOCIATE_FILESYSTEM_ENCODING(value) rb_enc_associate(value, rb_filesystem_encoding());
|
1900
1890
|
# define CONVERT_TO_UTF8(value) rb_str_export_to_enc(value, rb_utf8_encoding())
|
1901
1891
|
#else
|
1902
1892
|
# define ASSOCIATE_UTF8_ENCODING(value) /* nothing */
|
1893
|
+
# define ASSOCIATE_FILESYSTEM_ENCODING(value)
|
1903
1894
|
# define CONVERT_TO_UTF8(value) value
|
1904
1895
|
#endif
|
1905
1896
|
|
@@ -1960,12 +1951,15 @@ TagLib::StringList ruby_array_to_taglib_string_list(VALUE ary) {
|
|
1960
1951
|
}
|
1961
1952
|
|
1962
1953
|
VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
|
1954
|
+
VALUE result;
|
1963
1955
|
#ifdef _WIN32
|
1964
1956
|
const char *s = (const char *) filename;
|
1965
|
-
|
1957
|
+
result = rb_tainted_str_new2(s);
|
1966
1958
|
#else
|
1967
|
-
|
1959
|
+
result = rb_tainted_str_new2(filename);
|
1968
1960
|
#endif
|
1961
|
+
ASSOCIATE_FILESYSTEM_ENCODING(result);
|
1962
|
+
return result;
|
1969
1963
|
}
|
1970
1964
|
|
1971
1965
|
TagLib::FileName ruby_string_to_taglib_filename(VALUE s) {
|
@@ -2001,7 +1995,9 @@ VALUE taglib_id3v2_frame_to_ruby_object(const TagLib::ID3v2::Frame *frame) {
|
|
2001
1995
|
TagLib::ByteVector id = frame->frameID();
|
2002
1996
|
void *f = SWIG_as_voidptr(frame);
|
2003
1997
|
swig_type_info *ti;
|
2004
|
-
if (
|
1998
|
+
if (dynamic_cast<const TagLib::ID3v2::UnknownFrame *>(frame))
|
1999
|
+
ti = SWIGTYPE_p_TagLib__ID3v2__UnknownFrame;
|
2000
|
+
else if (id == "APIC")
|
2005
2001
|
ti = SWIGTYPE_p_TagLib__ID3v2__AttachedPictureFrame;
|
2006
2002
|
else if (id == "COMM")
|
2007
2003
|
ti = SWIGTYPE_p_TagLib__ID3v2__CommentsFrame;
|
@@ -2124,7 +2120,7 @@ SWIG_ruby_failed(void)
|
|
2124
2120
|
}
|
2125
2121
|
|
2126
2122
|
|
2127
|
-
/*@SWIG:/usr/local/share/swig/2.0.
|
2123
|
+
/*@SWIG:/usr/local/share/swig/2.0.12/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2128
2124
|
SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
|
2129
2125
|
{
|
2130
2126
|
VALUE obj = args[0];
|
@@ -2176,7 +2172,7 @@ SWIG_From_bool (bool value)
|
|
2176
2172
|
}
|
2177
2173
|
|
2178
2174
|
|
2179
|
-
/*@SWIG:/usr/local/share/swig/2.0.
|
2175
|
+
/*@SWIG:/usr/local/share/swig/2.0.12/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2180
2176
|
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
|
2181
2177
|
{
|
2182
2178
|
VALUE obj = args[0];
|
@@ -2314,13 +2310,37 @@ SWIG_From_float (float value)
|
|
2314
2310
|
#include <float.h>
|
2315
2311
|
|
2316
2312
|
|
2317
|
-
|
2313
|
+
#include <math.h>
|
2314
|
+
|
2315
|
+
|
2316
|
+
/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */
|
2317
|
+
#ifndef SWIG_isfinite
|
2318
|
+
# if defined(isfinite)
|
2319
|
+
# define SWIG_isfinite(X) (isfinite(X))
|
2320
|
+
# elif defined(_MSC_VER)
|
2321
|
+
# define SWIG_isfinite(X) (_finite(X))
|
2322
|
+
# elif defined(__sun) && defined(__SVR4)
|
2323
|
+
# include <ieeefp.h>
|
2324
|
+
# define SWIG_isfinite(X) (finite(X))
|
2325
|
+
# endif
|
2326
|
+
#endif
|
2327
|
+
|
2328
|
+
|
2329
|
+
/* Accept infinite as a valid float value unless we are unable to check if a value is finite */
|
2330
|
+
#ifdef SWIG_isfinite
|
2331
|
+
# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X))
|
2332
|
+
#else
|
2333
|
+
# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX))
|
2334
|
+
#endif
|
2335
|
+
|
2336
|
+
|
2337
|
+
/*@SWIG:/usr/local/share/swig/2.0.12/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2318
2338
|
SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
|
2319
2339
|
{
|
2320
2340
|
VALUE obj = args[0];
|
2321
2341
|
VALUE type = TYPE(obj);
|
2322
2342
|
double *res = (double *)(args[1]);
|
2323
|
-
*res = NUM2DBL(obj);
|
2343
|
+
*res = NUM2DBL(obj); (void)type;
|
2324
2344
|
return obj;
|
2325
2345
|
}
|
2326
2346
|
/*@SWIG@*/
|
@@ -2349,7 +2369,7 @@ SWIG_AsVal_float (VALUE obj, float *val)
|
|
2349
2369
|
double v;
|
2350
2370
|
int res = SWIG_AsVal_double (obj, &v);
|
2351
2371
|
if (SWIG_IsOK(res)) {
|
2352
|
-
if ((v
|
2372
|
+
if (SWIG_Float_Overflow_Check(v)) {
|
2353
2373
|
return SWIG_OverflowError;
|
2354
2374
|
} else {
|
2355
2375
|
if (val) *val = static_cast< float >(v);
|
@@ -8918,18 +8938,18 @@ static swig_cast_info *swig_cast_initial[] = {
|
|
8918
8938
|
|
8919
8939
|
/* -----------------------------------------------------------------------------
|
8920
8940
|
* Type initialization:
|
8921
|
-
* This problem is tough by the requirement that no dynamic
|
8922
|
-
* memory is used. Also, since swig_type_info structures store pointers to
|
8941
|
+
* This problem is tough by the requirement that no dynamic
|
8942
|
+
* memory is used. Also, since swig_type_info structures store pointers to
|
8923
8943
|
* swig_cast_info structures and swig_cast_info structures store pointers back
|
8924
|
-
* to swig_type_info structures, we need some lookup code at initialization.
|
8925
|
-
* The idea is that swig generates all the structures that are needed.
|
8926
|
-
* The runtime then collects these partially filled structures.
|
8927
|
-
* The SWIG_InitializeModule function takes these initial arrays out of
|
8944
|
+
* to swig_type_info structures, we need some lookup code at initialization.
|
8945
|
+
* The idea is that swig generates all the structures that are needed.
|
8946
|
+
* The runtime then collects these partially filled structures.
|
8947
|
+
* The SWIG_InitializeModule function takes these initial arrays out of
|
8928
8948
|
* swig_module, and does all the lookup, filling in the swig_module.types
|
8929
8949
|
* array with the correct data and linking the correct swig_cast_info
|
8930
8950
|
* structures together.
|
8931
8951
|
*
|
8932
|
-
* The generated swig_type_info structures are assigned staticly to an initial
|
8952
|
+
* The generated swig_type_info structures are assigned staticly to an initial
|
8933
8953
|
* array. We just loop through that array, and handle each type individually.
|
8934
8954
|
* First we lookup if this type has been already loaded, and if so, use the
|
8935
8955
|
* loaded structure instead of the generated one. Then we have to fill in the
|
@@ -8939,17 +8959,17 @@ static swig_cast_info *swig_cast_initial[] = {
|
|
8939
8959
|
* a column is one of the swig_cast_info structures for that type.
|
8940
8960
|
* The cast_initial array is actually an array of arrays, because each row has
|
8941
8961
|
* a variable number of columns. So to actually build the cast linked list,
|
8942
|
-
* we find the array of casts associated with the type, and loop through it
|
8962
|
+
* we find the array of casts associated with the type, and loop through it
|
8943
8963
|
* adding the casts to the list. The one last trick we need to do is making
|
8944
8964
|
* sure the type pointer in the swig_cast_info struct is correct.
|
8945
8965
|
*
|
8946
|
-
* First off, we lookup the cast->type name to see if it is already loaded.
|
8966
|
+
* First off, we lookup the cast->type name to see if it is already loaded.
|
8947
8967
|
* There are three cases to handle:
|
8948
8968
|
* 1) If the cast->type has already been loaded AND the type we are adding
|
8949
8969
|
* casting info to has not been loaded (it is in this module), THEN we
|
8950
8970
|
* replace the cast->type pointer with the type pointer that has already
|
8951
8971
|
* been loaded.
|
8952
|
-
* 2) If BOTH types (the one we are adding casting info to, and the
|
8972
|
+
* 2) If BOTH types (the one we are adding casting info to, and the
|
8953
8973
|
* cast->type) are loaded, THEN the cast info has already been loaded by
|
8954
8974
|
* the previous module so we just ignore it.
|
8955
8975
|
* 3) Finally, if cast->type has not already been loaded, then we add that
|
@@ -9012,7 +9032,7 @@ SWIG_InitializeModule(void *clientdata) {
|
|
9012
9032
|
module_head->next = &swig_module;
|
9013
9033
|
}
|
9014
9034
|
|
9015
|
-
/* When multiple
|
9035
|
+
/* When multiple interpreters are used, a module could have already been initialized in
|
9016
9036
|
a different interpreter, but not yet have a pointer in this interpreter.
|
9017
9037
|
In this case, we do not want to continue adding types... everything should be
|
9018
9038
|
set up already */
|
@@ -9026,7 +9046,7 @@ SWIG_InitializeModule(void *clientdata) {
|
|
9026
9046
|
swig_type_info *type = 0;
|
9027
9047
|
swig_type_info *ret;
|
9028
9048
|
swig_cast_info *cast;
|
9029
|
-
|
9049
|
+
|
9030
9050
|
#ifdef SWIGRUNTIME_DEBUG
|
9031
9051
|
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
|
9032
9052
|
#endif
|
@@ -9053,7 +9073,7 @@ SWIG_InitializeModule(void *clientdata) {
|
|
9053
9073
|
/* Insert casting types */
|
9054
9074
|
cast = swig_module.cast_initial[i];
|
9055
9075
|
while (cast->type) {
|
9056
|
-
|
9076
|
+
|
9057
9077
|
/* Don't need to add information already in the list */
|
9058
9078
|
ret = 0;
|
9059
9079
|
#ifdef SWIGRUNTIME_DEBUG
|