taglib-ruby 0.7.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/docs/taglib/mpeg.rb
CHANGED
@@ -14,7 +14,7 @@ module TagLib::MPEG
|
|
14
14
|
APE = 0x0004
|
15
15
|
AllTags = 0xffff
|
16
16
|
|
17
|
-
# {include
|
17
|
+
# {include:::TagLib::FileRef.open}
|
18
18
|
#
|
19
19
|
# @param (see #initialize)
|
20
20
|
# @yield [file] the {File} object, as obtained by {#initialize}
|
@@ -103,6 +103,24 @@ module TagLib::MPEG
|
|
103
103
|
# @return [Boolean] whether stripping was successful
|
104
104
|
def strip(tags=TagLib::MPEG::File::AllTags)
|
105
105
|
end
|
106
|
+
|
107
|
+
# @return [Boolean] Whether or not the file on disk actually has an ID3v1 tag.
|
108
|
+
#
|
109
|
+
# @since 1.0.0
|
110
|
+
def id3v1_tag?
|
111
|
+
end
|
112
|
+
|
113
|
+
# @return [Boolean] Whether or not the file on disk actually has an ID3v2 tag.
|
114
|
+
#
|
115
|
+
# @since 1.0.0
|
116
|
+
def id3v2_tag?
|
117
|
+
end
|
118
|
+
|
119
|
+
# @return [Boolean] Whether or not the file on disk actually has an APE tag.
|
120
|
+
#
|
121
|
+
# @since 1.0.0
|
122
|
+
def ape_tag?
|
123
|
+
end
|
106
124
|
end
|
107
125
|
|
108
126
|
# Audio properties for MPEG files.
|
@@ -153,6 +171,11 @@ module TagLib::MPEG
|
|
153
171
|
|
154
172
|
# Xing VBR header.
|
155
173
|
class XingHeader
|
174
|
+
|
175
|
+
Invalid = 0
|
176
|
+
Xing = 1
|
177
|
+
VBRI = 2
|
178
|
+
|
156
179
|
# @return [true] if a valid Xing header is present
|
157
180
|
def valid?
|
158
181
|
end
|
@@ -164,5 +187,11 @@ module TagLib::MPEG
|
|
164
187
|
# @return [Integer] total size of stream in bytes
|
165
188
|
def total_size
|
166
189
|
end
|
190
|
+
|
191
|
+
# @return [Integer] the type of the VBR header.
|
192
|
+
#
|
193
|
+
# @since 1.0.0
|
194
|
+
def type
|
195
|
+
end
|
167
196
|
end
|
168
197
|
end
|
data/docs/taglib/ogg.rb
CHANGED
@@ -29,10 +29,9 @@ module TagLib::Ogg
|
|
29
29
|
def contains?(name)
|
30
30
|
end
|
31
31
|
|
32
|
-
# Count the number of fields.
|
32
|
+
# Count the number of fields (including the pictures).
|
33
33
|
#
|
34
|
-
# @return [Integer] the number of fields in the comment (name-value
|
35
|
-
# pairs)
|
34
|
+
# @return [Integer] the number of fields in the comment (name-value pairs)
|
36
35
|
def field_count
|
37
36
|
end
|
38
37
|
|
@@ -44,7 +43,7 @@ module TagLib::Ogg
|
|
44
43
|
# 'GENRE' => ["Rock", "Pop"] }
|
45
44
|
#
|
46
45
|
# Note that the returned hash is read-only. Changing it will have no
|
47
|
-
# effect on the comment; use {#add_field} and {#
|
46
|
+
# effect on the comment; use {#add_field} and {#remove_fields} for
|
48
47
|
# that.
|
49
48
|
#
|
50
49
|
# @return [Hash<String, Array<String>>] a hash from field names to
|
@@ -66,7 +65,50 @@ module TagLib::Ogg
|
|
66
65
|
# @param [String] value field value
|
67
66
|
#
|
68
67
|
# @return [void]
|
69
|
-
|
68
|
+
#
|
69
|
+
# @since 1.0.0
|
70
|
+
def remove_fields
|
71
|
+
end
|
72
|
+
|
73
|
+
# Remove all the fields.
|
74
|
+
#
|
75
|
+
# @since 1.0.0
|
76
|
+
def remove_all_fields
|
77
|
+
end
|
78
|
+
|
79
|
+
# @return [Boolean] True if the specified string is a valid Xiph comment key.
|
80
|
+
#
|
81
|
+
# @since 1.0.0
|
82
|
+
def self.check_key(key)
|
83
|
+
end
|
84
|
+
|
85
|
+
# @return [Array<TagLib::FLAC::Picture>] The list of the pictures associated to this comment.
|
86
|
+
#
|
87
|
+
# @since 1.0.0
|
88
|
+
def picture_list
|
89
|
+
end
|
90
|
+
|
91
|
+
# Add a picture.
|
92
|
+
# @param [TagLib::FLAC::Picture] picture
|
93
|
+
# @return [void]
|
94
|
+
#
|
95
|
+
# @since 1.0.0
|
96
|
+
def add_picture(picture)
|
97
|
+
end
|
98
|
+
|
99
|
+
# Remove a picture.
|
100
|
+
# @param [TagLib::FLAC::Picture] picture
|
101
|
+
# @return [void]
|
102
|
+
#
|
103
|
+
# @since 1.0.0
|
104
|
+
def remove_picture(picture)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Remove all the pictures.
|
108
|
+
# @return [void]
|
109
|
+
#
|
110
|
+
# @since 1.0.0
|
111
|
+
def remove_all_pictures
|
70
112
|
end
|
71
113
|
|
72
114
|
# @return [String] vendor ID of the encoder used
|
data/docs/taglib/vorbis.rb
CHANGED
data/docs/taglib/wav.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# @since 0.7.0
|
2
2
|
module TagLib::RIFF::WAV
|
3
3
|
|
4
|
+
FORMAT_UNKNOWN = 0x0000 # @since 1.0.0
|
5
|
+
FORMAT_PCM = 0x0001 # @since 1.0.0
|
6
|
+
|
4
7
|
# The file class for `.wav` files.
|
5
8
|
#
|
6
9
|
# @example Reading the title
|
@@ -24,7 +27,14 @@ module TagLib::RIFF::WAV
|
|
24
27
|
# @see ID3v2::Tag ID3v2 examples.
|
25
28
|
#
|
26
29
|
class File < TagLib::File
|
27
|
-
|
30
|
+
|
31
|
+
NoTags = 0x0000
|
32
|
+
ID3v1 = 0x0001
|
33
|
+
ID3v2 = 0x0002
|
34
|
+
APE = 0x0004
|
35
|
+
AllTags = 0xffff
|
36
|
+
|
37
|
+
# {include:::TagLib::FileRef.open}
|
28
38
|
#
|
29
39
|
# @param (see #initialize)
|
30
40
|
# @yield [file] the {File} object, as obtained by {#initialize}
|
@@ -47,17 +57,60 @@ module TagLib::RIFF::WAV
|
|
47
57
|
def tag
|
48
58
|
end
|
49
59
|
|
60
|
+
# Returns the ID3v2 tag.
|
61
|
+
#
|
62
|
+
# @return [TagLib::ID3v2::Tag]
|
63
|
+
#
|
64
|
+
# @since 1.0.0
|
65
|
+
def id3v2_tag
|
66
|
+
end
|
67
|
+
|
50
68
|
# Returns audio properties.
|
51
69
|
#
|
52
70
|
# @return [TagLib::RIFF::WAV::Properties]
|
53
71
|
def audio_properties
|
54
72
|
end
|
55
73
|
|
74
|
+
# Remove the tags matching the specified OR-ed types.
|
75
|
+
#
|
76
|
+
# @param [int] tags The types of tags to remove.
|
77
|
+
# @return [void]
|
78
|
+
#
|
79
|
+
# @since 1.0.0
|
80
|
+
def strip(tags=TagLib::RIFF::WAV::File::AllTags)
|
81
|
+
end
|
82
|
+
|
56
83
|
end
|
57
84
|
|
58
85
|
class Properties < TagLib::AudioProperties
|
59
|
-
# @return [Integer]
|
60
|
-
|
86
|
+
# @return [Integer] Number of bits per audio sample.
|
87
|
+
#
|
88
|
+
# @since 1.0.0
|
89
|
+
attr_reader :bits_per_sample
|
90
|
+
|
91
|
+
# @return [Integer] Number of sample frames.
|
92
|
+
#
|
93
|
+
# @since 1.0.0
|
94
|
+
attr_reader :sample_frames
|
95
|
+
|
96
|
+
# @return [Integer] length of the file in seconds
|
97
|
+
#
|
98
|
+
# @since 1.0.0
|
99
|
+
attr_reader :length_in_seconds
|
100
|
+
|
101
|
+
# @return [Integer] length of the file in milliseconds
|
102
|
+
#
|
103
|
+
# @since 1.0.0
|
104
|
+
attr_reader :length_in_milliseconds
|
105
|
+
|
106
|
+
# @return [Integer] The format ID of the file.
|
107
|
+
#
|
108
|
+
# 0 for unknown, 1 for PCM, 2 for ADPCM, 3 for 32/64-bit IEEE754, and
|
109
|
+
# so forth. For further information, refer to the WAVE Form
|
110
|
+
# Registration Numbers in RFC 2361.
|
111
|
+
#
|
112
|
+
# @since 1.0.0
|
113
|
+
attr_reader :format
|
61
114
|
end
|
62
115
|
|
63
116
|
end
|
data/ext/extconf_common.rb
CHANGED
@@ -20,7 +20,14 @@ def error msg
|
|
20
20
|
abort
|
21
21
|
end
|
22
22
|
|
23
|
-
|
23
|
+
if ENV.has_key?('TAGLIB_DIR') and !File.directory?(ENV['TAGLIB_DIR'])
|
24
|
+
error "When defined, the TAGLIB_DIR environment variable must point to a valid directory."
|
25
|
+
end
|
26
|
+
|
27
|
+
# If specified, use the TAGLIB_DIR environment variable as the prefix
|
28
|
+
# for finding taglib headers and libs. See MakeMakefile#dir_config
|
29
|
+
# for more details.
|
30
|
+
dir_config('tag', (ENV['TAGLIB_DIR'] if ENV.has_key?('TAGLIB_DIR')))
|
24
31
|
|
25
32
|
# When compiling statically, -lstdc++ would make the resulting .so to
|
26
33
|
# have a dependency on an external libstdc++ instead of the static one.
|
@@ -35,7 +42,7 @@ if not have_library('tag')
|
|
35
42
|
You must have taglib installed in order to use taglib-ruby.
|
36
43
|
|
37
44
|
Debian/Ubuntu: sudo apt-get install libtag1-dev
|
38
|
-
Fedora/RHEL: sudo
|
45
|
+
Fedora/RHEL: sudo dnf install taglib-devel
|
39
46
|
Brew: brew install taglib
|
40
47
|
MacPorts: sudo port install taglib
|
41
48
|
DESC
|
@@ -9,10 +9,26 @@
|
|
9
9
|
%include "../taglib_base/includes.i"
|
10
10
|
%import(module="taglib_base") "../taglib_base/taglib_base.i"
|
11
11
|
|
12
|
+
// Deprecated
|
13
|
+
%ignore TagLib::RIFF::AIFF::Properties::Properties(const ByteVector&, ReadStyle);
|
14
|
+
%ignore TagLib::RIFF::AIFF::Properties::length;
|
15
|
+
%ignore TagLib::RIFF::AIFF::Properties::sampleWidth;
|
16
|
+
|
12
17
|
%include <taglib/aiffproperties.h>
|
13
18
|
|
14
19
|
%freefunc TagLib::RIFF::AIFF::File "free_taglib_riff_aiff_file";
|
15
20
|
|
21
|
+
// Ignore IOStream and all the constructors using it.
|
22
|
+
%ignore IOStream;
|
23
|
+
%ignore TagLib::RIFF::AIFF::File::File(IOStream *, bool, Properties::ReadStyle);
|
24
|
+
%ignore TagLib::RIFF::AIFF::File::File(IOStream *, bool);
|
25
|
+
%ignore TagLib::RIFF::AIFF::File::File(IOStream *);
|
26
|
+
|
27
|
+
// Ignore the unified property interface.
|
28
|
+
%ignore TagLib::RIFF::AIFF::File::properties;
|
29
|
+
%ignore TagLib::RIFF::AIFF::File::setProperties;
|
30
|
+
%ignore TagLib::RIFF::AIFF::File::removeUnsupportedProperties;
|
31
|
+
|
16
32
|
%rename("id3v2_tag?") TagLib::RIFF::AIFF::File::hasID3v2Tag;
|
17
33
|
|
18
34
|
namespace TagLib {
|
@@ -1891,7 +1891,7 @@ VALUE taglib_bytevector_to_ruby_string(const TagLib::ByteVector &byteVector) {
|
|
1891
1891
|
if (byteVector.isNull()) {
|
1892
1892
|
return Qnil;
|
1893
1893
|
} else {
|
1894
|
-
return
|
1894
|
+
return rb_str_new(byteVector.data(), byteVector.size());
|
1895
1895
|
}
|
1896
1896
|
}
|
1897
1897
|
|
@@ -1907,7 +1907,7 @@ VALUE taglib_string_to_ruby_string(const TagLib::String & string) {
|
|
1907
1907
|
if (string.isNull()) {
|
1908
1908
|
return Qnil;
|
1909
1909
|
} else {
|
1910
|
-
VALUE result =
|
1910
|
+
VALUE result = rb_str_new2(string.toCString(true));
|
1911
1911
|
ASSOCIATE_UTF8_ENCODING(result);
|
1912
1912
|
return result;
|
1913
1913
|
}
|
@@ -1947,9 +1947,9 @@ VALUE taglib_filename_to_ruby_string(TagLib::FileName filename) {
|
|
1947
1947
|
VALUE result;
|
1948
1948
|
#ifdef _WIN32
|
1949
1949
|
const char *s = (const char *) filename;
|
1950
|
-
result =
|
1950
|
+
result = rb_str_new2(s);
|
1951
1951
|
#else
|
1952
|
-
result =
|
1952
|
+
result = rb_str_new2(filename);
|
1953
1953
|
#endif
|
1954
1954
|
ASSOCIATE_FILESYSTEM_ENCODING(result);
|
1955
1955
|
return result;
|
@@ -2046,6 +2046,57 @@ SWIG_AsVal_int (VALUE obj, int *val)
|
|
2046
2046
|
}
|
2047
2047
|
|
2048
2048
|
|
2049
|
+
#define SWIG_From_long LONG2NUM
|
2050
|
+
|
2051
|
+
|
2052
|
+
SWIGINTERNINLINE VALUE
|
2053
|
+
SWIG_From_int (int value)
|
2054
|
+
{
|
2055
|
+
return SWIG_From_long (value);
|
2056
|
+
}
|
2057
|
+
|
2058
|
+
|
2059
|
+
SWIGINTERNINLINE VALUE
|
2060
|
+
SWIG_From_unsigned_SS_long (unsigned long value)
|
2061
|
+
{
|
2062
|
+
return ULONG2NUM(value);
|
2063
|
+
}
|
2064
|
+
|
2065
|
+
|
2066
|
+
SWIGINTERNINLINE VALUE
|
2067
|
+
SWIG_From_unsigned_SS_int (unsigned int value)
|
2068
|
+
{
|
2069
|
+
return SWIG_From_unsigned_SS_long (value);
|
2070
|
+
}
|
2071
|
+
|
2072
|
+
|
2073
|
+
SWIGINTERNINLINE VALUE
|
2074
|
+
SWIG_From_bool (bool value)
|
2075
|
+
{
|
2076
|
+
return value ? Qtrue : Qfalse;
|
2077
|
+
}
|
2078
|
+
|
2079
|
+
|
2080
|
+
SWIGINTERN int
|
2081
|
+
SWIG_AsVal_bool (VALUE obj, bool *val)
|
2082
|
+
{
|
2083
|
+
if (obj == Qtrue) {
|
2084
|
+
if (val) *val = true;
|
2085
|
+
return SWIG_OK;
|
2086
|
+
} else if (obj == Qfalse) {
|
2087
|
+
if (val) *val = false;
|
2088
|
+
return SWIG_OK;
|
2089
|
+
} else {
|
2090
|
+
int res = 0;
|
2091
|
+
if (SWIG_AsVal_int (obj, &res) == SWIG_OK) {
|
2092
|
+
if (val) *val = res ? true : false;
|
2093
|
+
return SWIG_OK;
|
2094
|
+
}
|
2095
|
+
}
|
2096
|
+
return SWIG_TypeError;
|
2097
|
+
}
|
2098
|
+
|
2099
|
+
|
2049
2100
|
SWIGINTERN swig_type_info*
|
2050
2101
|
SWIG_pchar_descriptor(void)
|
2051
2102
|
{
|
@@ -2095,43 +2146,6 @@ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
|
|
2095
2146
|
|
2096
2147
|
|
2097
2148
|
|
2098
|
-
|
2099
|
-
#define SWIG_From_long LONG2NUM
|
2100
|
-
|
2101
|
-
|
2102
|
-
SWIGINTERNINLINE VALUE
|
2103
|
-
SWIG_From_int (int value)
|
2104
|
-
{
|
2105
|
-
return SWIG_From_long (value);
|
2106
|
-
}
|
2107
|
-
|
2108
|
-
|
2109
|
-
SWIGINTERN int
|
2110
|
-
SWIG_AsVal_bool (VALUE obj, bool *val)
|
2111
|
-
{
|
2112
|
-
if (obj == Qtrue) {
|
2113
|
-
if (val) *val = true;
|
2114
|
-
return SWIG_OK;
|
2115
|
-
} else if (obj == Qfalse) {
|
2116
|
-
if (val) *val = false;
|
2117
|
-
return SWIG_OK;
|
2118
|
-
} else {
|
2119
|
-
int res = 0;
|
2120
|
-
if (SWIG_AsVal_int (obj, &res) == SWIG_OK) {
|
2121
|
-
if (val) *val = res ? true : false;
|
2122
|
-
return SWIG_OK;
|
2123
|
-
}
|
2124
|
-
}
|
2125
|
-
return SWIG_TypeError;
|
2126
|
-
}
|
2127
|
-
|
2128
|
-
|
2129
|
-
SWIGINTERNINLINE VALUE
|
2130
|
-
SWIG_From_bool (bool value)
|
2131
|
-
{
|
2132
|
-
return value ? Qtrue : Qfalse;
|
2133
|
-
}
|
2134
|
-
|
2135
2149
|
SWIGINTERN void TagLib_RIFF_AIFF_File_close(TagLib::RIFF::AIFF::File *self){
|
2136
2150
|
free_taglib_riff_aiff_file(self);
|
2137
2151
|
}
|
@@ -2185,9 +2199,10 @@ _wrap_Properties_allocate(VALUE self) {
|
|
2185
2199
|
|
2186
2200
|
SWIGINTERN VALUE
|
2187
2201
|
_wrap_new_Properties(int argc, VALUE *argv, VALUE self) {
|
2188
|
-
TagLib::
|
2202
|
+
TagLib::RIFF::AIFF::File *arg1 = (TagLib::RIFF::AIFF::File *) 0 ;
|
2189
2203
|
TagLib::AudioProperties::ReadStyle arg2 ;
|
2190
|
-
|
2204
|
+
void *argp1 = 0 ;
|
2205
|
+
int res1 = 0 ;
|
2191
2206
|
int val2 ;
|
2192
2207
|
int ecode2 = 0 ;
|
2193
2208
|
TagLib::RIFF::AIFF::Properties *result = 0 ;
|
@@ -2195,16 +2210,17 @@ _wrap_new_Properties(int argc, VALUE *argv, VALUE self) {
|
|
2195
2210
|
if ((argc < 2) || (argc > 2)) {
|
2196
2211
|
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
2197
2212
|
}
|
2198
|
-
|
2199
|
-
|
2200
|
-
|
2213
|
+
res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_TagLib__RIFF__AIFF__File, 0 | 0 );
|
2214
|
+
if (!SWIG_IsOK(res1)) {
|
2215
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::AIFF::File *","Properties", 1, argv[0] ));
|
2201
2216
|
}
|
2217
|
+
arg1 = reinterpret_cast< TagLib::RIFF::AIFF::File * >(argp1);
|
2202
2218
|
ecode2 = SWIG_AsVal_int(argv[1], &val2);
|
2203
2219
|
if (!SWIG_IsOK(ecode2)) {
|
2204
2220
|
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "TagLib::AudioProperties::ReadStyle","Properties", 2, argv[1] ));
|
2205
2221
|
}
|
2206
2222
|
arg2 = static_cast< TagLib::AudioProperties::ReadStyle >(val2);
|
2207
|
-
result = (TagLib::RIFF::AIFF::Properties *)new TagLib::RIFF::AIFF::Properties(
|
2223
|
+
result = (TagLib::RIFF::AIFF::Properties *)new TagLib::RIFF::AIFF::Properties(arg1,arg2);
|
2208
2224
|
DATA_PTR(self) = result;
|
2209
2225
|
SWIG_RubyAddTracking(result, self);
|
2210
2226
|
return self;
|
@@ -2220,7 +2236,31 @@ free_TagLib_RIFF_AIFF_Properties(TagLib::RIFF::AIFF::Properties *arg1) {
|
|
2220
2236
|
}
|
2221
2237
|
|
2222
2238
|
SWIGINTERN VALUE
|
2223
|
-
|
2239
|
+
_wrap_Properties_length_in_seconds(int argc, VALUE *argv, VALUE self) {
|
2240
|
+
TagLib::RIFF::AIFF::Properties *arg1 = (TagLib::RIFF::AIFF::Properties *) 0 ;
|
2241
|
+
void *argp1 = 0 ;
|
2242
|
+
int res1 = 0 ;
|
2243
|
+
int result;
|
2244
|
+
VALUE vresult = Qnil;
|
2245
|
+
|
2246
|
+
if ((argc < 0) || (argc > 0)) {
|
2247
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2248
|
+
}
|
2249
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__AIFF__Properties, 0 | 0 );
|
2250
|
+
if (!SWIG_IsOK(res1)) {
|
2251
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::AIFF::Properties const *","lengthInSeconds", 1, self ));
|
2252
|
+
}
|
2253
|
+
arg1 = reinterpret_cast< TagLib::RIFF::AIFF::Properties * >(argp1);
|
2254
|
+
result = (int)((TagLib::RIFF::AIFF::Properties const *)arg1)->lengthInSeconds();
|
2255
|
+
vresult = SWIG_From_int(static_cast< int >(result));
|
2256
|
+
return vresult;
|
2257
|
+
fail:
|
2258
|
+
return Qnil;
|
2259
|
+
}
|
2260
|
+
|
2261
|
+
|
2262
|
+
SWIGINTERN VALUE
|
2263
|
+
_wrap_Properties_length_in_milliseconds(int argc, VALUE *argv, VALUE self) {
|
2224
2264
|
TagLib::RIFF::AIFF::Properties *arg1 = (TagLib::RIFF::AIFF::Properties *) 0 ;
|
2225
2265
|
void *argp1 = 0 ;
|
2226
2266
|
int res1 = 0 ;
|
@@ -2232,10 +2272,10 @@ _wrap_Properties_length(int argc, VALUE *argv, VALUE self) {
|
|
2232
2272
|
}
|
2233
2273
|
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__AIFF__Properties, 0 | 0 );
|
2234
2274
|
if (!SWIG_IsOK(res1)) {
|
2235
|
-
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::AIFF::Properties const *","
|
2275
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::AIFF::Properties const *","lengthInMilliseconds", 1, self ));
|
2236
2276
|
}
|
2237
2277
|
arg1 = reinterpret_cast< TagLib::RIFF::AIFF::Properties * >(argp1);
|
2238
|
-
result = (int)((TagLib::RIFF::AIFF::Properties const *)arg1)->
|
2278
|
+
result = (int)((TagLib::RIFF::AIFF::Properties const *)arg1)->lengthInMilliseconds();
|
2239
2279
|
vresult = SWIG_From_int(static_cast< int >(result));
|
2240
2280
|
return vresult;
|
2241
2281
|
fail:
|
@@ -2316,7 +2356,7 @@ fail:
|
|
2316
2356
|
|
2317
2357
|
|
2318
2358
|
SWIGINTERN VALUE
|
2319
|
-
|
2359
|
+
_wrap_Properties_bits_per_sample(int argc, VALUE *argv, VALUE self) {
|
2320
2360
|
TagLib::RIFF::AIFF::Properties *arg1 = (TagLib::RIFF::AIFF::Properties *) 0 ;
|
2321
2361
|
void *argp1 = 0 ;
|
2322
2362
|
int res1 = 0 ;
|
@@ -2328,10 +2368,10 @@ _wrap_Properties_sample_width(int argc, VALUE *argv, VALUE self) {
|
|
2328
2368
|
}
|
2329
2369
|
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__AIFF__Properties, 0 | 0 );
|
2330
2370
|
if (!SWIG_IsOK(res1)) {
|
2331
|
-
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::AIFF::Properties const *","
|
2371
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::AIFF::Properties const *","bitsPerSample", 1, self ));
|
2332
2372
|
}
|
2333
2373
|
arg1 = reinterpret_cast< TagLib::RIFF::AIFF::Properties * >(argp1);
|
2334
|
-
result = (int)((TagLib::RIFF::AIFF::Properties const *)arg1)->
|
2374
|
+
result = (int)((TagLib::RIFF::AIFF::Properties const *)arg1)->bitsPerSample();
|
2335
2375
|
vresult = SWIG_From_int(static_cast< int >(result));
|
2336
2376
|
return vresult;
|
2337
2377
|
fail:
|
@@ -2339,11 +2379,111 @@ fail:
|
|
2339
2379
|
}
|
2340
2380
|
|
2341
2381
|
|
2382
|
+
SWIGINTERN VALUE
|
2383
|
+
_wrap_Properties_sample_frames(int argc, VALUE *argv, VALUE self) {
|
2384
|
+
TagLib::RIFF::AIFF::Properties *arg1 = (TagLib::RIFF::AIFF::Properties *) 0 ;
|
2385
|
+
void *argp1 = 0 ;
|
2386
|
+
int res1 = 0 ;
|
2387
|
+
unsigned int result;
|
2388
|
+
VALUE vresult = Qnil;
|
2389
|
+
|
2390
|
+
if ((argc < 0) || (argc > 0)) {
|
2391
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2392
|
+
}
|
2393
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__AIFF__Properties, 0 | 0 );
|
2394
|
+
if (!SWIG_IsOK(res1)) {
|
2395
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::AIFF::Properties const *","sampleFrames", 1, self ));
|
2396
|
+
}
|
2397
|
+
arg1 = reinterpret_cast< TagLib::RIFF::AIFF::Properties * >(argp1);
|
2398
|
+
result = (unsigned int)((TagLib::RIFF::AIFF::Properties const *)arg1)->sampleFrames();
|
2399
|
+
vresult = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
|
2400
|
+
return vresult;
|
2401
|
+
fail:
|
2402
|
+
return Qnil;
|
2403
|
+
}
|
2404
|
+
|
2405
|
+
|
2406
|
+
SWIGINTERN VALUE
|
2407
|
+
_wrap_Properties_aiff_cq___(int argc, VALUE *argv, VALUE self) {
|
2408
|
+
TagLib::RIFF::AIFF::Properties *arg1 = (TagLib::RIFF::AIFF::Properties *) 0 ;
|
2409
|
+
void *argp1 = 0 ;
|
2410
|
+
int res1 = 0 ;
|
2411
|
+
bool result;
|
2412
|
+
VALUE vresult = Qnil;
|
2413
|
+
|
2414
|
+
if ((argc < 0) || (argc > 0)) {
|
2415
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2416
|
+
}
|
2417
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__AIFF__Properties, 0 | 0 );
|
2418
|
+
if (!SWIG_IsOK(res1)) {
|
2419
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::AIFF::Properties const *","isAiffC", 1, self ));
|
2420
|
+
}
|
2421
|
+
arg1 = reinterpret_cast< TagLib::RIFF::AIFF::Properties * >(argp1);
|
2422
|
+
result = (bool)((TagLib::RIFF::AIFF::Properties const *)arg1)->isAiffC();
|
2423
|
+
vresult = SWIG_From_bool(static_cast< bool >(result));
|
2424
|
+
return vresult;
|
2425
|
+
fail:
|
2426
|
+
return Qnil;
|
2427
|
+
}
|
2428
|
+
|
2429
|
+
|
2430
|
+
SWIGINTERN VALUE
|
2431
|
+
_wrap_Properties_compression_type(int argc, VALUE *argv, VALUE self) {
|
2432
|
+
TagLib::RIFF::AIFF::Properties *arg1 = (TagLib::RIFF::AIFF::Properties *) 0 ;
|
2433
|
+
void *argp1 = 0 ;
|
2434
|
+
int res1 = 0 ;
|
2435
|
+
TagLib::ByteVector result;
|
2436
|
+
VALUE vresult = Qnil;
|
2437
|
+
|
2438
|
+
if ((argc < 0) || (argc > 0)) {
|
2439
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2440
|
+
}
|
2441
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__AIFF__Properties, 0 | 0 );
|
2442
|
+
if (!SWIG_IsOK(res1)) {
|
2443
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::AIFF::Properties const *","compressionType", 1, self ));
|
2444
|
+
}
|
2445
|
+
arg1 = reinterpret_cast< TagLib::RIFF::AIFF::Properties * >(argp1);
|
2446
|
+
result = ((TagLib::RIFF::AIFF::Properties const *)arg1)->compressionType();
|
2447
|
+
{
|
2448
|
+
vresult = taglib_bytevector_to_ruby_string(result);
|
2449
|
+
}
|
2450
|
+
return vresult;
|
2451
|
+
fail:
|
2452
|
+
return Qnil;
|
2453
|
+
}
|
2454
|
+
|
2455
|
+
|
2456
|
+
SWIGINTERN VALUE
|
2457
|
+
_wrap_Properties_compression_name(int argc, VALUE *argv, VALUE self) {
|
2458
|
+
TagLib::RIFF::AIFF::Properties *arg1 = (TagLib::RIFF::AIFF::Properties *) 0 ;
|
2459
|
+
void *argp1 = 0 ;
|
2460
|
+
int res1 = 0 ;
|
2461
|
+
TagLib::String result;
|
2462
|
+
VALUE vresult = Qnil;
|
2463
|
+
|
2464
|
+
if ((argc < 0) || (argc > 0)) {
|
2465
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2466
|
+
}
|
2467
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__AIFF__Properties, 0 | 0 );
|
2468
|
+
if (!SWIG_IsOK(res1)) {
|
2469
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::AIFF::Properties const *","compressionName", 1, self ));
|
2470
|
+
}
|
2471
|
+
arg1 = reinterpret_cast< TagLib::RIFF::AIFF::Properties * >(argp1);
|
2472
|
+
result = ((TagLib::RIFF::AIFF::Properties const *)arg1)->compressionName();
|
2473
|
+
{
|
2474
|
+
vresult = taglib_string_to_ruby_string(result);
|
2475
|
+
}
|
2476
|
+
return vresult;
|
2477
|
+
fail:
|
2478
|
+
return Qnil;
|
2479
|
+
}
|
2480
|
+
|
2481
|
+
|
2342
2482
|
static swig_class SwigClassFile;
|
2343
2483
|
|
2344
2484
|
SWIGINTERN VALUE
|
2345
2485
|
_wrap_new_File__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
2346
|
-
|
2486
|
+
TagLib::FileName arg1 ;
|
2347
2487
|
bool arg2 ;
|
2348
2488
|
TagLib::RIFF::AIFF::Properties::ReadStyle arg3 ;
|
2349
2489
|
bool val2 ;
|
@@ -2382,7 +2522,7 @@ fail:
|
|
2382
2522
|
|
2383
2523
|
SWIGINTERN VALUE
|
2384
2524
|
_wrap_new_File__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
2385
|
-
|
2525
|
+
TagLib::FileName arg1 ;
|
2386
2526
|
bool arg2 ;
|
2387
2527
|
bool val2 ;
|
2388
2528
|
int ecode2 = 0 ;
|
@@ -2430,7 +2570,7 @@ _wrap_File_allocate(VALUE self) {
|
|
2430
2570
|
|
2431
2571
|
SWIGINTERN VALUE
|
2432
2572
|
_wrap_new_File__SWIG_2(int argc, VALUE *argv, VALUE self) {
|
2433
|
-
|
2573
|
+
TagLib::FileName arg1 ;
|
2434
2574
|
TagLib::RIFF::AIFF::File *result = 0 ;
|
2435
2575
|
|
2436
2576
|
if ((argc < 1) || (argc > 1)) {
|
@@ -2586,6 +2726,30 @@ fail:
|
|
2586
2726
|
}
|
2587
2727
|
|
2588
2728
|
|
2729
|
+
SWIGINTERN VALUE
|
2730
|
+
_wrap_File_id3v2_tagq___(int argc, VALUE *argv, VALUE self) {
|
2731
|
+
TagLib::RIFF::AIFF::File *arg1 = (TagLib::RIFF::AIFF::File *) 0 ;
|
2732
|
+
void *argp1 = 0 ;
|
2733
|
+
int res1 = 0 ;
|
2734
|
+
bool result;
|
2735
|
+
VALUE vresult = Qnil;
|
2736
|
+
|
2737
|
+
if ((argc < 0) || (argc > 0)) {
|
2738
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2739
|
+
}
|
2740
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_TagLib__RIFF__AIFF__File, 0 | 0 );
|
2741
|
+
if (!SWIG_IsOK(res1)) {
|
2742
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "TagLib::RIFF::AIFF::File const *","hasID3v2Tag", 1, self ));
|
2743
|
+
}
|
2744
|
+
arg1 = reinterpret_cast< TagLib::RIFF::AIFF::File * >(argp1);
|
2745
|
+
result = (bool)((TagLib::RIFF::AIFF::File const *)arg1)->hasID3v2Tag();
|
2746
|
+
vresult = SWIG_From_bool(static_cast< bool >(result));
|
2747
|
+
return vresult;
|
2748
|
+
fail:
|
2749
|
+
return Qnil;
|
2750
|
+
}
|
2751
|
+
|
2752
|
+
|
2589
2753
|
SWIGINTERN VALUE
|
2590
2754
|
_wrap_File_close(int argc, VALUE *argv, VALUE self) {
|
2591
2755
|
TagLib::RIFF::AIFF::File *arg1 = (TagLib::RIFF::AIFF::File *) 0 ;
|
@@ -2917,11 +3081,16 @@ SWIGEXPORT void Init_taglib_aiff(void) {
|
|
2917
3081
|
SWIG_TypeClientData(SWIGTYPE_p_TagLib__RIFF__AIFF__Properties, (void *) &SwigClassProperties);
|
2918
3082
|
rb_define_alloc_func(SwigClassProperties.klass, _wrap_Properties_allocate);
|
2919
3083
|
rb_define_method(SwigClassProperties.klass, "initialize", VALUEFUNC(_wrap_new_Properties), -1);
|
2920
|
-
rb_define_method(SwigClassProperties.klass, "
|
3084
|
+
rb_define_method(SwigClassProperties.klass, "length_in_seconds", VALUEFUNC(_wrap_Properties_length_in_seconds), -1);
|
3085
|
+
rb_define_method(SwigClassProperties.klass, "length_in_milliseconds", VALUEFUNC(_wrap_Properties_length_in_milliseconds), -1);
|
2921
3086
|
rb_define_method(SwigClassProperties.klass, "bitrate", VALUEFUNC(_wrap_Properties_bitrate), -1);
|
2922
3087
|
rb_define_method(SwigClassProperties.klass, "sample_rate", VALUEFUNC(_wrap_Properties_sample_rate), -1);
|
2923
3088
|
rb_define_method(SwigClassProperties.klass, "channels", VALUEFUNC(_wrap_Properties_channels), -1);
|
2924
|
-
rb_define_method(SwigClassProperties.klass, "
|
3089
|
+
rb_define_method(SwigClassProperties.klass, "bits_per_sample", VALUEFUNC(_wrap_Properties_bits_per_sample), -1);
|
3090
|
+
rb_define_method(SwigClassProperties.klass, "sample_frames", VALUEFUNC(_wrap_Properties_sample_frames), -1);
|
3091
|
+
rb_define_method(SwigClassProperties.klass, "aiff_c?", VALUEFUNC(_wrap_Properties_aiff_cq___), -1);
|
3092
|
+
rb_define_method(SwigClassProperties.klass, "compression_type", VALUEFUNC(_wrap_Properties_compression_type), -1);
|
3093
|
+
rb_define_method(SwigClassProperties.klass, "compression_name", VALUEFUNC(_wrap_Properties_compression_name), -1);
|
2925
3094
|
SwigClassProperties.mark = 0;
|
2926
3095
|
SwigClassProperties.destroy = (void (*)(void *)) free_TagLib_RIFF_AIFF_Properties;
|
2927
3096
|
SwigClassProperties.trackObjects = 1;
|
@@ -2933,6 +3102,7 @@ SWIGEXPORT void Init_taglib_aiff(void) {
|
|
2933
3102
|
rb_define_method(SwigClassFile.klass, "tag", VALUEFUNC(_wrap_File_tag), -1);
|
2934
3103
|
rb_define_method(SwigClassFile.klass, "audio_properties", VALUEFUNC(_wrap_File_audio_properties), -1);
|
2935
3104
|
rb_define_method(SwigClassFile.klass, "save", VALUEFUNC(_wrap_File_save), -1);
|
3105
|
+
rb_define_method(SwigClassFile.klass, "id3v2_tag?", VALUEFUNC(_wrap_File_id3v2_tagq___), -1);
|
2936
3106
|
rb_define_method(SwigClassFile.klass, "close", VALUEFUNC(_wrap_File_close), -1);
|
2937
3107
|
SwigClassFile.mark = 0;
|
2938
3108
|
SwigClassFile.destroy = (void (*)(void *)) free_taglib_riff_aiff_file;
|