1 /***************************************************************************
2 copyright : (C) 2004 by Allan Sandfeld Jensen
3 email : kde@carewolf.org
4 ***************************************************************************/
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. *
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. *
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
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 ***************************************************************************/
26 #ifndef TAGLIB_OGGFLACFILE_H
27 #define TAGLIB_OGGFLACFILE_H
29 #include "taglib_export.h"
31 #include "xiphcomment.h"
33 #include "flacproperties.h"
41 //! An implementation of Ogg FLAC metadata
44 * This is implementation of FLAC metadata for Ogg FLAC files. For "pure"
45 * FLAC files look under the FLAC hiearchy.
47 * Unlike "pure" FLAC-files, Ogg FLAC only supports Xiph-comments,
48 * while the audio-properties are the same.
52 using TagLib::FLAC::Properties;
54 //! An implementation of TagLib::File with Ogg/FLAC specific methods
57 * This implements and provides an interface for Ogg/FLAC files to the
58 * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
59 * the abstract TagLib::File API as well as providing some additional
60 * information specific to Ogg FLAC files.
63 class TAGLIB_EXPORT File : public Ogg::File
67 * Contructs an Ogg/FLAC file from \a file. If \a readProperties is true
68 * the file's audio properties will also be read using \a propertiesStyle.
69 * If false, \a propertiesStyle is ignored.
71 File(FileName file, bool readProperties = true,
72 Properties::ReadStyle propertiesStyle = Properties::Average);
75 * Destroys this instance of the File.
80 * Returns the Tag for this file. This will always be a XiphComment.
82 virtual XiphComment *tag() const;
85 * Returns the FLAC::Properties for this file. If no audio properties
86 * were read then this will return a null pointer.
88 virtual Properties *audioProperties() const;
91 * Save the file. This will primarily save and update the XiphComment.
92 * Returns true if the save is successful.
97 * Returns the length of the audio-stream, used by FLAC::Properties for
98 * calculating the bitrate.
104 File &operator=(const File &);
106 void read(bool readProperties, Properties::ReadStyle propertiesStyle);
108 ByteVector streamInfoData();
109 ByteVector xiphCommentData();
116 } // namespace TagLib