TagLib  2.0.2
trueaudiofile.h
Go to the documentation of this file.
1 /***************************************************************************
2  copyright : (C) 2006 by Lukáš Lalinský
3  email : lalinsky@gmail.com
4 
5  copyright : (C) 2004 by Allan Sandfeld Jensen
6  email : kde@carewolf.org
7  (original MPC implementation)
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * This library is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU Lesser General Public License version *
13  * 2.1 as published by the Free Software Foundation. *
14  * *
15  * This library is distributed in the hope that it will be useful, but *
16  * WITHOUT ANY WARRANTY; without even the implied warranty of *
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
18  * Lesser General Public License for more details. *
19  * *
20  * You should have received a copy of the GNU Lesser General Public *
21  * License along with this library; if not, write to the Free Software *
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
23  * 02110-1301 USA *
24  * *
25  * Alternatively, this file is available under the Mozilla Public *
26  * License Version 1.1. You may obtain a copy of the License at *
27  * http://www.mozilla.org/MPL/ *
28  ***************************************************************************/
29 
30 #ifndef TAGLIB_TRUEAUDIOFILE_H
31 #define TAGLIB_TRUEAUDIOFILE_H
32 
33 #include "taglib.h"
34 #include "tfile.h"
35 #include "trueaudioproperties.h"
36 
37 namespace TagLib {
38 
39  class Tag;
40 
41  namespace ID3v2 { class Tag; class FrameFactory; }
42  namespace ID3v1 { class Tag; }
43 
45 
53  namespace TrueAudio {
54 
56 
65  {
66  public:
71  enum TagTypes {
73  NoTags = 0x0000,
75  ID3v1 = 0x0001,
77  ID3v2 = 0x0002,
79  AllTags = 0xffff
80  };
81 
91  File(FileName file, bool readProperties = true,
93  ID3v2::FrameFactory *frameFactory = nullptr);
94 
107  File(FileName file, ID3v2::FrameFactory *frameFactory,
108  bool readProperties = true,
109  Properties::ReadStyle propertiesStyle = Properties::Average);
110 
123  File(IOStream *stream, bool readProperties = true,
124  Properties::ReadStyle propertiesStyle = Properties::Average,
125  ID3v2::FrameFactory *frameFactory = nullptr);
126 
142  File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
143  bool readProperties = true,
144  Properties::ReadStyle propertiesStyle = Properties::Average);
145 
149  ~File() override;
150 
151  File(const File &) = delete;
152  File &operator=(const File &) = delete;
153 
157  TagLib::Tag *tag() const override;
158 
164  PropertyMap properties() const override;
165 
171  PropertyMap setProperties(const PropertyMap &) override;
172 
173  void removeUnsupportedProperties(const StringList &unsupported) override;
174 
179  Properties *audioProperties() const override;
180 
184  bool save() override;
185 
203  ID3v1::Tag *ID3v1Tag(bool create = false);
204 
222  ID3v2::Tag *ID3v2Tag(bool create = false);
223 
232  void strip(int tags = AllTags);
233 
239  bool hasID3v1Tag() const;
240 
246  bool hasID3v2Tag() const;
247 
255  static bool isSupported(IOStream *stream);
256 
257  private:
258  void read(bool readProperties);
259 
260  class FilePrivate;
262  std::unique_ptr<FilePrivate> d;
263  };
264  } // namespace TrueAudio
265 } // namespace TagLib
266 
267 #endif
An implementation of TagLib::File with TrueAudio specific methods.
Definition: trueaudiofile.h:64
A map for format-independent <key,values> tag representations.
Definition: tpropertymap.h:122
An abstract class that provides operations on a sequence of bytes.
Definition: tiostream.h:64
A simple, generic interface to common audio metadata fields.
Definition: tag.h:48
TagTypes
Definition: trueaudiofile.h:71
A file class with some useful methods for tag manipulation.
Definition: tfile.h:50
Read more of the file and make better values guesses.
Definition: audioproperties.h:60
The main class in the ID3v1 implementation.
Definition: id3v1tag.h:114
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:67
const char * FileName
Definition: tiostream.h:59
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55
#define TAGLIB_DEPRECATED
Definition: taglib.h:39
An implementation of audio property reading for TrueAudio.
Definition: trueaudioproperties.h:49
A list of strings.
Definition: tstringlist.h:43
ReadStyle
Definition: audioproperties.h:56
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:133
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41