mpegfile.h
Go to the documentation of this file.
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., 51 Franklin Street, Fifth Floor, Boston, MA *
19 * 02110-1301 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_MPEGFILE_H
27#define TAGLIB_MPEGFILE_H
28
29#include "taglib_export.h"
30#include "tfile.h"
31#include "tag.h"
32
33#include "mpegproperties.h"
34
35namespace TagLib {
36
37 namespace ID3v2 { class Tag; class FrameFactory; }
38 namespace ID3v1 { class Tag; }
39 namespace APE { class Tag; }
40
42
43 namespace MPEG {
44
46
54 {
55 public:
60 enum TagTypes {
62 NoTags = 0x0000,
64 ID3v1 = 0x0001,
66 ID3v2 = 0x0002,
68 APE = 0x0004,
70 AllTags = 0xffff
71 };
72
82 File(FileName file, bool readProperties = true,
84
94 // BIC: merge with the above constructor
95 File(FileName file, ID3v2::FrameFactory *frameFactory,
96 bool readProperties = true,
98
111 File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
112 bool readProperties = true,
114
118 virtual ~File();
119
137 virtual Tag *tag() const;
138
146
148
158
163 virtual Properties *audioProperties() const;
164
180 virtual bool save();
181
191 bool save(int tags);
192
202 // BIC: combine with the above method
203 bool save(int tags, bool stripOthers);
204
217 // BIC: combine with the above method
218 bool save(int tags, bool stripOthers, int id3v2Version);
219
235 // BIC: combine with the above method
236 bool save(int tags, bool stripOthers, int id3v2Version, bool duplicateTags);
237
255 ID3v2::Tag *ID3v2Tag(bool create = false);
256
274 ID3v1::Tag *ID3v1Tag(bool create = false);
275
293 APE::Tag *APETag(bool create = false);
294
307 bool strip(int tags = AllTags);
308
319 // BIC: merge with the method above
320 bool strip(int tags, bool freeMemory);
321
329
334
339 long nextFrameOffset(long position);
340
345 long previousFrameOffset(long position);
346
351
357 bool hasID3v1Tag() const;
358
364 bool hasID3v2Tag() const;
365
371 bool hasAPETag() const;
372
373 private:
374 File(const File &);
375 File &operator=(const File &);
376
377 void read(bool readProperties);
378 long findID3v2();
379
380 class FilePrivate;
381 FilePrivate *d;
382 };
383 }
384}
385
386#endif
An APE tag implementation.
Definition: apetag.h:58
ReadStyle
Definition: audioproperties.h:53
@ Average
Read more of the file and make better values guesses.
Definition: audioproperties.h:57
A file class with some useful methods for tag manipulation.
Definition: tfile.h:51
The main class in the ID3v1 implementation.
Definition: id3v1tag.h:106
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:66
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:136
An abstract class that provides operations on a sequence of bytes.
Definition: tiostream.h:63
An MPEG file class with some useful methods specific to MPEG.
Definition: mpegfile.h:54
APE::Tag * APETag(bool create=false)
bool strip(int tags, bool freeMemory)
bool hasID3v2Tag() const
TagTypes
Definition: mpegfile.h:60
bool save(int tags, bool stripOthers)
PropertyMap properties() const
bool hasID3v1Tag() const
bool save(int tags, bool stripOthers, int id3v2Version)
ID3v1::Tag * ID3v1Tag(bool create=false)
PropertyMap setProperties(const PropertyMap &)
virtual Tag * tag() const
bool save(int tags, bool stripOthers, int id3v2Version, bool duplicateTags)
ID3v2::Tag * ID3v2Tag(bool create=false)
File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average)
File(FileName file, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average)
void setID3v2FrameFactory(const ID3v2::FrameFactory *factory)
virtual Properties * audioProperties() const
void removeUnsupportedProperties(const StringList &properties)
bool save(int tags)
File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average)
long previousFrameOffset(long position)
bool strip(int tags=AllTags)
bool hasAPETag() const
virtual bool save()
long nextFrameOffset(long position)
An implementation of audio property reading for MP3.
Definition: mpegproperties.h:49
A map for format-independent <key,valuelist> tag representations.
Definition: tpropertymap.h:109
A list of strings.
Definition: tstringlist.h:46
Definition: tag.h:47
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
const char * FileName
Definition: tiostream.h:57
#define TAGLIB_EXPORT
Definition: taglib_export.h:40