rtaglib 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +1 -0
- data/Rakefile +4 -5
- data/ext/tagfile/tagfile.c +0 -3
- data/ext/taglib/extconf.rb +12 -3
- data/ext/taglib/taglib.cxx +78 -57
- data/lib/TagLib.rb +3 -1
- data/lib/TagLib_doc.rb +1337 -1329
- data/swig/Doxyfile +303 -0
- data/swig/Rakefile +14 -3
- data/swig/extconf.rb +12 -3
- data/swig/make_doc.rb +20 -10
- data/swig/process_cxx.rb +20 -9
- data/swig/taglib.i +23 -1
- data/swig/test.rb +31 -23
- data/test/test_taglib.rb +31 -23
- metadata +4 -3
data/Manifest.txt
CHANGED
data/Rakefile
CHANGED
@@ -47,6 +47,7 @@ Rake::TestTask.new do |t|
|
|
47
47
|
t.test_files = FileList['test/test*.rb']
|
48
48
|
t.verbose = true
|
49
49
|
end
|
50
|
+
|
50
51
|
Rake::RDocTask.new(:rdoc) do |rdoc|
|
51
52
|
rdoc.rdoc_dir = "doc/html"
|
52
53
|
rdoc.main = "README.txt"
|
@@ -55,10 +56,9 @@ end
|
|
55
56
|
|
56
57
|
require 'rubygems'
|
57
58
|
require 'hoe'
|
58
|
-
|
59
|
-
require './ext/tagfile/tagfile'
|
59
|
+
require "./lib/TagLib.rb"
|
60
60
|
|
61
|
-
Hoe.new('rtaglib',
|
61
|
+
Hoe.new('rtaglib', TagLib::VERSION) do |p|
|
62
62
|
p.developer('cdx', 'clbustos@surnet.cl')
|
63
63
|
p.author="Claudio Bustos"
|
64
64
|
p.summary="Bindings for taglib"
|
@@ -76,7 +76,6 @@ p.remote_rdoc_dir = '' # Release to root
|
|
76
76
|
p.rdoc_pattern=/(lib\/TagLib_doc.rb|ext\/tagfile\/.*\.c|\.txt)/
|
77
77
|
#p.clean_globs = ['ext/taglib/*.log','ext/taglib/*.o','ext/taglib/*.so', 'ext/tagfile/*.log','ext/tagfile/*.o','ext/tagfile/*.so']
|
78
78
|
#p.platform = Gem::Platform::RUBY
|
79
|
-
p.spec_extras= {'requirements'=>'libtag >=1.
|
80
|
-
end
|
79
|
+
p.spec_extras= {'requirements'=>'libtag >=1.5', 'autorequire'=>'', 'extensions' => ['ext/tagfile/extconf.rb','ext/taglib/extconf.rb']}
|
81
80
|
end
|
82
81
|
# vim: syntax=Ruby
|
data/ext/tagfile/tagfile.c
CHANGED
@@ -12,7 +12,6 @@ Data_Get_Struct(self, taglib_t, tl); \
|
|
12
12
|
if(NULL==tl->file || tl->open==0) {tl_closed();} \
|
13
13
|
TagLib_File *file=tl->file;
|
14
14
|
|
15
|
-
#define VERSION "0.2.1"
|
16
15
|
|
17
16
|
typedef struct {
|
18
17
|
TagLib_File *file;
|
@@ -109,8 +108,6 @@ Init_tagfile()
|
|
109
108
|
rb_define_method(cTagFileFile, "channels", cTagFileFile_channels, 0);
|
110
109
|
rb_define_attr(cTagFileFile, "path", 1, 0);
|
111
110
|
rb_define_attr(cTagFileFile, "file_type", 1, 0);
|
112
|
-
/* VERSION: Version number */
|
113
|
-
rb_define_const(mTagFile, "VERSION", rb_str_new2(VERSION));
|
114
111
|
/* TagLib_File_OggVorbis: Value for OggVorbis*/
|
115
112
|
|
116
113
|
rb_define_const(mTagFile, "MPEG", INT2FIX(TagLib_File_MPEG));
|
data/ext/taglib/extconf.rb
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
require 'mkmf'
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
if(PLATFORM=~/mingw/)
|
3
|
+
puts "Building for MinGW"
|
4
|
+
$libs = append_library($libs, "stdc++")
|
5
|
+
$CFLAGS= " -I/mingw/include/taglib"
|
6
|
+
|
7
|
+
else
|
8
|
+
puts "Building for other architecture"
|
9
|
+
$CFLAGS= " -I/usr/include/taglib"
|
10
|
+
|
11
|
+
end
|
12
|
+
$libs = append_library($libs, "supc++")
|
13
|
+
if have_header("taglib/taglib_export.h") and have_library("tag")
|
5
14
|
create_makefile("TagLib")
|
6
15
|
end
|
data/ext/taglib/taglib.cxx
CHANGED
@@ -1785,47 +1785,48 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
|
|
1785
1785
|
#define SWIGTYPE_p_TagLib__ID3v2__CommentsFrame swig_types[11]
|
1786
1786
|
#define SWIGTYPE_p_TagLib__ID3v2__Frame swig_types[12]
|
1787
1787
|
#define SWIGTYPE_p_TagLib__ID3v2__FrameFactory swig_types[13]
|
1788
|
-
#define
|
1789
|
-
#define
|
1790
|
-
#define
|
1791
|
-
#define
|
1792
|
-
#define
|
1793
|
-
#define
|
1794
|
-
#define
|
1795
|
-
#define
|
1796
|
-
#define
|
1797
|
-
#define
|
1798
|
-
#define
|
1799
|
-
#define
|
1800
|
-
#define
|
1801
|
-
#define
|
1802
|
-
#define
|
1803
|
-
#define
|
1804
|
-
#define
|
1805
|
-
#define
|
1806
|
-
#define
|
1807
|
-
#define
|
1808
|
-
#define
|
1809
|
-
#define
|
1810
|
-
#define
|
1811
|
-
#define
|
1812
|
-
#define
|
1813
|
-
#define
|
1814
|
-
#define
|
1815
|
-
#define
|
1816
|
-
#define
|
1817
|
-
#define
|
1818
|
-
#define
|
1819
|
-
#define
|
1820
|
-
#define
|
1821
|
-
#define
|
1822
|
-
#define
|
1823
|
-
#define
|
1824
|
-
#define
|
1825
|
-
#define
|
1826
|
-
#define
|
1827
|
-
|
1828
|
-
static
|
1788
|
+
#define SWIGTYPE_p_TagLib__ID3v2__GeneralEncapsulatedObjectFrame swig_types[14]
|
1789
|
+
#define SWIGTYPE_p_TagLib__ID3v2__Header swig_types[15]
|
1790
|
+
#define SWIGTYPE_p_TagLib__ID3v2__Tag swig_types[16]
|
1791
|
+
#define SWIGTYPE_p_TagLib__ListT_Frame_p_t swig_types[17]
|
1792
|
+
#define SWIGTYPE_p_TagLib__ListT_TagLib__ByteVector_t swig_types[18]
|
1793
|
+
#define SWIGTYPE_p_TagLib__ListT_TagLib__ID3v2__Frame_p_t swig_types[19]
|
1794
|
+
#define SWIGTYPE_p_TagLib__ListT_TagLib__String_t swig_types[20]
|
1795
|
+
#define SWIGTYPE_p_TagLib__ListT_int_t swig_types[21]
|
1796
|
+
#define SWIGTYPE_p_TagLib__MPC__File swig_types[22]
|
1797
|
+
#define SWIGTYPE_p_TagLib__MPC__Properties swig_types[23]
|
1798
|
+
#define SWIGTYPE_p_TagLib__MPEG__File swig_types[24]
|
1799
|
+
#define SWIGTYPE_p_TagLib__MPEG__Header swig_types[25]
|
1800
|
+
#define SWIGTYPE_p_TagLib__MPEG__Properties swig_types[26]
|
1801
|
+
#define SWIGTYPE_p_TagLib__MPEG__XingHeader swig_types[27]
|
1802
|
+
#define SWIGTYPE_p_TagLib__MapT_TagLib__ByteVector_TagLib__ID3v2__FrameList_t swig_types[28]
|
1803
|
+
#define SWIGTYPE_p_TagLib__MapT_TagLib__String_TagLib__APE__Item_t swig_types[29]
|
1804
|
+
#define SWIGTYPE_p_TagLib__MapT_TagLib__String_TagLib__StringList_t swig_types[30]
|
1805
|
+
#define SWIGTYPE_p_TagLib__MapT_TagLib__String_int_t swig_types[31]
|
1806
|
+
#define SWIGTYPE_p_TagLib__Ogg__FLAC__File swig_types[32]
|
1807
|
+
#define SWIGTYPE_p_TagLib__Ogg__File swig_types[33]
|
1808
|
+
#define SWIGTYPE_p_TagLib__Ogg__Page swig_types[34]
|
1809
|
+
#define SWIGTYPE_p_TagLib__Ogg__PageHeader swig_types[35]
|
1810
|
+
#define SWIGTYPE_p_TagLib__Ogg__Speex__File swig_types[36]
|
1811
|
+
#define SWIGTYPE_p_TagLib__Ogg__Speex__Properties swig_types[37]
|
1812
|
+
#define SWIGTYPE_p_TagLib__Ogg__XiphComment swig_types[38]
|
1813
|
+
#define SWIGTYPE_p_TagLib__String swig_types[39]
|
1814
|
+
#define SWIGTYPE_p_TagLib__Tag swig_types[40]
|
1815
|
+
#define SWIGTYPE_p_TagLib__TrueAudio__File swig_types[41]
|
1816
|
+
#define SWIGTYPE_p_TagLib__TrueAudio__Properties swig_types[42]
|
1817
|
+
#define SWIGTYPE_p_TagLib__Vorbis__File swig_types[43]
|
1818
|
+
#define SWIGTYPE_p_TagLib__Vorbis__Properties swig_types[44]
|
1819
|
+
#define SWIGTYPE_p_TagLib__WavPack__File swig_types[45]
|
1820
|
+
#define SWIGTYPE_p_TagLib__WavPack__Properties swig_types[46]
|
1821
|
+
#define SWIGTYPE_p_char swig_types[47]
|
1822
|
+
#define SWIGTYPE_p_p_TagLib__ID3v2__Frame swig_types[48]
|
1823
|
+
#define SWIGTYPE_p_std__basic_stringT_wchar_t_t swig_types[49]
|
1824
|
+
#define SWIGTYPE_p_unsigned_char swig_types[50]
|
1825
|
+
#define SWIGTYPE_p_unsigned_int swig_types[51]
|
1826
|
+
#define SWIGTYPE_p_unsigned_long swig_types[52]
|
1827
|
+
#define SWIGTYPE_p_wchar_t swig_types[53]
|
1828
|
+
static swig_type_info *swig_types[55];
|
1829
|
+
static swig_module_info swig_module = {swig_types, 54, 0, 0, 0, 0};
|
1829
1830
|
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
|
1830
1831
|
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
|
1831
1832
|
|
@@ -12095,16 +12096,16 @@ swig_class cVorbis_File;
|
|
12095
12096
|
|
12096
12097
|
|
12097
12098
|
/*
|
12098
|
-
Document-method: TagLib::ID3v1.
|
12099
|
+
Document-method: TagLib::ID3v1.ID3v1_genre
|
12099
12100
|
|
12100
12101
|
call-seq:
|
12101
|
-
|
12102
|
+
ID3v1_genre(int index) -> String
|
12102
12103
|
|
12103
12104
|
A module function.
|
12104
12105
|
|
12105
12106
|
*/
|
12106
12107
|
VALUE
|
12107
|
-
|
12108
|
+
_wrap_ID3v1_genre(int argc, VALUE *argv, VALUE self) {
|
12108
12109
|
int arg1 ;
|
12109
12110
|
TagLib::String result;
|
12110
12111
|
int val1 ;
|
@@ -12131,16 +12132,16 @@ fail:
|
|
12131
12132
|
|
12132
12133
|
|
12133
12134
|
/*
|
12134
|
-
Document-method: TagLib::ID3v1.
|
12135
|
+
Document-method: TagLib::ID3v1.ID3v1_genreIndex
|
12135
12136
|
|
12136
12137
|
call-seq:
|
12137
|
-
|
12138
|
+
ID3v1_genreIndex(String name) -> int
|
12138
12139
|
|
12139
12140
|
A module function.
|
12140
12141
|
|
12141
12142
|
*/
|
12142
12143
|
VALUE
|
12143
|
-
|
12144
|
+
_wrap_ID3v1_genreIndex(int argc, VALUE *argv, VALUE self) {
|
12144
12145
|
TagLib::String *arg1 = 0 ;
|
12145
12146
|
int result;
|
12146
12147
|
VALUE vresult = Qnil;
|
@@ -12161,16 +12162,16 @@ fail:
|
|
12161
12162
|
|
12162
12163
|
|
12163
12164
|
/*
|
12164
|
-
Document-method: TagLib::ID3v1.
|
12165
|
+
Document-method: TagLib::ID3v1.ID3v1_genreList
|
12165
12166
|
|
12166
12167
|
call-seq:
|
12167
|
-
|
12168
|
+
ID3v1_genreList
|
12168
12169
|
|
12169
12170
|
A module function.
|
12170
12171
|
|
12171
12172
|
*/
|
12172
12173
|
VALUE
|
12173
|
-
|
12174
|
+
_wrap_ID3v1_genreList(int argc, VALUE *argv, VALUE self) {
|
12174
12175
|
TagLib::StringList result;
|
12175
12176
|
VALUE vresult = Qnil;
|
12176
12177
|
|
@@ -12189,16 +12190,16 @@ fail:
|
|
12189
12190
|
|
12190
12191
|
|
12191
12192
|
/*
|
12192
|
-
Document-method: TagLib::ID3v1.
|
12193
|
+
Document-method: TagLib::ID3v1.ID3v1_genreMap
|
12193
12194
|
|
12194
12195
|
call-seq:
|
12195
|
-
|
12196
|
+
ID3v1_genreMap -> GenreMap
|
12196
12197
|
|
12197
12198
|
A module function.
|
12198
12199
|
|
12199
12200
|
*/
|
12200
12201
|
VALUE
|
12201
|
-
|
12202
|
+
_wrap_ID3v1_genreMap(int argc, VALUE *argv, VALUE self) {
|
12202
12203
|
TagLib::ID3v1::GenreMap result;
|
12203
12204
|
VALUE vresult = Qnil;
|
12204
12205
|
|
@@ -13123,6 +13124,16 @@ fail:
|
|
13123
13124
|
swig_class cID3v2_CommentsFrame;
|
13124
13125
|
|
13125
13126
|
|
13127
|
+
/*
|
13128
|
+
Document-class: TagLib::ID3v2_GeneralEncapsulatedObjectFrame
|
13129
|
+
|
13130
|
+
Proxy of C++ TagLib::ID3v2_GeneralEncapsulatedObjectFrame class
|
13131
|
+
|
13132
|
+
|
13133
|
+
*/
|
13134
|
+
swig_class cID3v2_GeneralEncapsulatedObjectFrame;
|
13135
|
+
|
13136
|
+
|
13126
13137
|
/*
|
13127
13138
|
Document-class: TagLib::ID3v2_FrameFactory
|
13128
13139
|
|
@@ -19936,6 +19947,7 @@ static swig_type_info _swigt__p_TagLib__ID3v2__AttachedPictureFrame = {"_p_TagLi
|
|
19936
19947
|
static swig_type_info _swigt__p_TagLib__ID3v2__CommentsFrame = {"_p_TagLib__ID3v2__CommentsFrame", "TagLib::ID3v2::CommentsFrame *", 0, 0, (void*)0, 0};
|
19937
19948
|
static swig_type_info _swigt__p_TagLib__ID3v2__Frame = {"_p_TagLib__ID3v2__Frame", "TagLib::ID3v2::Frame *", 0, 0, (void*)0, 0};
|
19938
19949
|
static swig_type_info _swigt__p_TagLib__ID3v2__FrameFactory = {"_p_TagLib__ID3v2__FrameFactory", "TagLib::ID3v2::FrameFactory *", 0, 0, (void*)0, 0};
|
19950
|
+
static swig_type_info _swigt__p_TagLib__ID3v2__GeneralEncapsulatedObjectFrame = {"_p_TagLib__ID3v2__GeneralEncapsulatedObjectFrame", "TagLib::ID3v2::GeneralEncapsulatedObjectFrame *", 0, 0, (void*)0, 0};
|
19939
19951
|
static swig_type_info _swigt__p_TagLib__ID3v2__Header = {"_p_TagLib__ID3v2__Header", "TagLib::ID3v2::Header *", 0, 0, (void*)0, 0};
|
19940
19952
|
static swig_type_info _swigt__p_TagLib__ID3v2__Tag = {"_p_TagLib__ID3v2__Tag", "TagLib::ID3v2::Tag *", 0, 0, (void*)0, 0};
|
19941
19953
|
static swig_type_info _swigt__p_TagLib__ListT_Frame_p_t = {"_p_TagLib__ListT_Frame_p_t", "TagLib::ID3v2::FrameList *|TagLib::List< Frame * > *", 0, 0, (void*)0, 0};
|
@@ -19991,6 +20003,7 @@ static swig_type_info *swig_type_initial[] = {
|
|
19991
20003
|
&_swigt__p_TagLib__ID3v2__CommentsFrame,
|
19992
20004
|
&_swigt__p_TagLib__ID3v2__Frame,
|
19993
20005
|
&_swigt__p_TagLib__ID3v2__FrameFactory,
|
20006
|
+
&_swigt__p_TagLib__ID3v2__GeneralEncapsulatedObjectFrame,
|
19994
20007
|
&_swigt__p_TagLib__ID3v2__Header,
|
19995
20008
|
&_swigt__p_TagLib__ID3v2__Tag,
|
19996
20009
|
&_swigt__p_TagLib__ListT_Frame_p_t,
|
@@ -20046,6 +20059,7 @@ static swig_cast_info _swigc__p_TagLib__ID3v2__AttachedPictureFrame[] = { {&_sw
|
|
20046
20059
|
static swig_cast_info _swigc__p_TagLib__ID3v2__CommentsFrame[] = { {&_swigt__p_TagLib__ID3v2__CommentsFrame, 0, 0, 0},{0, 0, 0, 0}};
|
20047
20060
|
static swig_cast_info _swigc__p_TagLib__ID3v2__Frame[] = { {&_swigt__p_TagLib__ID3v2__Frame, 0, 0, 0},{0, 0, 0, 0}};
|
20048
20061
|
static swig_cast_info _swigc__p_TagLib__ID3v2__FrameFactory[] = { {&_swigt__p_TagLib__ID3v2__FrameFactory, 0, 0, 0},{0, 0, 0, 0}};
|
20062
|
+
static swig_cast_info _swigc__p_TagLib__ID3v2__GeneralEncapsulatedObjectFrame[] = { {&_swigt__p_TagLib__ID3v2__GeneralEncapsulatedObjectFrame, 0, 0, 0},{0, 0, 0, 0}};
|
20049
20063
|
static swig_cast_info _swigc__p_TagLib__ID3v2__Header[] = { {&_swigt__p_TagLib__ID3v2__Header, 0, 0, 0},{0, 0, 0, 0}};
|
20050
20064
|
static swig_cast_info _swigc__p_TagLib__ID3v2__Tag[] = { {&_swigt__p_TagLib__ID3v2__Tag, 0, 0, 0},{0, 0, 0, 0}};
|
20051
20065
|
static swig_cast_info _swigc__p_TagLib__ListT_Frame_p_t[] = { {&_swigt__p_TagLib__ListT_Frame_p_t, 0, 0, 0},{0, 0, 0, 0}};
|
@@ -20101,6 +20115,7 @@ static swig_cast_info *swig_cast_initial[] = {
|
|
20101
20115
|
_swigc__p_TagLib__ID3v2__CommentsFrame,
|
20102
20116
|
_swigc__p_TagLib__ID3v2__Frame,
|
20103
20117
|
_swigc__p_TagLib__ID3v2__FrameFactory,
|
20118
|
+
_swigc__p_TagLib__ID3v2__GeneralEncapsulatedObjectFrame,
|
20104
20119
|
_swigc__p_TagLib__ID3v2__Header,
|
20105
20120
|
_swigc__p_TagLib__ID3v2__Tag,
|
20106
20121
|
_swigc__p_TagLib__ListT_Frame_p_t,
|
@@ -20810,10 +20825,10 @@ cVorbis_File.klass = rb_define_class_under(mTagLibVorbis, "File", ((swig_class *
|
|
20810
20825
|
rb_undef_alloc_func(cVorbis_File.klass);
|
20811
20826
|
cVorbis_File.mark = 0;
|
20812
20827
|
cVorbis_File.trackObjects = 0;
|
20813
|
-
|
20814
|
-
|
20815
|
-
|
20816
|
-
|
20828
|
+
rb_define_module_function(mTagLibID3v1,"genre", VALUEFUNC(_wrap_ID3v1_genre),-1);
|
20829
|
+
rb_define_module_function(mTagLibID3v1,"genreIndex", VALUEFUNC(_wrap_ID3v1_genreIndex),-1);
|
20830
|
+
rb_define_module_function(mTagLibID3v1,"genreList", VALUEFUNC(_wrap_ID3v1_genreList),-1);
|
20831
|
+
rb_define_module_function(mTagLibID3v1,"genreMap", VALUEFUNC(_wrap_ID3v1_genreMap),-1);
|
20817
20832
|
|
20818
20833
|
cID3v1_Tag.klass = rb_define_class_under(mTagLibID3v1, "Tag", ((swig_class *) SWIGTYPE_p_TagLib__Tag->clientdata)->klass);
|
20819
20834
|
SWIG_TypeClientData(SWIGTYPE_p_TagLib__ID3v1__Tag, (void *) &cID3v1_Tag);
|
@@ -20870,6 +20885,12 @@ cID3v2_CommentsFrame.klass = rb_define_class_under(mTagLibID3v2, "CommentsFrame"
|
|
20870
20885
|
cID3v2_CommentsFrame.mark = 0;
|
20871
20886
|
cID3v2_CommentsFrame.trackObjects = 0;
|
20872
20887
|
|
20888
|
+
cID3v2_GeneralEncapsulatedObjectFrame.klass = rb_define_class_under(mTagLibID3v2, "GeneralEncapsulatedObjectFrame", rb_cObject);
|
20889
|
+
SWIG_TypeClientData(SWIGTYPE_p_TagLib__ID3v2__GeneralEncapsulatedObjectFrame, (void *) &cID3v2_GeneralEncapsulatedObjectFrame);
|
20890
|
+
rb_undef_alloc_func(cID3v2_GeneralEncapsulatedObjectFrame.klass);
|
20891
|
+
cID3v2_GeneralEncapsulatedObjectFrame.mark = 0;
|
20892
|
+
cID3v2_GeneralEncapsulatedObjectFrame.trackObjects = 0;
|
20893
|
+
|
20873
20894
|
cID3v2_FrameFactory.klass = rb_define_class_under(mTagLibID3v2, "FrameFactory", rb_cObject);
|
20874
20895
|
SWIG_TypeClientData(SWIGTYPE_p_TagLib__ID3v2__FrameFactory, (void *) &cID3v2_FrameFactory);
|
20875
20896
|
rb_undef_alloc_func(cID3v2_FrameFactory.klass);
|
data/lib/TagLib.rb
CHANGED
data/lib/TagLib_doc.rb
CHANGED
@@ -6,62 +6,7 @@
|
|
6
6
|
#
|
7
7
|
#
|
8
8
|
module TagLib
|
9
|
-
|
10
|
-
def self.genreList()
|
11
|
-
end
|
12
|
-
def self.genreIndex()
|
13
|
-
end
|
14
|
-
def self.genre()
|
15
|
-
end
|
16
|
-
def self.genreMap()
|
17
|
-
end
|
18
|
-
# <b>
|
19
|
-
# This class provides a simple abstraction for creating and handling files. .</b>
|
20
|
-
#
|
21
|
-
#
|
22
|
-
# FileRef exists to provide a minimal, generic and value-based wrapper around a File. It is lightweight and implicitly shared, and as such suitable for pass-by-value use. This hides some of the uglier details of TagLib::File and the non-generic portions of the concrete file implementations.This class is useful in a "simple usage" situation where it is desirable to be able to get and set some of the tag information that is similar across file types.Also note that it is probably a good idea to plug this into your mime type system rather than using the constructor that accepts a file name using the FileTypeResolver.FileTypeResolver addFileTypeResolver()
|
23
|
-
#
|
24
|
-
#
|
25
|
-
class TagLib::FileRef
|
26
|
-
# Singleton methods
|
27
|
-
def self.defaultFileExtensions()
|
28
|
-
end
|
29
|
-
#
|
30
|
-
# Returns the audio properties for this FileRef. If no audio properties were read then this will returns a null pointer.
|
31
|
-
#
|
32
|
-
def audioProperties()
|
33
|
-
end
|
34
|
-
#
|
35
|
-
# Saves the file. Returns true on success.
|
36
|
-
#
|
37
|
-
def save()
|
38
|
-
end
|
39
|
-
#
|
40
|
-
# Returns a pointer to represented file's tag.This pointer will become invalid when this FileRef and all copies pass out of scope.
|
41
|
-
# File::tag()
|
42
|
-
#
|
43
|
-
#
|
44
|
-
def tag()
|
45
|
-
end
|
46
|
-
#
|
47
|
-
# Returns true if the file (and as such other pointers) are null.
|
48
|
-
#
|
49
|
-
def isNull()
|
50
|
-
end
|
51
|
-
def null?()
|
52
|
-
end
|
53
|
-
#
|
54
|
-
# Returns a pointer to the file represented by this handler class.As a general rule this call should be avoided since if you need to work with file objects directly, you are probably better served instantiating the File subclasses (i.e. MPEG::File) manually and working with their APIs.This handle exists to provide a minimal, generic and value-based wrapper around a File. Accessing the file directly generally indicates a moving away from this simplicity (and into things beyond the scope of FileRef).This pointer will become invalid when this FileRef and all copies pass out of scope.
|
55
|
-
#
|
56
|
-
#
|
57
|
-
def file()
|
58
|
-
end
|
59
|
-
end
|
60
|
-
class TagLib::FrameListMap
|
61
|
-
def isEmpty()
|
62
|
-
end
|
63
|
-
def contains()
|
64
|
-
end
|
9
|
+
class TagLib::FrameListMap
|
65
10
|
def clear()
|
66
11
|
end
|
67
12
|
def size()
|
@@ -70,6 +15,10 @@
|
|
70
15
|
end
|
71
16
|
def insert()
|
72
17
|
end
|
18
|
+
def contains()
|
19
|
+
end
|
20
|
+
def isEmpty()
|
21
|
+
end
|
73
22
|
def length()
|
74
23
|
end
|
75
24
|
end
|
@@ -80,16 +29,6 @@
|
|
80
29
|
# This is an attempt to abstract away the difference in the meta data formats of various audio codecs and tagging schemes. As such it is generally a subset of what is available in the specific formats but should be suitable for most applications. This is meant to compliment the generic APIs found in TagLib::AudioProperties, TagLib::File and TagLib::FileRef.
|
81
30
|
#
|
82
31
|
class TagLib::Tag
|
83
|
-
#
|
84
|
-
# Returns true if the tag does not contain any data. This should be reimplemented in subclasses that provide more than the basic tagging abilities in this class.
|
85
|
-
#
|
86
|
-
def isEmpty()
|
87
|
-
end
|
88
|
-
#
|
89
|
-
# Returns the genre name; if no genre is present in the tag String::null will be returned.
|
90
|
-
#
|
91
|
-
def genre()
|
92
|
-
end
|
93
32
|
def genre=()
|
94
33
|
end
|
95
34
|
#
|
@@ -98,16 +37,14 @@
|
|
98
37
|
def setComment( s)
|
99
38
|
end
|
100
39
|
#
|
101
|
-
# Returns the year; if there is no year set, this will return 0.
|
102
|
-
#
|
103
|
-
def year()
|
104
|
-
end
|
105
|
-
#
|
106
40
|
# Returns the track number; if there is no track number set, this will return 0.
|
107
41
|
#
|
108
42
|
def track()
|
109
43
|
end
|
110
|
-
|
44
|
+
#
|
45
|
+
# Returns the year; if there is no year set, this will return 0.
|
46
|
+
#
|
47
|
+
def year()
|
111
48
|
end
|
112
49
|
def track=()
|
113
50
|
end
|
@@ -121,7 +58,7 @@
|
|
121
58
|
#
|
122
59
|
def title()
|
123
60
|
end
|
124
|
-
def
|
61
|
+
def year=()
|
125
62
|
end
|
126
63
|
def title=()
|
127
64
|
end
|
@@ -136,10 +73,19 @@
|
|
136
73
|
def setYear(uint i)
|
137
74
|
end
|
138
75
|
#
|
76
|
+
# Returns the track comment; if no comment is present in the tag String::null will be returned.
|
77
|
+
#
|
78
|
+
def comment()
|
79
|
+
end
|
80
|
+
def empty?()
|
81
|
+
end
|
82
|
+
#
|
139
83
|
# Returns the artist name; if no artist name is present in the tag String::null will be returned.
|
140
84
|
#
|
141
85
|
def artist()
|
142
86
|
end
|
87
|
+
def comment=()
|
88
|
+
end
|
143
89
|
def artist=()
|
144
90
|
end
|
145
91
|
#
|
@@ -153,17 +99,10 @@
|
|
153
99
|
def setTrack(uint i)
|
154
100
|
end
|
155
101
|
#
|
156
|
-
# Returns the track comment; if no comment is present in the tag String::null will be returned.
|
157
|
-
#
|
158
|
-
def comment()
|
159
|
-
end
|
160
|
-
#
|
161
102
|
# Returns the album name; if no album name is present in the tag String::null will be returned.
|
162
103
|
#
|
163
104
|
def album()
|
164
105
|
end
|
165
|
-
def comment=()
|
166
|
-
end
|
167
106
|
def album=()
|
168
107
|
end
|
169
108
|
#
|
@@ -171,27 +110,23 @@
|
|
171
110
|
#
|
172
111
|
def setAlbum( s)
|
173
112
|
end
|
174
|
-
end
|
175
|
-
# <b>
|
176
|
-
# A wide string class suitable for unicode. .</b>
|
177
113
|
#
|
114
|
+
# Returns true if the tag does not contain any data. This should be reimplemented in subclasses that provide more than the basic tagging abilities in this class.
|
178
115
|
#
|
179
|
-
|
180
|
-
|
181
|
-
class TagLib::String
|
116
|
+
def isEmpty()
|
117
|
+
end
|
182
118
|
#
|
183
|
-
#
|
184
|
-
#
|
119
|
+
# Returns the genre name; if no genre is present in the tag String::null will be returned.
|
185
120
|
#
|
186
|
-
def
|
121
|
+
def genre()
|
187
122
|
end
|
188
123
|
end
|
189
124
|
class TagLib::FrameList
|
190
|
-
def
|
125
|
+
def size()
|
191
126
|
end
|
192
127
|
def contains()
|
193
128
|
end
|
194
|
-
def
|
129
|
+
def isEmpty()
|
195
130
|
end
|
196
131
|
end
|
197
132
|
# <b>
|
@@ -223,6 +158,20 @@
|
|
223
158
|
end
|
224
159
|
end
|
225
160
|
# <b>
|
161
|
+
# A wide string class suitable for unicode. .</b>
|
162
|
+
#
|
163
|
+
#
|
164
|
+
# This is an implicitly shared wide string. For storage it uses TagLib::wstring, but as this is an implementation detail this of course could change. Strings are stored internally as UTF-16BE. (Without the BOM (Byte Order Mark)The use of implicit sharing means that copying a string is cheap, the only cost comes into play when the copy is modified. Prior to that the string just has a pointer to the data of the parent String. This also makes this class suitable as a function return type.In addition to adding implicit sharing, this class keeps track of four possible encodings, which are the four supported by the ID3v2 standard.
|
165
|
+
#
|
166
|
+
class TagLib::String
|
167
|
+
#
|
168
|
+
# Creates and returns a C-String based on the data. This string is still owned by the String (class) and as such should not be deleted by the user.If unicode if false (the default) this string will be encoded in Latin1. If it is true the returned C-String will be UTF-8 encoded.This string remains valid until the String instance is destroyed or another export method is called.This however has the side effect that this C-String will remain in memory in addition to other memory that is consumed by the String instance. So, this method should not be used on large strings or where memory is critical.
|
169
|
+
#
|
170
|
+
#
|
171
|
+
def toCString(bool unicode = false)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
# <b>
|
226
175
|
# A byte vector. .</b>
|
227
176
|
#
|
228
177
|
#
|
@@ -241,10 +190,6 @@
|
|
241
190
|
end
|
242
191
|
end
|
243
192
|
class TagLib::GenreMap
|
244
|
-
def isEmpty()
|
245
|
-
end
|
246
|
-
def contains()
|
247
|
-
end
|
248
193
|
def clear()
|
249
194
|
end
|
250
195
|
def size()
|
@@ -253,6 +198,10 @@
|
|
253
198
|
end
|
254
199
|
def insert()
|
255
200
|
end
|
201
|
+
def contains()
|
202
|
+
end
|
203
|
+
def isEmpty()
|
204
|
+
end
|
256
205
|
def length()
|
257
206
|
end
|
258
207
|
def []()
|
@@ -265,18 +214,14 @@
|
|
265
214
|
# A List specialization with some handy features useful for ByteVectors.
|
266
215
|
#
|
267
216
|
class TagLib::ByteVectorList
|
268
|
-
def
|
217
|
+
def size()
|
269
218
|
end
|
270
219
|
def contains()
|
271
220
|
end
|
272
|
-
def
|
221
|
+
def isEmpty()
|
273
222
|
end
|
274
223
|
end
|
275
224
|
class TagLib::ItemListMap
|
276
|
-
def isEmpty()
|
277
|
-
end
|
278
|
-
def contains()
|
279
|
-
end
|
280
225
|
def clear()
|
281
226
|
end
|
282
227
|
def size()
|
@@ -285,6 +230,10 @@
|
|
285
230
|
end
|
286
231
|
def insert()
|
287
232
|
end
|
233
|
+
def contains()
|
234
|
+
end
|
235
|
+
def isEmpty()
|
236
|
+
end
|
288
237
|
def length()
|
289
238
|
end
|
290
239
|
end
|
@@ -295,12 +244,30 @@
|
|
295
244
|
# This is a spcialization of the List class with some members convention for string operations.
|
296
245
|
#
|
297
246
|
class TagLib::StringList
|
298
|
-
def
|
247
|
+
def size()
|
299
248
|
end
|
300
249
|
def contains()
|
301
250
|
end
|
251
|
+
def isEmpty()
|
252
|
+
end
|
253
|
+
end
|
254
|
+
class TagLib::FieldListMap
|
255
|
+
def clear()
|
256
|
+
end
|
302
257
|
def size()
|
303
258
|
end
|
259
|
+
def empty?()
|
260
|
+
end
|
261
|
+
def insert()
|
262
|
+
end
|
263
|
+
def contains()
|
264
|
+
end
|
265
|
+
def isEmpty()
|
266
|
+
end
|
267
|
+
def length()
|
268
|
+
end
|
269
|
+
def []()
|
270
|
+
end
|
304
271
|
end
|
305
272
|
# <b>
|
306
273
|
# A file class with some useful methods for tag manipulation. .</b>
|
@@ -320,23 +287,8 @@
|
|
320
287
|
#
|
321
288
|
def seek(long offset,Position p = Beginning)
|
322
289
|
end
|
323
|
-
#
|
324
|
-
# Returns true if the file is read only (or if the file can not be opened).
|
325
|
-
#
|
326
|
-
def readOnly()
|
327
|
-
end
|
328
|
-
#
|
329
|
-
# Returns a pointer to this file's audio properties. This should be reimplemented in the concrete subclasses. If no audio properties were read then this will return a null pointer.
|
330
|
-
#
|
331
|
-
def audioProperties()
|
332
|
-
end
|
333
290
|
def find2()
|
334
291
|
end
|
335
|
-
#
|
336
|
-
# Reset the end-of-file and error flags on the file.
|
337
|
-
#
|
338
|
-
def clear()
|
339
|
-
end
|
340
292
|
def valid?()
|
341
293
|
end
|
342
294
|
#
|
@@ -345,24 +297,27 @@
|
|
345
297
|
#
|
346
298
|
def save()
|
347
299
|
end
|
348
|
-
#
|
349
|
-
# Returns a pointer to this file's tag. This should be reimplemented in the concrete subclasses.
|
350
|
-
#
|
351
|
-
def tag()
|
352
|
-
end
|
353
300
|
def isWritable()
|
354
301
|
end
|
355
302
|
def find3()
|
356
303
|
end
|
304
|
+
#
|
305
|
+
# Reset the end-of-file and error flags on the file.
|
306
|
+
#
|
307
|
+
def clear()
|
308
|
+
end
|
357
309
|
def read_only?()
|
358
310
|
end
|
359
311
|
#
|
312
|
+
# Returns a pointer to this file's tag. This should be reimplemented in the concrete subclasses.
|
313
|
+
#
|
314
|
+
def tag()
|
315
|
+
end
|
316
|
+
#
|
360
317
|
# Since the file can currently only be opened as an argument to the constructor (sort-of by design), this returns if that open succeeded.
|
361
318
|
#
|
362
319
|
def isOpen()
|
363
320
|
end
|
364
|
-
def writable?()
|
365
|
-
end
|
366
321
|
#
|
367
322
|
# Reads a block of size length at the current get pointer.
|
368
323
|
#
|
@@ -374,11 +329,7 @@
|
|
374
329
|
#
|
375
330
|
def rfind( ByteVector pattern,long fromOffset = 0, ByteVector before = ByteVector::null)
|
376
331
|
end
|
377
|
-
|
378
|
-
# Insert data at position start in the file overwriting replace bytes of the original content.This method is slow since it requires rewriting all of the file after the insertion point.
|
379
|
-
#
|
380
|
-
#
|
381
|
-
def insert( ByteVector data,ulong start = 0,ulong replace = 0)
|
332
|
+
def writable?()
|
382
333
|
end
|
383
334
|
#
|
384
335
|
# Attempts to write the block data at the current get pointer. If the file is currently only opened read only -- i.e. readOnly() returns true -- this attempts to reopen the file in read/write mode.This should be used instead of using the streaming output operator for a ByteVector. And even this function is significantly slower than doing output with a char[].
|
@@ -387,9 +338,10 @@
|
|
387
338
|
def writeBlock( ByteVector data)
|
388
339
|
end
|
389
340
|
#
|
390
|
-
#
|
341
|
+
# Insert data at position start in the file overwriting replace bytes of the original content.This method is slow since it requires rewriting all of the file after the insertion point.
|
342
|
+
#
|
391
343
|
#
|
392
|
-
def
|
344
|
+
def insert( ByteVector data,ulong start = 0,ulong replace = 0)
|
393
345
|
end
|
394
346
|
#
|
395
347
|
# Removes a block of the file starting a start and continuing for length bytes.This method is slow since it involves rewriting all of the file after the removed portion.
|
@@ -400,674 +352,617 @@
|
|
400
352
|
def open?()
|
401
353
|
end
|
402
354
|
#
|
403
|
-
# Returns the
|
355
|
+
# Returns true if the file is open and readble and valid information for the Tag and / or AudioProperties was found.
|
404
356
|
#
|
405
|
-
def
|
357
|
+
def isValid()
|
406
358
|
end
|
407
359
|
#
|
408
|
-
# Returns
|
360
|
+
# Returns the current offset withing the file.
|
409
361
|
#
|
410
|
-
def
|
362
|
+
def tell()
|
411
363
|
end
|
412
364
|
def find1()
|
413
365
|
end
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
end
|
418
|
-
def contains()
|
419
|
-
end
|
420
|
-
def clear()
|
421
|
-
end
|
422
|
-
def size()
|
423
|
-
end
|
424
|
-
def empty?()
|
425
|
-
end
|
426
|
-
def insert()
|
427
|
-
end
|
366
|
+
#
|
367
|
+
# Returns the length of the file.
|
368
|
+
#
|
428
369
|
def length()
|
429
370
|
end
|
430
|
-
|
371
|
+
#
|
372
|
+
# Returns true if the file is read only (or if the file can not be opened).
|
373
|
+
#
|
374
|
+
def readOnly()
|
375
|
+
end
|
376
|
+
#
|
377
|
+
# Returns a pointer to this file's audio properties. This should be reimplemented in the concrete subclasses. If no audio properties were read then this will return a null pointer.
|
378
|
+
#
|
379
|
+
def audioProperties()
|
431
380
|
end
|
432
381
|
end
|
433
382
|
# <b>
|
434
|
-
#
|
383
|
+
# This class provides a simple abstraction for creating and handling files. .</b>
|
435
384
|
#
|
436
385
|
#
|
386
|
+
# FileRef exists to provide a minimal, generic and value-based wrapper around a File. It is lightweight and implicitly shared, and as such suitable for pass-by-value use. This hides some of the uglier details of TagLib::File and the non-generic portions of the concrete file implementations.This class is useful in a "simple usage" situation where it is desirable to be able to get and set some of the tag information that is similar across file types.Also note that it is probably a good idea to plug this into your mime type system rather than using the constructor that accepts a file name using the FileTypeResolver.FileTypeResolver addFileTypeResolver()
|
437
387
|
#
|
438
388
|
#
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
389
|
+
class TagLib::FileRef
|
390
|
+
# Singleton methods
|
391
|
+
def self.defaultFileExtensions()
|
392
|
+
end
|
443
393
|
#
|
444
|
-
#
|
394
|
+
# Saves the file. Returns true on success.
|
445
395
|
#
|
446
|
-
|
396
|
+
def save()
|
397
|
+
end
|
447
398
|
#
|
448
|
-
#
|
399
|
+
# Returns a pointer to represented file's tag.This pointer will become invalid when this FileRef and all copies pass out of scope.
|
400
|
+
# File::tag()
|
449
401
|
#
|
450
402
|
#
|
451
|
-
|
452
|
-
|
403
|
+
def tag()
|
404
|
+
end
|
453
405
|
#
|
454
|
-
#
|
455
|
-
#
|
406
|
+
# Returns true if the file (and as such other pointers) are null.
|
456
407
|
#
|
457
|
-
|
458
|
-
|
408
|
+
def isNull()
|
409
|
+
end
|
410
|
+
def null?()
|
411
|
+
end
|
459
412
|
#
|
460
|
-
# Returns
|
413
|
+
# Returns a pointer to the file represented by this handler class.As a general rule this call should be avoided since if you need to work with file objects directly, you are probably better served instantiating the File subclasses (i.e. MPEG::File) manually and working with their APIs.This handle exists to provide a minimal, generic and value-based wrapper around a File. Accessing the file directly generally indicates a moving away from this simplicity (and into things beyond the scope of FileRef).This pointer will become invalid when this FileRef and all copies pass out of scope.
|
461
414
|
#
|
462
415
|
#
|
463
|
-
|
464
|
-
|
416
|
+
def file()
|
417
|
+
end
|
465
418
|
#
|
466
|
-
#
|
467
|
-
#
|
419
|
+
# Returns the audio properties for this FileRef. If no audio properties were read then this will returns a null pointer.
|
468
420
|
#
|
469
|
-
|
470
|
-
|
421
|
+
def audioProperties()
|
422
|
+
end
|
423
|
+
end
|
424
|
+
# <b>
|
425
|
+
# An ID3v1 implementation. .</b>
|
471
426
|
#
|
472
|
-
# A special value of containing the position of the packet to be interpreted by the codec. In the case of Vorbis this contains the PCM value and is used to calculate the length of the stream.setAbsoluteGranularPosition()
|
473
|
-
#
|
474
427
|
#
|
475
|
-
|
476
|
-
end
|
428
|
+
#
|
477
429
|
#
|
478
|
-
|
479
|
-
|
430
|
+
module TagLib::ID3v1
|
431
|
+
# Singleton methods
|
432
|
+
def self.genreList()
|
433
|
+
end
|
434
|
+
def self.genreIndex()
|
435
|
+
end
|
436
|
+
def self.genre()
|
437
|
+
end
|
438
|
+
def self.genreMap()
|
439
|
+
end
|
440
|
+
# <b>
|
441
|
+
# The main class in the ID3v1 implementation. .</b>
|
480
442
|
#
|
481
|
-
def setPacketSizes( List< int > sizes)
|
482
|
-
end
|
483
443
|
#
|
484
|
-
#
|
485
|
-
#
|
444
|
+
# This is an implementation of the ID3v1 format. ID3v1 is both the simplist and most common of tag formats but is rather limited. Because of its pervasiveness and the way that applications have been written around the fields that it provides, the generic TagLib::Tag API is a mirror of what is provided by ID3v1.ID3v1 tags should generally only contain Latin1 information. However because many applications do not follow this rule there is now support for overriding the ID3v1 string handling using the ID3v1::StringHandler class. Please see the documentation for that class for more information.StringHandler
|
445
|
+
# Most fields are truncated to a maximum of 28-30 bytes. The truncation happens automatically when the tag is rendered.
|
446
|
+
#
|
486
447
|
#
|
487
|
-
|
448
|
+
class TagLib::ID3v1::Tag < TagLib::Tag
|
449
|
+
def genre=()
|
488
450
|
end
|
489
451
|
#
|
490
|
-
#
|
452
|
+
# Sets the comment to s. If s is String::null then this value will be cleared.
|
491
453
|
#
|
492
|
-
def
|
454
|
+
def setComment( s)
|
493
455
|
end
|
494
456
|
#
|
495
|
-
#
|
496
|
-
#
|
457
|
+
# Returns the track number; if there is no track number set, this will return 0.
|
497
458
|
#
|
498
|
-
def
|
459
|
+
def track()
|
499
460
|
end
|
500
461
|
#
|
501
|
-
#
|
502
|
-
#
|
462
|
+
# Returns the year; if there is no year set, this will return 0.
|
503
463
|
#
|
504
|
-
def
|
464
|
+
def year()
|
505
465
|
end
|
506
|
-
|
507
|
-
# Some packets can be continued across multiple pages. If the first packet in the current page is a continuation this will return true. If this is page starts with a new packet this will return false.lastPacketCompleted() setFirstPacketContinued()
|
508
|
-
#
|
509
|
-
#
|
510
|
-
def firstPacketContinued()
|
466
|
+
def track=()
|
511
467
|
end
|
512
468
|
#
|
513
|
-
#
|
469
|
+
# Sets the genre to s. If s is String::null then this value will be cleared. For tag formats that use a fixed set of genres, the appropriate value will be selected based on a string comparison. A list of available genres for those formats should be available in that type's implementation.
|
514
470
|
#
|
515
|
-
def
|
471
|
+
def setGenre( s)
|
516
472
|
end
|
517
473
|
#
|
518
|
-
#
|
519
|
-
#
|
474
|
+
# Returns the track name; if no track name is present in the tag String::null will be returned.
|
520
475
|
#
|
521
|
-
def
|
476
|
+
def title()
|
522
477
|
end
|
523
|
-
|
524
|
-
# Every Ogg logical stream is given a random serial number which is common to every page in that logical stream. This returns the serial number of the stream associated with this packet.setStreamSerialNumber()
|
525
|
-
#
|
526
|
-
#
|
527
|
-
def streamSerialNumber()
|
478
|
+
def year=()
|
528
479
|
end
|
529
|
-
|
530
|
-
# Sets the internal flag indicating if the first packet in this page is continued to continued.firstPacketContinued()
|
531
|
-
#
|
532
|
-
#
|
533
|
-
def setFirstPacketContinued(bool continued)
|
480
|
+
def title=()
|
534
481
|
end
|
535
482
|
#
|
536
|
-
#
|
537
|
-
#
|
483
|
+
# Sets the title to s. If s is String::null then this value will be cleared.
|
538
484
|
#
|
539
|
-
def
|
485
|
+
def setTitle( s)
|
540
486
|
end
|
541
487
|
#
|
542
|
-
#
|
543
|
-
#
|
488
|
+
# Sets the year to i. If s is 0 then this value will be cleared.
|
544
489
|
#
|
545
|
-
def
|
490
|
+
def setYear(uint i)
|
546
491
|
end
|
547
492
|
#
|
548
|
-
# Returns
|
493
|
+
# Returns the track comment; if no comment is present in the tag String::null will be returned.
|
549
494
|
#
|
550
|
-
def
|
495
|
+
def comment()
|
551
496
|
end
|
552
|
-
|
553
|
-
# Render the page header to binary data.The checksum -- bytes 22 - 25 -- will be left empty and must be filled in when rendering the entire page.
|
554
|
-
#
|
555
|
-
#
|
556
|
-
def render()
|
497
|
+
def empty?()
|
557
498
|
end
|
558
499
|
#
|
559
|
-
# Returns
|
560
|
-
#
|
500
|
+
# Returns the artist name; if no artist name is present in the tag String::null will be returned.
|
561
501
|
#
|
562
|
-
def
|
502
|
+
def artist()
|
563
503
|
end
|
564
|
-
|
565
|
-
# <b>
|
566
|
-
# An implementation of Ogg pages. .</b>
|
567
|
-
#
|
568
|
-
#
|
569
|
-
# This is an implementation of the pages that make up an Ogg stream. This handles parsing pages and breaking them down into packets and handles the details of packets spanning multiple pages and pages that contiain multiple packets.In most Xiph.org formats the comments are found in the first few packets, this however is a reasonably complete implementation of Ogg pages that could potentially be useful for non-meta data purposes.
|
570
|
-
#
|
571
|
-
class TagLib::Ogg::Page
|
572
|
-
#
|
573
|
-
# Checks to see if the specified packet is contained in the current page.ContainsPacketFlags
|
574
|
-
#
|
575
|
-
#
|
576
|
-
def containsPacket(int index)
|
504
|
+
def comment=()
|
577
505
|
end
|
578
|
-
|
579
|
-
# Returns the page's position within the file (in bytes).
|
580
|
-
#
|
581
|
-
def fileOffset()
|
506
|
+
def artist=()
|
582
507
|
end
|
583
508
|
#
|
584
|
-
#
|
509
|
+
# Sets the artist to s. If s is String::null then this value will be cleared.
|
585
510
|
#
|
586
|
-
def
|
511
|
+
def setArtist( s)
|
587
512
|
end
|
588
513
|
#
|
589
|
-
#
|
514
|
+
# Sets the track to i. If s is 0 then this value will be cleared.
|
590
515
|
#
|
591
|
-
def
|
516
|
+
def setTrack(uint i)
|
592
517
|
end
|
593
518
|
#
|
594
|
-
# Returns
|
519
|
+
# Returns the album name; if no album name is present in the tag String::null will be returned.
|
595
520
|
#
|
596
|
-
def
|
521
|
+
def album()
|
597
522
|
end
|
598
523
|
#
|
599
|
-
#
|
600
|
-
# PageHeader::firstPacketContinued()
|
601
|
-
#
|
524
|
+
# Renders the in memory values to a ByteVector suitable for writing to the file.
|
602
525
|
#
|
603
|
-
def
|
526
|
+
def render()
|
604
527
|
end
|
605
|
-
|
606
|
-
# Returns the index of the first packet wholly or partially contained in this page.setFirstPacketIndex()
|
607
|
-
#
|
608
|
-
#
|
609
|
-
def firstPacketIndex()
|
528
|
+
def album=()
|
610
529
|
end
|
611
530
|
#
|
612
|
-
# Sets the
|
613
|
-
#
|
531
|
+
# Sets the album to s. If s is String::null then this value will be cleared.
|
614
532
|
#
|
615
|
-
def
|
533
|
+
def setAlbum( s)
|
534
|
+
end
|
535
|
+
def isEmpty()
|
616
536
|
end
|
617
537
|
#
|
618
|
-
#
|
538
|
+
# Returns the genre name; if no genre is present in the tag String::null will be returned.
|
619
539
|
#
|
620
|
-
def
|
540
|
+
def genre()
|
621
541
|
end
|
622
542
|
end
|
543
|
+
end
|
623
544
|
# <b>
|
624
|
-
#
|
545
|
+
# A namespace containing classes for Vorbis metadata. .</b>
|
625
546
|
#
|
626
547
|
#
|
627
|
-
# This class is an implementation of the Ogg Vorbis comment specification, to be found in section 5 of the Ogg Vorbis specification. Because this format is also used in other (currently unsupported) Xiph.org formats, it has been made part of a generic implementation rather than being limited to strictly Vorbis.Vorbis comments are a simple vector of keys and values, called fields. Multiple values for a given key are supported.fieldListMap()
|
628
548
|
#
|
629
549
|
#
|
630
|
-
|
631
|
-
|
632
|
-
#
|
633
|
-
#
|
634
|
-
def isEmpty()
|
635
|
-
end
|
636
|
-
#
|
637
|
-
# Returns a reference to the map of field lists. Because Xiph comments support multiple fields with the same key, a pure Map would not work. As such this is a Map of string lists, keyed on the comment field name.The standard set of Xiph/Vorbis fields (which may or may not be contained in any specific comment) is:
|
638
|
-
#
|
639
|
-
# TITLE
|
640
|
-
#
|
641
|
-
# VERSION
|
642
|
-
#
|
643
|
-
# ALBUM
|
644
|
-
#
|
645
|
-
# ARTIST
|
646
|
-
#
|
647
|
-
# PERFORMER
|
648
|
-
#
|
649
|
-
# COPYRIGHT
|
550
|
+
module TagLib::Vorbis
|
551
|
+
# <b>
|
552
|
+
# An implementation of audio property reading for Ogg Vorbis. .</b>
|
650
553
|
#
|
651
|
-
# ORGANIZATION
|
652
554
|
#
|
653
|
-
#
|
555
|
+
# This reads the data from an Ogg Vorbis stream found in the AudioProperties API.
|
654
556
|
#
|
655
|
-
|
557
|
+
class TagLib::Vorbis::Properties < TagLib::AudioProperties
|
656
558
|
#
|
657
|
-
#
|
559
|
+
# Returns the minimum bitrate as read from the Vorbis identification header.
|
658
560
|
#
|
659
|
-
|
561
|
+
def bitrateMinimum()
|
562
|
+
end
|
660
563
|
#
|
661
|
-
#
|
564
|
+
# Returns the most appropriate bit rate for the file in kb/s. For constant bitrate formats this is simply the bitrate of the file. For variable bitrate formats this is either the average or nominal bitrate.
|
662
565
|
#
|
663
|
-
|
566
|
+
def bitrate()
|
567
|
+
end
|
664
568
|
#
|
665
|
-
#
|
666
|
-
# You should not modify this data structure directly, instead use addField() and removeField().
|
667
|
-
#
|
569
|
+
# Returns the sample rate in Hz.
|
668
570
|
#
|
669
|
-
def
|
571
|
+
def sampleRate()
|
670
572
|
end
|
671
573
|
#
|
672
|
-
# Returns
|
673
|
-
#
|
574
|
+
# Returns the Vorbis version, currently "0" (as specified by the spec).
|
674
575
|
#
|
675
|
-
def
|
576
|
+
def vorbisVersion()
|
676
577
|
end
|
677
578
|
#
|
678
|
-
# Returns the
|
579
|
+
# Returns the number of audio channels.
|
679
580
|
#
|
680
|
-
def
|
681
|
-
end
|
682
|
-
def genre=()
|
581
|
+
def channels()
|
683
582
|
end
|
684
583
|
#
|
685
|
-
#
|
584
|
+
# Returns the maximum bitrate as read from the Vorbis identification header.
|
686
585
|
#
|
687
|
-
def
|
586
|
+
def bitrateMaximum()
|
688
587
|
end
|
689
588
|
#
|
690
|
-
# Returns the
|
589
|
+
# Returns the length of the file in seconds.
|
691
590
|
#
|
692
|
-
def
|
591
|
+
def length()
|
693
592
|
end
|
694
593
|
#
|
695
|
-
# Returns the
|
594
|
+
# Returns the nominal bitrate as read from the Vorbis identification header.
|
696
595
|
#
|
697
|
-
def
|
596
|
+
def bitrateNominal()
|
698
597
|
end
|
598
|
+
end
|
599
|
+
# <b>
|
600
|
+
# An implementation of Ogg::File with Vorbis specific methods. .</b>
|
699
601
|
#
|
700
|
-
# Returns the vendor ID of the Ogg Vorbis encoder. libvorbis 1.0 as the most common case always returns "Xiph.Org libVorbis I 20020717".
|
701
602
|
#
|
702
|
-
|
703
|
-
|
704
|
-
|
603
|
+
# This is the central class in the Ogg Vorbis metadata processing collection of classes. It's built upon Ogg::File which handles processing of the Ogg logical bitstream and breaking it down into pages which are handled by the codec implementations, in this case Vorbis specifically.
|
604
|
+
#
|
605
|
+
class TagLib::Vorbis::File < TagLib::Ogg::File
|
606
|
+
def name()
|
705
607
|
end
|
706
|
-
def
|
608
|
+
def seek()
|
609
|
+
end
|
610
|
+
def find2()
|
611
|
+
end
|
612
|
+
def firstPageHeader()
|
613
|
+
end
|
614
|
+
def valid?()
|
707
615
|
end
|
708
616
|
#
|
709
|
-
#
|
617
|
+
# Save the file and its associated tags. This should be reimplemented in the concrete subclasses. Returns true if the save succeeds.On UNIX multiple processes are able to write to the same file at the same time. This can result in serious file corruption. If you are developing a program that makes use of TagLib from multiple processes you must insure that you are only doing writes to a particular file from one of them.
|
618
|
+
#
|
710
619
|
#
|
711
|
-
def
|
620
|
+
def save()
|
621
|
+
end
|
622
|
+
def isWritable()
|
623
|
+
end
|
624
|
+
def find3()
|
625
|
+
end
|
626
|
+
def clear()
|
627
|
+
end
|
628
|
+
def lastPageHeader()
|
629
|
+
end
|
630
|
+
def read_only?()
|
712
631
|
end
|
713
632
|
#
|
714
|
-
# Returns the
|
633
|
+
# Returns the XiphComment for this file. XiphComment implements the tag interface, so this serves as the reimplementation of TagLib::File::tag().
|
715
634
|
#
|
716
|
-
def
|
635
|
+
def tag()
|
717
636
|
end
|
718
|
-
def
|
637
|
+
def isOpen()
|
719
638
|
end
|
720
|
-
def
|
639
|
+
def readBlock()
|
640
|
+
end
|
641
|
+
def rfind()
|
642
|
+
end
|
643
|
+
def writable?()
|
644
|
+
end
|
645
|
+
def writeBlock()
|
646
|
+
end
|
647
|
+
def packet()
|
648
|
+
end
|
649
|
+
def insert()
|
650
|
+
end
|
651
|
+
def removeBlock()
|
652
|
+
end
|
653
|
+
def open?()
|
654
|
+
end
|
655
|
+
def isValid()
|
656
|
+
end
|
657
|
+
def tell()
|
658
|
+
end
|
659
|
+
def find1()
|
660
|
+
end
|
661
|
+
def setPacket()
|
662
|
+
end
|
663
|
+
def length()
|
664
|
+
end
|
665
|
+
def readOnly()
|
721
666
|
end
|
722
667
|
#
|
723
|
-
#
|
668
|
+
# Returns the Vorbis::Properties for this file. If no audio properties were read then this will return a null pointer.
|
724
669
|
#
|
725
|
-
def
|
670
|
+
def audioProperties()
|
726
671
|
end
|
672
|
+
end
|
673
|
+
end
|
674
|
+
# <b>
|
675
|
+
# An implementation of TagLib::File with MPEG (MP3) specific methods. .</b>
|
727
676
|
#
|
728
|
-
# Add the field specified by key with the data value. If replace is true, then all of the other fields with the same key will be removed first.If the field value is empty, the field will be removed.
|
729
677
|
#
|
730
|
-
|
731
|
-
end
|
678
|
+
#
|
732
679
|
#
|
733
|
-
|
680
|
+
module TagLib::MPEG
|
681
|
+
# <b>
|
682
|
+
# An implementation of MP3 frame headers. .</b>
|
734
683
|
#
|
735
|
-
def setYear(uint i)
|
736
|
-
end
|
737
684
|
#
|
738
|
-
#
|
685
|
+
# This is an implementation of MPEG Layer III headers. The API follows more or less the binary format of these headers. I've used this document as a reference.
|
739
686
|
#
|
740
|
-
|
687
|
+
class TagLib::MPEG::Header
|
688
|
+
#
|
689
|
+
# Returns true if the copyrighted bit is set.
|
690
|
+
#
|
691
|
+
def isCopyrighted()
|
741
692
|
end
|
742
|
-
|
693
|
+
#
|
694
|
+
# Returns the MPEG Version of the header.
|
695
|
+
#
|
696
|
+
def version()
|
743
697
|
end
|
744
698
|
#
|
745
|
-
#
|
699
|
+
# Returns the bitrate encoded in the header.
|
746
700
|
#
|
747
|
-
def
|
701
|
+
def bitrate()
|
748
702
|
end
|
749
703
|
#
|
750
|
-
#
|
704
|
+
# Returns the layer version. This will be between the values 1-3.
|
751
705
|
#
|
752
|
-
def
|
706
|
+
def layer()
|
753
707
|
end
|
754
708
|
#
|
755
|
-
#
|
709
|
+
# Returns true if the "original" bit is set.
|
756
710
|
#
|
757
|
-
def
|
711
|
+
def isOriginal()
|
758
712
|
end
|
759
713
|
#
|
760
|
-
# Returns the
|
714
|
+
# Returns the sample rate in Hz.
|
761
715
|
#
|
762
|
-
def
|
716
|
+
def sampleRate()
|
763
717
|
end
|
764
718
|
#
|
765
|
-
# Returns
|
719
|
+
# Returns true if the MPEG protection bit is enabled.
|
766
720
|
#
|
767
|
-
def
|
721
|
+
def protectionEnabled()
|
768
722
|
end
|
769
723
|
#
|
770
|
-
# Returns the
|
724
|
+
# Returns the frame length.
|
771
725
|
#
|
772
|
-
def
|
726
|
+
def frameLength()
|
773
727
|
end
|
774
|
-
|
728
|
+
#
|
729
|
+
# Returns true if the frame is padded.
|
730
|
+
#
|
731
|
+
def isPadded()
|
775
732
|
end
|
776
733
|
#
|
777
|
-
#
|
734
|
+
# Returns the number of frames per sample.
|
778
735
|
#
|
779
|
-
def
|
736
|
+
def samplesPerFrame()
|
780
737
|
end
|
781
|
-
|
738
|
+
#
|
739
|
+
# Returns true if the frame is at least an appropriate size and has legal values.
|
740
|
+
#
|
741
|
+
def isValid()
|
782
742
|
end
|
783
743
|
#
|
784
|
-
#
|
744
|
+
# Returns the channel mode for this frame.
|
785
745
|
#
|
786
|
-
def
|
746
|
+
def channelMode()
|
787
747
|
end
|
788
748
|
end
|
789
749
|
# <b>
|
790
|
-
# An implementation of
|
750
|
+
# An implementation of audio property reading for MP3. .</b>
|
791
751
|
#
|
792
752
|
#
|
793
|
-
# This
|
753
|
+
# This reads the data from an MPEG Layer III stream found in the AudioProperties API.
|
794
754
|
#
|
795
|
-
class TagLib::
|
755
|
+
class TagLib::MPEG::Properties < TagLib::AudioProperties
|
796
756
|
#
|
797
|
-
#
|
757
|
+
# Returns true if the copyrighted bit is set.
|
798
758
|
#
|
799
|
-
def
|
800
|
-
end
|
801
|
-
def name()
|
802
|
-
end
|
803
|
-
def seek()
|
804
|
-
end
|
805
|
-
def readOnly()
|
806
|
-
end
|
807
|
-
def audioProperties()
|
808
|
-
end
|
809
|
-
def find2()
|
759
|
+
def isCopyrighted()
|
810
760
|
end
|
811
761
|
#
|
812
|
-
# Returns
|
762
|
+
# Returns the MPEG Version of the file.
|
813
763
|
#
|
814
|
-
def
|
815
|
-
end
|
816
|
-
def clear()
|
817
|
-
end
|
818
|
-
def valid?()
|
764
|
+
def version()
|
819
765
|
end
|
820
766
|
#
|
821
|
-
#
|
822
|
-
#
|
767
|
+
# Returns the most appropriate bit rate for the file in kb/s. For constant bitrate formats this is simply the bitrate of the file. For variable bitrate formats this is either the average or nominal bitrate.
|
823
768
|
#
|
824
|
-
def
|
825
|
-
end
|
826
|
-
def tag()
|
827
|
-
end
|
828
|
-
def isWritable()
|
829
|
-
end
|
830
|
-
def find3()
|
769
|
+
def bitrate()
|
831
770
|
end
|
832
771
|
#
|
833
|
-
# Returns
|
772
|
+
# Returns the layer version. This will be between the values 1-3.
|
834
773
|
#
|
835
|
-
def
|
836
|
-
end
|
837
|
-
def read_only?()
|
838
|
-
end
|
839
|
-
def isOpen()
|
840
|
-
end
|
841
|
-
def writable?()
|
842
|
-
end
|
843
|
-
def readBlock()
|
844
|
-
end
|
845
|
-
def rfind()
|
774
|
+
def layer()
|
846
775
|
end
|
847
|
-
|
776
|
+
#
|
777
|
+
# Returns true if the "original" bit is set.
|
778
|
+
#
|
779
|
+
def isOriginal()
|
848
780
|
end
|
849
|
-
|
781
|
+
#
|
782
|
+
# Returns the sample rate in Hz.
|
783
|
+
#
|
784
|
+
def sampleRate()
|
850
785
|
end
|
851
786
|
#
|
852
|
-
# Returns
|
853
|
-
#
|
787
|
+
# Returns true if the MPEG protection bit is enabled.
|
854
788
|
#
|
855
|
-
def
|
789
|
+
def protectionEnabled()
|
856
790
|
end
|
857
|
-
|
791
|
+
#
|
792
|
+
# Returns a pointer to the XingHeader if one exists or null if no XingHeader was found.
|
793
|
+
#
|
794
|
+
def xingHeader()
|
858
795
|
end
|
859
|
-
|
796
|
+
#
|
797
|
+
# Returns the number of audio channels.
|
798
|
+
#
|
799
|
+
def channels()
|
860
800
|
end
|
861
|
-
|
801
|
+
#
|
802
|
+
# Returns the channel mode for this frame.
|
803
|
+
#
|
804
|
+
def channelMode()
|
862
805
|
end
|
806
|
+
#
|
807
|
+
# Returns the length of the file in seconds.
|
808
|
+
#
|
863
809
|
def length()
|
864
810
|
end
|
865
|
-
def isValid()
|
866
|
-
end
|
867
|
-
def find1()
|
868
|
-
end
|
869
811
|
end
|
870
812
|
# <b>
|
871
|
-
#
|
813
|
+
# An implementation of the Xing VBR headers. .</b>
|
872
814
|
#
|
873
815
|
#
|
874
|
-
#
|
816
|
+
# This is a minimalistic implementation of the Xing VBR headers. Xing headers are often added to VBR (variable bit rate) MP3 streams to make it easy to compute the length and quality of a VBR stream. Our implementation is only concerned with the total size of the stream (so that we can calculate the total playing time and the average bitrate). It uses this text and the XMMS sources as references.
|
875
817
|
#
|
876
|
-
|
877
|
-
# <b>
|
878
|
-
# An implementation of audio property reading for Ogg Speex. .</b>
|
818
|
+
class TagLib::MPEG::XingHeader
|
879
819
|
#
|
820
|
+
# Returns the total number of frames.
|
880
821
|
#
|
881
|
-
|
822
|
+
def totalFrames()
|
823
|
+
end
|
882
824
|
#
|
883
|
-
|
825
|
+
# Returns the total size of stream in bytes.
|
884
826
|
#
|
885
|
-
|
827
|
+
def totalSize()
|
828
|
+
end
|
886
829
|
#
|
887
|
-
|
888
|
-
end
|
830
|
+
# Returns true if the data was parsed properly and if there is a valid Xing header present.
|
889
831
|
#
|
890
|
-
|
832
|
+
def isValid()
|
833
|
+
end
|
834
|
+
end
|
835
|
+
# <b>
|
836
|
+
# An MPEG file class with some useful methods specific to MPEG. .</b>
|
891
837
|
#
|
892
|
-
def speexVersion()
|
893
|
-
end
|
894
838
|
#
|
895
|
-
#
|
839
|
+
# This implements the generic TagLib::File API and additionally provides access to properties that are distinct to MPEG files, notably access to the different ID3 tags.
|
896
840
|
#
|
897
|
-
|
898
|
-
|
841
|
+
class TagLib::MPEG::File < TagLib::File
|
842
|
+
def name()
|
843
|
+
end
|
899
844
|
#
|
900
|
-
# Returns the
|
845
|
+
# Returns the position in the file of the next MPEG frame, using the current position as start
|
901
846
|
#
|
902
|
-
|
903
|
-
|
847
|
+
def nextFrameOffset(long position)
|
848
|
+
end
|
849
|
+
def seek()
|
850
|
+
end
|
851
|
+
def find2()
|
852
|
+
end
|
853
|
+
def valid?()
|
854
|
+
end
|
904
855
|
#
|
905
|
-
# Returns the
|
856
|
+
# Returns a pointer to the APE tag of the file.If create is false (the default) this will return a null pointer if there is no valid APE tag. If create is true it will create an APE tag if one does not exist.The Tag is still owned by the MPEG::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
857
|
+
#
|
906
858
|
#
|
907
|
-
|
908
|
-
|
909
|
-
end
|
910
|
-
# <b>
|
911
|
-
# An implementation of Ogg::File with Speex specific methods. .</b>
|
859
|
+
def APETag(bool create = false)
|
860
|
+
end
|
912
861
|
#
|
862
|
+
# Save the file. This will attempt to save all of the tag types that are specified by OR-ing together TagTypes values. The save() method above uses AllTags. This returns true if saving was successful.If stripOthers is true this strips all tags not included in the mask, but does not modify them in memory, so later calls to save() which make use of these tags will remain valid. This also strips empty tags.
|
913
863
|
#
|
914
|
-
|
864
|
+
def save(int tags,bool stripOthers)
|
865
|
+
end
|
866
|
+
def isWritable()
|
867
|
+
end
|
915
868
|
#
|
916
|
-
|
917
|
-
def setPacket()
|
918
|
-
end
|
919
|
-
def name()
|
920
|
-
end
|
921
|
-
def seek()
|
922
|
-
end
|
923
|
-
def readOnly()
|
924
|
-
end
|
869
|
+
# Returns the position in the file of the previous MPEG frame, using the current position as start
|
925
870
|
#
|
926
|
-
|
871
|
+
def previousFrameOffset(long position)
|
872
|
+
end
|
873
|
+
def find3()
|
874
|
+
end
|
875
|
+
def clear()
|
876
|
+
end
|
877
|
+
def read_only?()
|
878
|
+
end
|
927
879
|
#
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
end
|
932
|
-
def firstPageHeader()
|
933
|
-
end
|
934
|
-
def clear()
|
935
|
-
end
|
936
|
-
def valid?()
|
937
|
-
end
|
880
|
+
# Returns a pointer to a tag that is the union of the ID3v2 and ID3v1 tags. The ID3v2 tag is given priority in reading the information -- if requested information exists in both the ID3v2 tag and the ID3v1 tag, the information from the ID3v2 tag will be returned.If you would like more granular control over the content of the tags, with the concession of generality, use the tag-type specific calls.As this tag is not implemented as an ID3v2 tag or an ID3v1 tag, but a union of the two this pointer may not be cast to the specific tag types.
|
881
|
+
# ID3v1Tag() ID3v2Tag() APETag()
|
882
|
+
#
|
938
883
|
#
|
939
|
-
|
884
|
+
def tag()
|
885
|
+
end
|
886
|
+
def isOpen()
|
887
|
+
end
|
888
|
+
def readBlock()
|
889
|
+
end
|
890
|
+
#
|
891
|
+
# Returns a pointer to the ID3v2 tag of the file.If create is false (the default) this will return a null pointer if there is no valid ID3v2 tag. If create is true it will create an ID3v2 tag if one does not exist.The Tag is still owned by the MPEG::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
940
892
|
#
|
941
893
|
#
|
942
|
-
|
943
|
-
|
894
|
+
def ID3v2Tag(bool create = false)
|
895
|
+
end
|
944
896
|
#
|
945
|
-
# Returns the
|
897
|
+
# Returns the position in the file of the last MPEG frame.
|
946
898
|
#
|
947
|
-
|
948
|
-
end
|
949
|
-
def isWritable()
|
950
|
-
end
|
951
|
-
def find3()
|
952
|
-
end
|
953
|
-
def lastPageHeader()
|
954
|
-
end
|
955
|
-
def read_only?()
|
956
|
-
end
|
957
|
-
def isOpen()
|
958
|
-
end
|
959
|
-
def writable?()
|
960
|
-
end
|
961
|
-
def readBlock()
|
962
|
-
end
|
963
|
-
def rfind()
|
964
|
-
end
|
965
|
-
def insert()
|
966
|
-
end
|
967
|
-
def writeBlock()
|
968
|
-
end
|
969
|
-
def packet()
|
970
|
-
end
|
971
|
-
def tell()
|
972
|
-
end
|
973
|
-
def removeBlock()
|
974
|
-
end
|
975
|
-
def open?()
|
976
|
-
end
|
977
|
-
def length()
|
978
|
-
end
|
979
|
-
def isValid()
|
980
|
-
end
|
981
|
-
def find1()
|
982
|
-
end
|
983
|
-
end
|
899
|
+
def lastFrameOffset()
|
984
900
|
end
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
def removeBlock()
|
1034
|
-
end
|
1035
|
-
def open?()
|
1036
|
-
end
|
1037
|
-
def length()
|
1038
|
-
end
|
1039
|
-
def isValid()
|
1040
|
-
end
|
1041
|
-
def streamLength()
|
1042
|
-
end
|
1043
|
-
def find1()
|
1044
|
-
end
|
1045
|
-
end
|
901
|
+
def rfind()
|
902
|
+
end
|
903
|
+
def writable?()
|
904
|
+
end
|
905
|
+
#
|
906
|
+
# This will strip the tags that match the OR-ed together TagTypes from the file. By default it strips all tags. It returns true if the tags are successfully stripped.If freeMemory is true the ID3 and APE tags will be deleted and pointers to them will be invalidated.
|
907
|
+
#
|
908
|
+
def strip(int tags,bool freeMemory)
|
909
|
+
end
|
910
|
+
def writeBlock()
|
911
|
+
end
|
912
|
+
#
|
913
|
+
# Returns a pointer to the ID3v1 tag of the file.If create is false (the default) this will return a null pointer if there is no valid ID3v1 tag. If create is true it will create an ID3v1 tag if one does not exist.The Tag is still owned by the MPEG::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
914
|
+
#
|
915
|
+
#
|
916
|
+
def ID3v1Tag(bool create = false)
|
917
|
+
end
|
918
|
+
def insert()
|
919
|
+
end
|
920
|
+
def removeBlock()
|
921
|
+
end
|
922
|
+
def open?()
|
923
|
+
end
|
924
|
+
def isValid()
|
925
|
+
end
|
926
|
+
#
|
927
|
+
# Returns the position in the file of the first MPEG frame.
|
928
|
+
#
|
929
|
+
def firstFrameOffset()
|
930
|
+
end
|
931
|
+
def tell()
|
932
|
+
end
|
933
|
+
def find1()
|
934
|
+
end
|
935
|
+
def length()
|
936
|
+
end
|
937
|
+
def readOnly()
|
938
|
+
end
|
939
|
+
#
|
940
|
+
# Set the ID3v2::FrameFactory to something other than the default.ID3v2FrameFactory
|
941
|
+
#
|
942
|
+
#
|
943
|
+
def setID3v2FrameFactory( ID3v2::FrameFactory factory)
|
944
|
+
end
|
945
|
+
#
|
946
|
+
# Returns the MPEG::Properties for this file. If no audio properties were read then this will return a null pointer.
|
947
|
+
#
|
948
|
+
def audioProperties()
|
1046
949
|
end
|
950
|
+
end
|
1047
951
|
end
|
1048
952
|
# <b>
|
1049
|
-
# An
|
953
|
+
# An implementation of the APE tagging format. .</b>
|
1050
954
|
#
|
1051
955
|
#
|
1052
956
|
#
|
1053
957
|
#
|
1054
|
-
module TagLib::
|
958
|
+
module TagLib::APE
|
1055
959
|
# <b>
|
1056
|
-
#
|
960
|
+
# An APE tag implementation. .</b>
|
1057
961
|
#
|
1058
962
|
#
|
1059
|
-
# This is an implementation of the ID3v1 format. ID3v1 is both the simplist and most common of tag formats but is rather limited. Because of its pervasiveness and the way that applications have been written around the fields that it provides, the generic TagLib::Tag API is a mirror of what is provided by ID3v1.ID3v1 tags should generally only contain Latin1 information. However because many applications do not follow this rule there is now support for overriding the ID3v1 string handling using the ID3v1::StringHandler class. Please see the documentation for that class for more information.StringHandler
|
1060
|
-
# Most fields are truncated to a maximum of 28-30 bytes. The truncation happens automatically when the tag is rendered.
|
1061
963
|
#
|
1062
964
|
#
|
1063
|
-
class TagLib::
|
1064
|
-
def isEmpty()
|
1065
|
-
end
|
1066
|
-
#
|
1067
|
-
# Returns the genre name; if no genre is present in the tag String::null will be returned.
|
1068
|
-
#
|
1069
|
-
def genre()
|
1070
|
-
end
|
965
|
+
class TagLib::APE::Tag < TagLib::Tag
|
1071
966
|
def genre=()
|
1072
967
|
end
|
1073
968
|
#
|
@@ -1076,16 +971,19 @@
|
|
1076
971
|
def setComment( s)
|
1077
972
|
end
|
1078
973
|
#
|
1079
|
-
#
|
974
|
+
# Removes the key item from the tag
|
1080
975
|
#
|
1081
|
-
def
|
976
|
+
def removeItem( key)
|
1082
977
|
end
|
1083
978
|
#
|
1084
979
|
# Returns the track number; if there is no track number set, this will return 0.
|
1085
980
|
#
|
1086
981
|
def track()
|
1087
982
|
end
|
1088
|
-
|
983
|
+
#
|
984
|
+
# Returns the year; if there is no year set, this will return 0.
|
985
|
+
#
|
986
|
+
def year()
|
1089
987
|
end
|
1090
988
|
def track=()
|
1091
989
|
end
|
@@ -1095,11 +993,16 @@
|
|
1095
993
|
def setGenre( s)
|
1096
994
|
end
|
1097
995
|
#
|
1098
|
-
#
|
996
|
+
# Adds to the item specified by key the data value. If replace is true, then all of the other values on the same key will be removed first.
|
1099
997
|
#
|
1100
|
-
def
|
998
|
+
def addValue( key, value,bool replace = true)
|
1101
999
|
end
|
1102
|
-
|
1000
|
+
#
|
1001
|
+
# Returns the track name; if no track name is present in the tag String::null will be returned.
|
1002
|
+
#
|
1003
|
+
def title()
|
1004
|
+
end
|
1005
|
+
def year=()
|
1103
1006
|
end
|
1104
1007
|
def title=()
|
1105
1008
|
end
|
@@ -1114,10 +1017,24 @@
|
|
1114
1017
|
def setYear(uint i)
|
1115
1018
|
end
|
1116
1019
|
#
|
1020
|
+
# Returns the track comment; if no comment is present in the tag String::null will be returned.
|
1021
|
+
#
|
1022
|
+
def comment()
|
1023
|
+
end
|
1024
|
+
def empty?()
|
1025
|
+
end
|
1026
|
+
#
|
1117
1027
|
# Returns the artist name; if no artist name is present in the tag String::null will be returned.
|
1118
1028
|
#
|
1119
1029
|
def artist()
|
1120
1030
|
end
|
1031
|
+
#
|
1032
|
+
# Sets the key item to the value of item. If an item with the key is already present, it will be replaced.
|
1033
|
+
#
|
1034
|
+
def setItem( key, Item item)
|
1035
|
+
end
|
1036
|
+
def comment=()
|
1037
|
+
end
|
1121
1038
|
def artist=()
|
1122
1039
|
end
|
1123
1040
|
#
|
@@ -1126,22 +1043,20 @@
|
|
1126
1043
|
def setArtist( s)
|
1127
1044
|
end
|
1128
1045
|
#
|
1129
|
-
#
|
1046
|
+
# Returns a pointer to the tag's footer.
|
1130
1047
|
#
|
1131
|
-
def
|
1048
|
+
def footer()
|
1132
1049
|
end
|
1133
1050
|
#
|
1134
|
-
#
|
1051
|
+
# Sets the track to i. If s is 0 then this value will be cleared.
|
1135
1052
|
#
|
1136
|
-
def
|
1053
|
+
def setTrack(uint i)
|
1137
1054
|
end
|
1138
1055
|
#
|
1139
1056
|
# Returns the album name; if no album name is present in the tag String::null will be returned.
|
1140
1057
|
#
|
1141
1058
|
def album()
|
1142
1059
|
end
|
1143
|
-
def comment=()
|
1144
|
-
end
|
1145
1060
|
#
|
1146
1061
|
# Renders the in memory values to a ByteVector suitable for writing to the file.
|
1147
1062
|
#
|
@@ -1154,249 +1069,220 @@
|
|
1154
1069
|
#
|
1155
1070
|
def setAlbum( s)
|
1156
1071
|
end
|
1157
|
-
end
|
1158
|
-
end
|
1159
|
-
# <b>
|
1160
|
-
# A namespace containing classes for Vorbis metadata. .</b>
|
1161
1072
|
#
|
1073
|
+
# Returns a reference to the item list map. This is an ItemListMap of all of the items in the tag.This is the most powerfull structure for accessing the items of the tag.You should not modify this data structure directly, instead use setItem() and removeItem().
|
1074
|
+
#
|
1162
1075
|
#
|
1163
|
-
|
1076
|
+
def itemListMap()
|
1077
|
+
end
|
1078
|
+
def isEmpty()
|
1079
|
+
end
|
1164
1080
|
#
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1081
|
+
# Returns the genre name; if no genre is present in the tag String::null will be returned.
|
1082
|
+
#
|
1083
|
+
def genre()
|
1084
|
+
end
|
1085
|
+
end
|
1086
|
+
# <b>
|
1087
|
+
# An implementation of APE-items. .</b>
|
1168
1088
|
#
|
1169
1089
|
#
|
1170
|
-
# This
|
1090
|
+
# This class provides the features of items in the APEv2 standard.
|
1171
1091
|
#
|
1172
|
-
class TagLib::
|
1092
|
+
class TagLib::APE::Item
|
1173
1093
|
#
|
1174
|
-
#
|
1094
|
+
# Set the item to read-only.
|
1175
1095
|
#
|
1176
|
-
def
|
1096
|
+
def setReadOnly(bool readOnly)
|
1177
1097
|
end
|
1178
1098
|
#
|
1179
|
-
# Returns the
|
1099
|
+
# Returns the binary value.DeprecatedThis will be removed in the next binary incompatible version as it is not kept in sync with the things that are set using setValue() and friends.
|
1180
1100
|
#
|
1181
|
-
def
|
1101
|
+
def value()
|
1182
1102
|
end
|
1183
1103
|
#
|
1184
|
-
#
|
1104
|
+
# Parse the item from the ByteVector data.
|
1185
1105
|
#
|
1186
|
-
def
|
1106
|
+
def parse( ByteVector data)
|
1187
1107
|
end
|
1188
1108
|
#
|
1189
|
-
# Returns the
|
1109
|
+
# Returns the list of values.
|
1190
1110
|
#
|
1191
|
-
def
|
1111
|
+
def values()
|
1192
1112
|
end
|
1193
1113
|
#
|
1194
|
-
#
|
1114
|
+
# Appends values to extend the current list of values.toStringList()
|
1115
|
+
#
|
1195
1116
|
#
|
1196
|
-
def
|
1117
|
+
def appendValues( List values)
|
1197
1118
|
end
|
1198
1119
|
#
|
1199
|
-
# Returns the
|
1120
|
+
# Returns the key.
|
1200
1121
|
#
|
1201
|
-
def
|
1122
|
+
def key()
|
1202
1123
|
end
|
1203
1124
|
#
|
1204
|
-
#
|
1125
|
+
# Return true if the item is read-only.
|
1205
1126
|
#
|
1206
|
-
def
|
1127
|
+
def isReadOnly()
|
1207
1128
|
end
|
1208
1129
|
#
|
1209
|
-
#
|
1130
|
+
# Sets the key for the item to key.
|
1210
1131
|
#
|
1211
|
-
def
|
1132
|
+
def setKey( key)
|
1212
1133
|
end
|
1213
|
-
end
|
1214
|
-
# <b>
|
1215
|
-
# An implementation of Ogg::File with Vorbis specific methods. .</b>
|
1216
|
-
#
|
1217
1134
|
#
|
1218
|
-
#
|
1135
|
+
# Returns the value as a single string. In case of multiple strings, the first is returned.
|
1219
1136
|
#
|
1220
|
-
|
1221
|
-
def setPacket()
|
1222
|
-
end
|
1223
|
-
def name()
|
1224
|
-
end
|
1225
|
-
def seek()
|
1226
|
-
end
|
1227
|
-
def readOnly()
|
1137
|
+
def toString()
|
1228
1138
|
end
|
1229
1139
|
#
|
1230
|
-
# Returns the
|
1140
|
+
# Returns the size of the full item.
|
1231
1141
|
#
|
1232
|
-
def
|
1233
|
-
end
|
1234
|
-
def find2()
|
1235
|
-
end
|
1236
|
-
def firstPageHeader()
|
1237
|
-
end
|
1238
|
-
def clear()
|
1239
|
-
end
|
1240
|
-
def valid?()
|
1142
|
+
def size()
|
1241
1143
|
end
|
1242
1144
|
#
|
1243
|
-
#
|
1145
|
+
# Sets the type of the item to type.ItemTypes
|
1244
1146
|
#
|
1245
1147
|
#
|
1246
|
-
def
|
1148
|
+
def setType(ItemTypes type)
|
1247
1149
|
end
|
1248
1150
|
#
|
1249
|
-
#
|
1151
|
+
# Sets the value of the item to value and clears any previous contents.toString()
|
1152
|
+
#
|
1250
1153
|
#
|
1251
|
-
def
|
1252
|
-
end
|
1253
|
-
def isWritable()
|
1254
|
-
end
|
1255
|
-
def find3()
|
1256
|
-
end
|
1257
|
-
def lastPageHeader()
|
1258
|
-
end
|
1259
|
-
def read_only?()
|
1260
|
-
end
|
1261
|
-
def isOpen()
|
1262
|
-
end
|
1263
|
-
def writable?()
|
1264
|
-
end
|
1265
|
-
def readBlock()
|
1266
|
-
end
|
1267
|
-
def rfind()
|
1268
|
-
end
|
1269
|
-
def insert()
|
1270
|
-
end
|
1271
|
-
def writeBlock()
|
1272
|
-
end
|
1273
|
-
def packet()
|
1274
|
-
end
|
1275
|
-
def tell()
|
1154
|
+
def setValue( value)
|
1276
1155
|
end
|
1277
|
-
|
1156
|
+
#
|
1157
|
+
# Deprecatedvalues
|
1158
|
+
#
|
1159
|
+
#
|
1160
|
+
def toStringList()
|
1278
1161
|
end
|
1279
|
-
|
1162
|
+
#
|
1163
|
+
# Sets the value of the item to the list of values in value and clears any previous contents.toStringList()
|
1164
|
+
#
|
1165
|
+
#
|
1166
|
+
def setValues( List values)
|
1280
1167
|
end
|
1281
|
-
|
1168
|
+
#
|
1169
|
+
# Render the item to a ByteVector.
|
1170
|
+
#
|
1171
|
+
def render()
|
1282
1172
|
end
|
1283
|
-
|
1173
|
+
#
|
1174
|
+
# Returns if the item has any real content.
|
1175
|
+
#
|
1176
|
+
def isEmpty()
|
1284
1177
|
end
|
1285
|
-
|
1178
|
+
#
|
1179
|
+
# Appends value to create (or extend) the current list of values.toString()
|
1180
|
+
#
|
1181
|
+
#
|
1182
|
+
def appendValue( value)
|
1286
1183
|
end
|
1287
1184
|
end
|
1288
|
-
end
|
1289
1185
|
# <b>
|
1290
|
-
# An implementation of
|
1291
|
-
#
|
1186
|
+
# An implementation of APE footers. .</b>
|
1292
1187
|
#
|
1293
|
-
#
|
1294
1188
|
#
|
1295
|
-
|
1296
|
-
# <b>
|
1297
|
-
# An implementation of audio property reading for MP3. .</b>
|
1189
|
+
# This class implements APE footers (and headers). It attempts to follow, both semantically and programatically, the structure specified in the APE v2.0 standard. The API is based on the properties of APE footer and headers specified there.
|
1298
1190
|
#
|
1191
|
+
class TagLib::APE::Footer
|
1299
1192
|
#
|
1300
|
-
#
|
1193
|
+
# Returns true if a header is present in the tag.
|
1301
1194
|
#
|
1302
|
-
|
1195
|
+
def headerPresent()
|
1196
|
+
end
|
1303
1197
|
#
|
1304
|
-
#
|
1198
|
+
# Set the item count to s. itemCount()
|
1199
|
+
#
|
1305
1200
|
#
|
1306
|
-
def
|
1201
|
+
def setItemCount(uint s)
|
1307
1202
|
end
|
1308
1203
|
#
|
1309
|
-
#
|
1204
|
+
# Renders the footer back to binary format.
|
1310
1205
|
#
|
1311
|
-
def
|
1206
|
+
def renderFooter()
|
1312
1207
|
end
|
1313
1208
|
#
|
1314
|
-
# Returns the
|
1209
|
+
# Returns the version number. (Note: This is the 1000 or 2000.)
|
1315
1210
|
#
|
1316
1211
|
def version()
|
1317
1212
|
end
|
1318
1213
|
#
|
1319
|
-
# Returns true if
|
1214
|
+
# Returns true if a footer is present in the tag.
|
1320
1215
|
#
|
1321
|
-
def
|
1216
|
+
def footerPresent()
|
1322
1217
|
end
|
1323
1218
|
#
|
1324
|
-
# Returns the
|
1219
|
+
# Returns the tag size in bytes. This is the size of the frame content and footer. The size of the entire tag will be this plus the header size, if present.completeTagSize()
|
1220
|
+
#
|
1325
1221
|
#
|
1326
|
-
def
|
1222
|
+
def tagSize()
|
1327
1223
|
end
|
1328
1224
|
#
|
1329
|
-
#
|
1225
|
+
# Renders the header corresponding to the footer. If headerPresent is set to false, it returns an empty ByteVector.
|
1330
1226
|
#
|
1331
|
-
def
|
1227
|
+
def renderHeader()
|
1332
1228
|
end
|
1333
1229
|
#
|
1334
|
-
# Returns
|
1230
|
+
# Returns true this is actually the header.
|
1335
1231
|
#
|
1336
|
-
def
|
1232
|
+
def isHeader()
|
1337
1233
|
end
|
1338
1234
|
#
|
1339
|
-
# Returns the
|
1235
|
+
# Returns the tag size, including if present, the header size.tagSize()
|
1236
|
+
#
|
1340
1237
|
#
|
1341
|
-
def
|
1238
|
+
def completeTagSize()
|
1342
1239
|
end
|
1343
1240
|
#
|
1344
|
-
#
|
1241
|
+
# Sets whether the header should be rendered or not
|
1345
1242
|
#
|
1346
|
-
def
|
1243
|
+
def setHeaderPresent(bool b)
|
1347
1244
|
end
|
1348
1245
|
#
|
1349
|
-
#
|
1246
|
+
# Set the tag size to s. tagSize()
|
1247
|
+
#
|
1350
1248
|
#
|
1351
|
-
def
|
1249
|
+
def setTagSize(uint s)
|
1352
1250
|
end
|
1353
1251
|
#
|
1354
|
-
# Returns the
|
1252
|
+
# Returns the number of items in the tag.
|
1355
1253
|
#
|
1356
|
-
def
|
1254
|
+
def itemCount()
|
1255
|
+
end
|
1256
|
+
#
|
1257
|
+
# Sets the data that will be used as the footer. 32 bytes, starting from data will be used.
|
1258
|
+
#
|
1259
|
+
def setData( ByteVector data)
|
1357
1260
|
end
|
1358
1261
|
end
|
1262
|
+
end
|
1359
1263
|
# <b>
|
1360
|
-
# An implementation of
|
1264
|
+
# An implementation of MPC metadata. .</b>
|
1361
1265
|
#
|
1362
1266
|
#
|
1363
|
-
# This is
|
1267
|
+
# This is implementation of MPC metadata.This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream properties from the file. ID3v2 tags are invalid in MPC-files, but will be skipped and ignored.
|
1364
1268
|
#
|
1365
|
-
|
1269
|
+
module TagLib::MPC
|
1270
|
+
# <b>
|
1271
|
+
# An implementation of audio property reading for MPC. .</b>
|
1366
1272
|
#
|
1367
|
-
# Returns true if the copyrighted bit is set.
|
1368
1273
|
#
|
1369
|
-
|
1370
|
-
end
|
1371
|
-
#
|
1372
|
-
# Returns the layer version. This will be between the values 1-3.
|
1373
|
-
#
|
1374
|
-
def layer()
|
1375
|
-
end
|
1376
|
-
#
|
1377
|
-
# Returns the MPEG Version of the header.
|
1378
|
-
#
|
1379
|
-
def version()
|
1380
|
-
end
|
1381
|
-
#
|
1382
|
-
# Returns true if the "original" bit is set.
|
1274
|
+
# This reads the data from an MPC stream found in the AudioProperties API.
|
1383
1275
|
#
|
1384
|
-
|
1385
|
-
end
|
1276
|
+
class TagLib::MPC::Properties < TagLib::AudioProperties
|
1386
1277
|
#
|
1387
|
-
# Returns the
|
1278
|
+
# Returns the most appropriate bit rate for the file in kb/s. For constant bitrate formats this is simply the bitrate of the file. For variable bitrate formats this is either the average or nominal bitrate.
|
1388
1279
|
#
|
1389
1280
|
def bitrate()
|
1390
1281
|
end
|
1391
1282
|
#
|
1392
|
-
# Returns
|
1393
|
-
#
|
1394
|
-
def protectionEnabled()
|
1395
|
-
end
|
1396
|
-
#
|
1397
|
-
# Returns the frame length.
|
1283
|
+
# Returns the version of the bitstream (SV4-SV7)
|
1398
1284
|
#
|
1399
|
-
def
|
1285
|
+
def mpcVersion()
|
1400
1286
|
end
|
1401
1287
|
#
|
1402
1288
|
# Returns the sample rate in Hz.
|
@@ -1404,631 +1290,615 @@
|
|
1404
1290
|
def sampleRate()
|
1405
1291
|
end
|
1406
1292
|
#
|
1407
|
-
# Returns
|
1408
|
-
#
|
1409
|
-
def isPadded()
|
1410
|
-
end
|
1411
|
-
#
|
1412
|
-
# Returns the number of frames per sample.
|
1413
|
-
#
|
1414
|
-
def samplesPerFrame()
|
1415
|
-
end
|
1416
|
-
#
|
1417
|
-
# Returns the channel mode for this frame.
|
1418
|
-
#
|
1419
|
-
def channelMode()
|
1420
|
-
end
|
1421
|
-
#
|
1422
|
-
# Returns true if the frame is at least an appropriate size and has legal values.
|
1423
|
-
#
|
1424
|
-
def isValid()
|
1425
|
-
end
|
1426
|
-
end
|
1427
|
-
# <b>
|
1428
|
-
# An implementation of the Xing VBR headers. .</b>
|
1429
|
-
#
|
1430
|
-
#
|
1431
|
-
# This is a minimalistic implementation of the Xing VBR headers. Xing headers are often added to VBR (variable bit rate) MP3 streams to make it easy to compute the length and quality of a VBR stream. Our implementation is only concerned with the total size of the stream (so that we can calculate the total playing time and the average bitrate). It uses this text and the XMMS sources as references.
|
1432
|
-
#
|
1433
|
-
class TagLib::MPEG::XingHeader
|
1434
|
-
#
|
1435
|
-
# Returns the total number of frames.
|
1436
|
-
#
|
1437
|
-
def totalFrames()
|
1438
|
-
end
|
1439
|
-
#
|
1440
|
-
# Returns the total size of stream in bytes.
|
1293
|
+
# Returns the number of audio channels.
|
1441
1294
|
#
|
1442
|
-
def
|
1295
|
+
def channels()
|
1443
1296
|
end
|
1444
1297
|
#
|
1445
|
-
# Returns
|
1298
|
+
# Returns the length of the file in seconds.
|
1446
1299
|
#
|
1447
|
-
def
|
1300
|
+
def length()
|
1448
1301
|
end
|
1449
1302
|
end
|
1450
1303
|
# <b>
|
1451
|
-
# An
|
1304
|
+
# An implementation of TagLib::File with MPC specific methods. .</b>
|
1452
1305
|
#
|
1453
1306
|
#
|
1454
|
-
# This implements the
|
1307
|
+
# This implements and provides an interface for MPC files to the TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing the abstract TagLib::File API as well as providing some additional information specific to MPC files. The only invalid tag combination supported is an ID3v1 tag after an APE tag.
|
1455
1308
|
#
|
1456
|
-
class TagLib::
|
1309
|
+
class TagLib::MPC::File < TagLib::File
|
1457
1310
|
def name()
|
1458
1311
|
end
|
1459
1312
|
def seek()
|
1460
1313
|
end
|
1461
|
-
def
|
1314
|
+
def find2()
|
1315
|
+
end
|
1316
|
+
def valid?()
|
1462
1317
|
end
|
1463
1318
|
#
|
1464
|
-
# Returns a pointer to the APE tag of the file.If create is false (the default) this will return a null pointer if there is no valid APE tag. If create is true it will create
|
1319
|
+
# Returns a pointer to the APE tag of the file.If create is false (the default) this will return a null pointer if there is no valid APE tag. If create is true it will create a APE tag if one does not exist. If there is already an ID3v1 tag, thes new APE tag will be placed before it.The Tag is still owned by the APE::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
1465
1320
|
#
|
1466
1321
|
#
|
1467
1322
|
def APETag(bool create = false)
|
1468
1323
|
end
|
1469
1324
|
#
|
1470
|
-
#
|
1325
|
+
# Saves the file.
|
1471
1326
|
#
|
1472
|
-
def
|
1327
|
+
def save()
|
1473
1328
|
end
|
1474
|
-
|
1475
|
-
# Returns the position in the file of the previous MPEG frame, using the current position as start
|
1476
|
-
#
|
1477
|
-
def previousFrameOffset(long position)
|
1329
|
+
def isWritable()
|
1478
1330
|
end
|
1479
|
-
def
|
1331
|
+
def find3()
|
1480
1332
|
end
|
1481
1333
|
def clear()
|
1482
1334
|
end
|
1483
|
-
def
|
1335
|
+
def read_only?()
|
1484
1336
|
end
|
1485
1337
|
#
|
1486
|
-
#
|
1338
|
+
# Returns the Tag for this file. This will be an APE tag, an ID3v1 tag or a combination of the two.
|
1487
1339
|
#
|
1488
|
-
def
|
1340
|
+
def tag()
|
1489
1341
|
end
|
1490
|
-
|
1491
|
-
# Returns a pointer to the ID3v2 tag of the file.If create is false (the default) this will return a null pointer if there is no valid ID3v2 tag. If create is true it will create an ID3v2 tag if one does not exist.The Tag is still owned by the MPEG::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
1492
|
-
#
|
1493
|
-
#
|
1494
|
-
def ID3v2Tag(bool create = false)
|
1342
|
+
def isOpen()
|
1495
1343
|
end
|
1496
|
-
|
1497
|
-
# Returns a pointer to a tag that is the union of the ID3v2 and ID3v1 tags. The ID3v2 tag is given priority in reading the information -- if requested information exists in both the ID3v2 tag and the ID3v1 tag, the information from the ID3v2 tag will be returned.If you would like more granular control over the content of the tags, with the concession of generality, use the tag-type specific calls.As this tag is not implemented as an ID3v2 tag or an ID3v1 tag, but a union of the two this pointer may not be cast to the specific tag types.
|
1498
|
-
# ID3v1Tag() ID3v2Tag() APETag()
|
1499
|
-
#
|
1500
|
-
#
|
1501
|
-
def tag()
|
1344
|
+
def readBlock()
|
1502
1345
|
end
|
1503
|
-
def
|
1346
|
+
def rfind()
|
1504
1347
|
end
|
1505
1348
|
#
|
1506
|
-
#
|
1349
|
+
# Deprecatedstrip
|
1350
|
+
#
|
1507
1351
|
#
|
1508
|
-
def
|
1509
|
-
end
|
1510
|
-
def find3()
|
1511
|
-
end
|
1512
|
-
def read_only?()
|
1513
|
-
end
|
1514
|
-
def isOpen()
|
1352
|
+
def remove(int tags = AllTags)
|
1515
1353
|
end
|
1516
1354
|
def writable?()
|
1517
1355
|
end
|
1518
|
-
def readBlock()
|
1519
|
-
end
|
1520
1356
|
#
|
1521
|
-
# This will
|
1357
|
+
# This will remove the tags that match the OR-ed together TagTypes from the file. By default it removes all tags.This will also invalidate pointers to the tags as their memory will be freed.
|
1358
|
+
# In order to make the removal permanent save() still needs to be called.
|
1359
|
+
#
|
1522
1360
|
#
|
1523
|
-
def strip(int tags
|
1361
|
+
def strip(int tags = AllTags)
|
1362
|
+
end
|
1363
|
+
def writeBlock()
|
1524
1364
|
end
|
1525
1365
|
#
|
1526
|
-
# Returns a pointer to the ID3v1 tag of the file.If create is false (the default) this will return a null pointer if there is no valid ID3v1 tag. If create is true it will create an ID3v1 tag if one does not exist.The Tag is still owned by the
|
1366
|
+
# Returns a pointer to the ID3v1 tag of the file.If create is false (the default) this will return a null pointer if there is no valid ID3v1 tag. If create is true it will create an ID3v1 tag if one does not exist. If there is already an APE tag, the new ID3v1 tag will be placed after it.The Tag is still owned by the APE::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
1527
1367
|
#
|
1528
1368
|
#
|
1529
1369
|
def ID3v1Tag(bool create = false)
|
1530
1370
|
end
|
1531
|
-
def rfind()
|
1532
|
-
end
|
1533
1371
|
def insert()
|
1534
1372
|
end
|
1535
|
-
#
|
1536
|
-
# Returns the position in the file of the first MPEG frame.
|
1537
|
-
#
|
1538
|
-
def firstFrameOffset()
|
1539
|
-
end
|
1540
|
-
def writeBlock()
|
1541
|
-
end
|
1542
|
-
def tell()
|
1543
|
-
end
|
1544
1373
|
def removeBlock()
|
1545
1374
|
end
|
1546
1375
|
def open?()
|
1547
1376
|
end
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
def
|
1377
|
+
def isValid()
|
1378
|
+
end
|
1379
|
+
def tell()
|
1380
|
+
end
|
1381
|
+
def find1()
|
1553
1382
|
end
|
1554
1383
|
def length()
|
1555
1384
|
end
|
1556
|
-
def
|
1385
|
+
def readOnly()
|
1557
1386
|
end
|
1558
1387
|
#
|
1559
|
-
# Returns the
|
1388
|
+
# Returns the MPC::Properties for this file. If no audio properties were read then this will return a null pointer.
|
1560
1389
|
#
|
1561
|
-
def
|
1562
|
-
end
|
1563
|
-
def find1()
|
1390
|
+
def audioProperties()
|
1564
1391
|
end
|
1565
1392
|
end
|
1566
1393
|
end
|
1567
1394
|
# <b>
|
1568
|
-
# An implementation of
|
1395
|
+
# An implementation of FLAC metadata. .</b>
|
1569
1396
|
#
|
1570
1397
|
#
|
1571
|
-
#
|
1398
|
+
# This is implementation of FLAC metadata for non-Ogg FLAC files. At some point when Ogg / FLAC is more common there will be a similar implementation under the Ogg hiearchy.This supports ID3v1, ID3v2 and Xiph style comments as well as reading stream properties from the file.
|
1572
1399
|
#
|
1573
|
-
module TagLib::
|
1400
|
+
module TagLib::FLAC
|
1574
1401
|
# <b>
|
1575
|
-
# An
|
1402
|
+
# An implementation of audio property reading for FLAC. .</b>
|
1576
1403
|
#
|
1577
1404
|
#
|
1578
|
-
#
|
1405
|
+
# This reads the data from an FLAC stream found in the AudioProperties API.
|
1579
1406
|
#
|
1580
|
-
class TagLib::
|
1407
|
+
class TagLib::FLAC::Properties < TagLib::AudioProperties
|
1581
1408
|
#
|
1582
|
-
# Returns
|
1583
|
-
#
|
1409
|
+
# Returns the sample width as read from the FLAC identification header.
|
1584
1410
|
#
|
1585
|
-
def
|
1586
|
-
end
|
1587
|
-
def isEmpty()
|
1411
|
+
def sampleWidth()
|
1588
1412
|
end
|
1589
1413
|
#
|
1590
|
-
# Returns the
|
1414
|
+
# Returns the most appropriate bit rate for the file in kb/s. For constant bitrate formats this is simply the bitrate of the file. For variable bitrate formats this is either the average or nominal bitrate.
|
1591
1415
|
#
|
1592
|
-
def
|
1593
|
-
end
|
1594
|
-
def genre=()
|
1416
|
+
def bitrate()
|
1595
1417
|
end
|
1596
1418
|
#
|
1597
|
-
#
|
1419
|
+
# Returns the sample rate in Hz.
|
1598
1420
|
#
|
1599
|
-
def
|
1421
|
+
def sampleRate()
|
1600
1422
|
end
|
1601
1423
|
#
|
1602
|
-
#
|
1424
|
+
# Returns the number of audio channels.
|
1603
1425
|
#
|
1604
|
-
def
|
1426
|
+
def channels()
|
1605
1427
|
end
|
1606
1428
|
#
|
1607
|
-
# Returns the
|
1429
|
+
# Returns the length of the file in seconds.
|
1608
1430
|
#
|
1609
|
-
def
|
1431
|
+
def length()
|
1610
1432
|
end
|
1433
|
+
end
|
1434
|
+
# <b>
|
1435
|
+
# An implementation of TagLib::File with FLAC specific methods. .</b>
|
1611
1436
|
#
|
1612
|
-
# Returns the track number; if there is no track number set, this will return 0.
|
1613
1437
|
#
|
1614
|
-
|
1438
|
+
# This implements and provides an interface for FLAC files to the TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing the abstract TagLib::File API as well as providing some additional information specific to FLAC files.
|
1439
|
+
#
|
1440
|
+
class TagLib::FLAC::File < TagLib::File
|
1441
|
+
def name()
|
1615
1442
|
end
|
1616
|
-
def
|
1443
|
+
def seek()
|
1617
1444
|
end
|
1618
|
-
def
|
1445
|
+
def find2()
|
1619
1446
|
end
|
1620
|
-
|
1621
|
-
# Sets the genre to s. If s is String::null then this value will be cleared. For tag formats that use a fixed set of genres, the appropriate value will be selected based on a string comparison. A list of available genres for those formats should be available in that type's implementation.
|
1622
|
-
#
|
1623
|
-
def setGenre( s)
|
1447
|
+
def valid?()
|
1624
1448
|
end
|
1625
1449
|
#
|
1626
|
-
#
|
1450
|
+
# Returns the block of data used by FLAC::Properties for parsing the stream properties.DeprecatedThis method will not be public in a future release.
|
1627
1451
|
#
|
1628
|
-
def
|
1452
|
+
def streamInfoData()
|
1629
1453
|
end
|
1630
1454
|
#
|
1631
|
-
#
|
1455
|
+
# Save the file. This will primarily save the XiphComment, but will also keep any old ID3-tags up to date. If the file has no XiphComment, one will be constructed from the ID3-tags.This returns true if the save was successful.
|
1632
1456
|
#
|
1633
|
-
def
|
1457
|
+
def save()
|
1634
1458
|
end
|
1635
|
-
def
|
1459
|
+
def isWritable()
|
1636
1460
|
end
|
1637
|
-
def
|
1461
|
+
def find3()
|
1638
1462
|
end
|
1639
|
-
|
1640
|
-
# Sets the title to s. If s is String::null then this value will be cleared.
|
1641
|
-
#
|
1642
|
-
def setTitle( s)
|
1463
|
+
def clear()
|
1643
1464
|
end
|
1644
|
-
|
1645
|
-
# Sets the year to i. If s is 0 then this value will be cleared.
|
1646
|
-
#
|
1647
|
-
def setYear(uint i)
|
1465
|
+
def read_only?()
|
1648
1466
|
end
|
1649
1467
|
#
|
1650
|
-
#
|
1468
|
+
# Returns the Tag for this file. This will be a union of XiphComment, ID3v1 and ID3v2 tags.ID3v2Tag() ID3v1Tag() XiphComment()
|
1469
|
+
#
|
1651
1470
|
#
|
1652
|
-
def
|
1471
|
+
def tag()
|
1653
1472
|
end
|
1654
|
-
|
1655
|
-
# Returns the artist name; if no artist name is present in the tag String::null will be returned.
|
1656
|
-
#
|
1657
|
-
def artist()
|
1473
|
+
def isOpen()
|
1658
1474
|
end
|
1659
|
-
def
|
1475
|
+
def readBlock()
|
1660
1476
|
end
|
1661
1477
|
#
|
1662
|
-
#
|
1478
|
+
# Returns a pointer to the ID3v2 tag of the file.If create is false (the default) this will return a null pointer if there is no valid ID3v2 tag. If create is true it will create an ID3v2 tag if one does not exist.The Tag is still owned by the FLAC::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
1479
|
+
#
|
1663
1480
|
#
|
1664
|
-
def
|
1481
|
+
def ID3v2Tag(bool create = false)
|
1665
1482
|
end
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1483
|
+
def rfind()
|
1484
|
+
end
|
1485
|
+
def writable?()
|
1486
|
+
end
|
1487
|
+
def writeBlock()
|
1670
1488
|
end
|
1671
1489
|
#
|
1672
|
-
#
|
1490
|
+
# Returns a pointer to the ID3v1 tag of the file.If create is false (the default) this will return a null pointer if there is no valid ID3v1 tag. If create is true it will create an ID3v1 tag if one does not exist.The Tag is still owned by the FLAC::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
1491
|
+
#
|
1673
1492
|
#
|
1674
|
-
def
|
1493
|
+
def ID3v1Tag(bool create = false)
|
1494
|
+
end
|
1495
|
+
def insert()
|
1496
|
+
end
|
1497
|
+
def removeBlock()
|
1498
|
+
end
|
1499
|
+
def open?()
|
1675
1500
|
end
|
1676
1501
|
#
|
1677
|
-
# Returns the
|
1502
|
+
# Returns a pointer to the XiphComment for the file.If create is false (the default) this will return a null pointer if there is no valid XiphComment. If create is true it will create a XiphComment if one does not exist.The Tag is still owned by the FLAC::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
1503
|
+
#
|
1678
1504
|
#
|
1679
|
-
def
|
1505
|
+
def xiphComment(bool create = false)
|
1506
|
+
end
|
1507
|
+
def isValid()
|
1508
|
+
end
|
1509
|
+
def tell()
|
1680
1510
|
end
|
1681
1511
|
#
|
1682
|
-
# Returns the
|
1512
|
+
# Returns the length of the audio-stream, used by FLAC::Properties for calculating the bitrate.DeprecatedThis method will not be public in a future release.
|
1683
1513
|
#
|
1684
|
-
def
|
1514
|
+
def streamLength()
|
1685
1515
|
end
|
1686
|
-
def
|
1516
|
+
def find1()
|
1517
|
+
end
|
1518
|
+
def length()
|
1519
|
+
end
|
1520
|
+
def readOnly()
|
1687
1521
|
end
|
1688
1522
|
#
|
1689
|
-
#
|
1523
|
+
# Set the ID3v2::FrameFactory to something other than the default. This can be used to specify the way that ID3v2 frames will be interpreted whenID3v2FrameFactory
|
1524
|
+
#
|
1690
1525
|
#
|
1691
|
-
def
|
1692
|
-
end
|
1693
|
-
def album=()
|
1526
|
+
def setID3v2FrameFactory( ID3v2::FrameFactory factory)
|
1694
1527
|
end
|
1695
1528
|
#
|
1696
|
-
#
|
1529
|
+
# Returns the FLAC::Properties for this file. If no audio properties were read then this will return a null pointer.
|
1697
1530
|
#
|
1698
|
-
def
|
1531
|
+
def audioProperties()
|
1699
1532
|
end
|
1700
1533
|
end
|
1534
|
+
end
|
1701
1535
|
# <b>
|
1702
|
-
# An implementation of
|
1703
|
-
#
|
1536
|
+
# An implementation of WavPack metadata. .</b>
|
1704
1537
|
#
|
1705
|
-
# This class provides the features of items in the APEv2 standard.
|
1706
1538
|
#
|
1707
|
-
|
1539
|
+
# This is implementation of WavPack metadata.This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream properties from the file.
|
1708
1540
|
#
|
1709
|
-
|
1541
|
+
module TagLib::WavPack
|
1542
|
+
# <b>
|
1543
|
+
# An implementation of audio property reading for WavPack. .</b>
|
1710
1544
|
#
|
1711
|
-
def isEmpty()
|
1712
|
-
end
|
1713
1545
|
#
|
1714
|
-
#
|
1546
|
+
# This reads the data from an WavPack stream found in the AudioProperties API.
|
1715
1547
|
#
|
1716
|
-
|
1717
|
-
end
|
1548
|
+
class TagLib::WavPack::Properties < TagLib::AudioProperties
|
1718
1549
|
#
|
1719
|
-
#
|
1720
|
-
#
|
1550
|
+
# Returns WavPack version.
|
1721
1551
|
#
|
1722
|
-
def
|
1552
|
+
def version()
|
1723
1553
|
end
|
1724
1554
|
#
|
1725
|
-
#
|
1555
|
+
# Returns the most appropriate bit rate for the file in kb/s. For constant bitrate formats this is simply the bitrate of the file. For variable bitrate formats this is either the average or nominal bitrate.
|
1726
1556
|
#
|
1727
|
-
def
|
1557
|
+
def bitrate()
|
1728
1558
|
end
|
1729
1559
|
#
|
1730
|
-
# Returns
|
1560
|
+
# Returns number of bits per sample.
|
1731
1561
|
#
|
1732
|
-
def
|
1562
|
+
def bitsPerSample()
|
1733
1563
|
end
|
1734
1564
|
#
|
1735
|
-
#
|
1565
|
+
# Returns the sample rate in Hz.
|
1736
1566
|
#
|
1737
|
-
def
|
1567
|
+
def sampleRate()
|
1738
1568
|
end
|
1739
1569
|
#
|
1740
|
-
# Returns the
|
1570
|
+
# Returns the number of audio channels.
|
1741
1571
|
#
|
1742
|
-
def
|
1572
|
+
def channels()
|
1743
1573
|
end
|
1744
1574
|
#
|
1745
|
-
#
|
1746
|
-
#
|
1575
|
+
# Returns the length of the file in seconds.
|
1747
1576
|
#
|
1748
|
-
def
|
1577
|
+
def length()
|
1749
1578
|
end
|
1579
|
+
end
|
1580
|
+
# <b>
|
1581
|
+
# An implementation of TagLib::File with WavPack specific methods. .</b>
|
1750
1582
|
#
|
1751
|
-
# Return true if the item is read-only.
|
1752
|
-
#
|
1753
|
-
def isReadOnly()
|
1754
|
-
end
|
1755
1583
|
#
|
1756
|
-
#
|
1584
|
+
# This implements and provides an interface for WavPack files to the TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing the abstract TagLib::File API as well as providing some additional information specific to WavPack files.
|
1757
1585
|
#
|
1758
|
-
|
1586
|
+
class TagLib::WavPack::File < TagLib::File
|
1587
|
+
def name()
|
1759
1588
|
end
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1763
|
-
|
1589
|
+
def seek()
|
1590
|
+
end
|
1591
|
+
def find2()
|
1592
|
+
end
|
1593
|
+
def valid?()
|
1764
1594
|
end
|
1765
1595
|
#
|
1766
|
-
# Returns the
|
1596
|
+
# Returns a pointer to the APE tag of the file.If create is false (the default) this will return a null pointer if there is no valid APE tag. If create is true it will create a APE tag if one does not exist.The Tag is still owned by the APE::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
1597
|
+
#
|
1767
1598
|
#
|
1768
|
-
def
|
1599
|
+
def APETag(bool create = false)
|
1769
1600
|
end
|
1770
1601
|
#
|
1771
|
-
#
|
1772
|
-
#
|
1602
|
+
# Saves the file.
|
1773
1603
|
#
|
1774
|
-
def
|
1604
|
+
def save()
|
1605
|
+
end
|
1606
|
+
def isWritable()
|
1607
|
+
end
|
1608
|
+
def find3()
|
1609
|
+
end
|
1610
|
+
def clear()
|
1611
|
+
end
|
1612
|
+
def read_only?()
|
1775
1613
|
end
|
1776
1614
|
#
|
1777
|
-
#
|
1778
|
-
#
|
1615
|
+
# Returns the Tag for this file. This will be an APE tag, an ID3v1 tag or a combination of the two.
|
1779
1616
|
#
|
1780
|
-
def
|
1617
|
+
def tag()
|
1618
|
+
end
|
1619
|
+
def isOpen()
|
1620
|
+
end
|
1621
|
+
def readBlock()
|
1622
|
+
end
|
1623
|
+
def rfind()
|
1624
|
+
end
|
1625
|
+
def writable?()
|
1781
1626
|
end
|
1782
1627
|
#
|
1783
|
-
#
|
1628
|
+
# This will remove the tags that match the OR-ed together TagTypes from the file. By default it removes all tags.This will also invalidate pointers to the tags as their memory will be freed. In order to make the removal permanent save() still needs to be called
|
1784
1629
|
#
|
1785
1630
|
#
|
1786
|
-
def
|
1631
|
+
def strip(int tags = AllTags)
|
1632
|
+
end
|
1633
|
+
def writeBlock()
|
1787
1634
|
end
|
1788
1635
|
#
|
1789
|
-
#
|
1636
|
+
# Returns a pointer to the ID3v1 tag of the file.If create is false (the default) this will return a null pointer if there is no valid ID3v1 tag. If create is true it will create an ID3v1 tag if one does not exist. If there is already an APE tag, the new ID3v1 tag will be placed after it.The Tag is still owned by the APE::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
1790
1637
|
#
|
1791
1638
|
#
|
1792
|
-
def
|
1639
|
+
def ID3v1Tag(bool create = false)
|
1640
|
+
end
|
1641
|
+
def insert()
|
1642
|
+
end
|
1643
|
+
def removeBlock()
|
1644
|
+
end
|
1645
|
+
def open?()
|
1646
|
+
end
|
1647
|
+
def isValid()
|
1648
|
+
end
|
1649
|
+
def tell()
|
1650
|
+
end
|
1651
|
+
def find1()
|
1652
|
+
end
|
1653
|
+
def length()
|
1654
|
+
end
|
1655
|
+
def readOnly()
|
1793
1656
|
end
|
1794
1657
|
#
|
1795
|
-
#
|
1658
|
+
# Returns the MPC::Properties for this file. If no audio properties were read then this will return a null pointer.
|
1796
1659
|
#
|
1797
|
-
def
|
1660
|
+
def audioProperties()
|
1798
1661
|
end
|
1799
1662
|
end
|
1663
|
+
end
|
1800
1664
|
# <b>
|
1801
|
-
# An implementation
|
1665
|
+
# An ID3v2 implementation. .</b>
|
1802
1666
|
#
|
1803
1667
|
#
|
1804
|
-
# This
|
1668
|
+
# This is a relatively complete and flexible framework for working with ID3v2 tags.ID3v2::Tag
|
1669
|
+
#
|
1805
1670
|
#
|
1806
|
-
|
1671
|
+
module TagLib::ID3v2
|
1672
|
+
# <b>
|
1673
|
+
# An implementation of ID3v2 comments. .</b>
|
1807
1674
|
#
|
1808
|
-
# Returns the number of items in the tag.
|
1809
1675
|
#
|
1810
|
-
|
1811
|
-
end
|
1676
|
+
# This implements the ID3v2 comment format. An ID3v2 comment concists of a language encoding, a description and a single text field.
|
1812
1677
|
#
|
1813
|
-
|
1678
|
+
class TagLib::ID3v2::CommentsFrame
|
1679
|
+
end
|
1680
|
+
# <b>
|
1681
|
+
# The main class in the ID3v2 implementation. .</b>
|
1814
1682
|
#
|
1815
|
-
def setData( ByteVector data)
|
1816
|
-
end
|
1817
1683
|
#
|
1818
|
-
#
|
1684
|
+
# This is the main class in the ID3v2 implementation. It serves two functions. This first, as is obvious from the public API, is to provide a container for the other ID3v2 related classes. In addition, through the read() and parse() protected methods, it provides the most basic level of parsing. In these methods the ID3v2 tag is extracted from the file and split into data components.ID3v2 tags have several parts, TagLib attempts to provide an interface for them all. header(), footer() and extendedHeader() corespond to those data structures in the ID3v2 standard and the APIs for the classes that they return attempt to reflect this.Also ID3v2 tags are built up from a list of frames, which are in turn have a header and a list of fields. TagLib provides two ways of accessing the list of frames that are in a given ID3v2 tag. The first is simply via the frameList() method. This is just a list of pointers to the frames. The second is a map from the frame type -- i.e. "COMM" for comments -- and a list of frames of that type. (In some cases ID3v2 allows for multiple frames of the same type, hence this being a map to a list rather than just a map to an individual frame.)More information on the structure of frames can be found in the ID3v2::Frame class.read() and parse() pass binary data to the other ID3v2 class structures, they do not handle parsing of flags or fields, for instace. Those are handled by similar functions within those classes.All pointers to data structures within the tag will become invalid when the tag is destroyed.
|
1685
|
+
# Dealing with the nasty details of ID3v2 is not for the faint of heart and should not be done without much meditation on the spec. It's rather long, but if you're planning on messing with this class and others that deal with the details of ID3v2 (rather than the nice, safe, abstract TagLib::Tag and friends), it's worth your time to familiarize yourself with said spec (which is distrubuted with the TagLib sources). TagLib tries to do most of the work, but with a little luck, you can still convince it to generate invalid ID3v2 tags. The APIs for ID3v2 assume a working knowledge of ID3v2 structure. You're been warned.
|
1686
|
+
#
|
1819
1687
|
#
|
1820
|
-
|
1688
|
+
class TagLib::ID3v2::Tag < TagLib::Tag
|
1689
|
+
def genre=()
|
1821
1690
|
end
|
1822
1691
|
#
|
1823
|
-
#
|
1692
|
+
# Sets the comment to s. If s is String::null then this value will be cleared.
|
1824
1693
|
#
|
1825
|
-
def
|
1694
|
+
def setComment( s)
|
1826
1695
|
end
|
1827
1696
|
#
|
1828
|
-
#
|
1829
|
-
#
|
1697
|
+
# Returns the track number; if there is no track number set, this will return 0.
|
1830
1698
|
#
|
1831
|
-
def
|
1699
|
+
def track()
|
1832
1700
|
end
|
1833
1701
|
#
|
1834
|
-
#
|
1702
|
+
# Returns the year; if there is no year set, this will return 0.
|
1835
1703
|
#
|
1836
|
-
def
|
1704
|
+
def year()
|
1705
|
+
end
|
1706
|
+
def track=()
|
1837
1707
|
end
|
1838
1708
|
#
|
1839
|
-
#
|
1709
|
+
# Sets the genre to s. If s is String::null then this value will be cleared. For tag formats that use a fixed set of genres, the appropriate value will be selected based on a string comparison. A list of available genres for those formats should be available in that type's implementation.
|
1840
1710
|
#
|
1841
|
-
def
|
1711
|
+
def setGenre( s)
|
1842
1712
|
end
|
1843
1713
|
#
|
1844
|
-
# Returns the
|
1845
|
-
#
|
1714
|
+
# Returns the track name; if no track name is present in the tag String::null will be returned.
|
1846
1715
|
#
|
1847
|
-
def
|
1716
|
+
def title()
|
1717
|
+
end
|
1718
|
+
def year=()
|
1848
1719
|
end
|
1849
1720
|
#
|
1850
|
-
#
|
1721
|
+
# Returns a pointer to the tag's header.
|
1851
1722
|
#
|
1852
|
-
def
|
1723
|
+
def header()
|
1724
|
+
end
|
1725
|
+
def title=()
|
1853
1726
|
end
|
1854
1727
|
#
|
1855
|
-
#
|
1728
|
+
# Sets the title to s. If s is String::null then this value will be cleared.
|
1856
1729
|
#
|
1857
|
-
def
|
1730
|
+
def setTitle( s)
|
1858
1731
|
end
|
1859
1732
|
#
|
1860
|
-
#
|
1861
|
-
#
|
1733
|
+
# Sets the year to i. If s is 0 then this value will be cleared.
|
1862
1734
|
#
|
1863
|
-
def
|
1735
|
+
def setYear(uint i)
|
1864
1736
|
end
|
1865
1737
|
#
|
1866
|
-
#
|
1738
|
+
# Returns the track comment; if no comment is present in the tag String::null will be returned.
|
1867
1739
|
#
|
1868
|
-
def
|
1740
|
+
def comment()
|
1741
|
+
end
|
1742
|
+
def empty?()
|
1869
1743
|
end
|
1870
1744
|
#
|
1871
|
-
#
|
1872
|
-
#
|
1745
|
+
# Returns the artist name; if no artist name is present in the tag String::null will be returned.
|
1873
1746
|
#
|
1874
|
-
def
|
1747
|
+
def artist()
|
1748
|
+
end
|
1749
|
+
def comment=()
|
1750
|
+
end
|
1751
|
+
def artist=()
|
1875
1752
|
end
|
1876
|
-
end
|
1877
|
-
end
|
1878
|
-
# <b>
|
1879
|
-
# An implementation of MPC metadata. .</b>
|
1880
1753
|
#
|
1754
|
+
# Sets the artist to s. If s is String::null then this value will be cleared.
|
1881
1755
|
#
|
1882
|
-
|
1756
|
+
def setArtist( s)
|
1757
|
+
end
|
1883
1758
|
#
|
1884
|
-
|
1885
|
-
# <b>
|
1886
|
-
# An implementation of audio property reading for MPC. .</b>
|
1759
|
+
# Sets the track to i. If s is 0 then this value will be cleared.
|
1887
1760
|
#
|
1761
|
+
def setTrack(uint i)
|
1762
|
+
end
|
1888
1763
|
#
|
1889
|
-
#
|
1764
|
+
# Returns the album name; if no album name is present in the tag String::null will be returned.
|
1890
1765
|
#
|
1891
|
-
|
1766
|
+
def album()
|
1767
|
+
end
|
1768
|
+
def album=()
|
1769
|
+
end
|
1892
1770
|
#
|
1893
|
-
#
|
1771
|
+
# Sets the album to s. If s is String::null then this value will be cleared.
|
1894
1772
|
#
|
1895
|
-
def
|
1773
|
+
def setAlbum( s)
|
1896
1774
|
end
|
1897
1775
|
#
|
1898
|
-
# Returns
|
1776
|
+
# Returns true if the tag does not contain any data. This should be reimplemented in subclasses that provide more than the basic tagging abilities in this class.
|
1899
1777
|
#
|
1900
|
-
def
|
1778
|
+
def isEmpty()
|
1901
1779
|
end
|
1902
1780
|
#
|
1903
|
-
# Returns the
|
1781
|
+
# Returns the genre name; if no genre is present in the tag String::null will be returned.
|
1904
1782
|
#
|
1905
|
-
def
|
1783
|
+
def genre()
|
1906
1784
|
end
|
1785
|
+
end
|
1786
|
+
# <b>
|
1787
|
+
# An implementation of ID3v2 headers. .</b>
|
1907
1788
|
#
|
1908
|
-
# Returns the number of audio channels.
|
1909
1789
|
#
|
1910
|
-
|
1911
|
-
end
|
1790
|
+
# This class implements ID3v2 headers. It attempts to follow, both semantically and programatically, the structure specified in the ID3v2 standard. The API is based on the properties of ID3v2 headers specified there. If any of the terms used in this documentation are unclear please check the specification in the linked section. (Structure, 3.1)
|
1912
1791
|
#
|
1913
|
-
|
1792
|
+
class TagLib::ID3v2::Header
|
1793
|
+
end
|
1794
|
+
# <b>
|
1795
|
+
# A factory for creating ID3v2 frames during parsing. .</b>
|
1914
1796
|
#
|
1915
|
-
|
1916
|
-
|
1797
|
+
#
|
1798
|
+
# This factory abstracts away the frame creation process and instantiates the appropriate ID3v2::Frame subclasses based on the contents of the data.Reimplementing this factory is the key to adding support for frame types not directly supported by TagLib to your application. To do so you would subclass this factory reimplement createFrame(). Then by setting your factory to be the default factory in ID3v2::Tag constructor or with MPEG::File::setID3v2FrameFactory() you can implement behavior that will allow for new ID3v2::Frame subclasses (also provided by you) to be used.This implements both abstract factory and singleton patterns of which more information is available on the web and in software design textbooks (Notably Design Patters).You do not need to use this factory to create new frames to add to an ID3v2::Tag. You can instantiate frame subclasses directly (with new) and add them to a tag using ID3v2::Tag::addFrame()
|
1799
|
+
# ID3v2::Tag::addFrame()
|
1800
|
+
#
|
1801
|
+
#
|
1802
|
+
class TagLib::ID3v2::FrameFactory
|
1917
1803
|
end
|
1918
1804
|
# <b>
|
1919
|
-
# An
|
1805
|
+
# An ID3v2 general encapsulated object frame implementation. .</b>
|
1920
1806
|
#
|
1921
1807
|
#
|
1922
|
-
# This
|
1808
|
+
# This is an implementation of ID3v2 general encapsulated objects. Arbitrary binary data may be included in tags, stored in GEOB frames. There may be multiple GEOB frames in a single tag. Each GEOB it labelled with a content description (which may be blank), a required mime-type, and a file name (may be blank). The content description uniquely identifies the GEOB frame in the tag.
|
1923
1809
|
#
|
1924
|
-
class TagLib::
|
1925
|
-
|
1926
|
-
|
1927
|
-
|
1928
|
-
end
|
1929
|
-
def readOnly()
|
1930
|
-
end
|
1810
|
+
class TagLib::ID3v2::GeneralEncapsulatedObjectFrame
|
1811
|
+
end
|
1812
|
+
# <b>
|
1813
|
+
# An ID3v2 attached picture frame implementation. .</b>
|
1931
1814
|
#
|
1932
|
-
#
|
1815
|
+
#
|
1816
|
+
# This is an implementation of ID3v2 attached pictures. Pictures may be included in tags, one per APIC frame (but there may be multiple APIC frames in a single tag). These pictures are usually in either JPEG or PNG format.
|
1817
|
+
#
|
1818
|
+
class TagLib::ID3v2::AttachedPictureFrame
|
1819
|
+
#
|
1820
|
+
# Sets the image data to p. p should be of the type specified in this frame's mime-type specification.picture() mimeType() setMimeType()
|
1933
1821
|
#
|
1934
1822
|
#
|
1935
|
-
def
|
1823
|
+
def setPicture( ByteVector p)
|
1936
1824
|
end
|
1937
1825
|
#
|
1938
|
-
# Returns the
|
1826
|
+
# Returns the mime type of the image. This should in most cases be "image/png" or "image/jpeg".
|
1939
1827
|
#
|
1940
|
-
def
|
1941
|
-
end
|
1942
|
-
def find2()
|
1943
|
-
end
|
1944
|
-
def clear()
|
1945
|
-
end
|
1946
|
-
def valid?()
|
1828
|
+
def mimeType()
|
1947
1829
|
end
|
1948
1830
|
#
|
1949
|
-
#
|
1831
|
+
# Returns a string containing the description and mime-type
|
1950
1832
|
#
|
1951
|
-
def
|
1833
|
+
def toString()
|
1952
1834
|
end
|
1953
1835
|
#
|
1954
|
-
#
|
1836
|
+
# Sets the mime type of the image. This should in most cases be "image/png" or "image/jpeg".
|
1955
1837
|
#
|
1956
|
-
def
|
1957
|
-
end
|
1958
|
-
def isWritable()
|
1959
|
-
end
|
1960
|
-
def find3()
|
1961
|
-
end
|
1962
|
-
def read_only?()
|
1963
|
-
end
|
1964
|
-
def isOpen()
|
1965
|
-
end
|
1966
|
-
def writable?()
|
1967
|
-
end
|
1968
|
-
def readBlock()
|
1838
|
+
def setMimeType( m)
|
1969
1839
|
end
|
1970
1840
|
#
|
1971
|
-
#
|
1972
|
-
# In order to make the removal permanent save() still needs to be called.
|
1841
|
+
# Sets the type for the image.Type type()
|
1973
1842
|
#
|
1974
1843
|
#
|
1975
|
-
def
|
1844
|
+
def setType(Type t)
|
1976
1845
|
end
|
1977
1846
|
#
|
1978
|
-
#
|
1847
|
+
# Sets a textual description of the image to desc.description() textEncoding() setTextEncoding()
|
1979
1848
|
#
|
1980
1849
|
#
|
1981
|
-
def
|
1982
|
-
end
|
1983
|
-
def rfind()
|
1984
|
-
end
|
1985
|
-
def insert()
|
1986
|
-
end
|
1987
|
-
def writeBlock()
|
1988
|
-
end
|
1989
|
-
def tell()
|
1850
|
+
def setDescription( desc)
|
1990
1851
|
end
|
1991
1852
|
#
|
1992
|
-
#
|
1853
|
+
# Returns a text description of the image.setDescription() textEncoding() setTextEncoding()
|
1993
1854
|
#
|
1994
1855
|
#
|
1995
|
-
def
|
1996
|
-
end
|
1997
|
-
def removeBlock()
|
1998
|
-
end
|
1999
|
-
def open?()
|
1856
|
+
def description()
|
2000
1857
|
end
|
2001
|
-
|
1858
|
+
#
|
1859
|
+
# Returns the text encoding used for the description.setTextEncoding() description()
|
1860
|
+
#
|
1861
|
+
#
|
1862
|
+
def textEncoding()
|
2002
1863
|
end
|
2003
|
-
|
1864
|
+
#
|
1865
|
+
# Returns the image data as a ByteVector.ByteVector has a data() method that returns a const char * which should make it easy to export this data to external programs.
|
1866
|
+
# setPicture() mimeType()
|
1867
|
+
#
|
1868
|
+
#
|
1869
|
+
def picture()
|
2004
1870
|
end
|
2005
|
-
|
1871
|
+
#
|
1872
|
+
# Set the text encoding used for the description.description()
|
1873
|
+
#
|
1874
|
+
#
|
1875
|
+
def setTextEncoding(::Type t)
|
2006
1876
|
end
|
2007
1877
|
end
|
2008
1878
|
end
|
2009
1879
|
# <b>
|
2010
|
-
# An implementation of
|
1880
|
+
# An implementation of TrueAudio metadata. .</b>
|
2011
1881
|
#
|
2012
1882
|
#
|
2013
|
-
# This is implementation of
|
1883
|
+
# This is implementation of TrueAudio metadata.This supports ID3v1 and ID3v2 tags as well as reading stream properties from the file.
|
2014
1884
|
#
|
2015
|
-
module TagLib::
|
1885
|
+
module TagLib::TrueAudio
|
2016
1886
|
# <b>
|
2017
|
-
# An implementation of audio property reading for
|
1887
|
+
# An implementation of audio property reading for TrueAudio. .</b>
|
2018
1888
|
#
|
2019
1889
|
#
|
2020
|
-
# This reads the data from an
|
1890
|
+
# This reads the data from an TrueAudio stream found in the AudioProperties API.
|
2021
1891
|
#
|
2022
|
-
class TagLib::
|
1892
|
+
class TagLib::TrueAudio::Properties < TagLib::AudioProperties
|
2023
1893
|
#
|
2024
|
-
# Returns the
|
1894
|
+
# Returns the most appropriate bit rate for the file in kb/s. For constant bitrate formats this is simply the bitrate of the file. For variable bitrate formats this is either the average or nominal bitrate.
|
2025
1895
|
#
|
2026
|
-
def
|
1896
|
+
def bitrate()
|
2027
1897
|
end
|
2028
1898
|
#
|
2029
|
-
# Returns
|
1899
|
+
# Returns number of bits per sample.
|
2030
1900
|
#
|
2031
|
-
def
|
1901
|
+
def bitsPerSample()
|
2032
1902
|
end
|
2033
1903
|
#
|
2034
1904
|
# Returns the sample rate in Hz.
|
@@ -2036,6 +1906,11 @@
|
|
2036
1906
|
def sampleRate()
|
2037
1907
|
end
|
2038
1908
|
#
|
1909
|
+
# Returns the major version number.
|
1910
|
+
#
|
1911
|
+
def ttaVersion()
|
1912
|
+
end
|
1913
|
+
#
|
2039
1914
|
# Returns the number of audio channels.
|
2040
1915
|
#
|
2041
1916
|
def channels()
|
@@ -2047,336 +1922,293 @@
|
|
2047
1922
|
end
|
2048
1923
|
end
|
2049
1924
|
# <b>
|
2050
|
-
# An implementation of TagLib::File with
|
1925
|
+
# An implementation of TagLib::File with TrueAudio specific methods. .</b>
|
2051
1926
|
#
|
2052
1927
|
#
|
2053
|
-
# This implements and provides an interface for
|
1928
|
+
# This implements and provides an interface for TrueAudio files to the TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing the abstract TagLib::File API as well as providing some additional information specific to TrueAudio files.
|
2054
1929
|
#
|
2055
|
-
class TagLib::
|
1930
|
+
class TagLib::TrueAudio::File < TagLib::File
|
2056
1931
|
def name()
|
2057
1932
|
end
|
2058
1933
|
def seek()
|
2059
1934
|
end
|
2060
|
-
def
|
1935
|
+
def find2()
|
2061
1936
|
end
|
2062
|
-
|
2063
|
-
# Returns the FLAC::Properties for this file. If no audio properties were read then this will return a null pointer.
|
2064
|
-
#
|
2065
|
-
def audioProperties()
|
1937
|
+
def valid?()
|
2066
1938
|
end
|
2067
1939
|
#
|
2068
|
-
#
|
1940
|
+
# Saves the file.
|
2069
1941
|
#
|
2070
|
-
def
|
1942
|
+
def save()
|
2071
1943
|
end
|
2072
|
-
def
|
1944
|
+
def isWritable()
|
1945
|
+
end
|
1946
|
+
def find3()
|
2073
1947
|
end
|
2074
1948
|
def clear()
|
2075
1949
|
end
|
2076
|
-
def
|
1950
|
+
def read_only?()
|
2077
1951
|
end
|
2078
1952
|
#
|
2079
|
-
#
|
1953
|
+
# Returns the Tag for this file.
|
2080
1954
|
#
|
2081
|
-
def
|
1955
|
+
def tag()
|
2082
1956
|
end
|
2083
|
-
|
2084
|
-
|
2085
|
-
|
2086
|
-
#
|
2087
|
-
def ID3v2Tag(bool create = false)
|
1957
|
+
def isOpen()
|
1958
|
+
end
|
1959
|
+
def readBlock()
|
2088
1960
|
end
|
2089
1961
|
#
|
2090
|
-
# Returns the
|
1962
|
+
# Returns a pointer to the ID3v1 tag of the file.If create is false (the default) this will return a null pointer if there is no valid ID3v1 tag. If create is true it will create an ID3v1 tag if one does not exist. If there is already an APE tag, the new ID3v1 tag will be placed after it.The Tag is still owned by the TrueAudio::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
2091
1963
|
#
|
2092
1964
|
#
|
2093
|
-
def
|
2094
|
-
end
|
2095
|
-
def isWritable()
|
2096
|
-
end
|
2097
|
-
def find3()
|
2098
|
-
end
|
2099
|
-
def read_only?()
|
1965
|
+
def ID3v2Tag(bool create = false)
|
2100
1966
|
end
|
2101
|
-
def
|
1967
|
+
def rfind()
|
2102
1968
|
end
|
2103
1969
|
def writable?()
|
2104
1970
|
end
|
2105
|
-
def readBlock()
|
2106
|
-
end
|
2107
1971
|
#
|
2108
|
-
#
|
1972
|
+
# This will remove the tags that match the OR-ed together TagTypes from the file. By default it removes all tags.This will also invalidate pointers to the tags as their memory will be freed. In order to make the removal permanent save() still needs to be called
|
2109
1973
|
#
|
2110
1974
|
#
|
2111
|
-
def
|
1975
|
+
def strip(int tags = AllTags)
|
2112
1976
|
end
|
2113
|
-
def
|
1977
|
+
def writeBlock()
|
2114
1978
|
end
|
2115
1979
|
#
|
2116
|
-
# Returns a pointer to the
|
1980
|
+
# Returns a pointer to the ID3v2 tag of the file.If create is false (the default) this will return a null pointer if there is no valid ID3v2 tag. If create is true it will create an ID3v1 tag if one does not exist. If there is already an APE tag, the new ID3v1 tag will be placed after it.The Tag is still owned by the TrueAudio::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
2117
1981
|
#
|
2118
1982
|
#
|
2119
|
-
def
|
1983
|
+
def ID3v1Tag(bool create = false)
|
2120
1984
|
end
|
2121
1985
|
def insert()
|
2122
1986
|
end
|
2123
|
-
def
|
1987
|
+
def removeBlock()
|
1988
|
+
end
|
1989
|
+
def open?()
|
1990
|
+
end
|
1991
|
+
def isValid()
|
2124
1992
|
end
|
2125
1993
|
def tell()
|
2126
1994
|
end
|
2127
|
-
def
|
1995
|
+
def find1()
|
2128
1996
|
end
|
2129
|
-
def
|
1997
|
+
def length()
|
1998
|
+
end
|
1999
|
+
def readOnly()
|
2130
2000
|
end
|
2131
2001
|
#
|
2132
|
-
# Set the ID3v2::FrameFactory to something other than the default.
|
2002
|
+
# Set the ID3v2::FrameFactory to something other than the default.ID3v2FrameFactory
|
2133
2003
|
#
|
2134
2004
|
#
|
2135
2005
|
def setID3v2FrameFactory( ID3v2::FrameFactory factory)
|
2136
2006
|
end
|
2137
|
-
def length()
|
2138
|
-
end
|
2139
|
-
def isValid()
|
2140
|
-
end
|
2141
2007
|
#
|
2142
|
-
# Returns the
|
2008
|
+
# Returns the TrueAudio::Properties for this file. If no audio properties were read then this will return a null pointer.
|
2143
2009
|
#
|
2144
|
-
def
|
2145
|
-
end
|
2146
|
-
def find1()
|
2010
|
+
def audioProperties()
|
2147
2011
|
end
|
2148
2012
|
end
|
2149
2013
|
end
|
2150
2014
|
# <b>
|
2151
|
-
#
|
2015
|
+
# A namespace for the classes used by Ogg-based metadata files. .</b>
|
2152
2016
|
#
|
2153
2017
|
#
|
2154
|
-
#
|
2018
|
+
#
|
2155
2019
|
#
|
2156
|
-
module TagLib::
|
2020
|
+
module TagLib::Ogg
|
2157
2021
|
# <b>
|
2158
|
-
# An implementation of
|
2022
|
+
# An implementation of the page headers associated with each Ogg::Page. .</b>
|
2159
2023
|
#
|
2160
2024
|
#
|
2161
|
-
# This
|
2025
|
+
# This class implements Ogg page headers which contain the information about Ogg pages needed to break them into packets which can be passed on to the codecs.
|
2162
2026
|
#
|
2163
|
-
class TagLib::
|
2027
|
+
class TagLib::Ogg::PageHeader
|
2164
2028
|
#
|
2165
|
-
#
|
2029
|
+
# Sets the internal flag indicating if the last packet in this page is complete to completed.lastPacketCompleted()
|
2030
|
+
#
|
2166
2031
|
#
|
2167
|
-
def
|
2032
|
+
def setLastPacketCompleted(bool completed)
|
2168
2033
|
end
|
2169
2034
|
#
|
2170
|
-
#
|
2035
|
+
# A special value of containing the position of the packet to be interpreted by the codec. In the case of Vorbis this contains the PCM value and is used to calculate the length of the stream.setAbsoluteGranularPosition()
|
2036
|
+
#
|
2171
2037
|
#
|
2172
|
-
def
|
2038
|
+
def absoluteGranularPosition()
|
2173
2039
|
end
|
2174
2040
|
#
|
2175
|
-
#
|
2041
|
+
# Sets the sizes of the packets in this page to sizes. Internally this updates the lacing values in the header.packetSizes()
|
2042
|
+
#
|
2176
2043
|
#
|
2177
|
-
def
|
2044
|
+
def setPacketSizes( List< int > sizes)
|
2178
2045
|
end
|
2179
2046
|
#
|
2180
|
-
#
|
2047
|
+
# Sets the page's position in the stream to sequenceNumber.pageSequenceNumber()
|
2048
|
+
#
|
2181
2049
|
#
|
2182
|
-
def
|
2050
|
+
def setPageSequenceNumber(int sequenceNumber)
|
2183
2051
|
end
|
2184
2052
|
#
|
2185
|
-
#
|
2053
|
+
# This returns true if this is the first page of the Ogg (logical) stream.setFirstPageOfStream()
|
2054
|
+
#
|
2186
2055
|
#
|
2187
|
-
def
|
2056
|
+
def firstPageOfStream()
|
2188
2057
|
end
|
2189
2058
|
#
|
2190
|
-
#
|
2059
|
+
# A special value of containing the position of the packet to be interpreted by the codec. It is only supported here so that it may be coppied from one page to another.absoluteGranularPosition()
|
2060
|
+
#
|
2191
2061
|
#
|
2192
|
-
def
|
2062
|
+
def setAbsoluteGranularPosition(long long agp)
|
2193
2063
|
end
|
2194
|
-
end
|
2195
|
-
# <b>
|
2196
|
-
# An implementation of TagLib::File with WavPack specific methods. .</b>
|
2197
|
-
#
|
2198
2064
|
#
|
2199
|
-
#
|
2065
|
+
# Returns the complete header size.
|
2200
2066
|
#
|
2201
|
-
|
2202
|
-
def name()
|
2203
|
-
end
|
2204
|
-
def seek()
|
2205
|
-
end
|
2206
|
-
def readOnly()
|
2067
|
+
def size()
|
2207
2068
|
end
|
2208
2069
|
#
|
2209
|
-
#
|
2070
|
+
# Some packets can be continued across multiple pages. If the first packet in the current page is a continuation this will return true. If this is page starts with a new packet this will return false.lastPacketCompleted() setFirstPacketContinued()
|
2210
2071
|
#
|
2211
2072
|
#
|
2212
|
-
def
|
2073
|
+
def firstPacketContinued()
|
2213
2074
|
end
|
2214
2075
|
#
|
2215
|
-
# Returns the
|
2076
|
+
# Returns the size of the data portion of the page -- i.e. the size of the page less the header size.
|
2216
2077
|
#
|
2217
|
-
def
|
2218
|
-
end
|
2219
|
-
def find2()
|
2220
|
-
end
|
2221
|
-
def clear()
|
2222
|
-
end
|
2223
|
-
def valid?()
|
2078
|
+
def dataSize()
|
2224
2079
|
end
|
2225
2080
|
#
|
2226
|
-
#
|
2081
|
+
# Marks this page as the first page of the Ogg stream.firstPageOfStream()
|
2082
|
+
#
|
2227
2083
|
#
|
2228
|
-
def
|
2084
|
+
def setFirstPageOfStream(bool first)
|
2229
2085
|
end
|
2230
2086
|
#
|
2231
|
-
#
|
2087
|
+
# Every Ogg logical stream is given a random serial number which is common to every page in that logical stream. This returns the serial number of the stream associated with this packet.setStreamSerialNumber()
|
2088
|
+
#
|
2232
2089
|
#
|
2233
|
-
def
|
2234
|
-
end
|
2235
|
-
def isWritable()
|
2236
|
-
end
|
2237
|
-
def find3()
|
2238
|
-
end
|
2239
|
-
def read_only?()
|
2240
|
-
end
|
2241
|
-
def isOpen()
|
2242
|
-
end
|
2243
|
-
def writable?()
|
2244
|
-
end
|
2245
|
-
def readBlock()
|
2090
|
+
def streamSerialNumber()
|
2246
2091
|
end
|
2247
2092
|
#
|
2248
|
-
#
|
2093
|
+
# Sets the internal flag indicating if the first packet in this page is continued to continued.firstPacketContinued()
|
2249
2094
|
#
|
2250
2095
|
#
|
2251
|
-
def
|
2096
|
+
def setFirstPacketContinued(bool continued)
|
2252
2097
|
end
|
2253
2098
|
#
|
2254
|
-
#
|
2099
|
+
# This returns true if this is the last page of the Ogg (logical) stream.setLastPageOfStream()
|
2255
2100
|
#
|
2256
2101
|
#
|
2257
|
-
def
|
2258
|
-
end
|
2259
|
-
def rfind()
|
2260
|
-
end
|
2261
|
-
def insert()
|
2262
|
-
end
|
2263
|
-
def writeBlock()
|
2264
|
-
end
|
2265
|
-
def tell()
|
2266
|
-
end
|
2267
|
-
def removeBlock()
|
2102
|
+
def lastPageOfStream()
|
2268
2103
|
end
|
2269
|
-
|
2104
|
+
#
|
2105
|
+
# Every Ogg logical stream is given a random serial number which is common to every page in that logical stream. This sets this pages serial number. This method should be used when adding new pages to a logical stream.streamSerialNumber()
|
2106
|
+
#
|
2107
|
+
#
|
2108
|
+
def setStreamSerialNumber(uint n)
|
2270
2109
|
end
|
2271
|
-
|
2110
|
+
#
|
2111
|
+
# Render the page header to binary data.The checksum -- bytes 22 - 25 -- will be left empty and must be filled in when rendering the entire page.
|
2112
|
+
#
|
2113
|
+
#
|
2114
|
+
def render()
|
2272
2115
|
end
|
2116
|
+
#
|
2117
|
+
# Returns true if the header parsed properly and is valid.
|
2118
|
+
#
|
2273
2119
|
def isValid()
|
2274
2120
|
end
|
2275
|
-
def find1()
|
2276
|
-
end
|
2277
|
-
end
|
2278
|
-
end
|
2279
|
-
# <b>
|
2280
|
-
# An ID3v2 implementation. .</b>
|
2281
2121
|
#
|
2122
|
+
# Returns true if the last packet of this page is completely contained in this page.firstPacketContinued() setLastPacketCompleted()
|
2123
|
+
#
|
2282
2124
|
#
|
2283
|
-
|
2284
|
-
|
2125
|
+
def lastPacketCompleted()
|
2126
|
+
end
|
2285
2127
|
#
|
2286
|
-
|
2287
|
-
|
2288
|
-
# An ID3v2 attached picture frame implementation. .</b>
|
2128
|
+
# Marks this page as the last page of the Ogg stream.lastPageOfStream()
|
2129
|
+
#
|
2289
2130
|
#
|
2131
|
+
def setLastPageOfStream(bool last)
|
2132
|
+
end
|
2290
2133
|
#
|
2291
|
-
#
|
2134
|
+
# Ogg pages contain a list of packets (which are used by the contained codecs). The sizes of these pages is encoded in the page header. This returns a list of the packet sizes in bytes.setPacketSizes()
|
2135
|
+
#
|
2292
2136
|
#
|
2293
|
-
|
2137
|
+
def packetSizes()
|
2138
|
+
end
|
2294
2139
|
#
|
2295
|
-
#
|
2140
|
+
# Returns the index of the page within the Ogg stream. This helps make it possible to determine if pages have been lost.setPageSequenceNumber()
|
2296
2141
|
#
|
2297
2142
|
#
|
2298
|
-
def
|
2143
|
+
def pageSequenceNumber()
|
2299
2144
|
end
|
2145
|
+
end
|
2146
|
+
# <b>
|
2147
|
+
# An implementation of Ogg pages. .</b>
|
2300
2148
|
#
|
2301
|
-
#
|
2149
|
+
#
|
2150
|
+
# This is an implementation of the pages that make up an Ogg stream. This handles parsing pages and breaking them down into packets and handles the details of packets spanning multiple pages and pages that contiain multiple packets.In most Xiph.org formats the comments are found in the first few packets, this however is a reasonably complete implementation of Ogg pages that could potentially be useful for non-meta data purposes.
|
2151
|
+
#
|
2152
|
+
class TagLib::Ogg::Page
|
2153
|
+
#
|
2154
|
+
# Checks to see if the specified packet is contained in the current page.ContainsPacketFlags
|
2302
2155
|
#
|
2303
2156
|
#
|
2304
|
-
def
|
2157
|
+
def containsPacket(int index)
|
2305
2158
|
end
|
2306
2159
|
#
|
2307
|
-
# Returns the
|
2160
|
+
# Returns the page's position within the file (in bytes).
|
2308
2161
|
#
|
2309
|
-
def
|
2162
|
+
def fileOffset()
|
2310
2163
|
end
|
2311
2164
|
#
|
2312
|
-
# Returns
|
2165
|
+
# Returns the number of packets (whole or partial) in this page.
|
2313
2166
|
#
|
2314
|
-
def
|
2167
|
+
def packetCount()
|
2315
2168
|
end
|
2316
2169
|
#
|
2317
|
-
#
|
2170
|
+
# Returns a pointer to the header for this page. This pointer will become invalid when the page is deleted.
|
2318
2171
|
#
|
2319
|
-
def
|
2172
|
+
def header()
|
2320
2173
|
end
|
2321
2174
|
#
|
2322
|
-
#
|
2323
|
-
#
|
2175
|
+
# Returns the size of the page in bytes.
|
2324
2176
|
#
|
2325
|
-
def
|
2177
|
+
def size()
|
2326
2178
|
end
|
2327
2179
|
#
|
2328
|
-
# Returns a
|
2180
|
+
# Returns a list of the packets in this page.Either or both the first and last packets may be only partial.
|
2181
|
+
# PageHeader::firstPacketContinued()
|
2329
2182
|
#
|
2330
2183
|
#
|
2331
|
-
def
|
2184
|
+
def packets()
|
2332
2185
|
end
|
2333
2186
|
#
|
2334
|
-
#
|
2187
|
+
# Returns the index of the first packet wholly or partially contained in this page.setFirstPacketIndex()
|
2335
2188
|
#
|
2336
2189
|
#
|
2337
|
-
def
|
2190
|
+
def firstPacketIndex()
|
2338
2191
|
end
|
2339
2192
|
#
|
2340
|
-
# Returns the text encoding used for the description.setTextEncoding() description()
|
2341
2193
|
#
|
2342
2194
|
#
|
2343
|
-
def
|
2195
|
+
def render()
|
2344
2196
|
end
|
2345
2197
|
#
|
2346
|
-
#
|
2347
|
-
# setPicture() mimeType()
|
2198
|
+
# Sets the index of the first packet in the page.firstPacketIndex()
|
2348
2199
|
#
|
2349
2200
|
#
|
2350
|
-
def
|
2201
|
+
def setFirstPacketIndex(int index)
|
2351
2202
|
end
|
2352
2203
|
end
|
2353
2204
|
# <b>
|
2354
|
-
#
|
2355
|
-
#
|
2356
|
-
#
|
2357
|
-
# This implements the ID3v2 comment format. An ID3v2 comment concists of a language encoding, a description and a single text field.
|
2358
|
-
#
|
2359
|
-
class TagLib::ID3v2::CommentsFrame
|
2360
|
-
end
|
2361
|
-
# <b>
|
2362
|
-
# The main class in the ID3v2 implementation. .</b>
|
2205
|
+
# Ogg Vorbis comment implementation. .</b>
|
2363
2206
|
#
|
2364
2207
|
#
|
2365
|
-
# This
|
2366
|
-
# Dealing with the nasty details of ID3v2 is not for the faint of heart and should not be done without much meditation on the spec. It's rather long, but if you're planning on messing with this class and others that deal with the details of ID3v2 (rather than the nice, safe, abstract TagLib::Tag and friends), it's worth your time to familiarize yourself with said spec (which is distrubuted with the TagLib sources). TagLib tries to do most of the work, but with a little luck, you can still convince it to generate invalid ID3v2 tags. The APIs for ID3v2 assume a working knowledge of ID3v2 structure. You're been warned.
|
2208
|
+
# This class is an implementation of the Ogg Vorbis comment specification, to be found in section 5 of the Ogg Vorbis specification. Because this format is also used in other (currently unsupported) Xiph.org formats, it has been made part of a generic implementation rather than being limited to strictly Vorbis.Vorbis comments are a simple vector of keys and values, called fields. Multiple values for a given key are supported.fieldListMap()
|
2367
2209
|
#
|
2368
2210
|
#
|
2369
|
-
class TagLib::
|
2370
|
-
#
|
2371
|
-
# Returns true if the tag does not contain any data. This should be reimplemented in subclasses that provide more than the basic tagging abilities in this class.
|
2372
|
-
#
|
2373
|
-
def isEmpty()
|
2374
|
-
end
|
2375
|
-
#
|
2376
|
-
# Returns the genre name; if no genre is present in the tag String::null will be returned.
|
2377
|
-
#
|
2378
|
-
def genre()
|
2379
|
-
end
|
2211
|
+
class TagLib::Ogg::XiphComment < TagLib::Tag
|
2380
2212
|
def genre=()
|
2381
2213
|
end
|
2382
2214
|
#
|
@@ -2385,16 +2217,19 @@
|
|
2385
2217
|
def setComment( s)
|
2386
2218
|
end
|
2387
2219
|
#
|
2388
|
-
# Returns the
|
2220
|
+
# Returns the vendor ID of the Ogg Vorbis encoder. libvorbis 1.0 as the most common case always returns "Xiph.Org libVorbis I 20020717".
|
2389
2221
|
#
|
2390
|
-
def
|
2222
|
+
def vendorID()
|
2391
2223
|
end
|
2392
2224
|
#
|
2393
2225
|
# Returns the track number; if there is no track number set, this will return 0.
|
2394
2226
|
#
|
2395
2227
|
def track()
|
2396
2228
|
end
|
2397
|
-
|
2229
|
+
#
|
2230
|
+
# Returns the year; if there is no year set, this will return 0.
|
2231
|
+
#
|
2232
|
+
def year()
|
2398
2233
|
end
|
2399
2234
|
def track=()
|
2400
2235
|
end
|
@@ -2408,12 +2243,7 @@
|
|
2408
2243
|
#
|
2409
2244
|
def title()
|
2410
2245
|
end
|
2411
|
-
|
2412
|
-
# Returns a pointer to the tag's header.
|
2413
|
-
#
|
2414
|
-
def header()
|
2415
|
-
end
|
2416
|
-
def empty?()
|
2246
|
+
def year=()
|
2417
2247
|
end
|
2418
2248
|
def title=()
|
2419
2249
|
end
|
@@ -2423,16 +2253,35 @@
|
|
2423
2253
|
def setTitle( s)
|
2424
2254
|
end
|
2425
2255
|
#
|
2256
|
+
# Add the field specified by key with the data value. If replace is true, then all of the other fields with the same key will be removed first.If the field value is empty, the field will be removed.
|
2257
|
+
#
|
2258
|
+
def addField( key, value,bool replace = true)
|
2259
|
+
end
|
2260
|
+
#
|
2426
2261
|
# Sets the year to i. If s is 0 then this value will be cleared.
|
2427
2262
|
#
|
2428
2263
|
def setYear(uint i)
|
2429
2264
|
end
|
2430
2265
|
#
|
2431
|
-
# Returns the
|
2266
|
+
# Returns the track comment; if no comment is present in the tag String::null will be returned.
|
2432
2267
|
#
|
2433
|
-
def
|
2268
|
+
def comment()
|
2434
2269
|
end
|
2435
|
-
def
|
2270
|
+
def empty?()
|
2271
|
+
end
|
2272
|
+
#
|
2273
|
+
# Returns the artist name; if no artist name is present in the tag String::null will be returned.
|
2274
|
+
#
|
2275
|
+
def artist()
|
2276
|
+
end
|
2277
|
+
def comment=()
|
2278
|
+
end
|
2279
|
+
#
|
2280
|
+
# Remove the field specified by key with the data value. If value is null, all of the fields with the given key will be removed.
|
2281
|
+
#
|
2282
|
+
def removeField( key, value = String::null)
|
2283
|
+
end
|
2284
|
+
def artist=()
|
2436
2285
|
end
|
2437
2286
|
#
|
2438
2287
|
# Sets the artist to s. If s is String::null then this value will be cleared.
|
@@ -2445,16 +2294,25 @@
|
|
2445
2294
|
def setTrack(uint i)
|
2446
2295
|
end
|
2447
2296
|
#
|
2448
|
-
# Returns the
|
2297
|
+
# Returns true if the field is contained within the comment.This is safer than checking for membership in the FieldListMap.
|
2298
|
+
#
|
2449
2299
|
#
|
2450
|
-
def
|
2300
|
+
def contains( key)
|
2451
2301
|
end
|
2452
2302
|
#
|
2453
2303
|
# Returns the album name; if no album name is present in the tag String::null will be returned.
|
2454
2304
|
#
|
2455
2305
|
def album()
|
2456
2306
|
end
|
2457
|
-
|
2307
|
+
#
|
2308
|
+
# Returns the number of fields present in the comment.
|
2309
|
+
#
|
2310
|
+
def fieldCount()
|
2311
|
+
end
|
2312
|
+
#
|
2313
|
+
# Renders the comment to a ByteVector suitable for inserting into a file.If addFramingBit is true the standard Vorbis comment framing bit will be appended. However some formats (notably FLAC) do not work with this in place.
|
2314
|
+
#
|
2315
|
+
def render(bool addFramingBit)
|
2458
2316
|
end
|
2459
2317
|
def album=()
|
2460
2318
|
end
|
@@ -2463,159 +2321,309 @@
|
|
2463
2321
|
#
|
2464
2322
|
def setAlbum( s)
|
2465
2323
|
end
|
2466
|
-
end
|
2467
|
-
# <b>
|
2468
|
-
# An implementation of ID3v2 headers. .</b>
|
2469
2324
|
#
|
2325
|
+
# Returns true if the tag does not contain any data. This should be reimplemented in subclasses that provide more than the basic tagging abilities in this class.
|
2470
2326
|
#
|
2471
|
-
|
2472
|
-
|
2473
|
-
class TagLib::ID3v2::Header
|
2474
|
-
end
|
2475
|
-
# <b>
|
2476
|
-
# A factory for creating ID3v2 frames during parsing. .</b>
|
2477
|
-
#
|
2478
|
-
#
|
2479
|
-
# This factory abstracts away the frame creation process and instantiates the appropriate ID3v2::Frame subclasses based on the contents of the data.Reimplementing this factory is the key to adding support for frame types not directly supported by TagLib to your application. To do so you would subclass this factory reimplement createFrame(). Then by setting your factory to be the default factory in ID3v2::Tag constructor or with MPEG::File::setID3v2FrameFactory() you can implement behavior that will allow for new ID3v2::Frame subclasses (also provided by you) to be used.This implements both abstract factory and singleton patterns of which more information is available on the web and in software design textbooks (Notably Design Patters).You do not need to use this factory to create new frames to add to an ID3v2::Tag. You can instantiate frame subclasses directly (with new) and add them to a tag using ID3v2::Tag::addFrame()
|
2480
|
-
# ID3v2::Tag::addFrame()
|
2481
|
-
#
|
2482
|
-
#
|
2483
|
-
class TagLib::ID3v2::FrameFactory
|
2484
|
-
end
|
2485
|
-
end
|
2486
|
-
# <b>
|
2487
|
-
# An implementation of TrueAudio metadata. .</b>
|
2327
|
+
def isEmpty()
|
2328
|
+
end
|
2488
2329
|
#
|
2330
|
+
# Returns the genre name; if no genre is present in the tag String::null will be returned.
|
2489
2331
|
#
|
2490
|
-
|
2332
|
+
def genre()
|
2333
|
+
end
|
2491
2334
|
#
|
2492
|
-
|
2493
|
-
# <b>
|
2494
|
-
# An implementation of audio property reading for TrueAudio. .</b>
|
2335
|
+
# Returns a reference to the map of field lists. Because Xiph comments support multiple fields with the same key, a pure Map would not work. As such this is a Map of string lists, keyed on the comment field name.The standard set of Xiph/Vorbis fields (which may or may not be contained in any specific comment) is:
|
2495
2336
|
#
|
2337
|
+
# TITLE
|
2496
2338
|
#
|
2497
|
-
#
|
2339
|
+
# VERSION
|
2498
2340
|
#
|
2499
|
-
|
2341
|
+
# ALBUM
|
2500
2342
|
#
|
2501
|
-
#
|
2343
|
+
# ARTIST
|
2502
2344
|
#
|
2503
|
-
|
2504
|
-
end
|
2345
|
+
# PERFORMER
|
2505
2346
|
#
|
2506
|
-
#
|
2347
|
+
# COPYRIGHT
|
2507
2348
|
#
|
2508
|
-
|
2509
|
-
end
|
2349
|
+
# ORGANIZATION
|
2510
2350
|
#
|
2511
|
-
#
|
2351
|
+
# DESCRIPTION
|
2512
2352
|
#
|
2513
|
-
|
2514
|
-
end
|
2353
|
+
# GENRE
|
2515
2354
|
#
|
2516
|
-
#
|
2355
|
+
# DATE
|
2517
2356
|
#
|
2518
|
-
|
2519
|
-
end
|
2357
|
+
# LOCATION
|
2520
2358
|
#
|
2521
|
-
#
|
2359
|
+
# CONTACT
|
2522
2360
|
#
|
2523
|
-
|
2524
|
-
end
|
2361
|
+
# ISRC
|
2525
2362
|
#
|
2526
|
-
#
|
2363
|
+
# For a more detailed description of these fields, please see the Ogg Vorbis specification, section 5.2.2.1.The Ogg Vorbis comment specification does allow these key values to be either upper or lower case. However, it is conventional for them to be upper case. As such, TagLib, when parsing a Xiph/Vorbis comment, converts all fields to uppercase. When you are using this data structure, you will need to specify the field name in upper case.
|
2364
|
+
# You should not modify this data structure directly, instead use addField() and removeField().
|
2365
|
+
#
|
2527
2366
|
#
|
2528
|
-
def
|
2367
|
+
def fieldListMap()
|
2529
2368
|
end
|
2530
2369
|
end
|
2531
2370
|
# <b>
|
2532
|
-
# An implementation of TagLib::File with
|
2371
|
+
# An implementation of TagLib::File with some helpers for Ogg based formats. .</b>
|
2533
2372
|
#
|
2534
2373
|
#
|
2535
|
-
# This
|
2374
|
+
# This is an implementation of Ogg file page and packet rendering and is of use to Ogg based formats. While the API is small this handles the non-trivial details of breaking up an Ogg stream into packets and makes these available (via subclassing) to the codec meta data implementations.
|
2536
2375
|
#
|
2537
|
-
class TagLib::
|
2376
|
+
class TagLib::Ogg::File < TagLib::File
|
2538
2377
|
def name()
|
2539
2378
|
end
|
2540
2379
|
def seek()
|
2541
2380
|
end
|
2542
|
-
def
|
2381
|
+
def find2()
|
2543
2382
|
end
|
2544
2383
|
#
|
2545
|
-
# Returns the
|
2384
|
+
# Returns a pointer to the PageHeader for the first page in the stream or null if the page could not be found.
|
2546
2385
|
#
|
2547
|
-
def
|
2548
|
-
end
|
2549
|
-
def find2()
|
2550
|
-
end
|
2551
|
-
def clear()
|
2386
|
+
def firstPageHeader()
|
2552
2387
|
end
|
2553
2388
|
def valid?()
|
2554
2389
|
end
|
2555
2390
|
#
|
2556
|
-
#
|
2557
|
-
#
|
2558
|
-
def save()
|
2559
|
-
end
|
2560
|
-
#
|
2561
|
-
# Returns a pointer to the ID3v1 tag of the file.If create is false (the default) this will return a null pointer if there is no valid ID3v1 tag. If create is true it will create an ID3v1 tag if one does not exist. If there is already an APE tag, the new ID3v1 tag will be placed after it.The Tag is still owned by the TrueAudio::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
2391
|
+
# Save the file and its associated tags. This should be reimplemented in the concrete subclasses. Returns true if the save succeeds.On UNIX multiple processes are able to write to the same file at the same time. This can result in serious file corruption. If you are developing a program that makes use of TagLib from multiple processes you must insure that you are only doing writes to a particular file from one of them.
|
2562
2392
|
#
|
2563
2393
|
#
|
2564
|
-
def
|
2565
|
-
end
|
2566
|
-
#
|
2567
|
-
# Returns the Tag for this file.
|
2568
|
-
#
|
2569
|
-
def tag()
|
2394
|
+
def save()
|
2570
2395
|
end
|
2571
2396
|
def isWritable()
|
2572
2397
|
end
|
2573
2398
|
def find3()
|
2574
2399
|
end
|
2400
|
+
def clear()
|
2401
|
+
end
|
2402
|
+
#
|
2403
|
+
# Returns a pointer to the PageHeader for the last page in the stream or null if the page could not be found.
|
2404
|
+
#
|
2405
|
+
def lastPageHeader()
|
2406
|
+
end
|
2575
2407
|
def read_only?()
|
2576
2408
|
end
|
2409
|
+
def tag()
|
2410
|
+
end
|
2577
2411
|
def isOpen()
|
2578
2412
|
end
|
2413
|
+
def readBlock()
|
2414
|
+
end
|
2415
|
+
def rfind()
|
2416
|
+
end
|
2579
2417
|
def writable?()
|
2580
2418
|
end
|
2581
|
-
def
|
2419
|
+
def writeBlock()
|
2582
2420
|
end
|
2583
2421
|
#
|
2584
|
-
#
|
2422
|
+
# Returns the packet contents for the i-th packet (starting from zero) in the Ogg bitstream.The requires reading at least the packet header for every page up to the requested page.
|
2585
2423
|
#
|
2586
2424
|
#
|
2587
|
-
def
|
2425
|
+
def packet(uint i)
|
2588
2426
|
end
|
2589
|
-
|
2590
|
-
# Returns a pointer to the ID3v2 tag of the file.If create is false (the default) this will return a null pointer if there is no valid ID3v2 tag. If create is true it will create an ID3v1 tag if one does not exist. If there is already an APE tag, the new ID3v1 tag will be placed after it.The Tag is still owned by the TrueAudio::File and should not be deleted by the user. It will be deleted when the file (object) is destroyed.
|
2591
|
-
#
|
2592
|
-
#
|
2593
|
-
def ID3v1Tag(bool create = false)
|
2427
|
+
def insert()
|
2594
2428
|
end
|
2595
|
-
def
|
2429
|
+
def removeBlock()
|
2596
2430
|
end
|
2597
|
-
def
|
2431
|
+
def open?()
|
2598
2432
|
end
|
2599
|
-
def
|
2433
|
+
def isValid()
|
2600
2434
|
end
|
2601
2435
|
def tell()
|
2602
2436
|
end
|
2603
|
-
def
|
2604
|
-
end
|
2605
|
-
def open?()
|
2437
|
+
def find1()
|
2606
2438
|
end
|
2607
2439
|
#
|
2608
|
-
#
|
2609
|
-
#
|
2440
|
+
# Sets the packet with index i to the value p.
|
2610
2441
|
#
|
2611
|
-
def
|
2442
|
+
def setPacket(uint i, ByteVector p)
|
2612
2443
|
end
|
2613
2444
|
def length()
|
2614
2445
|
end
|
2615
|
-
def
|
2446
|
+
def readOnly()
|
2616
2447
|
end
|
2617
|
-
def
|
2448
|
+
def audioProperties()
|
2618
2449
|
end
|
2619
2450
|
end
|
2451
|
+
# <b>
|
2452
|
+
# A namespace containing classes for Speex metadata. .</b>
|
2453
|
+
#
|
2454
|
+
#
|
2455
|
+
#
|
2456
|
+
#
|
2457
|
+
module TagLib::Ogg::Speex
|
2458
|
+
# <b>
|
2459
|
+
# An implementation of audio property reading for Ogg Speex. .</b>
|
2460
|
+
#
|
2461
|
+
#
|
2462
|
+
# This reads the data from an Ogg Speex stream found in the AudioProperties API.
|
2463
|
+
#
|
2464
|
+
class TagLib::Ogg::Speex::Properties < TagLib::AudioProperties
|
2465
|
+
#
|
2466
|
+
# Returns the most appropriate bit rate for the file in kb/s. For constant bitrate formats this is simply the bitrate of the file. For variable bitrate formats this is either the average or nominal bitrate.
|
2467
|
+
#
|
2468
|
+
def bitrate()
|
2469
|
+
end
|
2470
|
+
#
|
2471
|
+
# Returns the Speex version, currently "0" (as specified by the spec).
|
2472
|
+
#
|
2473
|
+
def speexVersion()
|
2474
|
+
end
|
2475
|
+
#
|
2476
|
+
# Returns the sample rate in Hz.
|
2477
|
+
#
|
2478
|
+
def sampleRate()
|
2479
|
+
end
|
2480
|
+
#
|
2481
|
+
# Returns the number of audio channels.
|
2482
|
+
#
|
2483
|
+
def channels()
|
2484
|
+
end
|
2485
|
+
#
|
2486
|
+
# Returns the length of the file in seconds.
|
2487
|
+
#
|
2488
|
+
def length()
|
2489
|
+
end
|
2490
|
+
end
|
2491
|
+
# <b>
|
2492
|
+
# An implementation of Ogg::File with Speex specific methods. .</b>
|
2493
|
+
#
|
2494
|
+
#
|
2495
|
+
# This is the central class in the Ogg Speex metadata processing collection of classes. It's built upon Ogg::File which handles processing of the Ogg logical bitstream and breaking it down into pages which are handled by the codec implementations, in this case Speex specifically.
|
2496
|
+
#
|
2497
|
+
class TagLib::Ogg::Speex::File < TagLib::Ogg::File
|
2498
|
+
def name()
|
2499
|
+
end
|
2500
|
+
def seek()
|
2501
|
+
end
|
2502
|
+
def find2()
|
2503
|
+
end
|
2504
|
+
def firstPageHeader()
|
2505
|
+
end
|
2506
|
+
def valid?()
|
2507
|
+
end
|
2508
|
+
#
|
2509
|
+
# Save the file and its associated tags. This should be reimplemented in the concrete subclasses. Returns true if the save succeeds.On UNIX multiple processes are able to write to the same file at the same time. This can result in serious file corruption. If you are developing a program that makes use of TagLib from multiple processes you must insure that you are only doing writes to a particular file from one of them.
|
2510
|
+
#
|
2511
|
+
#
|
2512
|
+
def save()
|
2513
|
+
end
|
2514
|
+
def isWritable()
|
2515
|
+
end
|
2516
|
+
def find3()
|
2517
|
+
end
|
2518
|
+
def clear()
|
2519
|
+
end
|
2520
|
+
def lastPageHeader()
|
2521
|
+
end
|
2522
|
+
def read_only?()
|
2523
|
+
end
|
2524
|
+
#
|
2525
|
+
# Returns the XiphComment for this file. XiphComment implements the tag interface, so this serves as the reimplementation of TagLib::File::tag().
|
2526
|
+
#
|
2527
|
+
def tag()
|
2528
|
+
end
|
2529
|
+
def isOpen()
|
2530
|
+
end
|
2531
|
+
def readBlock()
|
2532
|
+
end
|
2533
|
+
def rfind()
|
2534
|
+
end
|
2535
|
+
def writable?()
|
2536
|
+
end
|
2537
|
+
def writeBlock()
|
2538
|
+
end
|
2539
|
+
def packet()
|
2540
|
+
end
|
2541
|
+
def insert()
|
2542
|
+
end
|
2543
|
+
def removeBlock()
|
2544
|
+
end
|
2545
|
+
def open?()
|
2546
|
+
end
|
2547
|
+
def isValid()
|
2548
|
+
end
|
2549
|
+
def tell()
|
2550
|
+
end
|
2551
|
+
def find1()
|
2552
|
+
end
|
2553
|
+
def setPacket()
|
2554
|
+
end
|
2555
|
+
def length()
|
2556
|
+
end
|
2557
|
+
def readOnly()
|
2558
|
+
end
|
2559
|
+
#
|
2560
|
+
# Returns the Speex::Properties for this file. If no audio properties were read then this will return a null pointer.
|
2561
|
+
#
|
2562
|
+
def audioProperties()
|
2563
|
+
end
|
2564
|
+
end
|
2565
|
+
end
|
2566
|
+
module TagLib::Ogg::Flac
|
2567
|
+
class TagLib::Ogg::Flac::File < TagLib::Ogg::File
|
2568
|
+
def name()
|
2569
|
+
end
|
2570
|
+
def seek()
|
2571
|
+
end
|
2572
|
+
def find2()
|
2573
|
+
end
|
2574
|
+
def firstPageHeader()
|
2575
|
+
end
|
2576
|
+
def valid?()
|
2577
|
+
end
|
2578
|
+
def save()
|
2579
|
+
end
|
2580
|
+
def isWritable()
|
2581
|
+
end
|
2582
|
+
def find3()
|
2583
|
+
end
|
2584
|
+
def clear()
|
2585
|
+
end
|
2586
|
+
def lastPageHeader()
|
2587
|
+
end
|
2588
|
+
def read_only?()
|
2589
|
+
end
|
2590
|
+
def tag()
|
2591
|
+
end
|
2592
|
+
def isOpen()
|
2593
|
+
end
|
2594
|
+
def readBlock()
|
2595
|
+
end
|
2596
|
+
def rfind()
|
2597
|
+
end
|
2598
|
+
def writable?()
|
2599
|
+
end
|
2600
|
+
def writeBlock()
|
2601
|
+
end
|
2602
|
+
def packet()
|
2603
|
+
end
|
2604
|
+
def insert()
|
2605
|
+
end
|
2606
|
+
def removeBlock()
|
2607
|
+
end
|
2608
|
+
def open?()
|
2609
|
+
end
|
2610
|
+
def isValid()
|
2611
|
+
end
|
2612
|
+
def tell()
|
2613
|
+
end
|
2614
|
+
def streamLength()
|
2615
|
+
end
|
2616
|
+
def find1()
|
2617
|
+
end
|
2618
|
+
def setPacket()
|
2619
|
+
end
|
2620
|
+
def length()
|
2621
|
+
end
|
2622
|
+
def readOnly()
|
2623
|
+
end
|
2624
|
+
def audioProperties()
|
2625
|
+
end
|
2626
|
+
end
|
2627
|
+
end
|
2620
2628
|
end
|
2621
2629
|
end
|