Update taglib

This commit is contained in:
Jonas Kvinge
2019-09-20 18:07:13 +02:00
parent 2d4efd6cf0
commit e7b5e02657
58 changed files with 581 additions and 351 deletions

View File

@@ -117,6 +117,11 @@ RIFF::AIFF::Properties *RIFF::AIFF::File::audioProperties() const
}
bool RIFF::AIFF::File::save()
{
return save(ID3v2::v4);
}
bool RIFF::AIFF::File::save(ID3v2::Version version)
{
if(readOnly()) {
debug("RIFF::AIFF::File::save() -- File is read only.");
@@ -135,7 +140,7 @@ bool RIFF::AIFF::File::save()
}
if(tag() && !tag()->isEmpty()) {
setChunkData("ID3 ", d->tag->render());
setChunkData("ID3 ", d->tag->render(version));
d->hasID3v2 = true;
}

View File

@@ -46,12 +46,12 @@ namespace TagLib {
namespace AIFF {
//! An implementation of Strawberry_TagLib::TagLib::File with AIFF specific methods
//! An implementation of TagLib::File with AIFF specific methods
/*!
* This implements and provides an interface for AIFF files to the
* Strawberry_TagLib::TagLib::Tag and Strawberry_TagLib::TagLib::AudioProperties interfaces by way of implementing
* the abstract Strawberry_TagLib::TagLib::File API as well as providing some additional
* TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
* the abstract TagLib::File API as well as providing some additional
* information specific to AIFF files.
*/
@@ -120,6 +120,11 @@ namespace TagLib {
*/
virtual bool save();
/*!
* Save using a specific ID3v2 version (e.g. v3)
*/
bool save(ID3v2::Version version);
/*!
* Returns whether or not the file on disk actually has an ID3v2 tag.
*

View File

@@ -53,7 +53,7 @@ namespace TagLib {
*
* \deprecated
*/
Properties(const ByteVector &data, ReadStyle style);
TAGLIB_DEPRECATED Properties(const ByteVector &data, ReadStyle style);
/*!
* Create an instance of AIFF::Properties with the data read from the
@@ -74,7 +74,7 @@ namespace TagLib {
*
* \deprecated
*/
virtual int length() const;
TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
@@ -120,7 +120,7 @@ namespace TagLib {
*
* \deprecated
*/
int sampleWidth() const;
TAGLIB_DEPRECATED int sampleWidth() const;
/*!
* Returns the number of sample frames

View File

@@ -32,14 +32,14 @@
namespace Strawberry_TagLib {
namespace TagLib {
//! An implementation of Strawberry_TagLib::TagLib::File with RIFF specific methods
//! An implementation of TagLib::File with RIFF specific methods
namespace RIFF {
//! An RIFF file class with some useful methods specific to RIFF
/*!
* This implements the generic Strawberry_TagLib::TagLib::File API and additionally provides
* This implements the generic TagLib::File API and additionally provides
* access to properties that are distinct to RIFF files, notably access
* to the different ID3 tags.
*/

View File

@@ -151,6 +151,13 @@ bool RIFF::WAV::File::save()
}
bool RIFF::WAV::File::save(TagTypes tags, bool stripOthers, int id3v2Version)
{
return save(tags,
stripOthers ? StripOthers : StripNone,
id3v2Version == 3 ? ID3v2::v3 : ID3v2::v4);
}
bool RIFF::WAV::File::save(TagTypes tags, StripTags strip, ID3v2::Version version)
{
if(readOnly()) {
debug("RIFF::WAV::File::save() -- File is read only.");
@@ -162,14 +169,14 @@ bool RIFF::WAV::File::save(TagTypes tags, bool stripOthers, int id3v2Version)
return false;
}
if(stripOthers)
strip(static_cast<TagTypes>(AllTags & ~tags));
if(strip == StripOthers)
File::strip(static_cast<TagTypes>(AllTags & ~tags));
if(tags & ID3v2) {
removeTagChunks(ID3v2);
if(ID3v2Tag() && !ID3v2Tag()->isEmpty()) {
setChunkData("ID3 ", ID3v2Tag()->render(id3v2Version));
setChunkData("ID3 ", ID3v2Tag()->render(version));
d->hasID3v2 = true;
}
}

View File

@@ -47,12 +47,12 @@ namespace TagLib {
namespace WAV {
//! An implementation of Strawberry_TagLib::TagLib::File with WAV specific methods
//! An implementation of TagLib::File with WAV specific methods
/*!
* This implements and provides an interface for WAV files to the
* Strawberry_TagLib::TagLib::Tag and Strawberry_TagLib::TagLib::AudioProperties interfaces by way of implementing
* the abstract Strawberry_TagLib::TagLib::File API as well as providing some additional
* TagLib::Tag and TagLib::AudioProperties interfaces by way of implementing
* the abstract TagLib::File API as well as providing some additional
* information specific to WAV files.
*/
@@ -160,7 +160,19 @@ namespace TagLib {
*/
virtual bool save();
bool save(TagTypes tags, bool stripOthers = true, int id3v2Version = 4);
/*!
* \deprecated
*/
TAGLIB_DEPRECATED bool save(TagTypes tags, bool stripOthers, int id3v2Version = 4);
/*!
* Save the file. If \a strip is specified, it is possible to choose if
* tags not specified in \a tags should be stripped from the file or
* retained. With \a version, it is possible to specify whether ID3v2.4
* or ID3v2.3 should be used.
*/
bool save(TagTypes tags, StripTags strip = StripOthers,
ID3v2::Version version = ID3v2::v4);
/*!
* Returns whether or not the file on disk actually has an ID3v2 tag.

View File

@@ -56,7 +56,7 @@ namespace TagLib {
*
* \deprecated
*/
Properties(const ByteVector &data, ReadStyle style);
TAGLIB_DEPRECATED Properties(const ByteVector &data, ReadStyle style);
/*!
* Create an instance of WAV::Properties with the data read from the
@@ -64,7 +64,7 @@ namespace TagLib {
*
* \deprecated
*/
Properties(const ByteVector &data, unsigned int streamLength, ReadStyle style);
TAGLIB_DEPRECATED Properties(const ByteVector &data, unsigned int streamLength, ReadStyle style);
/*!
* Create an instance of WAV::Properties with the data read from the
@@ -85,7 +85,7 @@ namespace TagLib {
*
* \deprecated
*/
virtual int length() const;
TAGLIB_DEPRECATED virtual int length() const;
/*!
* Returns the length of the file in seconds. The length is rounded down to
@@ -131,7 +131,7 @@ namespace TagLib {
*
* \deprecated
*/
int sampleWidth() const;
TAGLIB_DEPRECATED int sampleWidth() const;
/*!
* Returns the number of sample frames.