1 /***************************************************************************
2 copyright : (C) 2006 by Lukáš Lalinský
3 email : lalinsky@gmail.com
5 copyright : (C) 2004 by Allan Sandfeld Jensen
6 email : kde@carewolf.org
7 (original MPC implementation)
8 ***************************************************************************/
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. *
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. *
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
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 ***************************************************************************/
30 #ifndef TAGLIB_WVFILE_H
31 #define TAGLIB_WVFILE_H
34 #include "taglib_export.h"
35 #include "wavpackproperties.h"
41 namespace ID3v1 { class Tag; }
42 namespace APE { class Tag; }
44 //! An implementation of WavPack metadata
47 * This is implementation of WavPack metadata.
49 * This supports ID3v1 and APE (v1 and v2) style comments as well as reading stream
50 * properties from the file.
55 //! An implementation of TagLib::File with WavPack specific methods
58 * This implements and provides an interface for WavPack files to the
59 * TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
60 * the abstract TagLib::File API as well as providing some additional
61 * information specific to WavPack files.
64 class TAGLIB_EXPORT File : public TagLib::File
68 * This set of flags is used for various operations and is suitable for
69 * being OR-ed together.
72 //! Empty set. Matches no tag types.
74 //! Matches ID3v1 tags.
78 //! Matches all tag types.
83 * Contructs an WavPack file from \a file. If \a readProperties is true the
84 * file's audio properties will also be read using \a propertiesStyle. If
85 * false, \a propertiesStyle is ignored.
87 File(FileName file, bool readProperties = true,
88 Properties::ReadStyle propertiesStyle = Properties::Average);
91 * Destroys this instance of the File.
96 * Returns the Tag for this file. This will be an APE tag, an ID3v1 tag
97 * or a combination of the two.
99 virtual TagLib::Tag *tag() const;
102 * Returns the MPC::Properties for this file. If no audio properties
103 * were read then this will return a null pointer.
105 virtual Properties *audioProperties() const;
113 * Returns a pointer to the ID3v1 tag of the file.
115 * If \a create is false (the default) this will return a null pointer
116 * if there is no valid ID3v1 tag. If \a create is true it will create
117 * an ID3v1 tag if one does not exist. If there is already an APE tag, the
118 * new ID3v1 tag will be placed after it.
120 * \note The Tag <b>is still</b> owned by the APE::File and should not be
121 * deleted by the user. It will be deleted when the file (object) is
124 ID3v1::Tag *ID3v1Tag(bool create = false);
127 * Returns a pointer to the APE tag of the file.
129 * If \a create is false (the default) this will return a null pointer
130 * if there is no valid APE tag. If \a create is true it will create
131 * a APE tag if one does not exist.
133 * \note The Tag <b>is still</b> owned by the APE::File and should not be
134 * deleted by the user. It will be deleted when the file (object) is
137 APE::Tag *APETag(bool create = false);
140 * This will remove the tags that match the OR-ed together TagTypes from the
141 * file. By default it removes all tags.
143 * \note This will also invalidate pointers to the tags
144 * as their memory will be freed.
145 * \note In order to make the removal permanent save() still needs to be called
147 void strip(int tags = AllTags);
151 File &operator=(const File &);
153 void read(bool readProperties, Properties::ReadStyle propertiesStyle);