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

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

View File

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

View File

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

View File

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