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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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