taglib: Rename Properties to AudioProperties

This commit is contained in:
Jonas Kvinge
2020-06-22 00:49:25 +02:00
parent f49c47c20d
commit 3a3dc02a66
80 changed files with 740 additions and 789 deletions

View File

@@ -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);
}
}

View 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 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.

View File

@@ -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;
}

View File

@@ -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