flacfile.h
Go to the documentation of this file.
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., 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_FLACFILE_H
27 #define TAGLIB_FLACFILE_H
28 
29 #include "taglib_export.h"
30 #include "tfile.h"
31 #include "tlist.h"
32 #include "tag.h"
33 
34 #include "flacpicture.h"
35 #include "flacproperties.h"
36 
37 namespace TagLib {
38 
39  class Tag;
40  namespace ID3v2 { class FrameFactory; class Tag; }
41  namespace ID3v1 { class Tag; }
42  namespace Ogg { class XiphComment; }
43 
45 
55  namespace FLAC {
56 
58 
67  {
68  public:
78  File(FileName file, bool readProperties = true,
79  Properties::ReadStyle propertiesStyle = Properties::Average);
80 
90  // BIC: merge with the above constructor
91  File(FileName file, ID3v2::FrameFactory *frameFactory,
92  bool readProperties = true,
93  Properties::ReadStyle propertiesStyle = Properties::Average);
94 
107  // BIC: merge with the above constructor
108  File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
109  bool readProperties = true,
110  Properties::ReadStyle propertiesStyle = Properties::Average);
111 
115  virtual ~File();
116 
125  virtual TagLib::Tag *tag() const;
126 
133  PropertyMap properties() const;
134 
135  void removeUnsupportedProperties(const StringList &);
136 
144  PropertyMap setProperties(const PropertyMap &);
145 
150  virtual Properties *audioProperties() const;
151 
162  virtual bool save();
163 
181  ID3v2::Tag *ID3v2Tag(bool create = false);
182 
200  ID3v1::Tag *ID3v1Tag(bool create = false);
201 
219  Ogg::XiphComment *xiphComment(bool create = false);
220 
229  void setID3v2FrameFactory(const ID3v2::FrameFactory *factory);
230 
237  ByteVector streamInfoData(); // BIC: remove
238 
245  long streamLength(); // BIC: remove
246 
250  List<Picture *> pictureList();
251 
256  void removePicture(Picture *picture, bool del = true);
257 
261  void removePictures();
262 
269  void addPicture(Picture *picture);
270 
276  bool hasXiphComment() const;
277 
283  bool hasID3v1Tag() const;
284 
290  bool hasID3v2Tag() const;
291 
292  private:
293  File(const File &);
294  File &operator=(const File &);
295 
296  void read(bool readProperties);
297  void scan();
298  long findID3v2();
299  long findID3v1();
300 
301  class FilePrivate;
302  FilePrivate *d;
303  };
304  }
305 }
306 
307 #endif
A generic, implicitly shared list.
Definition: tlist.h:53
An implementation of TagLib::File with FLAC specific methods.
Definition: flacfile.h:66
A map for format-independent tag representations.
Definition: tpropertymap.h:104
An abstract class that provides operations on a sequence of bytes.
Definition: tiostream.h:62
Definition: tag.h:46
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:57
The main class in the ID3v1 implementation.
Definition: id3v1tag.h:105
A byte vector.
Definition: tbytevector.h:45
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:65
A list of strings.
Definition: tstringlist.h:45
An implementation of audio property reading for FLAC.
Definition: flacproperties.h:45
ReadStyle
Definition: audioproperties.h:53
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
Definition: flacpicture.h:39
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:135
const char * FileName
Definition: tiostream.h:57
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
Ogg Vorbis comment implementation.
Definition: xiphcomment.h:64