dsdifffile.h
Go to the documentation of this file.
/***************************************************************************
copyright : (C) 2016 by Damien Plisson, Audirvana
email : damien78@audirvana.com
***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 2.1 as published by the Free Software Foundation. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#ifndef TAGLIB_DSDIFFFILE_H
#define TAGLIB_DSDIFFFILE_H
#include "tfile.h"
#include "id3v2tag.h"
#include "dsdiffproperties.h"
#include "dsdiffdiintag.h"
namespace TagLib {
namespace DSDIFF {
class TAGLIB_EXPORT File : public TagLib::File
{
public:
enum TagTypes {
NoTags = 0x0000,
DIIN = 0x0001,
ID3v2 = 0x0002,
AllTags = 0xffff
};
File(FileName file, bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average,
ID3v2::FrameFactory *frameFactory = nullptr);
File(IOStream *stream, bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average,
ID3v2::FrameFactory *frameFactory = nullptr);
~File() override;
Tag *tag() const override;
ID3v2::Tag *ID3v2Tag(bool create = false) const;
DSDIFF::DIIN::Tag *DIINTag(bool create = false) const;
PropertyMap properties() const override;
void removeUnsupportedProperties(const StringList &properties) override;
PropertyMap setProperties(const PropertyMap &) override;
Properties *audioProperties() const override;
bool save() override;
bool save(int tags, StripTags strip = StripOthers, ID3v2::Version version = ID3v2::v4);
void strip(int tags = AllTags);
bool hasID3v2Tag() const;
bool hasDIINTag() const;
static bool isSupported(IOStream *stream);
protected:
enum Endianness { BigEndian, LittleEndian };
private:
void removeRootChunk(const ByteVector &id);
void removeRootChunk(unsigned int i);
void removeChildChunk(const ByteVector &id, unsigned int childChunkNum);
void removeChildChunk(unsigned int i, unsigned int childChunkNum);
void setRootChunkData(unsigned int i, const ByteVector &data);
void setRootChunkData(const ByteVector &name, const ByteVector &data);
void setChildChunkData(unsigned int i, const ByteVector &data,
unsigned int childChunkNum);
void setChildChunkData(const ByteVector &name, const ByteVector &data,
unsigned int childChunkNum);
void updateRootChunksStructure(unsigned int startingChunk);
void read(bool readProperties, Properties::ReadStyle propertiesStyle);
void writeChunk(const ByteVector &name, const ByteVector &data,
unsigned long long offset, unsigned long replace = 0,
unsigned int leadingPadding = 0);
class FilePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<FilePrivate> d;
};
} // namespace DSDIFF
} // namespace TagLib
#endif
TagLib::AudioProperties::ReadStyle
ReadStyle
Definition audioproperties.h:56
TagLib::AudioProperties::Average
@ Average
Read more of the file and make better values guesses.
Definition audioproperties.h:60
TagLib::ByteVector
A byte vector.
Definition tbytevector.h:46
TagLib::DSDIFF::DIIN::Tag
Definition dsdiffdiintag.h:43
TagLib::DSDIFF::File::~File
~File() override
TagLib::DSDIFF::File::strip
void strip(int tags=AllTags)
TagLib::DSDIFF::File::save
bool save(int tags, StripTags strip=StripOthers, ID3v2::Version version=ID3v2::v4)
TagLib::DSDIFF::File::audioProperties
Properties * audioProperties() const override
TagLib::DSDIFF::File::File
File(FileName file, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average, ID3v2::FrameFactory *frameFactory=nullptr)
TagLib::DSDIFF::File::isSupported
static bool isSupported(IOStream *stream)
TagLib::DSDIFF::File::tag
Tag * tag() const override
TagLib::DSDIFF::File::save
bool save() override
TagLib::DSDIFF::File::removeUnsupportedProperties
void removeUnsupportedProperties(const StringList &properties) override
TagLib::DSDIFF::File::File
File(IOStream *stream, bool readProperties=true, Properties::ReadStyle propertiesStyle=Properties::Average, ID3v2::FrameFactory *frameFactory=nullptr)
TagLib::DSDIFF::File::ID3v2Tag
ID3v2::Tag * ID3v2Tag(bool create=false) const
TagLib::DSDIFF::File::properties
PropertyMap properties() const override
TagLib::DSDIFF::File::TagTypes
TagTypes
Definition dsdifffile.h:70
TagLib::DSDIFF::File::AllTags
@ AllTags
Matches all tag types.
Definition dsdifffile.h:78
TagLib::DSDIFF::File::ID3v2
@ ID3v2
Matches ID3v2 tags.
Definition dsdifffile.h:76
TagLib::DSDIFF::File::NoTags
@ NoTags
Empty set. Matches no tag types.
Definition dsdifffile.h:72
TagLib::DSDIFF::File::DIIN
@ DIIN
Matches DIIN tags.
Definition dsdifffile.h:74
TagLib::DSDIFF::File::hasDIINTag
bool hasDIINTag() const
TagLib::DSDIFF::File::setProperties
PropertyMap setProperties(const PropertyMap &) override
TagLib::DSDIFF::File::Endianness
Endianness
Definition dsdifffile.h:229
TagLib::DSDIFF::File::BigEndian
@ BigEndian
Definition dsdifffile.h:229
TagLib::DSDIFF::File::LittleEndian
@ LittleEndian
Definition dsdifffile.h:229
TagLib::DSDIFF::File::DIINTag
DSDIFF::DIIN::Tag * DIINTag(bool create=false) const
TagLib::DSDIFF::File::hasID3v2Tag
bool hasID3v2Tag() const
TagLib::DSDIFF::Properties
An implementation of audio property reading for DSDIFF.
Definition dsdiffproperties.h:45
TagLib::File
A file class with some useful methods for tag manipulation.
Definition tfile.h:51
TagLib::File::StripTags
StripTags
Definition tfile.h:68
TagLib::File::StripOthers
@ StripOthers
Strip all tags not explicitly referenced in method call.
Definition tfile.h:70
TagLib::ID3v2::FrameFactory
A factory for creating ID3v2 frames during parsing.
Definition id3v2framefactory.h:68
TagLib::ID3v2::Tag
The main class in the ID3v2 implementation.
Definition id3v2tag.h:134
TagLib::IOStream
An abstract class that provides operations on a sequence of bytes.
Definition tiostream.h:65
TagLib::PropertyMap
A map for format-independent <key,values> tag representations.
Definition tpropertymap.h:123
TagLib::StringList
A list of strings.
Definition tstringlist.h:44
TagLib::Tag
A simple, generic interface to common audio metadata fields.
Definition tag.h:49
dsdiffdiintag.h
dsdiffproperties.h
id3v2tag.h
TagLib::DSDIFF
An implementation of DSDIFF metadata.
Definition dsdiffdiintag.h:33
TagLib::ID3v2::Version
Version
Definition id3v2.h:27
TagLib::ID3v2::v4
@ v4
ID3v2.4.
Definition id3v2.h:29
TagLib
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
TagLib::FileName
const char * FileName
Definition tiostream.h:59
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition taglib_export.h:40
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition taglib_export.h:55
tfile.h