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 "tfile.h"
34 #include "trueaudioproperties.h"
35 
36 namespace TagLib {
37 
38  class Tag;
39 
40  namespace ID3v2 { class Tag; class FrameFactory; }
41  namespace ID3v1 { class Tag; }
42 
44 
52  namespace TrueAudio {
53 
55 
64  {
65  public:
70  enum TagTypes {
72  NoTags = 0x0000,
74  ID3v1 = 0x0001,
76  ID3v2 = 0x0002,
78  AllTags = 0xffff
79  };
80 
86  File(FileName file, bool readProperties = true,
87  Properties::ReadStyle propertiesStyle = Properties::Average);
88 
95  File(FileName file, ID3v2::FrameFactory *frameFactory,
96  bool readProperties = true,
97  Properties::ReadStyle propertiesStyle = Properties::Average);
98 
107  File(IOStream *stream, bool readProperties = true,
108  Properties::ReadStyle propertiesStyle = Properties::Average);
109 
119  File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
120  bool readProperties = true,
121  Properties::ReadStyle propertiesStyle = Properties::Average);
122 
126  virtual ~File();
127 
131  virtual TagLib::Tag *tag() const;
132 
138  PropertyMap properties() const;
139 
145  PropertyMap setProperties(const PropertyMap &);
146 
147  void removeUnsupportedProperties(const StringList &properties);
148 
153  virtual Properties *audioProperties() const;
154 
160  void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
161 
165  virtual bool save();
166 
179  ID3v1::Tag *ID3v1Tag(bool create = false);
180 
193  ID3v2::Tag *ID3v2Tag(bool create = false);
194 
203  void strip(int tags = AllTags);
204 
205  private:
206  File(const File &);
207  File &operator=(const File &);
208 
209  void read(bool readProperties, Properties::ReadStyle propertiesStyle);
210  void scan();
211  long findID3v1();
212  long findID3v2();
213 
214  class FilePrivate;
215  FilePrivate *d;
216  };
217  }
218 }
219 
220 #endif