From 3a3dc02a66f58a28de2ca63794589a599b55abd7 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Mon, 22 Jun 2020 00:49:25 +0200 Subject: [PATCH] taglib: Rename Properties to AudioProperties --- 3rdparty/taglib/ape/apefile.cpp | 10 +-- 3rdparty/taglib/ape/apefile.h | 8 +- 3rdparty/taglib/ape/apeproperties.cpp | 40 ++++----- 3rdparty/taglib/ape/apeproperties.h | 18 ++-- 3rdparty/taglib/asf/asffile.cpp | 10 +-- 3rdparty/taglib/asf/asffile.h | 6 +- 3rdparty/taglib/asf/asfproperties.cpp | 56 ++++++------- 3rdparty/taglib/asf/asfproperties.h | 12 +-- 3rdparty/taglib/audioproperties.cpp | 63 +++++++------- 3rdparty/taglib/audioproperties.h | 5 -- 3rdparty/taglib/dsdiff/dsdifffile.cpp | 12 +-- 3rdparty/taglib/dsdiff/dsdifffile.h | 10 +-- 3rdparty/taglib/dsdiff/dsdiffproperties.cpp | 28 +++---- 3rdparty/taglib/dsdiff/dsdiffproperties.h | 19 ++--- 3rdparty/taglib/dsf/dsffile.cpp | 12 +-- 3rdparty/taglib/dsf/dsffile.h | 8 +- 3rdparty/taglib/dsf/dsfproperties.cpp | 38 ++++----- 3rdparty/taglib/dsf/dsfproperties.h | 15 ++-- 3rdparty/taglib/flac/flacfile.cpp | 10 +-- 3rdparty/taglib/flac/flacfile.h | 8 +- 3rdparty/taglib/flac/flacproperties.cpp | 28 +++---- 3rdparty/taglib/flac/flacproperties.h | 18 ++-- 3rdparty/taglib/it/itfile.cpp | 8 +- 3rdparty/taglib/it/itfile.h | 4 +- 3rdparty/taglib/it/itproperties.cpp | 82 +++++++++---------- 3rdparty/taglib/it/itproperties.h | 15 ++-- 3rdparty/taglib/mod/modfile.cpp | 4 +- 3rdparty/taglib/mod/modfile.h | 4 +- 3rdparty/taglib/mod/modproperties.cpp | 32 ++++---- 3rdparty/taglib/mod/modproperties.h | 15 ++-- 3rdparty/taglib/mp4/mp4file.cpp | 6 +- 3rdparty/taglib/mp4/mp4file.h | 6 +- 3rdparty/taglib/mp4/mp4properties.cpp | 30 +++---- 3rdparty/taglib/mp4/mp4properties.h | 10 +-- 3rdparty/taglib/mpc/mpcfile.cpp | 10 +-- 3rdparty/taglib/mpc/mpcfile.h | 8 +- 3rdparty/taglib/mpc/mpcproperties.cpp | 50 +++++------ 3rdparty/taglib/mpc/mpcproperties.h | 22 ++--- 3rdparty/taglib/mpeg/mpegfile.cpp | 10 +-- 3rdparty/taglib/mpeg/mpegfile.h | 8 +- 3rdparty/taglib/mpeg/mpegproperties.cpp | 45 +++++----- 3rdparty/taglib/mpeg/mpegproperties.h | 28 ++----- 3rdparty/taglib/ogg/flac/oggflacfile.cpp | 14 ++-- 3rdparty/taglib/ogg/flac/oggflacfile.h | 14 ++-- 3rdparty/taglib/ogg/opus/opusfile.cpp | 10 +-- 3rdparty/taglib/ogg/opus/opusfile.h | 8 +- 3rdparty/taglib/ogg/opus/opusproperties.cpp | 28 +++---- 3rdparty/taglib/ogg/opus/opusproperties.h | 18 ++-- 3rdparty/taglib/ogg/speex/speexfile.cpp | 10 +-- 3rdparty/taglib/ogg/speex/speexfile.h | 8 +- 3rdparty/taglib/ogg/speex/speexproperties.cpp | 30 +++---- 3rdparty/taglib/ogg/speex/speexproperties.h | 18 ++-- 3rdparty/taglib/ogg/vorbis/vorbisfile.cpp | 10 +-- 3rdparty/taglib/ogg/vorbis/vorbisfile.h | 8 +- .../taglib/ogg/vorbis/vorbisproperties.cpp | 36 ++++---- 3rdparty/taglib/ogg/vorbis/vorbisproperties.h | 16 ++-- 3rdparty/taglib/riff/aiff/aifffile.cpp | 10 +-- 3rdparty/taglib/riff/aiff/aifffile.h | 10 +-- 3rdparty/taglib/riff/aiff/aiffproperties.cpp | 38 ++++----- 3rdparty/taglib/riff/aiff/aiffproperties.h | 18 ++-- 3rdparty/taglib/riff/wav/wavfile.cpp | 10 +-- 3rdparty/taglib/riff/wav/wavfile.h | 10 +-- 3rdparty/taglib/riff/wav/wavproperties.cpp | 38 ++++----- 3rdparty/taglib/riff/wav/wavproperties.h | 18 ++-- 3rdparty/taglib/s3m/s3mfile.cpp | 4 +- 3rdparty/taglib/s3m/s3mfile.h | 4 +- 3rdparty/taglib/s3m/s3mproperties.cpp | 68 ++++++++------- 3rdparty/taglib/s3m/s3mproperties.h | 15 ++-- 3rdparty/taglib/trueaudio/trueaudiofile.cpp | 14 ++-- 3rdparty/taglib/trueaudio/trueaudiofile.h | 12 +-- .../taglib/trueaudio/trueaudioproperties.cpp | 32 ++++---- .../taglib/trueaudio/trueaudioproperties.h | 18 ++-- 3rdparty/taglib/wavpack/wavpackfile.cpp | 10 +-- 3rdparty/taglib/wavpack/wavpackfile.h | 8 +- 3rdparty/taglib/wavpack/wavpackproperties.cpp | 34 ++++---- 3rdparty/taglib/wavpack/wavpackproperties.h | 16 ++-- 3rdparty/taglib/xm/xmfile.cpp | 4 +- 3rdparty/taglib/xm/xmfile.h | 4 +- 3rdparty/taglib/xm/xmproperties.cpp | 60 +++++++------- 3rdparty/taglib/xm/xmproperties.h | 15 ++-- 80 files changed, 740 insertions(+), 789 deletions(-) diff --git a/3rdparty/taglib/ape/apefile.cpp b/3rdparty/taglib/ape/apefile.cpp index f074ae5bd..9ed21dfda 100644 --- a/3rdparty/taglib/ape/apefile.cpp +++ b/3rdparty/taglib/ape/apefile.cpp @@ -77,7 +77,7 @@ class APE::File::FilePrivate { TagUnion tag; - Properties *properties; + AudioProperties *properties; }; //////////////////////////////////////////////////////////////////////////////// @@ -98,14 +98,14 @@ bool APE::File::isSupported(IOStream *) { // public members //////////////////////////////////////////////////////////////////////////////// -APE::File::File(FileName file, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) { +APE::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) { if (isOpen()) read(readProperties); } -APE::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) { +APE::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) { if (isOpen()) read(readProperties); @@ -137,7 +137,7 @@ PropertyMap APE::File::setProperties(const PropertyMap &properties) { } -APE::Properties *APE::File::audioProperties() const { +APE::AudioProperties *APE::File::audioProperties() const { return d->properties; } @@ -300,7 +300,7 @@ void APE::File::read(bool readProperties) { seek(0); } - d->properties = new Properties(this, streamLength); + d->properties = new AudioProperties(this, streamLength); } } diff --git a/3rdparty/taglib/ape/apefile.h b/3rdparty/taglib/ape/apefile.h index 756ce57c8..12fe3b1b4 100644 --- a/3rdparty/taglib/ape/apefile.h +++ b/3rdparty/taglib/ape/apefile.h @@ -93,7 +93,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * \note In the current implementation, \a propertiesStyle is ignored. */ File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs an APE file from \a stream. @@ -104,7 +104,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * \note In the current implementation, \a propertiesStyle is ignored. */ File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -135,10 +135,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { PropertyMap setProperties(const PropertyMap &); /*! - * Returns the APE::Properties for this file. + * Returns the APE::AudioProperties for this file. * If no audio properties were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Saves the file. diff --git a/3rdparty/taglib/ape/apeproperties.cpp b/3rdparty/taglib/ape/apeproperties.cpp index 5270fb74e..98448cb66 100644 --- a/3rdparty/taglib/ape/apeproperties.cpp +++ b/3rdparty/taglib/ape/apeproperties.cpp @@ -38,9 +38,9 @@ using namespace Strawberry_TagLib::TagLib; -class APE::Properties::PropertiesPrivate { +class APE::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : length(0), + AudioPropertiesPrivate() : length(0), bitrate(0), sampleRate(0), channels(0), @@ -61,43 +61,43 @@ class APE::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -APE::Properties::Properties(File *file, long streamLength, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { +APE::AudioProperties::AudioProperties(File *file, long streamLength, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) { read(file, streamLength); } -APE::Properties::~Properties() { +APE::AudioProperties::~AudioProperties() { delete d; } -int APE::Properties::lengthInSeconds() const { +int APE::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int APE::Properties::lengthInMilliseconds() const { +int APE::AudioProperties::lengthInMilliseconds() const { return d->length; } -int APE::Properties::bitrate() const { +int APE::AudioProperties::bitrate() const { return d->bitrate; } -int APE::Properties::sampleRate() const { +int APE::AudioProperties::sampleRate() const { return d->sampleRate; } -int APE::Properties::channels() const { +int APE::AudioProperties::channels() const { return d->channels; } -int APE::Properties::version() const { +int APE::AudioProperties::version() const { return d->version; } -int APE::Properties::bitsPerSample() const { +int APE::AudioProperties::bitsPerSample() const { return d->bitsPerSample; } -unsigned int APE::Properties::sampleFrames() const { +unsigned int APE::AudioProperties::sampleFrames() const { return d->sampleFrames; } @@ -114,7 +114,7 @@ int headerVersion(const ByteVector &header) { } } // namespace -void APE::Properties::read(File *file, long streamLength) { +void APE::AudioProperties::read(File *file, long streamLength) { // First, we assume that the file pointer is set at the first descriptor. long offset = file->tell(); @@ -128,7 +128,7 @@ void APE::Properties::read(File *file, long streamLength) { } if (version < 0) { - debug("APE::Properties::read() -- APE descriptor not found"); + debug("APE::AudioProperties::read() -- APE descriptor not found"); return; } @@ -147,13 +147,13 @@ void APE::Properties::read(File *file, long streamLength) { } -void APE::Properties::analyzeCurrent(File *file) { +void APE::AudioProperties::analyzeCurrent(File *file) { // Read the descriptor file->seek(2, File::Current); const ByteVector descriptor = file->readBlock(44); if (descriptor.size() < 44) { - debug("APE::Properties::analyzeCurrent() -- descriptor is too short."); + debug("APE::AudioProperties::analyzeCurrent() -- descriptor is too short."); return; } @@ -165,7 +165,7 @@ void APE::Properties::analyzeCurrent(File *file) { // Read the header const ByteVector header = file->readBlock(24); if (header.size() < 24) { - debug("APE::Properties::analyzeCurrent() -- MAC header is too short."); + debug("APE::AudioProperties::analyzeCurrent() -- MAC header is too short."); return; } @@ -184,11 +184,11 @@ void APE::Properties::analyzeCurrent(File *file) { } -void APE::Properties::analyzeOld(File *file) { +void APE::AudioProperties::analyzeOld(File *file) { const ByteVector header = file->readBlock(26); if (header.size() < 26) { - debug("APE::Properties::analyzeOld() -- MAC header is too short."); + debug("APE::AudioProperties::analyzeOld() -- MAC header is too short."); return; } @@ -218,7 +218,7 @@ void APE::Properties::analyzeOld(File *file) { file->seek(16, File::Current); const ByteVector fmt = file->readBlock(28); if (fmt.size() < 28 || !fmt.startsWith("WAVEfmt ")) { - debug("APE::Properties::analyzeOld() -- fmt header is too short."); + debug("APE::AudioProperties::analyzeOld() -- fmt header is too short."); return; } diff --git a/3rdparty/taglib/ape/apeproperties.h b/3rdparty/taglib/ape/apeproperties.h index 3bb421715..9c1ea2459 100644 --- a/3rdparty/taglib/ape/apeproperties.h +++ b/3rdparty/taglib/ape/apeproperties.h @@ -45,18 +45,18 @@ class File; * This reads the data from an APE stream found in the AudioProperties API. */ -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! - * Create an instance of APE::Properties with the data read from the APE::File \a file. + * Create an instance of APE::AudioProperties with the data read from the APE::File \a file. */ - Properties(File *file, long streamLength, ReadStyle style = Average); + AudioProperties(File *file, long streamLength, ReadStyle style = Average); /*! - * Destroys this APE::Properties instance. + * Destroys this APE::AudioProperties instance. */ - virtual ~Properties(); + virtual ~AudioProperties(); /*! * Returns the length of the file in seconds. The length is rounded down to the nearest whole second. @@ -105,16 +105,16 @@ class TAGLIB_EXPORT Properties : public AudioProperties { int version() const; private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); void read(File *file, long streamLength); void analyzeCurrent(File *file); void analyzeOld(File *file); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace APE } // namespace TagLib diff --git a/3rdparty/taglib/asf/asffile.cpp b/3rdparty/taglib/asf/asffile.cpp index fca592dae..8da505131 100644 --- a/3rdparty/taglib/asf/asffile.cpp +++ b/3rdparty/taglib/asf/asffile.cpp @@ -68,7 +68,7 @@ class ASF::File::FilePrivate { unsigned long long headerSize; ASF::Tag *tag; - ASF::Properties *properties; + ASF::AudioProperties *properties; List objects; @@ -474,12 +474,12 @@ bool ASF::File::isSupported(IOStream *stream) { // public members //////////////////////////////////////////////////////////////////////////////// -ASF::File::File(FileName file, bool, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) { +ASF::File::File(FileName file, bool, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) { if (isOpen()) read(); } -ASF::File::File(IOStream *stream, bool, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) { +ASF::File::File(IOStream *stream, bool, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) { if (isOpen()) read(); } @@ -504,7 +504,7 @@ PropertyMap ASF::File::setProperties(const PropertyMap &properties) { return d->tag->setProperties(properties); } -ASF::Properties *ASF::File::audioProperties() const { +ASF::AudioProperties *ASF::File::audioProperties() const { return d->properties; } @@ -609,7 +609,7 @@ void ASF::File::read() { } d->tag = new ASF::Tag(); - d->properties = new ASF::Properties(); + d->properties = new ASF::AudioProperties(); bool ok; d->headerSize = readQWORD(this, &ok); diff --git a/3rdparty/taglib/asf/asffile.h b/3rdparty/taglib/asf/asffile.h index 6ffb9f4e3..a49e440b3 100644 --- a/3rdparty/taglib/asf/asffile.h +++ b/3rdparty/taglib/asf/asffile.h @@ -54,7 +54,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * read. */ File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs an ASF file from \a stream. @@ -66,7 +66,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * \note TagLib will *not* take ownership of the stream, the caller is * responsible for deleting it after the File object. */ - File(IOStream *stream, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(IOStream *stream, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -103,7 +103,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { /*! * Returns the ASF audio properties for this file. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Save the file. diff --git a/3rdparty/taglib/asf/asfproperties.cpp b/3rdparty/taglib/asf/asfproperties.cpp index 1b8e69c34..fa2118270 100644 --- a/3rdparty/taglib/asf/asfproperties.cpp +++ b/3rdparty/taglib/asf/asfproperties.cpp @@ -29,14 +29,14 @@ using namespace Strawberry_TagLib::TagLib; -class ASF::Properties::PropertiesPrivate { +class ASF::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : length(0), + AudioPropertiesPrivate() : length(0), bitrate(0), sampleRate(0), channels(0), bitsPerSample(0), - codec(ASF::Properties::Unknown), + codec(ASF::AudioProperties::Unknown), encrypted(false) {} int length; @@ -44,7 +44,7 @@ class ASF::Properties::PropertiesPrivate { int sampleRate; int channels; int bitsPerSample; - ASF::Properties::Codec codec; + ASF::AudioProperties::Codec codec; String codecName; String codecDescription; bool encrypted; @@ -54,51 +54,51 @@ class ASF::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -ASF::Properties::Properties() : AudioProperties(AudioProperties::Average), - d(new PropertiesPrivate()) { +ASF::AudioProperties::AudioProperties() : Strawberry_TagLib::TagLib::AudioProperties(AudioProperties::Average), + d(new AudioPropertiesPrivate()) { } -ASF::Properties::~Properties() { +ASF::AudioProperties::~AudioProperties() { delete d; } -int ASF::Properties::lengthInSeconds() const { +int ASF::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int ASF::Properties::lengthInMilliseconds() const { +int ASF::AudioProperties::lengthInMilliseconds() const { return d->length; } -int ASF::Properties::bitrate() const { +int ASF::AudioProperties::bitrate() const { return d->bitrate; } -int ASF::Properties::sampleRate() const { +int ASF::AudioProperties::sampleRate() const { return d->sampleRate; } -int ASF::Properties::channels() const { +int ASF::AudioProperties::channels() const { return d->channels; } -int ASF::Properties::bitsPerSample() const { +int ASF::AudioProperties::bitsPerSample() const { return d->bitsPerSample; } -ASF::Properties::Codec ASF::Properties::codec() const { +ASF::AudioProperties::Codec ASF::AudioProperties::codec() const { return d->codec; } -String ASF::Properties::codecName() const { +String ASF::AudioProperties::codecName() const { return d->codecName; } -String ASF::Properties::codecDescription() const { +String ASF::AudioProperties::codecDescription() const { return d->codecDescription; } -bool ASF::Properties::isEncrypted() const { +bool ASF::AudioProperties::isEncrypted() const { return d->encrypted; } @@ -106,31 +106,31 @@ bool ASF::Properties::isEncrypted() const { // private members //////////////////////////////////////////////////////////////////////////////// -void ASF::Properties::setLength(int /*length*/) { - debug("ASF::Properties::setLength() -- This method is deprecated. Do not use."); +void ASF::AudioProperties::setLength(int /*length*/) { + debug("ASF::AudioProperties::setLength() -- This method is deprecated. Do not use."); } -void ASF::Properties::setLengthInMilliseconds(int value) { +void ASF::AudioProperties::setLengthInMilliseconds(int value) { d->length = value; } -void ASF::Properties::setBitrate(int value) { +void ASF::AudioProperties::setBitrate(int value) { d->bitrate = value; } -void ASF::Properties::setSampleRate(int value) { +void ASF::AudioProperties::setSampleRate(int value) { d->sampleRate = value; } -void ASF::Properties::setChannels(int value) { +void ASF::AudioProperties::setChannels(int value) { d->channels = value; } -void ASF::Properties::setBitsPerSample(int value) { +void ASF::AudioProperties::setBitsPerSample(int value) { d->bitsPerSample = value; } -void ASF::Properties::setCodec(int value) { +void ASF::AudioProperties::setCodec(int value) { switch (value) { case 0x0160: @@ -152,14 +152,14 @@ void ASF::Properties::setCodec(int value) { } -void ASF::Properties::setCodecName(const String &value) { +void ASF::AudioProperties::setCodecName(const String &value) { d->codecName = value; } -void ASF::Properties::setCodecDescription(const String &value) { +void ASF::AudioProperties::setCodecDescription(const String &value) { d->codecDescription = value; } -void ASF::Properties::setEncrypted(bool value) { +void ASF::AudioProperties::setEncrypted(bool value) { d->encrypted = value; } diff --git a/3rdparty/taglib/asf/asfproperties.h b/3rdparty/taglib/asf/asfproperties.h index 47090b926..2a00193d2 100644 --- a/3rdparty/taglib/asf/asfproperties.h +++ b/3rdparty/taglib/asf/asfproperties.h @@ -35,7 +35,7 @@ namespace TagLib { namespace ASF { //! An implementation of ASF audio properties -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! * Audio codec types can be used in ASF file. @@ -70,12 +70,12 @@ class TAGLIB_EXPORT Properties : public AudioProperties { /*! * Creates an instance of ASF::Properties. */ - Properties(); + AudioProperties(); /*! - * Destroys this ASF::Properties instance. + * Destroys this ASF::AudioProperties instance. */ - virtual ~Properties(); + virtual ~AudioProperties(); /*! * Returns the length of the file in seconds. The length is rounded down to @@ -160,8 +160,8 @@ class TAGLIB_EXPORT Properties : public AudioProperties { #endif private: - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace ASF diff --git a/3rdparty/taglib/audioproperties.cpp b/3rdparty/taglib/audioproperties.cpp index 792f44747..f9602ffba 100644 --- a/3rdparty/taglib/audioproperties.cpp +++ b/3rdparty/taglib/audioproperties.cpp @@ -49,41 +49,40 @@ using namespace Strawberry_TagLib::TagLib; // Should be true virtual functions in taglib2. #define VIRTUAL_FUNCTION_WORKAROUND(function_name, default_value) \ - if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ - else if (dynamic_cast(this)) \ - return dynamic_cast(this)->function_name(); \ + if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ + else if (dynamic_cast(this)) \ + return dynamic_cast(this)->function_name(); \ else \ return (default_value); -class AudioProperties::AudioPropertiesPrivate { -}; +class AudioProperties::AudioPropertiesPrivate {}; //////////////////////////////////////////////////////////////////////////////// // public methods diff --git a/3rdparty/taglib/audioproperties.h b/3rdparty/taglib/audioproperties.h index 74d650dc4..0d8a59149 100644 --- a/3rdparty/taglib/audioproperties.h +++ b/3rdparty/taglib/audioproperties.h @@ -62,11 +62,6 @@ class TAGLIB_EXPORT AudioProperties { */ virtual ~AudioProperties(); - /*! - * Returns the length of the file in seconds. - */ - //virtual int length() const = 0; - /*! * Returns the length of the file in seconds. The length is rounded down to the nearest whole second. * diff --git a/3rdparty/taglib/dsdiff/dsdifffile.cpp b/3rdparty/taglib/dsdiff/dsdifffile.cpp index 2c39447a1..4c3624c98 100644 --- a/3rdparty/taglib/dsdiff/dsdifffile.cpp +++ b/3rdparty/taglib/dsdiff/dsdifffile.cpp @@ -118,7 +118,7 @@ class DSDIFF::File::FilePrivate { */ int duplicateID3V2chunkIndex; - Properties *properties; + AudioProperties *properties; TagUnion tag; @@ -145,7 +145,7 @@ bool DSDIFF::File::isSupported(IOStream *stream) { // public members //////////////////////////////////////////////////////////////////////////////// -DSDIFF::File::File(FileName file, bool readProperties, Properties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(file) { +DSDIFF::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(file) { d = new FilePrivate; d->endianness = BigEndian; @@ -154,7 +154,7 @@ DSDIFF::File::File(FileName file, bool readProperties, Properties::ReadStyle pro } -DSDIFF::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(stream) { +DSDIFF::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(stream) { d = new FilePrivate; d->endianness = BigEndian; @@ -210,7 +210,7 @@ PropertyMap DSDIFF::File::setProperties(const PropertyMap &properties) { return d->tag.access(ID3v2Index, true)->setProperties(properties); } -DSDIFF::Properties *DSDIFF::File::audioProperties() const { +DSDIFF::AudioProperties *DSDIFF::File::audioProperties() const { return d->properties; } @@ -582,7 +582,7 @@ void DSDIFF::File::updateRootChunksStructure(unsigned int startingChunk) { } -void DSDIFF::File::read(bool readProperties, Properties::ReadStyle propertiesStyle) { +void DSDIFF::File::read(bool readProperties, AudioProperties::ReadStyle propertiesStyle) { bool bigEndian = (d->endianness == BigEndian); @@ -868,7 +868,7 @@ void DSDIFF::File::read(bool readProperties, Properties::ReadStyle propertiesSty if (lengthDSDSamplesTimeChannels > 0) bitrate = (audioDataSizeinBytes * 8 * sampleRate) / lengthDSDSamplesTimeChannels / 1000; - d->properties = new Properties(sampleRate, channels, lengthDSDSamplesTimeChannels, bitrate, propertiesStyle); + d->properties = new AudioProperties(sampleRate, channels, lengthDSDSamplesTimeChannels, bitrate, propertiesStyle); } if (!ID3v2Tag()) { diff --git a/3rdparty/taglib/dsdiff/dsdifffile.h b/3rdparty/taglib/dsdiff/dsdifffile.h index c40ac0249..ea9630b7f 100644 --- a/3rdparty/taglib/dsdiff/dsdifffile.h +++ b/3rdparty/taglib/dsdiff/dsdifffile.h @@ -80,7 +80,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(FileName file, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs an DSDIFF file from \a stream. @@ -91,7 +91,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * \note In the current implementation, \a propertiesStyle is ignored. */ File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -144,10 +144,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { PropertyMap setProperties(const PropertyMap &properties); /*! - * Returns the AIFF::Properties for this file. + * Returns the AIFF::AudioProperties for this file. * If no audio properties were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Save the file. If at least one tag -- ID3v1 or DIIN -- exists this will duplicate its content into the other tag. @@ -254,7 +254,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { void updateRootChunksStructure(unsigned int startingChunk); - void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void read(bool readProperties, AudioProperties::ReadStyle propertiesStyle); void writeChunk(const ByteVector &name, const ByteVector &data, unsigned long long offset, unsigned long replace = 0, unsigned int leadingPadding = 0); class FilePrivate; diff --git a/3rdparty/taglib/dsdiff/dsdiffproperties.cpp b/3rdparty/taglib/dsdiff/dsdiffproperties.cpp index c86186d86..545e60f00 100644 --- a/3rdparty/taglib/dsdiff/dsdiffproperties.cpp +++ b/3rdparty/taglib/dsdiff/dsdiffproperties.cpp @@ -30,9 +30,9 @@ using namespace Strawberry_TagLib::TagLib; -class DSDIFF::Properties::PropertiesPrivate { +class DSDIFF::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : length(0), + AudioPropertiesPrivate() : length(0), bitrate(0), sampleRate(0), channels(0), @@ -52,9 +52,9 @@ class DSDIFF::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -DSDIFF::Properties::Properties(const unsigned int sampleRate, const unsigned short channels, const unsigned long long samplesCount, const int bitrate, ReadStyle style) : AudioProperties(style) { +DSDIFF::AudioProperties::AudioProperties(const unsigned int sampleRate, const unsigned short channels, const unsigned long long samplesCount, const int bitrate, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style) { - d = new PropertiesPrivate; + d = new AudioPropertiesPrivate; d->channels = channels; d->sampleCount = samplesCount; @@ -65,38 +65,34 @@ DSDIFF::Properties::Properties(const unsigned int sampleRate, const unsigned sho } -DSDIFF::Properties::~Properties() { +DSDIFF::AudioProperties::~AudioProperties() { delete d; } -int DSDIFF::Properties::length() const { - return lengthInSeconds(); -} - -int DSDIFF::Properties::lengthInSeconds() const { +int DSDIFF::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int DSDIFF::Properties::lengthInMilliseconds() const { +int DSDIFF::AudioProperties::lengthInMilliseconds() const { return d->length; } -int DSDIFF::Properties::bitrate() const { +int DSDIFF::AudioProperties::bitrate() const { return d->bitrate; } -int DSDIFF::Properties::sampleRate() const { +int DSDIFF::AudioProperties::sampleRate() const { return d->sampleRate; } -int DSDIFF::Properties::channels() const { +int DSDIFF::AudioProperties::channels() const { return d->channels; } -int DSDIFF::Properties::bitsPerSample() const { +int DSDIFF::AudioProperties::bitsPerSample() const { return d->sampleWidth; } -long long DSDIFF::Properties::sampleCount() const { +long long DSDIFF::AudioProperties::sampleCount() const { return d->sampleCount; } diff --git a/3rdparty/taglib/dsdiff/dsdiffproperties.h b/3rdparty/taglib/dsdiff/dsdiffproperties.h index bef37259d..d00be1ab1 100644 --- a/3rdparty/taglib/dsdiff/dsdiffproperties.h +++ b/3rdparty/taglib/dsdiff/dsdiffproperties.h @@ -40,21 +40,20 @@ class File; * This reads the data from an DSDIFF stream found in the AudioProperties API. */ -class TAGLIB_EXPORT Properties : public Strawberry_TagLib::TagLib::AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! - * Create an instance of DSDIFF::Properties with the data read from the ByteVector \a data. + * Create an instance of DSDIFF::AudioProperties with the data read from the ByteVector \a data. */ - Properties(const unsigned int sampleRate, const unsigned short channels, const unsigned long long samplesCount, const int bitrate, ReadStyle style); + AudioProperties(const unsigned int sampleRate, const unsigned short channels, const unsigned long long samplesCount, const int bitrate, ReadStyle style); /*! - * Destroys this DSDIFF::Properties instance. + * Destroys this DSDIFF::AudioProperties instance. */ - virtual ~Properties(); + virtual ~AudioProperties(); // Reimplementations. - virtual int length() const; virtual int lengthInSeconds() const; virtual int lengthInMilliseconds() const; virtual int bitrate() const; @@ -65,11 +64,11 @@ class TAGLIB_EXPORT Properties : public Strawberry_TagLib::TagLib::AudioProperti long long sampleCount() const; private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace DSDIFF diff --git a/3rdparty/taglib/dsf/dsffile.cpp b/3rdparty/taglib/dsf/dsffile.cpp index 090293091..ad2fda1e8 100644 --- a/3rdparty/taglib/dsf/dsffile.cpp +++ b/3rdparty/taglib/dsf/dsffile.cpp @@ -51,7 +51,7 @@ class DSF::File::FilePrivate { long long fileSize; long long metadataOffset; - Properties *properties; + AudioProperties *properties; ID3v2::Tag *tag; }; @@ -72,14 +72,14 @@ bool DSF::File::isSupported(IOStream *stream) { //////////////////////////////////////////////////////////////////////////////// DSF::File::File(FileName file, bool readProperties, - Properties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) { + AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) { if (isOpen()) read(readProperties, propertiesStyle); } -DSF::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) { +DSF::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) { if (isOpen()) read(readProperties, propertiesStyle); @@ -102,7 +102,7 @@ PropertyMap DSF::File::setProperties(const PropertyMap &properties) { return d->tag->setProperties(properties); } -DSF::Properties *DSF::File::audioProperties() const { +DSF::AudioProperties *DSF::File::audioProperties() const { return d->properties; } @@ -170,7 +170,7 @@ bool DSF::File::save() { //////////////////////////////////////////////////////////////////////////////// -void DSF::File::read(bool, Properties::ReadStyle propertiesStyle) { +void DSF::File::read(bool, AudioProperties::ReadStyle propertiesStyle) { // A DSF file consists of four chunks: DSD chunk, format chunk, data chunk, and metadata chunk // The file format is not chunked in the sense of a RIFF File, though @@ -220,7 +220,7 @@ void DSF::File::read(bool, Properties::ReadStyle propertiesStyle) { chunkSize = readBlock(8).toLongLong(false); - d->properties = new Properties(readBlock(chunkSize), propertiesStyle); + d->properties = new AudioProperties(readBlock(chunkSize), propertiesStyle); // Skip the data chunk diff --git a/3rdparty/taglib/dsf/dsffile.h b/3rdparty/taglib/dsf/dsffile.h index 98691df0f..a7a899d19 100644 --- a/3rdparty/taglib/dsf/dsffile.h +++ b/3rdparty/taglib/dsf/dsffile.h @@ -60,7 +60,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * If false, \a propertiesStyle is ignored. */ File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs an DSF file from \a file. @@ -68,7 +68,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * If false, \a propertiesStyle is ignored. */ File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -96,7 +96,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * Returns the DSF::AudioProperties for this file. * If no audio properties were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Saves the file. @@ -115,7 +115,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { File(const File &); File &operator=(const File &); - void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void read(bool readProperties, AudioProperties::ReadStyle propertiesStyle); class FilePrivate; FilePrivate *d; diff --git a/3rdparty/taglib/dsf/dsfproperties.cpp b/3rdparty/taglib/dsf/dsfproperties.cpp index c24dc916b..689d20ab8 100644 --- a/3rdparty/taglib/dsf/dsfproperties.cpp +++ b/3rdparty/taglib/dsf/dsfproperties.cpp @@ -30,9 +30,9 @@ using namespace Strawberry_TagLib::TagLib; -class DSF::Properties::PropertiesPrivate { +class DSF::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : formatVersion(0), + AudioPropertiesPrivate() : formatVersion(0), formatID(0), channelType(0), channelNum(0), @@ -63,61 +63,57 @@ class DSF::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -DSF::Properties::Properties(const ByteVector &data, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style) { - d = new PropertiesPrivate; +DSF::AudioProperties::AudioProperties(const ByteVector &data, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style) { + d = new AudioPropertiesPrivate; read(data); } -DSF::Properties::~Properties() { +DSF::AudioProperties::~AudioProperties() { delete d; } -int DSF::Properties::length() const { - return lengthInSeconds(); -} - -int DSF::Properties::lengthInSeconds() const { +int DSF::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int DSF::Properties::lengthInMilliseconds() const { +int DSF::AudioProperties::lengthInMilliseconds() const { return d->length; } -int DSF::Properties::bitrate() const { +int DSF::AudioProperties::bitrate() const { return d->bitrate; } -int DSF::Properties::sampleRate() const { +int DSF::AudioProperties::sampleRate() const { return d->samplingFrequency; } -int DSF::Properties::channels() const { +int DSF::AudioProperties::channels() const { return d->channelNum; } // DSF specific -int DSF::Properties::formatVersion() const { +int DSF::AudioProperties::formatVersion() const { return d->formatVersion; } -int DSF::Properties::formatID() const { +int DSF::AudioProperties::formatID() const { return d->formatID; } -int DSF::Properties::channelType() const { +int DSF::AudioProperties::channelType() const { return d->channelType; } -int DSF::Properties::bitsPerSample() const { +int DSF::AudioProperties::bitsPerSample() const { return d->bitsPerSample; } -long long DSF::Properties::sampleCount() const { +long long DSF::AudioProperties::sampleCount() const { return d->sampleCount; } -int DSF::Properties::blockSizePerChannel() const { +int DSF::AudioProperties::blockSizePerChannel() const { return d->blockSizePerChannel; } @@ -125,7 +121,7 @@ int DSF::Properties::blockSizePerChannel() const { // private members //////////////////////////////////////////////////////////////////////////////// -void DSF::Properties::read(const ByteVector &data) { +void DSF::AudioProperties::read(const ByteVector &data) { d->formatVersion = data.toUInt(0U, false); d->formatID = data.toUInt(4U, false); d->channelType = data.toUInt(8U, false); diff --git a/3rdparty/taglib/dsf/dsfproperties.h b/3rdparty/taglib/dsf/dsfproperties.h index 2b13c27c3..dec58e4c6 100644 --- a/3rdparty/taglib/dsf/dsfproperties.h +++ b/3rdparty/taglib/dsf/dsfproperties.h @@ -40,21 +40,20 @@ class File; * This reads the data from a DSF stream found in the AudioProperties API. */ -class TAGLIB_EXPORT Properties : public Strawberry_TagLib::TagLib::AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! * Create an instance of DSF::AudioProperties with the data read from the ByteVector \a data. */ - Properties(const ByteVector &data, ReadStyle style); + AudioProperties(const ByteVector &data, ReadStyle style); /*! * Destroys this DSF::AudioProperties instance. */ - virtual ~Properties(); + virtual ~AudioProperties(); // Reimplementations. - virtual int length() const; virtual int lengthInSeconds() const; virtual int lengthInMilliseconds() const; virtual int bitrate() const; @@ -80,13 +79,13 @@ class TAGLIB_EXPORT Properties : public Strawberry_TagLib::TagLib::AudioProperti int blockSizePerChannel() const; private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); void read(const ByteVector &data); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace DSF } // namespace TagLib diff --git a/3rdparty/taglib/flac/flacfile.cpp b/3rdparty/taglib/flac/flacfile.cpp index 44eac5545..a7d19c2d2 100644 --- a/3rdparty/taglib/flac/flacfile.cpp +++ b/3rdparty/taglib/flac/flacfile.cpp @@ -83,7 +83,7 @@ class FLAC::File::FilePrivate { TagUnion tag; - Properties *properties; + AudioProperties *properties; ByteVector xiphCommentData; BlockList blocks; @@ -109,14 +109,14 @@ bool FLAC::File::isSupported(IOStream *stream) { // public members //////////////////////////////////////////////////////////////////////////////// -FLAC::File::File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate(frameFactory)) { +FLAC::File::File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate(frameFactory)) { if (isOpen()) read(readProperties); } -FLAC::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate(frameFactory)) { +FLAC::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate(frameFactory)) { if (isOpen()) read(readProperties); @@ -143,7 +143,7 @@ PropertyMap FLAC::File::setProperties(const PropertyMap &properties) { return xiphComment(true)->setProperties(properties); } -FLAC::Properties *FLAC::File::audioProperties() const { +FLAC::AudioProperties *FLAC::File::audioProperties() const { return d->properties; } @@ -416,7 +416,7 @@ void FLAC::File::read(bool readProperties) { else streamLength = length() - d->streamStart; - d->properties = new Properties(infoData, streamLength); + d->properties = new AudioProperties(infoData, streamLength); } } diff --git a/3rdparty/taglib/flac/flacfile.h b/3rdparty/taglib/flac/flacfile.h index af0da76a2..f20041109 100644 --- a/3rdparty/taglib/flac/flacfile.h +++ b/3rdparty/taglib/flac/flacfile.h @@ -97,7 +97,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs a FLAC file from \a stream. If \a readProperties is true the file's audio properties will also be read. @@ -109,7 +109,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * \note In the current implementation, \a propertiesStyle is ignored. */ // BIC: merge with the above constructor - File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -141,9 +141,9 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { PropertyMap setProperties(const PropertyMap &); /*! - * Returns the FLAC::Properties for this file. If no audio properties were read then this will return a null pointer. + * Returns the FLAC::AudioProperties for this file. If no audio properties were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Save the file. This will primarily save the XiphComment, but will also keep any old ID3-tags up to date. diff --git a/3rdparty/taglib/flac/flacproperties.cpp b/3rdparty/taglib/flac/flacproperties.cpp index c19231c27..64960fbc6 100644 --- a/3rdparty/taglib/flac/flacproperties.cpp +++ b/3rdparty/taglib/flac/flacproperties.cpp @@ -31,9 +31,9 @@ using namespace Strawberry_TagLib::TagLib; -class FLAC::Properties::PropertiesPrivate { +class FLAC::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : length(0), + AudioPropertiesPrivate() : length(0), bitrate(0), sampleRate(0), bitsPerSample(0), @@ -53,43 +53,43 @@ class FLAC::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -FLAC::Properties::Properties(const ByteVector &data, long streamLength, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { +FLAC::AudioProperties::AudioProperties(const ByteVector &data, long streamLength, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) { read(data, streamLength); } -FLAC::Properties::~Properties() { +FLAC::AudioProperties::~AudioProperties() { delete d; } -int FLAC::Properties::lengthInSeconds() const { +int FLAC::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int FLAC::Properties::lengthInMilliseconds() const { +int FLAC::AudioProperties::lengthInMilliseconds() const { return d->length; } -int FLAC::Properties::bitrate() const { +int FLAC::AudioProperties::bitrate() const { return d->bitrate; } -int FLAC::Properties::sampleRate() const { +int FLAC::AudioProperties::sampleRate() const { return d->sampleRate; } -int FLAC::Properties::bitsPerSample() const { +int FLAC::AudioProperties::bitsPerSample() const { return d->bitsPerSample; } -int FLAC::Properties::channels() const { +int FLAC::AudioProperties::channels() const { return d->channels; } -unsigned long long FLAC::Properties::sampleFrames() const { +unsigned long long FLAC::AudioProperties::sampleFrames() const { return d->sampleFrames; } -ByteVector FLAC::Properties::signature() const { +ByteVector FLAC::AudioProperties::signature() const { return d->signature; } @@ -97,10 +97,10 @@ ByteVector FLAC::Properties::signature() const { // private members //////////////////////////////////////////////////////////////////////////////// -void FLAC::Properties::read(const ByteVector &data, long streamLength) { +void FLAC::AudioProperties::read(const ByteVector &data, long streamLength) { if (data.size() < 18) { - debug("FLAC::Properties::read() - FLAC properties must contain at least 18 bytes."); + debug("FLAC::AudioProperties::read() - FLAC properties must contain at least 18 bytes."); return; } diff --git a/3rdparty/taglib/flac/flacproperties.h b/3rdparty/taglib/flac/flacproperties.h index d1b722aa1..2c1ee2f47 100644 --- a/3rdparty/taglib/flac/flacproperties.h +++ b/3rdparty/taglib/flac/flacproperties.h @@ -42,17 +42,17 @@ class File; * This reads the data from an FLAC stream found in the AudioProperties API. */ -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! - * Create an instance of FLAC::Properties with the data read from the ByteVector \a data. + * Create an instance of FLAC::AudioProperties with the data read from the ByteVector \a data. */ - Properties(const ByteVector &data, long streamLength, ReadStyle style = Average); + AudioProperties(const ByteVector &data, long streamLength, ReadStyle style = Average); /*! - * Destroys this FLAC::Properties instance. + * Destroys this FLAC::AudioProperties instance. */ - virtual ~Properties(); + virtual ~AudioProperties(); /*! * Returns the length of the file in seconds. The length is rounded down to the nearest whole second. @@ -101,13 +101,13 @@ class TAGLIB_EXPORT Properties : public AudioProperties { ByteVector signature() const; private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); void read(const ByteVector &data, long streamLength); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace FLAC } // namespace TagLib diff --git a/3rdparty/taglib/it/itfile.cpp b/3rdparty/taglib/it/itfile.cpp index ce42014f8..23888d498 100644 --- a/3rdparty/taglib/it/itfile.cpp +++ b/3rdparty/taglib/it/itfile.cpp @@ -38,7 +38,7 @@ class IT::File::FilePrivate { explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : properties(propertiesStyle) {} Mod::Tag tag; - IT::Properties properties; + IT::AudioProperties properties; }; IT::File::File(FileName file, bool readProperties, @@ -73,7 +73,7 @@ PropertyMap IT::File::setProperties(const PropertyMap &properties) { return d->tag.setProperties(properties); } -IT::Properties *IT::File::audioProperties() const { +IT::AudioProperties *IT::File::audioProperties() const { return &d->properties; } @@ -151,7 +151,7 @@ bool IT::File::save() { return false; unsigned long fileSize = File::length(); - if (special & Properties::MessageAttached) { + if (special & AudioProperties::MessageAttached) { seek(54); if (!readU16L(messageLength) || !readU32L(messageOffset)) return false; @@ -219,7 +219,7 @@ void IT::File::read(bool) { // sample/instrument names are abused as comments so // I just add all together. String message; - if (special & Properties::MessageAttached) { + if (special & AudioProperties::MessageAttached) { READ_U16L_AS(messageLength); READ_U32L_AS(messageOffset); seek(messageOffset); diff --git a/3rdparty/taglib/it/itfile.h b/3rdparty/taglib/it/itfile.h index 80c851a8d..05bdd2b01 100644 --- a/3rdparty/taglib/it/itfile.h +++ b/3rdparty/taglib/it/itfile.h @@ -77,10 +77,10 @@ class TAGLIB_EXPORT File : public Mod::FileBase { PropertyMap setProperties(const PropertyMap &); /*! - * Returns the IT::Properties for this file. If no audio properties + * Returns the IT::AudioProperties for this file. If no audio properties * were read then this will return a null pointer. */ - IT::Properties *audioProperties() const; + IT::AudioProperties *audioProperties() const; /*! * Save the file. diff --git a/3rdparty/taglib/it/itproperties.cpp b/3rdparty/taglib/it/itproperties.cpp index f85f83af2..b966e5cc2 100644 --- a/3rdparty/taglib/it/itproperties.cpp +++ b/3rdparty/taglib/it/itproperties.cpp @@ -29,9 +29,9 @@ using namespace Strawberry_TagLib::TagLib; using namespace IT; -class IT::Properties::PropertiesPrivate { +class IT::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : channels(0), + AudioPropertiesPrivate() : channels(0), lengthInPatterns(0), instrumentCount(0), sampleCount(0), @@ -65,152 +65,148 @@ class IT::Properties::PropertiesPrivate { unsigned char pitchWheelDepth; }; -IT::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) : AudioProperties(propertiesStyle), d(new PropertiesPrivate()) {} +IT::AudioProperties::AudioProperties(AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::AudioProperties(propertiesStyle), d(new AudioPropertiesPrivate()) {} -IT::Properties::~Properties() { +IT::AudioProperties::~AudioProperties() { delete d; } -int IT::Properties::length() const { +int IT::AudioProperties::lengthInSeconds() const { return 0; } -int IT::Properties::lengthInSeconds() const { +int IT::AudioProperties::lengthInMilliseconds() const { return 0; } -int IT::Properties::lengthInMilliseconds() const { +int IT::AudioProperties::bitrate() const { return 0; } -int IT::Properties::bitrate() const { +int IT::AudioProperties::sampleRate() const { return 0; } -int IT::Properties::sampleRate() const { - return 0; -} - -int IT::Properties::channels() const { +int IT::AudioProperties::channels() const { return d->channels; } -unsigned short IT::Properties::lengthInPatterns() const { +unsigned short IT::AudioProperties::lengthInPatterns() const { return d->lengthInPatterns; } -bool IT::Properties::stereo() const { +bool IT::AudioProperties::stereo() const { return d->flags & Stereo; } -unsigned short IT::Properties::instrumentCount() const { +unsigned short IT::AudioProperties::instrumentCount() const { return d->instrumentCount; } -unsigned short IT::Properties::sampleCount() const { +unsigned short IT::AudioProperties::sampleCount() const { return d->sampleCount; } -unsigned short IT::Properties::patternCount() const { +unsigned short IT::AudioProperties::patternCount() const { return d->patternCount; } -unsigned short IT::Properties::version() const { +unsigned short IT::AudioProperties::version() const { return d->version; } -unsigned short IT::Properties::compatibleVersion() const { +unsigned short IT::AudioProperties::compatibleVersion() const { return d->compatibleVersion; } -unsigned short IT::Properties::flags() const { +unsigned short IT::AudioProperties::flags() const { return d->flags; } -unsigned short IT::Properties::special() const { +unsigned short IT::AudioProperties::special() const { return d->special; } -unsigned char IT::Properties::globalVolume() const { +unsigned char IT::AudioProperties::globalVolume() const { return d->globalVolume; } -unsigned char IT::Properties::mixVolume() const { +unsigned char IT::AudioProperties::mixVolume() const { return d->mixVolume; } -unsigned char IT::Properties::tempo() const { +unsigned char IT::AudioProperties::tempo() const { return d->tempo; } -unsigned char IT::Properties::bpmSpeed() const { +unsigned char IT::AudioProperties::bpmSpeed() const { return d->bpmSpeed; } -unsigned char IT::Properties::panningSeparation() const { +unsigned char IT::AudioProperties::panningSeparation() const { return d->panningSeparation; } -unsigned char IT::Properties::pitchWheelDepth() const { +unsigned char IT::AudioProperties::pitchWheelDepth() const { return d->pitchWheelDepth; } -void IT::Properties::setChannels(int channels) { +void IT::AudioProperties::setChannels(int channels) { d->channels = channels; } -void IT::Properties::setLengthInPatterns(unsigned short lengthInPatterns) { +void IT::AudioProperties::setLengthInPatterns(unsigned short lengthInPatterns) { d->lengthInPatterns = lengthInPatterns; } -void IT::Properties::setInstrumentCount(unsigned short instrumentCount) { +void IT::AudioProperties::setInstrumentCount(unsigned short instrumentCount) { d->instrumentCount = instrumentCount; } -void IT::Properties::setSampleCount(unsigned short sampleCount) { +void IT::AudioProperties::setSampleCount(unsigned short sampleCount) { d->sampleCount = sampleCount; } -void IT::Properties::setPatternCount(unsigned short patternCount) { +void IT::AudioProperties::setPatternCount(unsigned short patternCount) { d->patternCount = patternCount; } -void IT::Properties::setFlags(unsigned short flags) { +void IT::AudioProperties::setFlags(unsigned short flags) { d->flags = flags; } -void IT::Properties::setSpecial(unsigned short special) { +void IT::AudioProperties::setSpecial(unsigned short special) { d->special = special; } -void IT::Properties::setCompatibleVersion(unsigned short compatibleVersion) { +void IT::AudioProperties::setCompatibleVersion(unsigned short compatibleVersion) { d->compatibleVersion = compatibleVersion; } -void IT::Properties::setVersion(unsigned short version) { +void IT::AudioProperties::setVersion(unsigned short version) { d->version = version; } -void IT::Properties::setGlobalVolume(unsigned char globalVolume) { +void IT::AudioProperties::setGlobalVolume(unsigned char globalVolume) { d->globalVolume = globalVolume; } -void IT::Properties::setMixVolume(unsigned char mixVolume) { +void IT::AudioProperties::setMixVolume(unsigned char mixVolume) { d->mixVolume = mixVolume; } -void IT::Properties::setTempo(unsigned char tempo) { +void IT::AudioProperties::setTempo(unsigned char tempo) { d->tempo = tempo; } -void IT::Properties::setBpmSpeed(unsigned char bpmSpeed) { +void IT::AudioProperties::setBpmSpeed(unsigned char bpmSpeed) { d->bpmSpeed = bpmSpeed; } -void IT::Properties::setPanningSeparation(unsigned char panningSeparation) { +void IT::AudioProperties::setPanningSeparation(unsigned char panningSeparation) { d->panningSeparation = panningSeparation; } -void IT::Properties::setPitchWheelDepth(unsigned char pitchWheelDepth) { +void IT::AudioProperties::setPitchWheelDepth(unsigned char pitchWheelDepth) { d->pitchWheelDepth = pitchWheelDepth; } diff --git a/3rdparty/taglib/it/itproperties.h b/3rdparty/taglib/it/itproperties.h index 6c6f81c90..ed9926416 100644 --- a/3rdparty/taglib/it/itproperties.h +++ b/3rdparty/taglib/it/itproperties.h @@ -32,7 +32,7 @@ namespace Strawberry_TagLib { namespace TagLib { namespace IT { -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { friend class File; public: @@ -54,10 +54,9 @@ class TAGLIB_EXPORT Properties : public AudioProperties { MidiConfEmbedded = 8 }; - Properties(AudioProperties::ReadStyle propertiesStyle); - virtual ~Properties(); + AudioProperties(AudioProperties::ReadStyle propertiesStyle); + virtual ~AudioProperties(); - int length() const; int lengthInSeconds() const; int lengthInMilliseconds() const; int bitrate() const; @@ -97,11 +96,11 @@ class TAGLIB_EXPORT Properties : public AudioProperties { void setPitchWheelDepth(unsigned char pitchWheelDepth); private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace IT } // namespace TagLib diff --git a/3rdparty/taglib/mod/modfile.cpp b/3rdparty/taglib/mod/modfile.cpp index 55732f713..3bc705f2f 100644 --- a/3rdparty/taglib/mod/modfile.cpp +++ b/3rdparty/taglib/mod/modfile.cpp @@ -38,7 +38,7 @@ class Mod::File::FilePrivate { explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : properties(propertiesStyle) {} Mod::Tag tag; - Mod::Properties properties; + Mod::AudioProperties properties; }; Mod::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle propertiesStyle) : Mod::FileBase(file), d(new FilePrivate(propertiesStyle)) { @@ -63,7 +63,7 @@ Mod::Tag *Mod::File::tag() const { return &d->tag; } -Mod::Properties *Mod::File::audioProperties() const { +Mod::AudioProperties *Mod::File::audioProperties() const { return &d->properties; } diff --git a/3rdparty/taglib/mod/modfile.h b/3rdparty/taglib/mod/modfile.h index 342e4f98e..18586e9a5 100644 --- a/3rdparty/taglib/mod/modfile.h +++ b/3rdparty/taglib/mod/modfile.h @@ -77,9 +77,9 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::Mod::FileBase { */ PropertyMap setProperties(const PropertyMap &); /*! - * Returns the Mod::Properties for this file. If no audio properties were read then this will return a null pointer. + * Returns the Mod::AudioProperties for this file. If no audio properties were read then this will return a null pointer. */ - Mod::Properties *audioProperties() const; + Mod::AudioProperties *audioProperties() const; /*! * Save the file. diff --git a/3rdparty/taglib/mod/modproperties.cpp b/3rdparty/taglib/mod/modproperties.cpp index 8489c6410..44c80acb5 100644 --- a/3rdparty/taglib/mod/modproperties.cpp +++ b/3rdparty/taglib/mod/modproperties.cpp @@ -29,62 +29,58 @@ using namespace Strawberry_TagLib::TagLib; using namespace Mod; -class Mod::Properties::PropertiesPrivate { +class Mod::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : channels(0), instrumentCount(0), lengthInPatterns(0) {} + AudioPropertiesPrivate() : channels(0), instrumentCount(0), lengthInPatterns(0) {} int channels; unsigned int instrumentCount; unsigned char lengthInPatterns; }; -Mod::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) : AudioProperties(propertiesStyle), d(new PropertiesPrivate()) { +Mod::AudioProperties::AudioProperties(AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::AudioProperties(propertiesStyle), d(new AudioPropertiesPrivate()) { } -Mod::Properties::~Properties() { +Mod::AudioProperties::~AudioProperties() { delete d; } -int Mod::Properties::length() const { +int Mod::AudioProperties::lengthInSeconds() const { return 0; } -int Mod::Properties::lengthInSeconds() const { +int Mod::AudioProperties::lengthInMilliseconds() const { return 0; } -int Mod::Properties::lengthInMilliseconds() const { +int Mod::AudioProperties::bitrate() const { return 0; } -int Mod::Properties::bitrate() const { +int Mod::AudioProperties::sampleRate() const { return 0; } -int Mod::Properties::sampleRate() const { - return 0; -} - -int Mod::Properties::channels() const { +int Mod::AudioProperties::channels() const { return d->channels; } -unsigned int Mod::Properties::instrumentCount() const { +unsigned int Mod::AudioProperties::instrumentCount() const { return d->instrumentCount; } -unsigned char Mod::Properties::lengthInPatterns() const { +unsigned char Mod::AudioProperties::lengthInPatterns() const { return d->lengthInPatterns; } -void Mod::Properties::setChannels(int channels) { +void Mod::AudioProperties::setChannels(int channels) { d->channels = channels; } -void Mod::Properties::setInstrumentCount(unsigned int instrumentCount) { +void Mod::AudioProperties::setInstrumentCount(unsigned int instrumentCount) { d->instrumentCount = instrumentCount; } -void Mod::Properties::setLengthInPatterns(unsigned char lengthInPatterns) { +void Mod::AudioProperties::setLengthInPatterns(unsigned char lengthInPatterns) { d->lengthInPatterns = lengthInPatterns; } diff --git a/3rdparty/taglib/mod/modproperties.h b/3rdparty/taglib/mod/modproperties.h index 31ed2d023..5d535aaab 100644 --- a/3rdparty/taglib/mod/modproperties.h +++ b/3rdparty/taglib/mod/modproperties.h @@ -33,12 +33,11 @@ namespace Strawberry_TagLib { namespace TagLib { namespace Mod { -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: - Properties(AudioProperties::ReadStyle propertiesStyle); - virtual ~Properties(); + AudioProperties(AudioProperties::ReadStyle propertiesStyle); + virtual ~AudioProperties(); - int length() const; int lengthInSeconds() const; int lengthInMilliseconds() const; int bitrate() const; @@ -56,11 +55,11 @@ class TAGLIB_EXPORT Properties : public AudioProperties { private: friend class File; - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace Mod diff --git a/3rdparty/taglib/mp4/mp4file.cpp b/3rdparty/taglib/mp4/mp4file.cpp index f22daf037..659726d4d 100644 --- a/3rdparty/taglib/mp4/mp4file.cpp +++ b/3rdparty/taglib/mp4/mp4file.cpp @@ -63,7 +63,7 @@ class MP4::File::FilePrivate { MP4::Tag *tag; MP4::Atoms *atoms; - MP4::Properties *properties; + MP4::AudioProperties *properties; }; //////////////////////////////////////////////////////////////////////////////// @@ -118,7 +118,7 @@ PropertyMap MP4::File::setProperties(const PropertyMap &properties) { return d->tag->setProperties(properties); } -MP4::Properties * +MP4::AudioProperties * MP4::File::audioProperties() const { return d->properties; } @@ -142,7 +142,7 @@ void MP4::File::read(bool readProperties) { d->tag = new Tag(this, d->atoms); if (readProperties) { - d->properties = new Properties(this, d->atoms); + d->properties = new AudioProperties(this, d->atoms); } } diff --git a/3rdparty/taglib/mp4/mp4file.h b/3rdparty/taglib/mp4/mp4file.h index 0fb5c7bad..9d97381f4 100644 --- a/3rdparty/taglib/mp4/mp4file.h +++ b/3rdparty/taglib/mp4/mp4file.h @@ -54,7 +54,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(FileName file, bool readProperties = true, Properties::ReadStyle audioPropertiesStyle = Properties::Average); + File(FileName file, bool readProperties = true, AudioProperties::ReadStyle audioPropertiesStyle = AudioProperties::Average); /*! * Constructs an MP4 file from \a stream. @@ -66,7 +66,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * \note In the current implementation, \a propertiesStyle is ignored. */ File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle audioPropertiesStyle = Properties::Average); + AudioProperties::ReadStyle audioPropertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -101,7 +101,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { /*! * Returns the MP4 audio properties for this file. */ - Properties *audioProperties() const; + AudioProperties *audioProperties() const; /*! * Save the file. diff --git a/3rdparty/taglib/mp4/mp4properties.cpp b/3rdparty/taglib/mp4/mp4properties.cpp index 0a4099615..fbb464ca0 100644 --- a/3rdparty/taglib/mp4/mp4properties.cpp +++ b/3rdparty/taglib/mp4/mp4properties.cpp @@ -31,15 +31,15 @@ using namespace Strawberry_TagLib::TagLib; -class MP4::Properties::PropertiesPrivate { +class MP4::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : length(0), + AudioPropertiesPrivate() : length(0), bitrate(0), sampleRate(0), channels(0), bitsPerSample(0), encrypted(false), - codec(MP4::Properties::Unknown) {} + codec(MP4::AudioProperties::Unknown) {} int length; int bitrate; @@ -54,44 +54,44 @@ class MP4::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -MP4::Properties::Properties(File *file, MP4::Atoms *atoms, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { +MP4::AudioProperties::AudioProperties(File *file, MP4::Atoms *atoms, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) { read(file, atoms); } -MP4::Properties::~Properties() { +MP4::AudioProperties::~AudioProperties() { delete d; } -int MP4::Properties::channels() const { +int MP4::AudioProperties::channels() const { return d->channels; } -int MP4::Properties::sampleRate() const { +int MP4::AudioProperties::sampleRate() const { return d->sampleRate; } -int MP4::Properties::lengthInSeconds() const { +int MP4::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int MP4::Properties::lengthInMilliseconds() const { +int MP4::AudioProperties::lengthInMilliseconds() const { return d->length; } -int MP4::Properties::bitrate() const { +int MP4::AudioProperties::bitrate() const { return d->bitrate; } -int MP4::Properties::bitsPerSample() const { +int MP4::AudioProperties::bitsPerSample() const { return d->bitsPerSample; } -bool MP4::Properties::isEncrypted() const { +bool MP4::AudioProperties::isEncrypted() const { return d->encrypted; } -MP4::Properties::Codec -MP4::Properties::codec() const { +MP4::AudioProperties::Codec +MP4::AudioProperties::codec() const { return d->codec; } @@ -99,7 +99,7 @@ MP4::Properties::codec() const { // private members //////////////////////////////////////////////////////////////////////////////// -void MP4::Properties::read(File *file, Atoms *atoms) { +void MP4::AudioProperties::read(File *file, Atoms *atoms) { MP4::Atom *moov = atoms->find("moov"); if (!moov) { diff --git a/3rdparty/taglib/mp4/mp4properties.h b/3rdparty/taglib/mp4/mp4properties.h index 0456e5494..d9feb0ad0 100644 --- a/3rdparty/taglib/mp4/mp4properties.h +++ b/3rdparty/taglib/mp4/mp4properties.h @@ -37,7 +37,7 @@ class Atoms; class File; //! An implementation of MP4 audio properties -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: enum Codec { Unknown = 0, @@ -45,8 +45,8 @@ class TAGLIB_EXPORT Properties : public AudioProperties { ALAC }; - Properties(File *file, Atoms *atoms, ReadStyle style = Average); - virtual ~Properties(); + AudioProperties(File *file, Atoms *atoms, ReadStyle style = Average); + virtual ~AudioProperties(); /*! * Returns the length of the file in seconds. The length is rounded down to the nearest whole second. @@ -97,8 +97,8 @@ class TAGLIB_EXPORT Properties : public AudioProperties { private: void read(File *file, Atoms *atoms); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace MP4 diff --git a/3rdparty/taglib/mpc/mpcfile.cpp b/3rdparty/taglib/mpc/mpcfile.cpp index 01c212bd6..a4f1ec25c 100644 --- a/3rdparty/taglib/mpc/mpcfile.cpp +++ b/3rdparty/taglib/mpc/mpcfile.cpp @@ -69,7 +69,7 @@ class MPC::File::FilePrivate { TagUnion tag; - Properties *properties; + AudioProperties *properties; }; //////////////////////////////////////////////////////////////////////////////// @@ -90,14 +90,14 @@ bool MPC::File::isSupported(IOStream *stream) { // public members //////////////////////////////////////////////////////////////////////////////// -MPC::File::File(FileName file, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) { +MPC::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) { if (isOpen()) read(readProperties); } -MPC::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) { +MPC::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) { if (isOpen()) read(readProperties); @@ -127,7 +127,7 @@ PropertyMap MPC::File::setProperties(const PropertyMap &properties) { return APETag(true)->setProperties(properties); } -MPC::Properties *MPC::File::audioProperties() const { +MPC::AudioProperties *MPC::File::audioProperties() const { return d->properties; } @@ -310,7 +310,7 @@ void MPC::File::read(bool readProperties) { seek(0); } - d->properties = new Properties(this, streamLength); + d->properties = new AudioProperties(this, streamLength); } } diff --git a/3rdparty/taglib/mpc/mpcfile.h b/3rdparty/taglib/mpc/mpcfile.h index a24610873..9ca8c0c2f 100644 --- a/3rdparty/taglib/mpc/mpcfile.h +++ b/3rdparty/taglib/mpc/mpcfile.h @@ -89,7 +89,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(FileName file, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs an MPC file from \a stream. @@ -99,7 +99,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(IOStream *stream, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(IOStream *stream, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -128,10 +128,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { PropertyMap setProperties(const PropertyMap &); /*! - * Returns the MPC::Properties for this file. + * Returns the MPC::AudioProperties for this file. * If no audio properties were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Saves the file. diff --git a/3rdparty/taglib/mpc/mpcproperties.cpp b/3rdparty/taglib/mpc/mpcproperties.cpp index d7f02a2c7..4b2d8f746 100644 --- a/3rdparty/taglib/mpc/mpcproperties.cpp +++ b/3rdparty/taglib/mpc/mpcproperties.cpp @@ -33,9 +33,9 @@ using namespace Strawberry_TagLib::TagLib; -class MPC::Properties::PropertiesPrivate { +class MPC::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : version(0), + AudioPropertiesPrivate() : version(0), length(0), bitrate(0), sampleRate(0), @@ -64,11 +64,11 @@ class MPC::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -MPC::Properties::Properties(const ByteVector &data, long streamLength, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { +MPC::AudioProperties::AudioProperties(const ByteVector &data, long streamLength, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) { readSV7(data, streamLength); } -MPC::Properties::Properties(File *file, long streamLength, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { +MPC::AudioProperties::AudioProperties(File *file, long streamLength, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) { ByteVector magic = file->readBlock(4); if (magic == "MPCK") { @@ -82,55 +82,55 @@ MPC::Properties::Properties(File *file, long streamLength, ReadStyle style) : Au } -MPC::Properties::~Properties() { +MPC::AudioProperties::~AudioProperties() { delete d; } -int MPC::Properties::lengthInSeconds() const { +int MPC::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int MPC::Properties::lengthInMilliseconds() const { +int MPC::AudioProperties::lengthInMilliseconds() const { return d->length; } -int MPC::Properties::bitrate() const { +int MPC::AudioProperties::bitrate() const { return d->bitrate; } -int MPC::Properties::sampleRate() const { +int MPC::AudioProperties::sampleRate() const { return d->sampleRate; } -int MPC::Properties::channels() const { +int MPC::AudioProperties::channels() const { return d->channels; } -int MPC::Properties::mpcVersion() const { +int MPC::AudioProperties::mpcVersion() const { return d->version; } -unsigned int MPC::Properties::totalFrames() const { +unsigned int MPC::AudioProperties::totalFrames() const { return d->totalFrames; } -unsigned int MPC::Properties::sampleFrames() const { +unsigned int MPC::AudioProperties::sampleFrames() const { return d->sampleFrames; } -int MPC::Properties::trackGain() const { +int MPC::AudioProperties::trackGain() const { return d->trackGain; } -int MPC::Properties::trackPeak() const { +int MPC::AudioProperties::trackPeak() const { return d->trackPeak; } -int MPC::Properties::albumGain() const { +int MPC::AudioProperties::albumGain() const { return d->albumGain; } -int MPC::Properties::albumPeak() const { +int MPC::AudioProperties::albumPeak() const { return d->albumPeak; } @@ -184,7 +184,7 @@ unsigned long readSize(const ByteVector &data, unsigned int &pos) { const unsigned short sftable[8] = { 44100, 48000, 37800, 32000, 0, 0, 0, 0 }; } // namespace -void MPC::Properties::readSV8(File *file, long streamLength) { +void MPC::AudioProperties::readSV8(File *file, long streamLength) { bool readSH = false, readRG = false; @@ -195,7 +195,7 @@ void MPC::Properties::readSV8(File *file, long streamLength) { bool eof; const unsigned long packetSize = readSize(file, packetSizeLength, eof); if (eof) { - debug("MPC::Properties::readSV8() - Reached to EOF."); + debug("MPC::AudioProperties::readSV8() - Reached to EOF."); break; } @@ -203,7 +203,7 @@ void MPC::Properties::readSV8(File *file, long streamLength) { const ByteVector data = file->readBlock(dataSize); if (data.size() != dataSize) { - debug("MPC::Properties::readSV8() - dataSize doesn't match the actual data size."); + debug("MPC::AudioProperties::readSV8() - dataSize doesn't match the actual data size."); break; } @@ -212,7 +212,7 @@ void MPC::Properties::readSV8(File *file, long streamLength) { // http://trac.musepack.net/wiki/SV8Specification#StreamHeaderPacket if (dataSize <= 5) { - debug("MPC::Properties::readSV8() - \"SH\" packet is too short to parse."); + debug("MPC::AudioProperties::readSV8() - \"SH\" packet is too short to parse."); break; } @@ -223,13 +223,13 @@ void MPC::Properties::readSV8(File *file, long streamLength) { pos += 1; d->sampleFrames = readSize(data, pos); if (pos > dataSize - 3) { - debug("MPC::Properties::readSV8() - \"SH\" packet is corrupt."); + debug("MPC::AudioProperties::readSV8() - \"SH\" packet is corrupt."); break; } const unsigned long begSilence = readSize(data, pos); if (pos > dataSize - 2) { - debug("MPC::Properties::readSV8() - \"SH\" packet is corrupt."); + debug("MPC::AudioProperties::readSV8() - \"SH\" packet is corrupt."); break; } @@ -251,7 +251,7 @@ void MPC::Properties::readSV8(File *file, long streamLength) { // http://trac.musepack.net/wiki/SV8Specification#ReplaygainPacket if (dataSize <= 9) { - debug("MPC::Properties::readSV8() - \"RG\" packet is too short to parse."); + debug("MPC::AudioProperties::readSV8() - \"RG\" packet is too short to parse."); break; } @@ -277,7 +277,7 @@ void MPC::Properties::readSV8(File *file, long streamLength) { } -void MPC::Properties::readSV7(const ByteVector &data, long streamLength) { +void MPC::AudioProperties::readSV7(const ByteVector &data, long streamLength) { if (data.startsWith("MP+")) { d->version = data[3] & 15; diff --git a/3rdparty/taglib/mpc/mpcproperties.h b/3rdparty/taglib/mpc/mpcproperties.h index bef35c416..19a5d7146 100644 --- a/3rdparty/taglib/mpc/mpcproperties.h +++ b/3rdparty/taglib/mpc/mpcproperties.h @@ -44,24 +44,24 @@ static const unsigned int HeaderSize = 8 * 7; * This reads the data from an MPC stream found in the AudioProperties API. */ -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! - * Create an instance of MPC::Properties with the data read from the ByteVector \a data. + * Create an instance of MPC::AudioProperties with the data read from the ByteVector \a data. * * This constructor is deprecated. It only works for MPC version up to 7. */ - Properties(const ByteVector &data, long streamLength, ReadStyle style = Average); + AudioProperties(const ByteVector &data, long streamLength, ReadStyle style = Average); /*! - * Create an instance of MPC::Properties with the data read directly from a MPC::File. + * Create an instance of MPC::AudioProperties with the data read directly from a MPC::File. */ - Properties(File *file, long streamLength, ReadStyle style = Average); + AudioProperties(File *file, long streamLength, ReadStyle style = Average); /*! - * Destroys this MPC::Properties instance. + * Destroys this MPC::AudioProperties instance. */ - virtual ~Properties(); + virtual ~AudioProperties(); /*! * Returns the length of the file in seconds. @@ -130,14 +130,14 @@ class TAGLIB_EXPORT Properties : public AudioProperties { int albumPeak() const; private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); void readSV7(const ByteVector &data, long streamLength); void readSV8(File *file, long streamLength); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace MPC } // namespace TagLib diff --git a/3rdparty/taglib/mpeg/mpegfile.cpp b/3rdparty/taglib/mpeg/mpegfile.cpp index ece75b142..92200dd67 100644 --- a/3rdparty/taglib/mpeg/mpegfile.cpp +++ b/3rdparty/taglib/mpeg/mpegfile.cpp @@ -71,7 +71,7 @@ class MPEG::File::FilePrivate { TagUnion tag; - Properties *properties; + AudioProperties *properties; }; //////////////////////////////////////////////////////////////////////////////// @@ -129,14 +129,14 @@ bool MPEG::File::isSupported(IOStream *stream) { // public members //////////////////////////////////////////////////////////////////////////////// -MPEG::File::File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate(frameFactory)) { +MPEG::File::File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate(frameFactory)) { if (isOpen()) read(readProperties); } -MPEG::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate(frameFactory)) { +MPEG::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate(frameFactory)) { if (isOpen()) read(readProperties); @@ -170,7 +170,7 @@ PropertyMap MPEG::File::setProperties(const PropertyMap &properties) { } -MPEG::Properties *MPEG::File::audioProperties() const { +MPEG::AudioProperties *MPEG::File::audioProperties() const { return d->properties; } @@ -480,7 +480,7 @@ void MPEG::File::read(bool readProperties) { } if (readProperties) - d->properties = new Properties(this); + d->properties = new AudioProperties(this); // Make sure that we have our default tag types available. diff --git a/3rdparty/taglib/mpeg/mpegfile.h b/3rdparty/taglib/mpeg/mpegfile.h index 74679cfaf..641ca997b 100644 --- a/3rdparty/taglib/mpeg/mpegfile.h +++ b/3rdparty/taglib/mpeg/mpegfile.h @@ -88,7 +88,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * \note In the current implementation, \a propertiesStyle is ignored. */ // BIC: merge with the above constructor - File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs an MPEG file from \a stream. @@ -102,7 +102,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { */ File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -145,10 +145,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { PropertyMap setProperties(const PropertyMap &); /*! - * Returns the MPEG::Properties for this file. + * Returns the MPEG::AudioProperties for this file. * If no audio properties were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Save the file. If at least one tag -- ID3v1 or ID3v2 -- exists this will duplicate its content into the other tag. diff --git a/3rdparty/taglib/mpeg/mpegproperties.cpp b/3rdparty/taglib/mpeg/mpegproperties.cpp index dab2dd5e6..4eab8d1bf 100644 --- a/3rdparty/taglib/mpeg/mpegproperties.cpp +++ b/3rdparty/taglib/mpeg/mpegproperties.cpp @@ -26,6 +26,7 @@ #include #include +#include "audioproperties.h" #include "mpegproperties.h" #include "mpegfile.h" #include "xingheader.h" @@ -34,9 +35,9 @@ using namespace Strawberry_TagLib::TagLib; -class MPEG::Properties::PropertiesPrivate { +class MPEG::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : xingHeader(nullptr), + AudioPropertiesPrivate() : xingHeader(nullptr), length(0), bitrate(0), sampleRate(0), @@ -48,7 +49,7 @@ class MPEG::Properties::PropertiesPrivate { isCopyrighted(false), isOriginal(false) {} - ~PropertiesPrivate() { + ~AudioPropertiesPrivate() { delete xingHeader; } @@ -69,63 +70,59 @@ class MPEG::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -MPEG::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { +MPEG::AudioProperties::AudioProperties(File *file, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) { read(file); } -MPEG::Properties::~Properties() { +MPEG::AudioProperties::~AudioProperties() { delete d; } -int MPEG::Properties::length() const { - return lengthInSeconds(); -} - -int MPEG::Properties::lengthInSeconds() const { +int MPEG::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int MPEG::Properties::lengthInMilliseconds() const { +int MPEG::AudioProperties::lengthInMilliseconds() const { return d->length; } -int MPEG::Properties::bitrate() const { +int MPEG::AudioProperties::bitrate() const { return d->bitrate; } -int MPEG::Properties::sampleRate() const { +int MPEG::AudioProperties::sampleRate() const { return d->sampleRate; } -int MPEG::Properties::channels() const { +int MPEG::AudioProperties::channels() const { return d->channels; } -const MPEG::XingHeader *MPEG::Properties::xingHeader() const { +const MPEG::XingHeader *MPEG::AudioProperties::xingHeader() const { return d->xingHeader; } -MPEG::Header::Version MPEG::Properties::version() const { +MPEG::Header::Version MPEG::AudioProperties::version() const { return d->version; } -int MPEG::Properties::layer() const { +int MPEG::AudioProperties::layer() const { return d->layer; } -bool MPEG::Properties::protectionEnabled() const { +bool MPEG::AudioProperties::protectionEnabled() const { return d->protectionEnabled; } -MPEG::Header::ChannelMode MPEG::Properties::channelMode() const { +MPEG::Header::ChannelMode MPEG::AudioProperties::channelMode() const { return d->channelMode; } -bool MPEG::Properties::isCopyrighted() const { +bool MPEG::AudioProperties::isCopyrighted() const { return d->isCopyrighted; } -bool MPEG::Properties::isOriginal() const { +bool MPEG::AudioProperties::isOriginal() const { return d->isOriginal; } @@ -133,13 +130,13 @@ bool MPEG::Properties::isOriginal() const { // private members //////////////////////////////////////////////////////////////////////////////// -void MPEG::Properties::read(File *file) { +void MPEG::AudioProperties::read(File *file) { // Only the first valid frame is required if we have a VBR header. const long firstFrameOffset = file->firstFrameOffset(); if (firstFrameOffset < 0) { - debug("MPEG::Properties::read() -- Could not find an MPEG frame in the stream."); + debug("MPEG::AudioProperties::read() -- Could not find an MPEG frame in the stream."); return; } @@ -179,7 +176,7 @@ void MPEG::Properties::read(File *file) { const long lastFrameOffset = file->lastFrameOffset(); if (lastFrameOffset < 0) { - debug("MPEG::Properties::read() -- Could not find an MPEG frame in the stream."); + debug("MPEG::AudioProperties::read() -- Could not find an MPEG frame in the stream."); return; } diff --git a/3rdparty/taglib/mpeg/mpegproperties.h b/3rdparty/taglib/mpeg/mpegproperties.h index 7cca92256..0d8c0f0c1 100644 --- a/3rdparty/taglib/mpeg/mpegproperties.h +++ b/3rdparty/taglib/mpeg/mpegproperties.h @@ -44,27 +44,17 @@ class XingHeader; * This reads the data from an MPEG Layer III stream found in the AudioProperties API. */ -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! - * Create an instance of MPEG::Properties with the data read from the MPEG::File \a file. + * Create an instance of MPEG::AudioProperties with the data read from the MPEG::File \a file. */ - Properties(File *file, ReadStyle style = Average); + AudioProperties(File *file, ReadStyle style = Average); /*! - * Destroys this MPEG Properties instance. + * Destroys this MPEG AudioProperties instance. */ - virtual ~Properties(); - - /*! - * Returns the length of the file in seconds. - * The length is rounded down to the nearest whole second. - * - * \note This method is just an alias of lengthInSeconds(). - * - * \deprecated - */ - virtual int length() const; + virtual ~AudioProperties(); /*! * Returns the length of the file in seconds. The length is rounded down to the nearest whole second. @@ -133,13 +123,13 @@ class TAGLIB_EXPORT Properties : public AudioProperties { bool isOriginal() const; private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); void read(File *file); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace MPEG diff --git a/3rdparty/taglib/ogg/flac/oggflacfile.cpp b/3rdparty/taglib/ogg/flac/oggflacfile.cpp index 5c7f98f22..78091a0a6 100644 --- a/3rdparty/taglib/ogg/flac/oggflacfile.cpp +++ b/3rdparty/taglib/ogg/flac/oggflacfile.cpp @@ -33,7 +33,7 @@ #include "oggflacfile.h" using namespace Strawberry_TagLib::TagLib; -using Strawberry_TagLib::TagLib::FLAC::Properties; +using Strawberry_TagLib::TagLib::FLAC::AudioProperties; class Ogg::FLAC::File::FilePrivate { public: @@ -52,7 +52,7 @@ class Ogg::FLAC::File::FilePrivate { Ogg::XiphComment *comment; - Properties *properties; + AudioProperties *properties; ByteVector streamInfoData; ByteVector xiphCommentData; long streamStart; @@ -78,14 +78,14 @@ bool Ogg::FLAC::File::isSupported(IOStream *stream) { // public members //////////////////////////////////////////////////////////////////////////////// -Ogg::FLAC::File::File(FileName file, bool readProperties, Properties::ReadStyle propertiesStyle) : Ogg::File(file), d(new FilePrivate()) { +Ogg::FLAC::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle propertiesStyle) : Ogg::File(file), d(new FilePrivate()) { if (isOpen()) read(readProperties, propertiesStyle); } -Ogg::FLAC::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle) : Ogg::File(stream), d(new FilePrivate()) { +Ogg::FLAC::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle propertiesStyle) : Ogg::File(stream), d(new FilePrivate()) { if (isOpen()) read(readProperties, propertiesStyle); @@ -108,7 +108,7 @@ PropertyMap Ogg::FLAC::File::setProperties(const PropertyMap &properties) { return d->comment->setProperties(properties); } -Properties *Ogg::FLAC::File::audioProperties() const { +FLAC::AudioProperties *Ogg::FLAC::File::audioProperties() const { return d->properties; } @@ -148,7 +148,7 @@ bool Ogg::FLAC::File::hasXiphComment() const { // private members //////////////////////////////////////////////////////////////////////////////// -void Ogg::FLAC::File::read(bool readProperties, Properties::ReadStyle propertiesStyle) { +void Ogg::FLAC::File::read(bool readProperties, AudioProperties::ReadStyle propertiesStyle) { // Sanity: Check if we really have an Ogg/FLAC file @@ -178,7 +178,7 @@ void Ogg::FLAC::File::read(bool readProperties, Properties::ReadStyle properties if (readProperties) - d->properties = new Properties(streamInfoData(), streamLength(), propertiesStyle); + d->properties = new AudioProperties(streamInfoData(), streamLength(), propertiesStyle); } diff --git a/3rdparty/taglib/ogg/flac/oggflacfile.h b/3rdparty/taglib/ogg/flac/oggflacfile.h index 809d41458..028b0de79 100644 --- a/3rdparty/taglib/ogg/flac/oggflacfile.h +++ b/3rdparty/taglib/ogg/flac/oggflacfile.h @@ -50,7 +50,7 @@ namespace Ogg { */ namespace FLAC { -using Strawberry_TagLib::TagLib::FLAC::Properties; +using Strawberry_TagLib::TagLib::FLAC::AudioProperties; //! An implementation of TagLib::File with Ogg/FLAC specific methods @@ -69,7 +69,7 @@ class TAGLIB_EXPORT File : public Ogg::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(FileName file, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs an Ogg/FLAC file from \a stream. @@ -79,7 +79,7 @@ class TAGLIB_EXPORT File : public Ogg::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(IOStream *stream, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(IOStream *stream, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -100,10 +100,10 @@ class TAGLIB_EXPORT File : public Ogg::File { virtual XiphComment *tag() const; /*! - * Returns the FLAC::Properties for this file. + * Returns the FLAC::AudioProperties for this file. * If no audio properties were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! @@ -126,7 +126,7 @@ class TAGLIB_EXPORT File : public Ogg::File { virtual bool save(); /*! - * Returns the length of the audio-stream, used by FLAC::Properties for calculating the bitrate. + * Returns the length of the audio-stream, used by FLAC::AudioProperties for calculating the bitrate. */ long streamLength(); @@ -148,7 +148,7 @@ class TAGLIB_EXPORT File : public Ogg::File { File(const File &); File &operator=(const File &); - void read(bool readProperties, Properties::ReadStyle propertiesStyle); + void read(bool readProperties, AudioProperties::ReadStyle propertiesStyle); void scan(); ByteVector streamInfoData(); ByteVector xiphCommentData(); diff --git a/3rdparty/taglib/ogg/opus/opusfile.cpp b/3rdparty/taglib/ogg/opus/opusfile.cpp index 0a8ba0bf0..5acd7006c 100644 --- a/3rdparty/taglib/ogg/opus/opusfile.cpp +++ b/3rdparty/taglib/ogg/opus/opusfile.cpp @@ -47,7 +47,7 @@ class Opus::File::FilePrivate { } Ogg::XiphComment *comment; - Properties *properties; + AudioProperties *properties; }; //////////////////////////////////////////////////////////////////////////////// @@ -67,14 +67,14 @@ bool Ogg::Opus::File::isSupported(IOStream *stream) { // public members //////////////////////////////////////////////////////////////////////////////// -Opus::File::File(FileName file, bool readProperties, Properties::ReadStyle) : Ogg::File(file), d(new FilePrivate()) { +Opus::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : Ogg::File(file), d(new FilePrivate()) { if (isOpen()) read(readProperties); } -Opus::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : Ogg::File(stream), d(new FilePrivate()) { +Opus::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle) : Ogg::File(stream), d(new FilePrivate()) { if (isOpen()) read(readProperties); @@ -97,7 +97,7 @@ PropertyMap Opus::File::setProperties(const PropertyMap &properties) { return d->comment->setProperties(properties); } -Opus::Properties *Opus::File::audioProperties() const { +Opus::AudioProperties *Opus::File::audioProperties() const { return d->properties; } @@ -137,6 +137,6 @@ void Opus::File::read(bool readProperties) { d->comment = new Ogg::XiphComment(commentHeaderData.mid(8)); if (readProperties) - d->properties = new Properties(this); + d->properties = new AudioProperties(this); } diff --git a/3rdparty/taglib/ogg/opus/opusfile.h b/3rdparty/taglib/ogg/opus/opusfile.h index 0e36b75de..a5d3c7601 100644 --- a/3rdparty/taglib/ogg/opus/opusfile.h +++ b/3rdparty/taglib/ogg/opus/opusfile.h @@ -61,7 +61,7 @@ class TAGLIB_EXPORT File : public Ogg::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(FileName file, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs an Opus file from \a stream. @@ -71,7 +71,7 @@ class TAGLIB_EXPORT File : public Ogg::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(IOStream *stream, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(IOStream *stream, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -97,10 +97,10 @@ class TAGLIB_EXPORT File : public Ogg::File { PropertyMap setProperties(const PropertyMap &); /*! - * Returns the Opus::Properties for this file. + * Returns the Opus::AudioProperties for this file. * If no audio properties were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Save the file. diff --git a/3rdparty/taglib/ogg/opus/opusproperties.cpp b/3rdparty/taglib/ogg/opus/opusproperties.cpp index 50baff7b4..6b5375e1f 100644 --- a/3rdparty/taglib/ogg/opus/opusproperties.cpp +++ b/3rdparty/taglib/ogg/opus/opusproperties.cpp @@ -38,9 +38,9 @@ using namespace Strawberry_TagLib::TagLib; using namespace Strawberry_TagLib::TagLib::Ogg; -class Opus::Properties::PropertiesPrivate { +class Opus::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : length(0), + AudioPropertiesPrivate() : length(0), bitrate(0), inputSampleRate(0), channels(0), @@ -57,27 +57,27 @@ class Opus::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -Opus::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { +Opus::AudioProperties::AudioProperties(File *file, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) { read(file); } -Opus::Properties::~Properties() { +Opus::AudioProperties::~AudioProperties() { delete d; } -int Ogg::Opus::Properties::lengthInSeconds() const { +int Ogg::Opus::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int Ogg::Opus::Properties::lengthInMilliseconds() const { +int Ogg::Opus::AudioProperties::lengthInMilliseconds() const { return d->length; } -int Opus::Properties::bitrate() const { +int Opus::AudioProperties::bitrate() const { return d->bitrate; } -int Opus::Properties::sampleRate() const { +int Opus::AudioProperties::sampleRate() const { // Opus can decode any stream at a sample rate of 8, 12, 16, 24, or 48 kHz, // so there is no single sample rate. Let's assume it's the highest @@ -86,15 +86,15 @@ int Opus::Properties::sampleRate() const { } -int Opus::Properties::channels() const { +int Opus::AudioProperties::channels() const { return d->channels; } -int Opus::Properties::inputSampleRate() const { +int Opus::AudioProperties::inputSampleRate() const { return d->inputSampleRate; } -int Opus::Properties::opusVersion() const { +int Opus::AudioProperties::opusVersion() const { return d->opusVersion; } @@ -102,7 +102,7 @@ int Opus::Properties::opusVersion() const { // private members //////////////////////////////////////////////////////////////////////////////// -void Opus::Properties::read(File *file) { +void Opus::AudioProperties::read(File *file) { // Get the identification header from the Ogg implementation. @@ -158,11 +158,11 @@ void Opus::Properties::read(File *file) { } } else { - debug("Opus::Properties::read() -- The PCM values for the start or " + debug("Opus::AudioProperties::read() -- The PCM values for the start or " "end of this file was incorrect."); } } else - debug("Opus::Properties::read() -- Could not find valid first and last Ogg pages."); + debug("Opus::AudioProperties::read() -- Could not find valid first and last Ogg pages."); } diff --git a/3rdparty/taglib/ogg/opus/opusproperties.h b/3rdparty/taglib/ogg/opus/opusproperties.h index ba93fb8a8..fad911605 100644 --- a/3rdparty/taglib/ogg/opus/opusproperties.h +++ b/3rdparty/taglib/ogg/opus/opusproperties.h @@ -47,18 +47,18 @@ class File; * This reads the data from an Ogg Opus stream found in the AudioProperties API. */ -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! - * Create an instance of Opus::Properties with the data read from the + * Create an instance of Opus::AudioProperties with the data read from the * Opus::File \a file. */ - Properties(File *file, ReadStyle style = Average); + AudioProperties(File *file, ReadStyle style = Average); /*! - * Destroys this Opus::Properties instance. + * Destroys this Opus::AudioProperties instance. */ - virtual ~Properties(); + virtual ~AudioProperties(); /*! * Returns the length of the file in seconds. The length is rounded down to the nearest whole second. @@ -105,13 +105,13 @@ class TAGLIB_EXPORT Properties : public AudioProperties { int opusVersion() const; private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); void read(File *file); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace Opus diff --git a/3rdparty/taglib/ogg/speex/speexfile.cpp b/3rdparty/taglib/ogg/speex/speexfile.cpp index 2fa50ac5e..c02d8e626 100644 --- a/3rdparty/taglib/ogg/speex/speexfile.cpp +++ b/3rdparty/taglib/ogg/speex/speexfile.cpp @@ -47,7 +47,7 @@ class Speex::File::FilePrivate { } Ogg::XiphComment *comment; - Properties *properties; + AudioProperties *properties; }; //////////////////////////////////////////////////////////////////////////////// @@ -67,12 +67,12 @@ bool Ogg::Speex::File::isSupported(IOStream *stream) { // public members //////////////////////////////////////////////////////////////////////////////// -Speex::File::File(FileName file, bool readProperties, Properties::ReadStyle) : Ogg::File(file), d(new FilePrivate()) { +Speex::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : Ogg::File(file), d(new FilePrivate()) { if (isOpen()) read(readProperties); } -Speex::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : Ogg::File(stream), d(new FilePrivate()) { +Speex::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle) : Ogg::File(stream), d(new FilePrivate()) { if (isOpen()) read(readProperties); } @@ -93,7 +93,7 @@ PropertyMap Speex::File::setProperties(const PropertyMap &properties) { return d->comment->setProperties(properties); } -Speex::Properties *Speex::File::audioProperties() const { +Speex::AudioProperties *Speex::File::audioProperties() const { return d->properties; } @@ -127,6 +127,6 @@ void Speex::File::read(bool readProperties) { d->comment = new Ogg::XiphComment(commentHeaderData); if (readProperties) - d->properties = new Properties(this); + d->properties = new AudioProperties(this); } diff --git a/3rdparty/taglib/ogg/speex/speexfile.h b/3rdparty/taglib/ogg/speex/speexfile.h index d63d52422..a7251e2a9 100644 --- a/3rdparty/taglib/ogg/speex/speexfile.h +++ b/3rdparty/taglib/ogg/speex/speexfile.h @@ -62,7 +62,7 @@ class TAGLIB_EXPORT File : public Ogg::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(FileName file, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs a Speex file from \a stream. @@ -72,7 +72,7 @@ class TAGLIB_EXPORT File : public Ogg::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(IOStream *stream, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(IOStream *stream, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -97,10 +97,10 @@ class TAGLIB_EXPORT File : public Ogg::File { PropertyMap setProperties(const PropertyMap &); /*! - * Returns the Speex::Properties for this file. + * Returns the Speex::AudioProperties for this file. * If no audio properties were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Save the file. diff --git a/3rdparty/taglib/ogg/speex/speexproperties.cpp b/3rdparty/taglib/ogg/speex/speexproperties.cpp index 93be4e6c4..51f2e23a6 100644 --- a/3rdparty/taglib/ogg/speex/speexproperties.cpp +++ b/3rdparty/taglib/ogg/speex/speexproperties.cpp @@ -38,9 +38,9 @@ using namespace Strawberry_TagLib::TagLib; using namespace Strawberry_TagLib::TagLib::Ogg; -class Speex::Properties::PropertiesPrivate { +class Speex::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : length(0), + AudioPropertiesPrivate() : length(0), bitrate(0), bitrateNominal(0), sampleRate(0), @@ -63,39 +63,39 @@ class Speex::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -Speex::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { +Speex::AudioProperties::AudioProperties(File *file, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) { read(file); } -Speex::Properties::~Properties() { +Speex::AudioProperties::~AudioProperties() { delete d; } -int Speex::Properties::lengthInSeconds() const { +int Speex::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int Speex::Properties::lengthInMilliseconds() const { +int Speex::AudioProperties::lengthInMilliseconds() const { return d->length; } -int Speex::Properties::bitrate() const { +int Speex::AudioProperties::bitrate() const { return d->bitrate; } -int Speex::Properties::bitrateNominal() const { +int Speex::AudioProperties::bitrateNominal() const { return d->bitrateNominal; } -int Speex::Properties::sampleRate() const { +int Speex::AudioProperties::sampleRate() const { return d->sampleRate; } -int Speex::Properties::channels() const { +int Speex::AudioProperties::channels() const { return d->channels; } -int Speex::Properties::speexVersion() const { +int Speex::AudioProperties::speexVersion() const { return d->speexVersion; } @@ -103,13 +103,13 @@ int Speex::Properties::speexVersion() const { // private members //////////////////////////////////////////////////////////////////////////////// -void Speex::Properties::read(File *file) { +void Speex::AudioProperties::read(File *file) { // Get the identification header from the Ogg implementation. const ByteVector data = file->packet(0); if (data.size() < 64) { - debug("Speex::Properties::read() -- data is too short."); + debug("Speex::AudioProperties::read() -- data is too short."); return; } @@ -175,12 +175,12 @@ void Speex::Properties::read(File *file) { } } else { - debug("Speex::Properties::read() -- Either the PCM values for the start or " + debug("Speex::AudioProperties::read() -- Either the PCM values for the start or " "end of this file was incorrect or the sample rate is zero."); } } else - debug("Speex::Properties::read() -- Could not find valid first and last Ogg pages."); + debug("Speex::AudioProperties::read() -- Could not find valid first and last Ogg pages."); // Alternative to the actual average bitrate. diff --git a/3rdparty/taglib/ogg/speex/speexproperties.h b/3rdparty/taglib/ogg/speex/speexproperties.h index 9b65f7ce1..e64967f02 100644 --- a/3rdparty/taglib/ogg/speex/speexproperties.h +++ b/3rdparty/taglib/ogg/speex/speexproperties.h @@ -42,17 +42,17 @@ class File; //! An implementation of audio property reading for Ogg Speex //! This reads the data from an Ogg Speex stream found in the AudioProperties API. -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! - * Create an instance of Speex::Properties with the data read from the Speex::File \a file. + * Create an instance of Speex::AudioProperties with the data read from the Speex::File \a file. */ - Properties(File *file, ReadStyle style = Average); + AudioProperties(File *file, ReadStyle style = Average); /*! - * Destroys this Speex::Properties instance. + * Destroys this Speex::AudioProperties instance. */ - virtual ~Properties(); + virtual ~AudioProperties(); /*! * Returns the length of the file in seconds. The length is rounded down to the nearest whole second. @@ -96,13 +96,13 @@ class TAGLIB_EXPORT Properties : public AudioProperties { int speexVersion() const; private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); void read(File *file); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace Speex diff --git a/3rdparty/taglib/ogg/vorbis/vorbisfile.cpp b/3rdparty/taglib/ogg/vorbis/vorbisfile.cpp index 8be957de9..1abdfc214 100644 --- a/3rdparty/taglib/ogg/vorbis/vorbisfile.cpp +++ b/3rdparty/taglib/ogg/vorbis/vorbisfile.cpp @@ -44,7 +44,7 @@ class Vorbis::File::FilePrivate { } Ogg::XiphComment *comment; - Properties *properties; + AudioProperties *properties; }; namespace Strawberry_TagLib { @@ -72,13 +72,13 @@ bool Vorbis::File::isSupported(IOStream *stream) { // public members //////////////////////////////////////////////////////////////////////////////// -Vorbis::File::File(FileName file, bool readProperties, Properties::ReadStyle) : Ogg::File(file), +Vorbis::File::File(FileName file, bool readProperties, Strawberry_TagLib::TagLib::AudioProperties::ReadStyle) : Ogg::File(file), d(new FilePrivate()) { if (isOpen()) read(readProperties); } -Vorbis::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : Ogg::File(stream), +Vorbis::File::File(IOStream *stream, bool readProperties, Strawberry_TagLib::TagLib::AudioProperties::ReadStyle) : Ogg::File(stream), d(new FilePrivate()) { if (isOpen()) read(readProperties); @@ -100,7 +100,7 @@ PropertyMap Vorbis::File::setProperties(const PropertyMap &properties) { return d->comment->setProperties(properties); } -Vorbis::Properties *Vorbis::File::audioProperties() const { +Vorbis::AudioProperties *Vorbis::File::audioProperties() const { return d->properties; } @@ -135,6 +135,6 @@ void Vorbis::File::read(bool readProperties) { d->comment = new Ogg::XiphComment(commentHeaderData.mid(7)); if (readProperties) - d->properties = new Properties(this); + d->properties = new AudioProperties(this); } diff --git a/3rdparty/taglib/ogg/vorbis/vorbisfile.h b/3rdparty/taglib/ogg/vorbis/vorbisfile.h index 5d376748f..3eea68c37 100644 --- a/3rdparty/taglib/ogg/vorbis/vorbisfile.h +++ b/3rdparty/taglib/ogg/vorbis/vorbisfile.h @@ -64,7 +64,7 @@ class TAGLIB_EXPORT File : public Ogg::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(FileName file, bool readProperties = true, Strawberry_TagLib::TagLib::AudioProperties::ReadStyle propertiesStyle = Strawberry_TagLib::TagLib::AudioProperties::Average); /*! * Constructs a Vorbis file from \a stream. @@ -74,7 +74,7 @@ class TAGLIB_EXPORT File : public Ogg::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(IOStream *stream, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(IOStream *stream, bool readProperties = true, Strawberry_TagLib::TagLib::AudioProperties::ReadStyle propertiesStyle = Strawberry_TagLib::TagLib::AudioProperties::Average); /*! * Destroys this instance of the File. @@ -101,9 +101,9 @@ class TAGLIB_EXPORT File : public Ogg::File { PropertyMap setProperties(const PropertyMap &); /*! - * Returns the Vorbis::Properties for this file. If no audio properties were read then this will return a null pointer. + * Returns the Vorbis::AudioProperties for this file. If no audio properties were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Save the file. diff --git a/3rdparty/taglib/ogg/vorbis/vorbisproperties.cpp b/3rdparty/taglib/ogg/vorbis/vorbisproperties.cpp index 373ce727b..8d68557b3 100644 --- a/3rdparty/taglib/ogg/vorbis/vorbisproperties.cpp +++ b/3rdparty/taglib/ogg/vorbis/vorbisproperties.cpp @@ -33,9 +33,9 @@ using namespace Strawberry_TagLib::TagLib; -class Vorbis::Properties::PropertiesPrivate { +class Vorbis::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : length(0), + AudioPropertiesPrivate() : length(0), bitrate(0), sampleRate(0), channels(0), @@ -68,47 +68,47 @@ static const char vorbisSetupHeaderID[] = { 0x01, 'v', 'o', 'r', 'b', 'i', 's', // public members //////////////////////////////////////////////////////////////////////////////// -Vorbis::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { +Vorbis::AudioProperties::AudioProperties(File *file, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) { read(file); } -Vorbis::Properties::~Properties() { +Vorbis::AudioProperties::~AudioProperties() { delete d; } -int Vorbis::Properties::lengthInSeconds() const { +int Vorbis::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int Vorbis::Properties::lengthInMilliseconds() const { +int Vorbis::AudioProperties::lengthInMilliseconds() const { return d->length; } -int Vorbis::Properties::bitrate() const { +int Vorbis::AudioProperties::bitrate() const { return d->bitrate; } -int Vorbis::Properties::sampleRate() const { +int Vorbis::AudioProperties::sampleRate() const { return d->sampleRate; } -int Vorbis::Properties::channels() const { +int Vorbis::AudioProperties::channels() const { return d->channels; } -int Vorbis::Properties::vorbisVersion() const { +int Vorbis::AudioProperties::vorbisVersion() const { return d->vorbisVersion; } -int Vorbis::Properties::bitrateMaximum() const { +int Vorbis::AudioProperties::bitrateMaximum() const { return d->bitrateMaximum; } -int Vorbis::Properties::bitrateNominal() const { +int Vorbis::AudioProperties::bitrateNominal() const { return d->bitrateNominal; } -int Vorbis::Properties::bitrateMinimum() const { +int Vorbis::AudioProperties::bitrateMinimum() const { return d->bitrateMinimum; } @@ -116,20 +116,20 @@ int Vorbis::Properties::bitrateMinimum() const { // private members //////////////////////////////////////////////////////////////////////////////// -void Vorbis::Properties::read(File *file) { +void Vorbis::AudioProperties::read(File *file) { // Get the identification header from the Ogg implementation. const ByteVector data = file->packet(0); if (data.size() < 28) { - debug("Vorbis::Properties::read() -- data is too short."); + debug("Vorbis::AudioProperties::read() -- data is too short."); return; } unsigned int pos = 0; if (data.mid(pos, 7) != vorbisSetupHeaderID) { - debug("Vorbis::Properties::read() -- invalid Vorbis identification header"); + debug("Vorbis::AudioProperties::read() -- invalid Vorbis identification header"); return; } @@ -179,12 +179,12 @@ void Vorbis::Properties::read(File *file) { } } else { - debug("Vorbis::Properties::read() -- Either the PCM values for the start or " + debug("Vorbis::AudioProperties::read() -- Either the PCM values for the start or " "end of this file was incorrect or the sample rate is zero."); } } else - debug("Vorbis::Properties::read() -- Could not find valid first and last Ogg pages."); + debug("Vorbis::AudioProperties::read() -- Could not find valid first and last Ogg pages."); // Alternative to the actual average bitrate. diff --git a/3rdparty/taglib/ogg/vorbis/vorbisproperties.h b/3rdparty/taglib/ogg/vorbis/vorbisproperties.h index ce1a3ac0a..1efebdbd5 100644 --- a/3rdparty/taglib/ogg/vorbis/vorbisproperties.h +++ b/3rdparty/taglib/ogg/vorbis/vorbisproperties.h @@ -52,17 +52,17 @@ class File; * This reads the data from an Ogg Vorbis stream found in the AudioProperties API. */ -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! - * Create an instance of Vorbis::Properties with the data read from the Vorbis::File \a file. + * Create an instance of Vorbis::AudioProperties with the data read from the Vorbis::File \a file. */ - Properties(File *file, ReadStyle style = Average); + AudioProperties(File *file, ReadStyle style = Average); /*! * Destroys this VorbisProperties instance. */ - virtual ~Properties(); + virtual ~AudioProperties(); /*! * Returns the length of the file in seconds. The length is rounded down to the nearest whole second. @@ -116,13 +116,13 @@ class TAGLIB_EXPORT Properties : public AudioProperties { int bitrateMinimum() const; private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); void read(File *file); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace Vorbis diff --git a/3rdparty/taglib/riff/aiff/aifffile.cpp b/3rdparty/taglib/riff/aiff/aifffile.cpp index 384d10c15..d68a9396f 100644 --- a/3rdparty/taglib/riff/aiff/aifffile.cpp +++ b/3rdparty/taglib/riff/aiff/aifffile.cpp @@ -43,7 +43,7 @@ class RIFF::AIFF::File::FilePrivate { delete tag; } - Properties *properties; + AudioProperties *properties; ID3v2::Tag *tag; bool hasID3v2; @@ -66,13 +66,13 @@ bool RIFF::AIFF::File::isSupported(IOStream *stream) { // public members //////////////////////////////////////////////////////////////////////////////// -RIFF::AIFF::File::File(FileName file, bool readProperties, Properties::ReadStyle) : RIFF::File(file, BigEndian), d(new FilePrivate()) { +RIFF::AIFF::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : RIFF::File(file, BigEndian), d(new FilePrivate()) { if (isOpen()) read(readProperties); } -RIFF::AIFF::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : RIFF::File(stream, BigEndian), d(new FilePrivate()) { +RIFF::AIFF::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle) : RIFF::File(stream, BigEndian), d(new FilePrivate()) { if (isOpen()) read(readProperties); @@ -98,7 +98,7 @@ PropertyMap RIFF::AIFF::File::setProperties(const PropertyMap &properties) { return d->tag->setProperties(properties); } -RIFF::AIFF::Properties *RIFF::AIFF::File::audioProperties() const { +RIFF::AIFF::AudioProperties *RIFF::AIFF::File::audioProperties() const { return d->properties; } @@ -160,6 +160,6 @@ void RIFF::AIFF::File::read(bool readProperties) { d->tag = new ID3v2::Tag(); if (readProperties) - d->properties = new Properties(this, Properties::Average); + d->properties = new AudioProperties(this, AudioProperties::Average); } diff --git a/3rdparty/taglib/riff/aiff/aifffile.h b/3rdparty/taglib/riff/aiff/aifffile.h index 55643e5c2..ac0fb213b 100644 --- a/3rdparty/taglib/riff/aiff/aifffile.h +++ b/3rdparty/taglib/riff/aiff/aifffile.h @@ -63,7 +63,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File { * \note In the current implementation, \a propertiesStyle is ignored. */ File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs an AIFF file from \a stream. @@ -75,7 +75,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File { * \note In the current implementation, \a propertiesStyle is ignored. */ File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -107,10 +107,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File { PropertyMap setProperties(const PropertyMap &); /*! - * Returns the AIFF::Properties for this file. + * Returns the AIFF::AudioProperties for this file. * If no audio properties were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Saves the file. @@ -143,7 +143,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File { void read(bool readProperties); - friend class Properties; + friend class AudioProperties; class FilePrivate; FilePrivate *d; diff --git a/3rdparty/taglib/riff/aiff/aiffproperties.cpp b/3rdparty/taglib/riff/aiff/aiffproperties.cpp index 1967e8fba..b40107206 100644 --- a/3rdparty/taglib/riff/aiff/aiffproperties.cpp +++ b/3rdparty/taglib/riff/aiff/aiffproperties.cpp @@ -30,9 +30,9 @@ using namespace Strawberry_TagLib::TagLib; -class RIFF::AIFF::Properties::PropertiesPrivate { +class RIFF::AIFF::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : length(0), + AudioPropertiesPrivate() : length(0), bitrate(0), sampleRate(0), channels(0), @@ -55,51 +55,51 @@ class RIFF::AIFF::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -RIFF::AIFF::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { +RIFF::AIFF::AudioProperties::AudioProperties(File *file, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) { read(file); } -RIFF::AIFF::Properties::~Properties() { +RIFF::AIFF::AudioProperties::~AudioProperties() { delete d; } -int RIFF::AIFF::Properties::lengthInSeconds() const { +int RIFF::AIFF::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int RIFF::AIFF::Properties::lengthInMilliseconds() const { +int RIFF::AIFF::AudioProperties::lengthInMilliseconds() const { return d->length; } -int RIFF::AIFF::Properties::bitrate() const { +int RIFF::AIFF::AudioProperties::bitrate() const { return d->bitrate; } -int RIFF::AIFF::Properties::sampleRate() const { +int RIFF::AIFF::AudioProperties::sampleRate() const { return d->sampleRate; } -int RIFF::AIFF::Properties::channels() const { +int RIFF::AIFF::AudioProperties::channels() const { return d->channels; } -int RIFF::AIFF::Properties::bitsPerSample() const { +int RIFF::AIFF::AudioProperties::bitsPerSample() const { return d->bitsPerSample; } -unsigned int RIFF::AIFF::Properties::sampleFrames() const { +unsigned int RIFF::AIFF::AudioProperties::sampleFrames() const { return d->sampleFrames; } -bool RIFF::AIFF::Properties::isAiffC() const { +bool RIFF::AIFF::AudioProperties::isAiffC() const { return (!d->compressionType.isEmpty()); } -ByteVector RIFF::AIFF::Properties::compressionType() const { +ByteVector RIFF::AIFF::AudioProperties::compressionType() const { return d->compressionType; } -String RIFF::AIFF::Properties::compressionName() const { +String RIFF::AIFF::AudioProperties::compressionName() const { return d->compressionName; } @@ -107,7 +107,7 @@ String RIFF::AIFF::Properties::compressionName() const { // private members //////////////////////////////////////////////////////////////////////////////// -void RIFF::AIFF::Properties::read(File *file) { +void RIFF::AIFF::AudioProperties::read(File *file) { ByteVector data; unsigned int streamLength = 0; @@ -117,23 +117,23 @@ void RIFF::AIFF::Properties::read(File *file) { if (data.isEmpty()) data = file->chunkData(i); else - debug("RIFF::AIFF::Properties::read() - Duplicate 'COMM' chunk found."); + debug("RIFF::AIFF::AudioProperties::read() - Duplicate 'COMM' chunk found."); } else if (name == "SSND") { if (streamLength == 0) streamLength = file->chunkDataSize(i) + file->chunkPadding(i); else - debug("RIFF::AIFF::Properties::read() - Duplicate 'SSND' chunk found."); + debug("RIFF::AIFF::AudioProperties::read() - Duplicate 'SSND' chunk found."); } } if (data.size() < 18) { - debug("RIFF::AIFF::Properties::read() - 'COMM' chunk not found or too short."); + debug("RIFF::AIFF::AudioProperties::read() - 'COMM' chunk not found or too short."); return; } if (streamLength == 0) { - debug("RIFF::AIFF::Properties::read() - 'SSND' chunk not found."); + debug("RIFF::AIFF::AudioProperties::read() - 'SSND' chunk not found."); return; } diff --git a/3rdparty/taglib/riff/aiff/aiffproperties.h b/3rdparty/taglib/riff/aiff/aiffproperties.h index 02336dcb5..79393cce2 100644 --- a/3rdparty/taglib/riff/aiff/aiffproperties.h +++ b/3rdparty/taglib/riff/aiff/aiffproperties.h @@ -41,18 +41,18 @@ class File; * This reads the data from an AIFF stream found in the AudioProperties API. */ -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! - * Create an instance of AIFF::Properties with the data read from the AIFF::File \a file. + * Create an instance of AIFF::AudioProperties with the data read from the AIFF::File \a file. */ - Properties(File *file, ReadStyle style); + AudioProperties(File *file, ReadStyle style); /*! - * Destroys this AIFF::Properties instance. + * Destroys this AIFF::AudioProperties instance. */ - virtual ~Properties(); + virtual ~AudioProperties(); /*! * Returns the length of the file in seconds. The length is rounded down to the nearest whole second. @@ -119,13 +119,13 @@ class TAGLIB_EXPORT Properties : public AudioProperties { String compressionName() const; private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); void read(File *file); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace AIFF } // namespace RIFF diff --git a/3rdparty/taglib/riff/wav/wavfile.cpp b/3rdparty/taglib/riff/wav/wavfile.cpp index b2c5ae2a9..e39b57e28 100644 --- a/3rdparty/taglib/riff/wav/wavfile.cpp +++ b/3rdparty/taglib/riff/wav/wavfile.cpp @@ -51,7 +51,7 @@ class RIFF::WAV::File::FilePrivate { delete properties; } - Properties *properties; + AudioProperties *properties; TagUnion tag; bool hasID3v2; @@ -75,14 +75,14 @@ bool RIFF::WAV::File::isSupported(IOStream *stream) { // public members //////////////////////////////////////////////////////////////////////////////// -RIFF::WAV::File::File(FileName file, bool readProperties, Properties::ReadStyle) : RIFF::File(file, LittleEndian), d(new FilePrivate()) { +RIFF::WAV::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : RIFF::File(file, LittleEndian), d(new FilePrivate()) { if (isOpen()) read(readProperties); } -RIFF::WAV::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : RIFF::File(stream, LittleEndian), d(new FilePrivate()) { +RIFF::WAV::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle) : RIFF::File(stream, LittleEndian), d(new FilePrivate()) { if (isOpen()) read(readProperties); @@ -132,7 +132,7 @@ PropertyMap RIFF::WAV::File::setProperties(const PropertyMap &properties) { } -RIFF::WAV::Properties *RIFF::WAV::File::audioProperties() const { +RIFF::WAV::AudioProperties *RIFF::WAV::File::audioProperties() const { return d->properties; } @@ -223,7 +223,7 @@ void RIFF::WAV::File::read(bool readProperties) { d->tag.set(InfoIndex, new RIFF::Info::Tag()); if (readProperties) - d->properties = new Properties(this, Properties::Average); + d->properties = new AudioProperties(this, AudioProperties::Average); } void RIFF::WAV::File::removeTagChunks(TagTypes tags) { diff --git a/3rdparty/taglib/riff/wav/wavfile.h b/3rdparty/taglib/riff/wav/wavfile.h index 83d55bad7..6f0b2d290 100644 --- a/3rdparty/taglib/riff/wav/wavfile.h +++ b/3rdparty/taglib/riff/wav/wavfile.h @@ -75,7 +75,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(FileName file, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs a WAV file from \a stream. @@ -85,7 +85,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(IOStream *stream, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(IOStream *stream, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -142,10 +142,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File { PropertyMap setProperties(const PropertyMap &); /*! - * Returns the WAV::Properties for this file. If no audio properties + * Returns the WAV::AudioProperties for this file. If no audio properties * were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Saves the file. @@ -187,7 +187,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File { void read(bool readProperties); void removeTagChunks(TagTypes tags); - friend class Properties; + friend class AudioProperties; class FilePrivate; FilePrivate *d; diff --git a/3rdparty/taglib/riff/wav/wavproperties.cpp b/3rdparty/taglib/riff/wav/wavproperties.cpp index d9dbcfa0d..be2aab5a2 100644 --- a/3rdparty/taglib/riff/wav/wavproperties.cpp +++ b/3rdparty/taglib/riff/wav/wavproperties.cpp @@ -37,9 +37,9 @@ enum WaveFormat { }; } // namespace -class RIFF::WAV::Properties::PropertiesPrivate { +class RIFF::WAV::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : format(0), + AudioPropertiesPrivate() : format(0), length(0), bitrate(0), sampleRate(0), @@ -60,43 +60,43 @@ class RIFF::WAV::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -Strawberry_TagLib::TagLib::RIFF::WAV::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style),d(new PropertiesPrivate()) { +Strawberry_TagLib::TagLib::RIFF::WAV::AudioProperties::AudioProperties(File *file, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style),d(new AudioPropertiesPrivate()) { read(file); } -RIFF::WAV::Properties::~Properties() { +RIFF::WAV::AudioProperties::~AudioProperties() { delete d; } -int RIFF::WAV::Properties::lengthInSeconds() const { +int RIFF::WAV::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int RIFF::WAV::Properties::lengthInMilliseconds() const { +int RIFF::WAV::AudioProperties::lengthInMilliseconds() const { return d->length; } -int RIFF::WAV::Properties::bitrate() const { +int RIFF::WAV::AudioProperties::bitrate() const { return d->bitrate; } -int RIFF::WAV::Properties::sampleRate() const { +int RIFF::WAV::AudioProperties::sampleRate() const { return d->sampleRate; } -int RIFF::WAV::Properties::channels() const { +int RIFF::WAV::AudioProperties::channels() const { return d->channels; } -int RIFF::WAV::Properties::bitsPerSample() const { +int RIFF::WAV::AudioProperties::bitsPerSample() const { return d->bitsPerSample; } -unsigned int RIFF::WAV::Properties::sampleFrames() const { +unsigned int RIFF::WAV::AudioProperties::sampleFrames() const { return d->sampleFrames; } -int RIFF::WAV::Properties::format() const { +int RIFF::WAV::AudioProperties::format() const { return d->format; } @@ -104,7 +104,7 @@ int RIFF::WAV::Properties::format() const { // private members //////////////////////////////////////////////////////////////////////////////// -void RIFF::WAV::Properties::read(File *file) { +void RIFF::WAV::AudioProperties::read(File *file) { ByteVector data; unsigned int streamLength = 0; @@ -116,35 +116,35 @@ void RIFF::WAV::Properties::read(File *file) { if (data.isEmpty()) data = file->chunkData(i); else - debug("RIFF::WAV::Properties::read() - Duplicate 'fmt ' chunk found."); + debug("RIFF::WAV::AudioProperties::read() - Duplicate 'fmt ' chunk found."); } else if (name == "data") { if (streamLength == 0) streamLength = file->chunkDataSize(i) + file->chunkPadding(i); else - debug("RIFF::WAV::Properties::read() - Duplicate 'data' chunk found."); + debug("RIFF::WAV::AudioProperties::read() - Duplicate 'data' chunk found."); } else if (name == "fact") { if (totalSamples == 0) totalSamples = file->chunkData(i).toUInt(0, false); else - debug("RIFF::WAV::Properties::read() - Duplicate 'fact' chunk found."); + debug("RIFF::WAV::AudioProperties::read() - Duplicate 'fact' chunk found."); } } if (data.size() < 16) { - debug("RIFF::WAV::Properties::read() - 'fmt ' chunk not found or too short."); + debug("RIFF::WAV::AudioProperties::read() - 'fmt ' chunk not found or too short."); return; } if (streamLength == 0) { - debug("RIFF::WAV::Properties::read() - 'data' chunk not found."); + debug("RIFF::WAV::AudioProperties::read() - 'data' chunk not found."); return; } d->format = data.toShort(0, false); if (d->format != FORMAT_PCM && totalSamples == 0) { - debug("RIFF::WAV::Properties::read() - Non-PCM format, but 'fact' chunk not found."); + debug("RIFF::WAV::AudioProperties::read() - Non-PCM format, but 'fact' chunk not found."); return; } diff --git a/3rdparty/taglib/riff/wav/wavproperties.h b/3rdparty/taglib/riff/wav/wavproperties.h index 78ee5596e..0de2e4406 100644 --- a/3rdparty/taglib/riff/wav/wavproperties.h +++ b/3rdparty/taglib/riff/wav/wavproperties.h @@ -46,17 +46,17 @@ class File; * API. */ -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! - * Create an instance of WAV::Properties with the data read from the WAV::File \a file. + * Create an instance of WAV::AudioProperties with the data read from the WAV::File \a file. */ - Properties(File *file, ReadStyle style); + AudioProperties(File *file, ReadStyle style); /*! - * Destroys this WAV::Properties instance. + * Destroys this WAV::AudioProperties instance. */ - virtual ~Properties(); + virtual ~AudioProperties(); /*! * Returns the length of the file in seconds. @@ -109,13 +109,13 @@ class TAGLIB_EXPORT Properties : public AudioProperties { int format() const; private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); void read(File *file); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace WAV diff --git a/3rdparty/taglib/s3m/s3mfile.cpp b/3rdparty/taglib/s3m/s3mfile.cpp index fc174be93..f43bddc3f 100644 --- a/3rdparty/taglib/s3m/s3mfile.cpp +++ b/3rdparty/taglib/s3m/s3mfile.cpp @@ -40,7 +40,7 @@ class S3M::File::FilePrivate { explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : properties(propertiesStyle) {} Mod::Tag tag; - S3M::Properties properties; + S3M::AudioProperties properties; }; S3M::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle propertiesStyle) : Mod::FileBase(file), d(new FilePrivate(propertiesStyle)) { @@ -73,7 +73,7 @@ PropertyMap S3M::File::setProperties(const PropertyMap &properties) { return d->tag.setProperties(properties); } -S3M::Properties *S3M::File::audioProperties() const { +S3M::AudioProperties *S3M::File::audioProperties() const { return &d->properties; } diff --git a/3rdparty/taglib/s3m/s3mfile.h b/3rdparty/taglib/s3m/s3mfile.h index f2d8f60e9..ad2e53daf 100644 --- a/3rdparty/taglib/s3m/s3mfile.h +++ b/3rdparty/taglib/s3m/s3mfile.h @@ -77,10 +77,10 @@ class TAGLIB_EXPORT File : public Mod::FileBase { PropertyMap setProperties(const PropertyMap &); /*! - * Returns the S3M::Properties for this file. If no audio properties + * Returns the S3M::AudioProperties for this file. If no audio properties * were read then this will return a null pointer. */ - S3M::Properties *audioProperties() const; + S3M::AudioProperties *audioProperties() const; /*! * Save the file. diff --git a/3rdparty/taglib/s3m/s3mproperties.cpp b/3rdparty/taglib/s3m/s3mproperties.cpp index 698b47ec3..87aa46036 100644 --- a/3rdparty/taglib/s3m/s3mproperties.cpp +++ b/3rdparty/taglib/s3m/s3mproperties.cpp @@ -29,9 +29,9 @@ using namespace Strawberry_TagLib::TagLib; using namespace S3M; -class S3M::Properties::PropertiesPrivate { +class S3M::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : lengthInPatterns(0), + AudioPropertiesPrivate() : lengthInPatterns(0), channels(0), stereo(false), sampleCount(0), @@ -59,124 +59,120 @@ class S3M::Properties::PropertiesPrivate { unsigned char bpmSpeed; }; -S3M::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) : AudioProperties(propertiesStyle), d(new PropertiesPrivate()) {} +S3M::AudioProperties::AudioProperties(AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::AudioProperties(propertiesStyle), d(new AudioPropertiesPrivate()) {} -S3M::Properties::~Properties() { +S3M::AudioProperties::~AudioProperties() { delete d; } -int S3M::Properties::length() const { +int S3M::AudioProperties::lengthInSeconds() const { return 0; } -int S3M::Properties::lengthInSeconds() const { +int S3M::AudioProperties::lengthInMilliseconds() const { return 0; } -int S3M::Properties::lengthInMilliseconds() const { +int S3M::AudioProperties::bitrate() const { return 0; } -int S3M::Properties::bitrate() const { +int S3M::AudioProperties::sampleRate() const { return 0; } -int S3M::Properties::sampleRate() const { - return 0; -} - -int S3M::Properties::channels() const { +int S3M::AudioProperties::channels() const { return d->channels; } -unsigned short S3M::Properties::lengthInPatterns() const { +unsigned short S3M::AudioProperties::lengthInPatterns() const { return d->lengthInPatterns; } -bool S3M::Properties::stereo() const { +bool S3M::AudioProperties::stereo() const { return d->stereo; } -unsigned short S3M::Properties::sampleCount() const { +unsigned short S3M::AudioProperties::sampleCount() const { return d->sampleCount; } -unsigned short S3M::Properties::patternCount() const { +unsigned short S3M::AudioProperties::patternCount() const { return d->patternCount; } -unsigned short S3M::Properties::flags() const { +unsigned short S3M::AudioProperties::flags() const { return d->flags; } -unsigned short S3M::Properties::trackerVersion() const { +unsigned short S3M::AudioProperties::trackerVersion() const { return d->trackerVersion; } -unsigned short S3M::Properties::fileFormatVersion() const { +unsigned short S3M::AudioProperties::fileFormatVersion() const { return d->fileFormatVersion; } -unsigned char S3M::Properties::globalVolume() const { +unsigned char S3M::AudioProperties::globalVolume() const { return d->globalVolume; } -unsigned char S3M::Properties::masterVolume() const { +unsigned char S3M::AudioProperties::masterVolume() const { return d->masterVolume; } -unsigned char S3M::Properties::tempo() const { +unsigned char S3M::AudioProperties::tempo() const { return d->tempo; } -unsigned char S3M::Properties::bpmSpeed() const { +unsigned char S3M::AudioProperties::bpmSpeed() const { return d->bpmSpeed; } -void S3M::Properties::setLengthInPatterns(unsigned short lengthInPatterns) { +void S3M::AudioProperties::setLengthInPatterns(unsigned short lengthInPatterns) { d->lengthInPatterns = lengthInPatterns; } -void S3M::Properties::setChannels(int channels) { +void S3M::AudioProperties::setChannels(int channels) { d->channels = channels; } -void S3M::Properties::setStereo(bool stereo) { +void S3M::AudioProperties::setStereo(bool stereo) { d->stereo = stereo; } -void S3M::Properties::setSampleCount(unsigned short sampleCount) { +void S3M::AudioProperties::setSampleCount(unsigned short sampleCount) { d->sampleCount = sampleCount; } -void S3M::Properties::setPatternCount(unsigned short patternCount) { +void S3M::AudioProperties::setPatternCount(unsigned short patternCount) { d->patternCount = patternCount; } -void S3M::Properties::setFlags(unsigned short flags) { +void S3M::AudioProperties::setFlags(unsigned short flags) { d->flags = flags; } -void S3M::Properties::setTrackerVersion(unsigned short trackerVersion) { +void S3M::AudioProperties::setTrackerVersion(unsigned short trackerVersion) { d->trackerVersion = trackerVersion; } -void S3M::Properties::setFileFormatVersion(unsigned short fileFormatVersion) { +void S3M::AudioProperties::setFileFormatVersion(unsigned short fileFormatVersion) { d->fileFormatVersion = fileFormatVersion; } -void S3M::Properties::setGlobalVolume(unsigned char globalVolume) { +void S3M::AudioProperties::setGlobalVolume(unsigned char globalVolume) { d->globalVolume = globalVolume; } -void S3M::Properties::setMasterVolume(unsigned char masterVolume) { +void S3M::AudioProperties::setMasterVolume(unsigned char masterVolume) { d->masterVolume = masterVolume; } -void S3M::Properties::setTempo(unsigned char tempo) { +void S3M::AudioProperties::setTempo(unsigned char tempo) { d->tempo = tempo; } -void S3M::Properties::setBpmSpeed(unsigned char bpmSpeed) { +void S3M::AudioProperties::setBpmSpeed(unsigned char bpmSpeed) { d->bpmSpeed = bpmSpeed; } diff --git a/3rdparty/taglib/s3m/s3mproperties.h b/3rdparty/taglib/s3m/s3mproperties.h index 17111ca91..aff47baf6 100644 --- a/3rdparty/taglib/s3m/s3mproperties.h +++ b/3rdparty/taglib/s3m/s3mproperties.h @@ -33,7 +33,7 @@ namespace Strawberry_TagLib { namespace TagLib { namespace S3M { -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { friend class File; public: @@ -48,10 +48,9 @@ class TAGLIB_EXPORT Properties : public AudioProperties { CustomData = 128 }; - Properties(AudioProperties::ReadStyle propertiesStyle); - virtual ~Properties(); + AudioProperties(AudioProperties::ReadStyle propertiesStyle); + virtual ~AudioProperties(); - int length() const; int lengthInSeconds() const; int lengthInMilliseconds() const; int bitrate() const; @@ -85,11 +84,11 @@ class TAGLIB_EXPORT Properties : public AudioProperties { void setBpmSpeed(unsigned char bpmSpeed); private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace S3M diff --git a/3rdparty/taglib/trueaudio/trueaudiofile.cpp b/3rdparty/taglib/trueaudio/trueaudiofile.cpp index a2aea9389..0c7989719 100644 --- a/3rdparty/taglib/trueaudio/trueaudiofile.cpp +++ b/3rdparty/taglib/trueaudio/trueaudiofile.cpp @@ -69,7 +69,7 @@ class TrueAudio::File::FilePrivate { TagUnion tag; - Properties *properties; + AudioProperties *properties; }; //////////////////////////////////////////////////////////////////////////////// @@ -89,28 +89,28 @@ bool TrueAudio::File::isSupported(IOStream *stream) { // public members //////////////////////////////////////////////////////////////////////////////// -TrueAudio::File::File(FileName file, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) { +TrueAudio::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) { if (isOpen()) read(readProperties); } -TrueAudio::File::File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate(frameFactory)) { +TrueAudio::File::File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate(frameFactory)) { if (isOpen()) read(readProperties); } -TrueAudio::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) { +TrueAudio::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) { if (isOpen()) read(readProperties); } -TrueAudio::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate(frameFactory)) { +TrueAudio::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate(frameFactory)) { if (isOpen()) read(readProperties); @@ -142,7 +142,7 @@ PropertyMap TrueAudio::File::setProperties(const PropertyMap &properties) { } -TrueAudio::Properties *TrueAudio::File::audioProperties() const { +TrueAudio::AudioProperties *TrueAudio::File::audioProperties() const { return d->properties; } @@ -288,7 +288,7 @@ void TrueAudio::File::read(bool readProperties) { seek(0); } - d->properties = new Properties(readBlock(TrueAudio::HeaderSize), streamLength); + d->properties = new AudioProperties(readBlock(TrueAudio::HeaderSize), streamLength); } } diff --git a/3rdparty/taglib/trueaudio/trueaudiofile.h b/3rdparty/taglib/trueaudio/trueaudiofile.h index 9e491c177..ab85f7c72 100644 --- a/3rdparty/taglib/trueaudio/trueaudiofile.h +++ b/3rdparty/taglib/trueaudio/trueaudiofile.h @@ -87,7 +87,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * \note In the current implementation, \a propertiesStyle is ignored. */ File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs a TrueAudio file from \a file. @@ -97,7 +97,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs a TrueAudio file from \a stream. @@ -107,7 +107,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(IOStream *stream, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(IOStream *stream, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs a TrueAudio file from \a stream. @@ -119,7 +119,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * * \note In the current implementation, \a propertiesStyle is ignored. */ - File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); + File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -146,10 +146,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { void removeUnsupportedProperties(const StringList &properties); /*! - * Returns the TrueAudio::Properties for this file. + * Returns the TrueAudio::AudioProperties for this file. * If no audio properties were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Saves the file. */ diff --git a/3rdparty/taglib/trueaudio/trueaudioproperties.cpp b/3rdparty/taglib/trueaudio/trueaudioproperties.cpp index a6d22100c..8c6aeec87 100644 --- a/3rdparty/taglib/trueaudio/trueaudioproperties.cpp +++ b/3rdparty/taglib/trueaudio/trueaudioproperties.cpp @@ -36,9 +36,9 @@ using namespace Strawberry_TagLib::TagLib; -class TrueAudio::Properties::PropertiesPrivate { +class TrueAudio::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : version(0), + AudioPropertiesPrivate() : version(0), length(0), bitrate(0), sampleRate(0), @@ -59,43 +59,43 @@ class TrueAudio::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -TrueAudio::Properties::Properties(const ByteVector &data, long streamLength, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { +TrueAudio::AudioProperties::AudioProperties(const ByteVector &data, long streamLength, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) { read(data, streamLength); } -TrueAudio::Properties::~Properties() { +TrueAudio::AudioProperties::~AudioProperties() { delete d; } -int TrueAudio::Properties::lengthInSeconds() const { +int TrueAudio::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int TrueAudio::Properties::lengthInMilliseconds() const { +int TrueAudio::AudioProperties::lengthInMilliseconds() const { return d->length; } -int TrueAudio::Properties::bitrate() const { +int TrueAudio::AudioProperties::bitrate() const { return d->bitrate; } -int TrueAudio::Properties::sampleRate() const { +int TrueAudio::AudioProperties::sampleRate() const { return d->sampleRate; } -int TrueAudio::Properties::bitsPerSample() const { +int TrueAudio::AudioProperties::bitsPerSample() const { return d->bitsPerSample; } -int TrueAudio::Properties::channels() const { +int TrueAudio::AudioProperties::channels() const { return d->channels; } -unsigned int TrueAudio::Properties::sampleFrames() const { +unsigned int TrueAudio::AudioProperties::sampleFrames() const { return d->sampleFrames; } -int TrueAudio::Properties::ttaVersion() const { +int TrueAudio::AudioProperties::ttaVersion() const { return d->version; } @@ -103,15 +103,15 @@ int TrueAudio::Properties::ttaVersion() const { // private members //////////////////////////////////////////////////////////////////////////////// -void TrueAudio::Properties::read(const ByteVector &data, long streamLength) { +void TrueAudio::AudioProperties::read(const ByteVector &data, long streamLength) { if (data.size() < 4) { - debug("TrueAudio::Properties::read() -- data is too short."); + debug("TrueAudio::AudioProperties::read() -- data is too short."); return; } if (!data.startsWith("TTA")) { - debug("TrueAudio::Properties::read() -- invalid header signature."); + debug("TrueAudio::AudioProperties::read() -- invalid header signature."); return; } @@ -124,7 +124,7 @@ void TrueAudio::Properties::read(const ByteVector &data, long streamLength) { // TTA2 headers are in development, and have a different format if (1 == d->version) { if (data.size() < 18) { - debug("TrueAudio::Properties::read() -- data is too short."); + debug("TrueAudio::AudioProperties::read() -- data is too short."); return; } diff --git a/3rdparty/taglib/trueaudio/trueaudioproperties.h b/3rdparty/taglib/trueaudio/trueaudioproperties.h index 8e698d2a8..6df18d4c9 100644 --- a/3rdparty/taglib/trueaudio/trueaudioproperties.h +++ b/3rdparty/taglib/trueaudio/trueaudioproperties.h @@ -46,17 +46,17 @@ static const unsigned int HeaderSize = 18; * This reads the data from an TrueAudio stream found in the AudioProperties API. */ -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! - * Create an instance of TrueAudio::Properties with the data read from the ByteVector \a data. + * Create an instance of TrueAudio::AudioProperties with the data read from the ByteVector \a data. */ - Properties(const ByteVector &data, long streamLength, ReadStyle style = Average); + AudioProperties(const ByteVector &data, long streamLength, ReadStyle style = Average); /*! - * Destroys this TrueAudio::Properties instance. + * Destroys this TrueAudio::AudioProperties instance. */ - virtual ~Properties(); + virtual ~AudioProperties(); /*! * Returns the length of the file in seconds. The length is rounded down to the nearest whole second. @@ -105,13 +105,13 @@ class TAGLIB_EXPORT Properties : public AudioProperties { int ttaVersion() const; private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); void read(const ByteVector &data, long streamLength); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace TrueAudio diff --git a/3rdparty/taglib/wavpack/wavpackfile.cpp b/3rdparty/taglib/wavpack/wavpackfile.cpp index 0519c3f79..3105d5c27 100644 --- a/3rdparty/taglib/wavpack/wavpackfile.cpp +++ b/3rdparty/taglib/wavpack/wavpackfile.cpp @@ -67,7 +67,7 @@ class WavPack::File::FilePrivate { TagUnion tag; - Properties *properties; + AudioProperties *properties; }; //////////////////////////////////////////////////////////////////////////////// @@ -87,14 +87,14 @@ bool WavPack::File::isSupported(IOStream *stream) { // public members //////////////////////////////////////////////////////////////////////////////// -WavPack::File::File(FileName file, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) { +WavPack::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) { if (isOpen()) read(readProperties); } -WavPack::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) { +WavPack::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) { if (isOpen()) read(readProperties); @@ -126,7 +126,7 @@ PropertyMap WavPack::File::setProperties(const PropertyMap &properties) { } -WavPack::Properties *WavPack::File::audioProperties() const { +WavPack::AudioProperties *WavPack::File::audioProperties() const { return d->properties; } @@ -271,7 +271,7 @@ void WavPack::File::read(bool readProperties) { else streamLength = length(); - d->properties = new Properties(this, streamLength); + d->properties = new AudioProperties(this, streamLength); } } diff --git a/3rdparty/taglib/wavpack/wavpackfile.h b/3rdparty/taglib/wavpack/wavpackfile.h index 2cdaa7b38..d209fa135 100644 --- a/3rdparty/taglib/wavpack/wavpackfile.h +++ b/3rdparty/taglib/wavpack/wavpackfile.h @@ -90,7 +90,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * If false, \a propertiesStyle is ignored */ File(FileName file, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Constructs an WavPack file from \a file. @@ -101,7 +101,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { * responsible for deleting it after the File object. */ File(IOStream *stream, bool readProperties = true, - Properties::ReadStyle propertiesStyle = Properties::Average); + AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average); /*! * Destroys this instance of the File. @@ -131,10 +131,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File { PropertyMap setProperties(const PropertyMap &); /*! - * Returns the MPC::Properties for this file. + * Returns the MPC::AudioProperties for this file. * If no audio properties were read then this will return a null pointer. */ - virtual Properties *audioProperties() const; + virtual AudioProperties *audioProperties() const; /*! * Saves the file. diff --git a/3rdparty/taglib/wavpack/wavpackproperties.cpp b/3rdparty/taglib/wavpack/wavpackproperties.cpp index 47e82e16e..869d74270 100644 --- a/3rdparty/taglib/wavpack/wavpackproperties.cpp +++ b/3rdparty/taglib/wavpack/wavpackproperties.cpp @@ -38,9 +38,9 @@ using namespace Strawberry_TagLib::TagLib; -class WavPack::Properties::PropertiesPrivate { +class WavPack::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : length(0), + AudioPropertiesPrivate() : length(0), bitrate(0), sampleRate(0), channels(0), @@ -63,47 +63,47 @@ class WavPack::Properties::PropertiesPrivate { // public members //////////////////////////////////////////////////////////////////////////////// -WavPack::Properties::Properties(File *file, long streamLength, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) { +WavPack::AudioProperties::AudioProperties(File *file, long streamLength, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) { read(file, streamLength); } -WavPack::Properties::~Properties() { +WavPack::AudioProperties::~AudioProperties() { delete d; } -int WavPack::Properties::lengthInSeconds() const { +int WavPack::AudioProperties::lengthInSeconds() const { return d->length / 1000; } -int WavPack::Properties::lengthInMilliseconds() const { +int WavPack::AudioProperties::lengthInMilliseconds() const { return d->length; } -int WavPack::Properties::bitrate() const { +int WavPack::AudioProperties::bitrate() const { return d->bitrate; } -int WavPack::Properties::sampleRate() const { +int WavPack::AudioProperties::sampleRate() const { return d->sampleRate; } -int WavPack::Properties::channels() const { +int WavPack::AudioProperties::channels() const { return d->channels; } -int WavPack::Properties::version() const { +int WavPack::AudioProperties::version() const { return d->version; } -int WavPack::Properties::bitsPerSample() const { +int WavPack::AudioProperties::bitsPerSample() const { return d->bitsPerSample; } -bool WavPack::Properties::isLossless() const { +bool WavPack::AudioProperties::isLossless() const { return d->lossless; } -unsigned int WavPack::Properties::sampleFrames() const { +unsigned int WavPack::AudioProperties::sampleFrames() const { return d->sampleFrames; } @@ -133,7 +133,7 @@ const unsigned int sample_rates[] = { #define FINAL_BLOCK 0x1000 -void WavPack::Properties::read(File *file, long streamLength) { +void WavPack::AudioProperties::read(File *file, long streamLength) { long offset = 0; @@ -142,12 +142,12 @@ void WavPack::Properties::read(File *file, long streamLength) { const ByteVector data = file->readBlock(32); if (data.size() < 32) { - debug("WavPack::Properties::read() -- data is too short."); + debug("WavPack::AudioProperties::read() -- data is too short."); break; } if (!data.startsWith("wvpk")) { - debug("WavPack::Properties::read() -- Block header not found."); + debug("WavPack::AudioProperties::read() -- Block header not found."); break; } @@ -184,7 +184,7 @@ void WavPack::Properties::read(File *file, long streamLength) { } -unsigned int WavPack::Properties::seekFinalIndex(File *file, long streamLength) { +unsigned int WavPack::AudioProperties::seekFinalIndex(File *file, long streamLength) { const long offset = file->rfind("wvpk", streamLength); if (offset == -1) diff --git a/3rdparty/taglib/wavpack/wavpackproperties.h b/3rdparty/taglib/wavpack/wavpackproperties.h index 70cc80b16..4bebe38c5 100644 --- a/3rdparty/taglib/wavpack/wavpackproperties.h +++ b/3rdparty/taglib/wavpack/wavpackproperties.h @@ -48,18 +48,18 @@ static const unsigned int HeaderSize = 32; * API. */ -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { public: /*! * Create an instance of WavPack::Properties. */ - Properties(File *file, long streamLength, ReadStyle style = Average); + AudioProperties(File *file, long streamLength, ReadStyle style = Average); /*! - * Destroys this WavPack::Properties instance. + * Destroys this WavPack::AudioProperties instance. */ - virtual ~Properties(); + virtual ~AudioProperties(); /*! * Returns the length of the file in seconds. @@ -114,14 +114,14 @@ class TAGLIB_EXPORT Properties : public AudioProperties { int version() const; private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); void read(File *file, long streamLength); unsigned int seekFinalIndex(File *file, long streamLength); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace WavPack diff --git a/3rdparty/taglib/xm/xmfile.cpp b/3rdparty/taglib/xm/xmfile.cpp index 4452d6c11..12aed28db 100644 --- a/3rdparty/taglib/xm/xmfile.cpp +++ b/3rdparty/taglib/xm/xmfile.cpp @@ -307,7 +307,7 @@ class XM::File::FilePrivate { explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : properties(propertiesStyle) {} Mod::Tag tag; - XM::Properties properties; + XM::AudioProperties properties; }; XM::File::File(FileName file, bool readProperties, @@ -340,7 +340,7 @@ PropertyMap XM::File::setProperties(const PropertyMap &properties) { return d->tag.setProperties(properties); } -XM::Properties *XM::File::audioProperties() const { +XM::AudioProperties *XM::File::audioProperties() const { return &d->properties; } diff --git a/3rdparty/taglib/xm/xmfile.h b/3rdparty/taglib/xm/xmfile.h index 817062489..aa055c53b 100644 --- a/3rdparty/taglib/xm/xmfile.h +++ b/3rdparty/taglib/xm/xmfile.h @@ -77,10 +77,10 @@ class TAGLIB_EXPORT File : public Mod::FileBase { PropertyMap setProperties(const PropertyMap &); /*! - * Returns the XM::Properties for this file. + * Returns the XM::AudioProperties for this file. * If no audio properties were read then this will return a null pointer. */ - XM::Properties *audioProperties() const; + XM::AudioProperties *audioProperties() const; /*! * Save the file. diff --git a/3rdparty/taglib/xm/xmproperties.cpp b/3rdparty/taglib/xm/xmproperties.cpp index d4e518118..f0334ddd4 100644 --- a/3rdparty/taglib/xm/xmproperties.cpp +++ b/3rdparty/taglib/xm/xmproperties.cpp @@ -29,9 +29,9 @@ using namespace Strawberry_TagLib::TagLib; using namespace XM; -class XM::Properties::PropertiesPrivate { +class XM::AudioProperties::AudioPropertiesPrivate { public: - PropertiesPrivate() : lengthInPatterns(0), + AudioPropertiesPrivate() : lengthInPatterns(0), channels(0), version(0), restartPosition(0), @@ -55,108 +55,104 @@ class XM::Properties::PropertiesPrivate { unsigned short bpmSpeed; }; -XM::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) : AudioProperties(propertiesStyle), d(new PropertiesPrivate()) {} +XM::AudioProperties::AudioProperties(AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::AudioProperties(propertiesStyle), d(new AudioPropertiesPrivate()) {} -XM::Properties::~Properties() { +XM::AudioProperties::~AudioProperties() { delete d; } -int XM::Properties::length() const { +int XM::AudioProperties::lengthInSeconds() const { return 0; } -int XM::Properties::lengthInSeconds() const { +int XM::AudioProperties::lengthInMilliseconds() const { return 0; } -int XM::Properties::lengthInMilliseconds() const { +int XM::AudioProperties::bitrate() const { return 0; } -int XM::Properties::bitrate() const { +int XM::AudioProperties::sampleRate() const { return 0; } -int XM::Properties::sampleRate() const { - return 0; -} - -int XM::Properties::channels() const { +int XM::AudioProperties::channels() const { return d->channels; } -unsigned short XM::Properties::lengthInPatterns() const { +unsigned short XM::AudioProperties::lengthInPatterns() const { return d->lengthInPatterns; } -unsigned short XM::Properties::version() const { +unsigned short XM::AudioProperties::version() const { return d->version; } -unsigned short XM::Properties::restartPosition() const { +unsigned short XM::AudioProperties::restartPosition() const { return d->restartPosition; } -unsigned short XM::Properties::patternCount() const { +unsigned short XM::AudioProperties::patternCount() const { return d->patternCount; } -unsigned short XM::Properties::instrumentCount() const { +unsigned short XM::AudioProperties::instrumentCount() const { return d->instrumentCount; } -unsigned int XM::Properties::sampleCount() const { +unsigned int XM::AudioProperties::sampleCount() const { return d->sampleCount; } -unsigned short XM::Properties::flags() const { +unsigned short XM::AudioProperties::flags() const { return d->flags; } -unsigned short XM::Properties::tempo() const { +unsigned short XM::AudioProperties::tempo() const { return d->tempo; } -unsigned short XM::Properties::bpmSpeed() const { +unsigned short XM::AudioProperties::bpmSpeed() const { return d->bpmSpeed; } -void XM::Properties::setLengthInPatterns(unsigned short lengthInPatterns) { +void XM::AudioProperties::setLengthInPatterns(unsigned short lengthInPatterns) { d->lengthInPatterns = lengthInPatterns; } -void XM::Properties::setChannels(int channels) { +void XM::AudioProperties::setChannels(int channels) { d->channels = channels; } -void XM::Properties::setVersion(unsigned short version) { +void XM::AudioProperties::setVersion(unsigned short version) { d->version = version; } -void XM::Properties::setRestartPosition(unsigned short restartPosition) { +void XM::AudioProperties::setRestartPosition(unsigned short restartPosition) { d->restartPosition = restartPosition; } -void XM::Properties::setPatternCount(unsigned short patternCount) { +void XM::AudioProperties::setPatternCount(unsigned short patternCount) { d->patternCount = patternCount; } -void XM::Properties::setInstrumentCount(unsigned short instrumentCount) { +void XM::AudioProperties::setInstrumentCount(unsigned short instrumentCount) { d->instrumentCount = instrumentCount; } -void XM::Properties::setSampleCount(unsigned int sampleCount) { +void XM::AudioProperties::setSampleCount(unsigned int sampleCount) { d->sampleCount = sampleCount; } -void XM::Properties::setFlags(unsigned short flags) { +void XM::AudioProperties::setFlags(unsigned short flags) { d->flags = flags; } -void XM::Properties::setTempo(unsigned short tempo) { +void XM::AudioProperties::setTempo(unsigned short tempo) { d->tempo = tempo; } -void XM::Properties::setBpmSpeed(unsigned short bpmSpeed) { +void XM::AudioProperties::setBpmSpeed(unsigned short bpmSpeed) { d->bpmSpeed = bpmSpeed; } diff --git a/3rdparty/taglib/xm/xmproperties.h b/3rdparty/taglib/xm/xmproperties.h index 7b8b68a16..0705fa5c2 100644 --- a/3rdparty/taglib/xm/xmproperties.h +++ b/3rdparty/taglib/xm/xmproperties.h @@ -33,7 +33,7 @@ namespace Strawberry_TagLib { namespace TagLib { namespace XM { -class TAGLIB_EXPORT Properties : public AudioProperties { +class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties { friend class File; public: @@ -42,10 +42,9 @@ class TAGLIB_EXPORT Properties : public AudioProperties { LinearFreqTable = 1 // otherwise its the amiga freq. table }; - Properties(AudioProperties::ReadStyle propertiesStyle); - virtual ~Properties(); + AudioProperties(AudioProperties::ReadStyle propertiesStyle); + virtual ~AudioProperties(); - int length() const; int lengthInSeconds() const; int lengthInMilliseconds() const; int bitrate() const; @@ -75,11 +74,11 @@ class TAGLIB_EXPORT Properties : public AudioProperties { void setBpmSpeed(unsigned short bpmSpeed); private: - Properties(const Properties &); - Properties &operator=(const Properties &); + AudioProperties(const AudioProperties &); + AudioProperties &operator=(const AudioProperties &); - class PropertiesPrivate; - PropertiesPrivate *d; + class AudioPropertiesPrivate; + AudioPropertiesPrivate *d; }; } // namespace XM