| TagLib 1.13 |  |

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
35#include "id3v2.h"
36
37 namespace TagLib {
38
39 namespace ID3v2 { class Tag; class FrameFactory; }
40 namespace ID3v1 { class Tag; }
41 namespace APE { class Tag; }
42
44
45 namespace MPEG {
46
48
55 class TAGLIB_EXPORT File : public TagLib::File
56 {
57 public:
62 enum TagTypes {
64 NoTags = 0x0000,
66 ID3v1 = 0x0001,
68 ID3v2 = 0x0002,
70 APE = 0x0004,
72 AllTags = 0xffff
73 };
74
84 File(FileName file, bool readProperties = true,
85 Properties::ReadStyle propertiesStyle = Properties::Average);
86
96 // BIC: merge with the above constructor
97 File(FileName file, ID3v2::FrameFactory *frameFactory,
98 bool readProperties = true,
99 Properties::ReadStyle propertiesStyle = Properties::Average);
100
113 File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
114 bool readProperties = true,
115 Properties::ReadStyle propertiesStyle = Properties::Average);
116
120 virtual ~File();
121
139 virtual Tag *tag() const;
140
147 PropertyMap properties() const;
148
149 void removeUnsupportedProperties(const StringList &properties);
150
159 PropertyMap setProperties(const PropertyMap &);
160
165 virtual Properties *audioProperties() const;
166
182 virtual bool save();
183
193 bool save(int tags);
194
198 // BIC: combine with the above method
199 TAGLIB_DEPRECATED bool save(int tags, bool stripOthers);
200
204 // BIC: combine with the above method
205 TAGLIB_DEPRECATED bool save(int tags, bool stripOthers, int id3v2Version);
206
210 // BIC: combine with the above method
211 TAGLIB_DEPRECATED bool save(int tags, bool stripOthers, int id3v2Version, bool duplicateTags);
212
226 bool save(int tags, StripTags strip,
227 ID3v2::Version version = ID3v2::v4,
228 DuplicateTags duplicate = Duplicate);
229
247 ID3v2::Tag *ID3v2Tag(bool create = false);
248
266 ID3v1::Tag *ID3v1Tag(bool create = false);
267
285 APE::Tag *APETag(bool create = false);
286
299 bool strip(int tags = AllTags);
300
311 // BIC: merge with the method above
312 bool strip(int tags, bool freeMemory);
313
320 TAGLIB_DEPRECATED void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
321
325 long firstFrameOffset();
326
331 long nextFrameOffset(long position);
332
337 long previousFrameOffset(long position);
338
342 long lastFrameOffset();
343
349 bool hasID3v1Tag() const;
350
356 bool hasID3v2Tag() const;
357
363 bool hasAPETag() const;
364
372 static bool isSupported(IOStream *stream);
373
374 private:
375 File(const File &);
376 File &operator=(const File &);
377
378 void read(bool readProperties);
379 long findID3v2();
380
381 class FilePrivate;
382 FilePrivate *d;
383 };
384 }
385}
386
387#endif
TagLib::APE::Tag
An APE tag implementation.
Definition: apetag.h:58
TagLib::AudioProperties::ReadStyle
ReadStyle
Definition: audioproperties.h:53
TagLib::AudioProperties::Average
@ Average
Read more of the file and make better values guesses.
Definition: audioproperties.h:57
TagLib::File
A file class with some useful methods for tag manipulation.
Definition: tfile.h:51
TagLib::File::StripTags
StripTags
Definition: tfile.h:68
TagLib::File::DuplicateTags
DuplicateTags
Definition: tfile.h:77
TagLib::ID3v1::Tag
The main class in the ID3v1 implementation.
Definition: id3v1tag.h:106
TagLib::ID3v2::FrameFactory
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:66
TagLib::ID3v2::Tag
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:128
TagLib::IOStream
An abstract class that provides operations on a sequence of bytes.
Definition: tiostream.h:63
TagLib::MPEG::File
An MPEG file class with some useful methods specific to MPEG.
Definition: mpegfile.h:56
TagLib::MPEG::File::APETag
APE::Tag * APETag(bool create=false)
TagLib::MPEG::File::strip
bool strip(int tags, bool freeMemory)
TagLib::MPEG::File::lastFrameOffset
long lastFrameOffset()
TagLib::MPEG::File::hasID3v2Tag
bool hasID3v2Tag() const
TagLib::MPEG::File::TagTypes
TagTypes
Definition: mpegfile.h:62
TagLib::MPEG::File::properties
PropertyMap properties() const
TagLib::MPEG::File::save
TAGLIB_DEPRECATED bool save(int tags, bool stripOthers)
TagLib::MPEG::File::hasID3v1Tag
bool hasID3v1Tag() const
TagLib::MPEG::File::firstFrameOffset
long firstFrameOffset()
TagLib::MPEG::File::ID3v1Tag
ID3v1::Tag * ID3v1Tag(bool create=false)
TagLib::MPEG::File::setProperties
PropertyMap setProperties(const PropertyMap &)
TagLib::MPEG::File::tag
virtual Tag * tag() const
TagLib::MPEG::File::ID3v2Tag
ID3v2::Tag * ID3v2Tag(bool create=false)
TagLib::MPEG::File::save
TAGLIB_DEPRECATED bool save(int tags, bool stripOthers, int id3v2Version, bool duplicateTags)
TagLib::MPEG::File::isSupported
static bool isSupported(IOStream *stream)
TagLib::MPEG::File::setID3v2FrameFactory
TAGLIB_DEPRECATED void setID3v2FrameFactory(const ID3v2::FrameFactory *factory)
TagLib::MPEG::File::~File
virtual ~File()
TagLib::MPEG::File::save
bool save(int tags, StripTags strip, ID3v2::Version version=ID3v2::v4, DuplicateTags duplicate=Duplicate)
TagLib::MPEG::File::File
File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average)
TagLib::MPEG::File::File
File(FileName file, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average)
TagLib::MPEG::File::audioProperties
virtual Properties * audioProperties() const
TagLib::MPEG::File::removeUnsupportedProperties
void removeUnsupportedProperties(const StringList &properties)
TagLib::MPEG::File::save
bool save(int tags)
TagLib::MPEG::File::File
File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average)
TagLib::MPEG::File::save
TAGLIB_DEPRECATED bool save(int tags, bool stripOthers, int id3v2Version)
TagLib::MPEG::File::previousFrameOffset
long previousFrameOffset(long position)
TagLib::MPEG::File::strip
bool strip(int tags=AllTags)
TagLib::MPEG::File::hasAPETag
bool hasAPETag() const
TagLib::MPEG::File::save
virtual bool save()
TagLib::MPEG::File::nextFrameOffset
long nextFrameOffset(long position)
TagLib::MPEG::Properties
An implementation of audio property reading for MP3.
Definition: mpegproperties.h:49
TagLib::PropertyMap
A map for format-independent <key,valuelist> tag representations.
Definition: tpropertymap.h:119
TagLib::StringList
A list of strings.
Definition: tstringlist.h:46
TagLib::Tag
Definition: tag.h:47
id3v2.h
mpegproperties.h
TagLib::ID3v2::Version
Version
Definition: id3v2.h:17
TagLib::ID3v2::v4
@ v4
Definition: id3v2.h:19
TagLib
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
TagLib::FileName
const char * FileName
Definition: tiostream.h:57
tag.h
TAGLIB_DEPRECATED
#define TAGLIB_DEPRECATED
Definition: taglib.h:54
taglib_export.h
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
tfile.h