rtaglib 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +84 -9
- data/README.txt +0 -0
- data/Rakefile +30 -27
- data/{test/data → data}/440Hz-5sec.flac +0 -0
- data/{test/data → data}/440Hz-5sec.mp3 +0 -0
- data/{test/data → data}/440Hz-5sec.mpc +0 -0
- data/{test/data → data}/440Hz-5sec.ogg +0 -0
- data/{test/data → data}/440Hz-5sec.wv +0 -0
- data/data/test_jason.mp3 +0 -0
- data/data/test_jason.ogg +0 -0
- data/ext/Rakefile +10 -0
- data/ext/tagfile/Rakefile.rb +42 -0
- data/ext/tagfile/rake_ext_conf.rb +29 -0
- data/ext/tagfile/tagfile.c +11 -7
- data/ext/taglib/Rakefile.rb +48 -0
- data/ext/taglib/rake_ext_conf.rb +33 -0
- data/ext/taglib/taglib-mswin32/bin/tag.dll +0 -0
- data/ext/taglib/taglib-mswin32/bin/tag_c.dll +0 -0
- data/ext/taglib/taglib-mswin32/bin/tag_cd.dll +0 -0
- data/ext/taglib/taglib-mswin32/bin/tagd.dll +0 -0
- data/ext/taglib/taglib-mswin32/bin/taglib-config +55 -0
- data/ext/taglib/taglib-mswin32/include/taglib/apefooter.h +173 -0
- data/ext/taglib/taglib-mswin32/include/taglib/apeitem.h +204 -0
- data/ext/taglib/taglib-mswin32/include/taglib/apetag.h +162 -0
- data/ext/taglib/taglib-mswin32/include/taglib/attachedpictureframe.h +220 -0
- data/ext/taglib/taglib-mswin32/include/taglib/audioproperties.h +110 -0
- data/ext/taglib/taglib-mswin32/include/taglib/commentsframe.h +168 -0
- data/ext/taglib/taglib-mswin32/include/taglib/fileref.h +262 -0
- data/ext/taglib/taglib-mswin32/include/taglib/flacfile.h +201 -0
- data/ext/taglib/taglib-mswin32/include/taglib/flacproperties.h +92 -0
- data/ext/taglib/taglib-mswin32/include/taglib/generalencapsulatedobjectframe.h +174 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v1genres.h +66 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v1tag.h +180 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2extendedheader.h +93 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2footer.h +82 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2frame.h +414 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2framefactory.h +167 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2header.h +175 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2synchdata.h +70 -0
- data/ext/taglib/taglib-mswin32/include/taglib/id3v2tag.h +300 -0
- data/ext/taglib/taglib-mswin32/include/taglib/mpcfile.h +175 -0
- data/ext/taglib/taglib-mswin32/include/taglib/mpcproperties.h +85 -0
- data/ext/taglib/taglib-mswin32/include/taglib/mpegfile.h +277 -0
- data/ext/taglib/taglib-mswin32/include/taglib/mpegheader.h +166 -0
- data/ext/taglib/taglib-mswin32/include/taglib/mpegproperties.h +118 -0
- data/ext/taglib/taglib-mswin32/include/taglib/oggfile.h +112 -0
- data/ext/taglib/taglib-mswin32/include/taglib/oggflacfile.h +118 -0
- data/ext/taglib/taglib-mswin32/include/taglib/oggpage.h +203 -0
- data/ext/taglib/taglib-mswin32/include/taglib/oggpageheader.h +232 -0
- data/ext/taglib/taglib-mswin32/include/taglib/relativevolumeframe.h +274 -0
- data/ext/taglib/taglib-mswin32/include/taglib/speexfile.h +99 -0
- data/ext/taglib/taglib-mswin32/include/taglib/speexproperties.h +89 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tag.h +173 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tag_c.h +288 -0
- data/ext/taglib/taglib-mswin32/include/taglib/taglib.h +177 -0
- data/ext/taglib/taglib-mswin32/include/taglib/taglib_export.h +39 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tbytevector.h +409 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tbytevectorlist.h +91 -0
- data/ext/taglib/taglib-mswin32/include/taglib/textidentificationframe.h +258 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tfile.h +271 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tlist.h +252 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tlist.tcc +316 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tmap.h +200 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tmap.tcc +196 -0
- data/ext/taglib/taglib-mswin32/include/taglib/trueaudiofile.h +180 -0
- data/ext/taglib/taglib-mswin32/include/taglib/trueaudioproperties.h +93 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tstring.h +456 -0
- data/ext/taglib/taglib-mswin32/include/taglib/tstringlist.h +115 -0
- data/ext/taglib/taglib-mswin32/include/taglib/uniquefileidentifierframe.h +113 -0
- data/ext/taglib/taglib-mswin32/include/taglib/unknownframe.h +79 -0
- data/ext/taglib/taglib-mswin32/include/taglib/unsynchronizedlyricsframe.h +157 -0
- data/ext/taglib/taglib-mswin32/include/taglib/urllinkframe.h +172 -0
- data/ext/taglib/taglib-mswin32/include/taglib/vorbisfile.h +118 -0
- data/ext/taglib/taglib-mswin32/include/taglib/vorbisproperties.h +125 -0
- data/ext/taglib/taglib-mswin32/include/taglib/wavpackfile.h +164 -0
- data/ext/taglib/taglib-mswin32/include/taglib/wavpackproperties.h +94 -0
- data/ext/taglib/taglib-mswin32/include/taglib/xingheader.h +100 -0
- data/ext/taglib/taglib-mswin32/include/taglib/xiphcomment.h +202 -0
- data/ext/taglib/taglib-mswin32/lib/pkgconfig/taglib_c.pc +12 -0
- data/ext/taglib/taglib-mswin32/lib/tag.lib +0 -0
- data/ext/taglib/taglib-mswin32/lib/tag_c.lib +0 -0
- data/ext/taglib/taglib_i386-mingw32.source +22645 -0
- data/ext/taglib/taglib_i386-mswin32.source +22645 -0
- data/ext/taglib/{taglib.cxx → taglib_x86_64-linux.source} +508 -75
- data/lib/TagLib.rb +3 -2
- data/lib/TagLib_doc.rb +1532 -1526
- data/lib/rtaglib_mswin32.rb +4 -0
- data/lib/tagfile.rb +6 -0
- data/swig/Doxyfile +0 -0
- data/swig/Rakefile +44 -19
- data/swig/TagLib_doc.rb +2755 -0
- data/swig/make_doc.rb +5 -4
- data/swig/process_cxx.rb +2 -2
- data/swig/rake_ext_conf.rb +33 -0
- data/swig/taglib.i +8 -5
- data/swig/test.rb +47 -39
- data/test/test_read.rb +4 -3
- data/test/test_taglib.rb +47 -39
- data/test/test_write.rb +4 -3
- metadata +96 -20
- data/ext/tagfile/extconf.rb +0 -14
- data/ext/taglib/extconf.rb +0 -22
- data/swig/extconf.rb +0 -22
@@ -0,0 +1,262 @@
|
|
1
|
+
/***************************************************************************
|
2
|
+
copyright : (C) 2002 - 2008 by Scott Wheeler
|
3
|
+
email : wheeler@kde.org
|
4
|
+
***************************************************************************/
|
5
|
+
|
6
|
+
/***************************************************************************
|
7
|
+
* This library is free software; you can redistribute it and/or modify *
|
8
|
+
* it under the terms of the GNU Lesser General Public License version *
|
9
|
+
* 2.1 as published by the Free Software Foundation. *
|
10
|
+
* *
|
11
|
+
* This library is distributed in the hope that it will be useful, but *
|
12
|
+
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
14
|
+
* Lesser General Public License for more details. *
|
15
|
+
* *
|
16
|
+
* You should have received a copy of the GNU Lesser General Public *
|
17
|
+
* License along with this library; if not, write to the Free Software *
|
18
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
19
|
+
* USA *
|
20
|
+
* *
|
21
|
+
* Alternatively, this file is available under the Mozilla Public *
|
22
|
+
* License Version 1.1. You may obtain a copy of the License at *
|
23
|
+
* http://www.mozilla.org/MPL/ *
|
24
|
+
***************************************************************************/
|
25
|
+
|
26
|
+
#ifndef TAGLIB_FILEREF_H
|
27
|
+
#define TAGLIB_FILEREF_H
|
28
|
+
|
29
|
+
#include <tfile.h>
|
30
|
+
#include <tstringlist.h>
|
31
|
+
|
32
|
+
#include "taglib_export.h"
|
33
|
+
#include "audioproperties.h"
|
34
|
+
|
35
|
+
namespace TagLib {
|
36
|
+
|
37
|
+
class Tag;
|
38
|
+
|
39
|
+
//! This class provides a simple abstraction for creating and handling files
|
40
|
+
|
41
|
+
/*!
|
42
|
+
* FileRef exists to provide a minimal, generic and value-based wrapper around
|
43
|
+
* a File. It is lightweight and implicitly shared, and as such suitable for
|
44
|
+
* pass-by-value use. This hides some of the uglier details of TagLib::File
|
45
|
+
* and the non-generic portions of the concrete file implementations.
|
46
|
+
*
|
47
|
+
* This class is useful in a "simple usage" situation where it is desirable
|
48
|
+
* to be able to get and set some of the tag information that is similar
|
49
|
+
* across file types.
|
50
|
+
*
|
51
|
+
* Also note that it is probably a good idea to plug this into your mime
|
52
|
+
* type system rather than using the constructor that accepts a file name using
|
53
|
+
* the FileTypeResolver.
|
54
|
+
*
|
55
|
+
* \see FileTypeResolver
|
56
|
+
* \see addFileTypeResolver()
|
57
|
+
*/
|
58
|
+
|
59
|
+
class TAGLIB_EXPORT FileRef
|
60
|
+
{
|
61
|
+
public:
|
62
|
+
|
63
|
+
//! A class for pluggable file type resolution.
|
64
|
+
|
65
|
+
/*!
|
66
|
+
* This class is used to add extend TagLib's very basic file name based file
|
67
|
+
* type resolution.
|
68
|
+
*
|
69
|
+
* This can be accomplished with:
|
70
|
+
*
|
71
|
+
* \code
|
72
|
+
*
|
73
|
+
* class MyFileTypeResolver : FileTypeResolver
|
74
|
+
* {
|
75
|
+
* TagLib::File *createFile(TagLib::FileName *fileName, bool, AudioProperties::ReadStyle)
|
76
|
+
* {
|
77
|
+
* if(someCheckForAnMP3File(fileName))
|
78
|
+
* return new TagLib::MPEG::File(fileName);
|
79
|
+
* return 0;
|
80
|
+
* }
|
81
|
+
* }
|
82
|
+
*
|
83
|
+
* FileRef::addFileTypeResolver(new MyFileTypeResolver);
|
84
|
+
*
|
85
|
+
* \endcode
|
86
|
+
*
|
87
|
+
* Naturally a less contrived example would be slightly more complex. This
|
88
|
+
* can be used to plug in mime-type detection systems or to add new file types
|
89
|
+
* to TagLib.
|
90
|
+
*/
|
91
|
+
|
92
|
+
class TAGLIB_EXPORT FileTypeResolver
|
93
|
+
{
|
94
|
+
public:
|
95
|
+
// do not fix compiler warning about missing virtual destructor
|
96
|
+
// since this would not be binary compatible
|
97
|
+
// let Scott fix it whenever he thinks BIC changes can next be applied
|
98
|
+
/*!
|
99
|
+
* This method must be overridden to provide an additional file type
|
100
|
+
* resolver. If the resolver is able to determine the file type it should
|
101
|
+
* return a valid File object; if not it should return 0.
|
102
|
+
*
|
103
|
+
* \note The created file is then owned by the FileRef and should not be
|
104
|
+
* deleted. Deletion will happen automatically when the FileRef passes
|
105
|
+
* out of scope.
|
106
|
+
*/
|
107
|
+
virtual File *createFile(FileName fileName,
|
108
|
+
bool readAudioProperties = true,
|
109
|
+
AudioProperties::ReadStyle
|
110
|
+
audioPropertiesStyle = AudioProperties::Average) const = 0;
|
111
|
+
};
|
112
|
+
|
113
|
+
/*!
|
114
|
+
* Creates a null FileRef.
|
115
|
+
*/
|
116
|
+
FileRef();
|
117
|
+
|
118
|
+
/*!
|
119
|
+
* Create a FileRef from \a fileName. If \a readAudioProperties is true then
|
120
|
+
* the audio properties will be read using \a audioPropertiesStyle. If
|
121
|
+
* \a readAudioProperties is false then \a audioPropertiesStyle will be
|
122
|
+
* ignored.
|
123
|
+
*
|
124
|
+
* Also see the note in the class documentation about why you may not want to
|
125
|
+
* use this method in your application.
|
126
|
+
*/
|
127
|
+
explicit FileRef(FileName fileName,
|
128
|
+
bool readAudioProperties = true,
|
129
|
+
AudioProperties::ReadStyle
|
130
|
+
audioPropertiesStyle = AudioProperties::Average);
|
131
|
+
|
132
|
+
/*!
|
133
|
+
* Contruct a FileRef using \a file. The FileRef now takes ownership of the
|
134
|
+
* pointer and will delete the File when it passes out of scope.
|
135
|
+
*/
|
136
|
+
explicit FileRef(File *file);
|
137
|
+
|
138
|
+
/*!
|
139
|
+
* Make a copy of \a ref.
|
140
|
+
*/
|
141
|
+
FileRef(const FileRef &ref);
|
142
|
+
|
143
|
+
/*!
|
144
|
+
* Destroys this FileRef instance.
|
145
|
+
*/
|
146
|
+
virtual ~FileRef();
|
147
|
+
|
148
|
+
/*!
|
149
|
+
* Returns a pointer to represented file's tag.
|
150
|
+
*
|
151
|
+
* \warning This pointer will become invalid when this FileRef and all
|
152
|
+
* copies pass out of scope.
|
153
|
+
*
|
154
|
+
* \see File::tag()
|
155
|
+
*/
|
156
|
+
Tag *tag() const;
|
157
|
+
|
158
|
+
/*!
|
159
|
+
* Returns the audio properties for this FileRef. If no audio properties
|
160
|
+
* were read then this will returns a null pointer.
|
161
|
+
*/
|
162
|
+
AudioProperties *audioProperties() const;
|
163
|
+
|
164
|
+
/*!
|
165
|
+
* Returns a pointer to the file represented by this handler class.
|
166
|
+
*
|
167
|
+
* As a general rule this call should be avoided since if you need to work
|
168
|
+
* with file objects directly, you are probably better served instantiating
|
169
|
+
* the File subclasses (i.e. MPEG::File) manually and working with their APIs.
|
170
|
+
*
|
171
|
+
* This <i>handle</i> exists to provide a minimal, generic and value-based
|
172
|
+
* wrapper around a File. Accessing the file directly generally indicates
|
173
|
+
* a moving away from this simplicity (and into things beyond the scope of
|
174
|
+
* FileRef).
|
175
|
+
*
|
176
|
+
* \warning This pointer will become invalid when this FileRef and all
|
177
|
+
* copies pass out of scope.
|
178
|
+
*/
|
179
|
+
File *file() const;
|
180
|
+
|
181
|
+
/*!
|
182
|
+
* Saves the file. Returns true on success.
|
183
|
+
*/
|
184
|
+
bool save();
|
185
|
+
|
186
|
+
/*!
|
187
|
+
* Adds a FileTypeResolver to the list of those used by TagLib. Each
|
188
|
+
* additional FileTypeResolver is added to the front of a list of resolvers
|
189
|
+
* that are tried. If the FileTypeResolver returns zero the next resolver
|
190
|
+
* is tried.
|
191
|
+
*
|
192
|
+
* Returns a pointer to the added resolver (the same one that's passed in --
|
193
|
+
* this is mostly so that static inialializers have something to use for
|
194
|
+
* assignment).
|
195
|
+
*
|
196
|
+
* \see FileTypeResolver
|
197
|
+
*/
|
198
|
+
static const FileTypeResolver *addFileTypeResolver(const FileTypeResolver *resolver);
|
199
|
+
|
200
|
+
/*!
|
201
|
+
* As is mentioned elsewhere in this class's documentation, the default file
|
202
|
+
* type resolution code provided by TagLib only works by comparing file
|
203
|
+
* extensions.
|
204
|
+
*
|
205
|
+
* This method returns the list of file extensions that are used by default.
|
206
|
+
*
|
207
|
+
* The extensions are all returned in lowercase, though the comparison used
|
208
|
+
* by TagLib for resolution is case-insensitive.
|
209
|
+
*
|
210
|
+
* \note This does not account for any additional file type resolvers that
|
211
|
+
* are plugged in. Also note that this is not intended to replace a propper
|
212
|
+
* mime-type resolution system, but is just here for reference.
|
213
|
+
*
|
214
|
+
* \see FileTypeResolver
|
215
|
+
*/
|
216
|
+
static StringList defaultFileExtensions();
|
217
|
+
|
218
|
+
/*!
|
219
|
+
* Returns true if the file (and as such other pointers) are null.
|
220
|
+
*/
|
221
|
+
bool isNull() const;
|
222
|
+
|
223
|
+
/*!
|
224
|
+
* Assign the file pointed to by \a ref to this FileRef.
|
225
|
+
*/
|
226
|
+
FileRef &operator=(const FileRef &ref);
|
227
|
+
|
228
|
+
/*!
|
229
|
+
* Returns true if this FileRef and \a ref point to the same File object.
|
230
|
+
*/
|
231
|
+
bool operator==(const FileRef &ref) const;
|
232
|
+
|
233
|
+
/*!
|
234
|
+
* Returns true if this FileRef and \a ref do not point to the same File
|
235
|
+
* object.
|
236
|
+
*/
|
237
|
+
bool operator!=(const FileRef &ref) const;
|
238
|
+
|
239
|
+
/*!
|
240
|
+
* A simple implementation of file type guessing. If \a readAudioProperties
|
241
|
+
* is true then the audio properties will be read using
|
242
|
+
* \a audioPropertiesStyle. If \a readAudioProperties is false then
|
243
|
+
* \a audioPropertiesStyle will be ignored.
|
244
|
+
*
|
245
|
+
* \note You generally shouldn't use this method, but instead the constructor
|
246
|
+
* directly.
|
247
|
+
*
|
248
|
+
* \deprecated
|
249
|
+
*/
|
250
|
+
static File *create(FileName fileName,
|
251
|
+
bool readAudioProperties = true,
|
252
|
+
AudioProperties::ReadStyle audioPropertiesStyle = AudioProperties::Average);
|
253
|
+
|
254
|
+
|
255
|
+
private:
|
256
|
+
class FileRefPrivate;
|
257
|
+
FileRefPrivate *d;
|
258
|
+
};
|
259
|
+
|
260
|
+
} // namespace TagLib
|
261
|
+
|
262
|
+
#endif
|
@@ -0,0 +1,201 @@
|
|
1
|
+
/***************************************************************************
|
2
|
+
copyright : (C) 2003 by Allan Sandfeld Jensen
|
3
|
+
email : kde@carewolf.org
|
4
|
+
***************************************************************************/
|
5
|
+
|
6
|
+
/***************************************************************************
|
7
|
+
* This library is free software; you can redistribute it and/or modify *
|
8
|
+
* it under the terms of the GNU Lesser General Public License version *
|
9
|
+
* 2.1 as published by the Free Software Foundation. *
|
10
|
+
* *
|
11
|
+
* This library is distributed in the hope that it will be useful, but *
|
12
|
+
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
14
|
+
* Lesser General Public License for more details. *
|
15
|
+
* *
|
16
|
+
* You should have received a copy of the GNU Lesser General Public *
|
17
|
+
* License along with this library; if not, write to the Free Software *
|
18
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
19
|
+
* USA *
|
20
|
+
* *
|
21
|
+
* Alternatively, this file is available under the Mozilla Public *
|
22
|
+
* License Version 1.1. You may obtain a copy of the License at *
|
23
|
+
* http://www.mozilla.org/MPL/ *
|
24
|
+
***************************************************************************/
|
25
|
+
|
26
|
+
#ifndef TAGLIB_FLACFILE_H
|
27
|
+
#define TAGLIB_FLACFILE_H
|
28
|
+
|
29
|
+
#include "taglib_export.h"
|
30
|
+
#include "tfile.h"
|
31
|
+
|
32
|
+
#include "flacproperties.h"
|
33
|
+
|
34
|
+
namespace TagLib {
|
35
|
+
|
36
|
+
class Tag;
|
37
|
+
|
38
|
+
namespace ID3v2 { class FrameFactory; class Tag; }
|
39
|
+
namespace ID3v1 { class Tag; }
|
40
|
+
namespace Ogg { class XiphComment; }
|
41
|
+
|
42
|
+
//! An implementation of FLAC metadata
|
43
|
+
|
44
|
+
/*!
|
45
|
+
* This is implementation of FLAC metadata for non-Ogg FLAC files. At some
|
46
|
+
* point when Ogg / FLAC is more common there will be a similar implementation
|
47
|
+
* under the Ogg hiearchy.
|
48
|
+
*
|
49
|
+
* This supports ID3v1, ID3v2 and Xiph style comments as well as reading stream
|
50
|
+
* properties from the file.
|
51
|
+
*/
|
52
|
+
|
53
|
+
namespace FLAC {
|
54
|
+
|
55
|
+
//! An implementation of TagLib::File with FLAC specific methods
|
56
|
+
|
57
|
+
/*!
|
58
|
+
* This implements and provides an interface for FLAC files to the
|
59
|
+
* TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
|
60
|
+
* the abstract TagLib::File API as well as providing some additional
|
61
|
+
* information specific to FLAC files.
|
62
|
+
*/
|
63
|
+
|
64
|
+
class TAGLIB_EXPORT File : public TagLib::File
|
65
|
+
{
|
66
|
+
public:
|
67
|
+
/*!
|
68
|
+
* Contructs a FLAC file from \a file. If \a readProperties is true the
|
69
|
+
* file's audio properties will also be read using \a propertiesStyle. If
|
70
|
+
* false, \a propertiesStyle is ignored.
|
71
|
+
*
|
72
|
+
* \deprecated This constructor will be dropped in favor of the one below
|
73
|
+
* in a future version.
|
74
|
+
*/
|
75
|
+
File(FileName file, bool readProperties = true,
|
76
|
+
Properties::ReadStyle propertiesStyle = Properties::Average);
|
77
|
+
|
78
|
+
/*!
|
79
|
+
* Contructs a FLAC file from \a file. If \a readProperties is true the
|
80
|
+
* file's audio properties will also be read using \a propertiesStyle. If
|
81
|
+
* false, \a propertiesStyle is ignored.
|
82
|
+
*
|
83
|
+
* If this file contains and ID3v2 tag the frames will be created using
|
84
|
+
* \a frameFactory.
|
85
|
+
*/
|
86
|
+
// BIC: merge with the above constructor
|
87
|
+
File(FileName file, ID3v2::FrameFactory *frameFactory,
|
88
|
+
bool readProperties = true,
|
89
|
+
Properties::ReadStyle propertiesStyle = Properties::Average);
|
90
|
+
|
91
|
+
/*!
|
92
|
+
* Destroys this instance of the File.
|
93
|
+
*/
|
94
|
+
virtual ~File();
|
95
|
+
|
96
|
+
/*!
|
97
|
+
* Returns the Tag for this file. This will be a union of XiphComment,
|
98
|
+
* ID3v1 and ID3v2 tags.
|
99
|
+
*
|
100
|
+
* \see ID3v2Tag()
|
101
|
+
* \see ID3v1Tag()
|
102
|
+
* \see XiphComment()
|
103
|
+
*/
|
104
|
+
virtual TagLib::Tag *tag() const;
|
105
|
+
|
106
|
+
/*!
|
107
|
+
* Returns the FLAC::Properties for this file. If no audio properties
|
108
|
+
* were read then this will return a null pointer.
|
109
|
+
*/
|
110
|
+
virtual Properties *audioProperties() const;
|
111
|
+
|
112
|
+
/*!
|
113
|
+
* Save the file. This will primarily save the XiphComment, but
|
114
|
+
* will also keep any old ID3-tags up to date. If the file
|
115
|
+
* has no XiphComment, one will be constructed from the ID3-tags.
|
116
|
+
*
|
117
|
+
* This returns true if the save was successful.
|
118
|
+
*/
|
119
|
+
virtual bool save();
|
120
|
+
|
121
|
+
/*!
|
122
|
+
* Returns a pointer to the ID3v2 tag of the file.
|
123
|
+
*
|
124
|
+
* If \a create is false (the default) this will return a null pointer
|
125
|
+
* if there is no valid ID3v2 tag. If \a create is true it will create
|
126
|
+
* an ID3v2 tag if one does not exist.
|
127
|
+
*
|
128
|
+
* \note The Tag <b>is still</b> owned by the FLAC::File and should not be
|
129
|
+
* deleted by the user. It will be deleted when the file (object) is
|
130
|
+
* destroyed.
|
131
|
+
*/
|
132
|
+
ID3v2::Tag *ID3v2Tag(bool create = false);
|
133
|
+
|
134
|
+
/*!
|
135
|
+
* Returns a pointer to the ID3v1 tag of the file.
|
136
|
+
*
|
137
|
+
* If \a create is false (the default) this will return a null pointer
|
138
|
+
* if there is no valid ID3v1 tag. If \a create is true it will create
|
139
|
+
* an ID3v1 tag if one does not exist.
|
140
|
+
*
|
141
|
+
* \note The Tag <b>is still</b> owned by the FLAC::File and should not be
|
142
|
+
* deleted by the user. It will be deleted when the file (object) is
|
143
|
+
* destroyed.
|
144
|
+
*/
|
145
|
+
ID3v1::Tag *ID3v1Tag(bool create = false);
|
146
|
+
|
147
|
+
/*!
|
148
|
+
* Returns a pointer to the XiphComment for the file.
|
149
|
+
*
|
150
|
+
* If \a create is false (the default) this will return a null pointer
|
151
|
+
* if there is no valid XiphComment. If \a create is true it will create
|
152
|
+
* a XiphComment if one does not exist.
|
153
|
+
*
|
154
|
+
* \note The Tag <b>is still</b> owned by the FLAC::File and should not be
|
155
|
+
* deleted by the user. It will be deleted when the file (object) is
|
156
|
+
* destroyed.
|
157
|
+
*/
|
158
|
+
Ogg::XiphComment *xiphComment(bool create = false);
|
159
|
+
|
160
|
+
/*!
|
161
|
+
* Set the ID3v2::FrameFactory to something other than the default. This
|
162
|
+
* can be used to specify the way that ID3v2 frames will be interpreted
|
163
|
+
* when
|
164
|
+
*
|
165
|
+
* \see ID3v2FrameFactory
|
166
|
+
*/
|
167
|
+
void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
|
168
|
+
|
169
|
+
/*!
|
170
|
+
* Returns the block of data used by FLAC::Properties for parsing the
|
171
|
+
* stream properties.
|
172
|
+
*
|
173
|
+
* \deprecated This method will not be public in a future release.
|
174
|
+
*/
|
175
|
+
ByteVector streamInfoData(); // BIC: remove
|
176
|
+
|
177
|
+
/*!
|
178
|
+
* Returns the length of the audio-stream, used by FLAC::Properties for
|
179
|
+
* calculating the bitrate.
|
180
|
+
*
|
181
|
+
* \deprecated This method will not be public in a future release.
|
182
|
+
*/
|
183
|
+
long streamLength(); // BIC: remove
|
184
|
+
|
185
|
+
private:
|
186
|
+
File(const File &);
|
187
|
+
File &operator=(const File &);
|
188
|
+
|
189
|
+
void read(bool readProperties, Properties::ReadStyle propertiesStyle);
|
190
|
+
void scan();
|
191
|
+
long findID3v2();
|
192
|
+
long findID3v1();
|
193
|
+
ByteVector xiphCommentData() const;
|
194
|
+
|
195
|
+
class FilePrivate;
|
196
|
+
FilePrivate *d;
|
197
|
+
};
|
198
|
+
}
|
199
|
+
}
|
200
|
+
|
201
|
+
#endif
|