TagLib API Documentation
dsdifffile.h
Go to the documentation of this file.
1/***************************************************************************
2 copyright : (C) 2016 by Damien Plisson, Audirvana
3 email : damien78@audirvana.com
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_DSDIFFFILE_H
27#define TAGLIB_DSDIFFFILE_H
28
29#include "rifffile.h"
30#include "id3v2tag.h"
31#include "dsdiffproperties.h"
32#include "dsdiffdiintag.h"
33
34namespace TagLib {
35
37
51 namespace DSDIFF {
52
54
63 {
64 public:
65
70 enum TagTypes {
72 NoTags = 0x0000,
74 DIIN = 0x0001,
76 ID3v2 = 0x0002,
78 AllTags = 0xffff
79 };
80
90 File(FileName file, bool readProperties = true,
92 ID3v2::FrameFactory *frameFactory = nullptr);
93
106 File(IOStream *stream, bool readProperties = true,
108 ID3v2::FrameFactory *frameFactory = nullptr);
109
113 ~File() override;
114
131 Tag *tag() const override;
132
142 ID3v2::Tag *ID3v2Tag(bool create = false) const;
143
148 DSDIFF::DIIN::Tag *DIINTag(bool create = false) const;
149
154 PropertyMap properties() const override;
155
156 void removeUnsupportedProperties(const StringList &properties) override;
157
163
168 Properties *audioProperties() const override;
169
185 bool save() override;
186
193 bool save(int tags, StripTags strip = StripOthers, ID3v2::Version version = ID3v2::v4);
194
202 void strip(int tags = AllTags);
203
209 bool hasID3v2Tag() const;
210
217 bool hasDIINTag() const;
218
226 static bool isSupported(IOStream *stream);
227
228 protected:
229 enum Endianness { BigEndian, LittleEndian };
230
231 private:
232 void removeRootChunk(const ByteVector &id);
233 void removeRootChunk(unsigned int i);
234 void removeChildChunk(const ByteVector &id, unsigned int childChunkNum);
235 void removeChildChunk(unsigned int i, unsigned int childChunkNum);
236
242 void setRootChunkData(unsigned int i, const ByteVector &data);
243
252 void setRootChunkData(const ByteVector &name, const ByteVector &data);
253
261 void setChildChunkData(unsigned int i, const ByteVector &data,
262 unsigned int childChunkNum);
263
273 void setChildChunkData(const ByteVector &name, const ByteVector &data,
274 unsigned int childChunkNum);
275
276 void updateRootChunksStructure(unsigned int startingChunk);
277
278 void read(bool readProperties, Properties::ReadStyle propertiesStyle);
279 void writeChunk(const ByteVector &name, const ByteVector &data,
280 unsigned long long offset, unsigned long replace = 0,
281 unsigned int leadingPadding = 0);
282
283 class FilePrivate;
285 std::unique_ptr<FilePrivate> d;
286 };
287 } // namespace DSDIFF
288} // namespace TagLib
289
290#endif
ReadStyle
Definition: audioproperties.h:56
@ Average
Read more of the file and make better values guesses.
Definition: audioproperties.h:60
A byte vector.
Definition: tbytevector.h:46
Definition: dsdiffdiintag.h:43
An implementation of TagLib::File with DSDIFF specific methods.
Definition: dsdifffile.h:63
void strip(int tags=AllTags)
bool save(int tags, StripTags strip=StripOthers, ID3v2::Version version=ID3v2::v4)
Properties * audioProperties() const override
File(FileName file, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average, ID3v2::FrameFactory *frameFactory=nullptr)
static bool isSupported(IOStream *stream)
Tag * tag() const override
bool save() override
void removeUnsupportedProperties(const StringList &properties) override
File(IOStream *stream, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average, ID3v2::FrameFactory *frameFactory=nullptr)
ID3v2::Tag * ID3v2Tag(bool create=false) const
PropertyMap properties() const override
TagTypes
Definition: dsdifffile.h:70
bool hasDIINTag() const
PropertyMap setProperties(const PropertyMap &) override
Endianness
Definition: dsdifffile.h:229
@ BigEndian
Definition: dsdifffile.h:229
DSDIFF::DIIN::Tag * DIINTag(bool create=false) const
bool hasID3v2Tag() const
An implementation of audio property reading for DSDIFF.
Definition: dsdiffproperties.h:45
A file class with some useful methods for tag manipulation.
Definition: tfile.h:51
StripTags
Definition: tfile.h:68
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:68
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:134
An abstract class that provides operations on a sequence of bytes.
Definition: tiostream.h:65
A map for format-independent <key,values> tag representations.
Definition: tpropertymap.h:123
A list of strings.
Definition: tstringlist.h:44
A simple, generic interface to common audio metadata fields.
Definition: tag.h:49
Version
Definition: id3v2.h:27
@ v4
ID3v2.4.
Definition: id3v2.h:29
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
const char * FileName
Definition: tiostream.h:59
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55