Changed names of derived classes of AudioProperties

This commit is contained in:
Tsuda Kageyu
2013-05-06 19:23:57 +09:00
parent 72bb1a887e
commit 4ce7ebe520
77 changed files with 578 additions and 560 deletions

View File

@ -32,7 +32,7 @@
#include "oggflacfile.h"
using namespace TagLib;
using TagLib::FLAC::Properties;
using TagLib::FLAC::AudioProperties;
class Ogg::FLAC::File::FilePrivate
{
@ -54,7 +54,7 @@ public:
Ogg::XiphComment *comment;
Properties *properties;
AudioProperties *properties;
ByteVector streamInfoData;
ByteVector xiphCommentData;
offset_t streamStart;
@ -70,7 +70,7 @@ public:
////////////////////////////////////////////////////////////////////////////////
Ogg::FLAC::File::File(FileName file, bool readProperties,
Properties::ReadStyle propertiesStyle) : Ogg::File(file)
AudioProperties::ReadStyle propertiesStyle) : Ogg::File(file)
{
d = new FilePrivate;
if(isOpen())
@ -78,7 +78,7 @@ Ogg::FLAC::File::File(FileName file, bool readProperties,
}
Ogg::FLAC::File::File(IOStream *stream, bool readProperties,
Properties::ReadStyle propertiesStyle) : Ogg::File(stream)
AudioProperties::ReadStyle propertiesStyle) : Ogg::File(stream)
{
d = new FilePrivate;
if(isOpen())
@ -105,7 +105,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;
}
@ -141,7 +141,7 @@ bool Ogg::FLAC::File::save()
// 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
@ -171,7 +171,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);
}
ByteVector Ogg::FLAC::File::streamInfoData()

View File

@ -49,7 +49,7 @@ namespace TagLib {
*/
namespace FLAC {
using TagLib::FLAC::Properties;
using TagLib::FLAC::AudioProperties;
//! An implementation of TagLib::File with Ogg/FLAC specific methods
@ -69,7 +69,7 @@ namespace TagLib {
* If false, \a propertiesStyle is ignored.
*/
File(FileName file, bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
/*!
* Contructs an Ogg/FLAC file from \a file. If \a readProperties is true
@ -80,7 +80,7 @@ namespace TagLib {
* 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.
@ -98,7 +98,7 @@ namespace TagLib {
* Returns the FLAC::Properties for this file. If no audio properties
* were read then this will return a null pointer.
*/
virtual Properties *audioProperties() const;
virtual AudioProperties *audioProperties() const;
/*!
@ -130,7 +130,7 @@ namespace TagLib {
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

@ -52,7 +52,7 @@ public:
}
Ogg::XiphComment *comment;
Properties *properties;
AudioProperties *properties;
};
////////////////////////////////////////////////////////////////////////////////
@ -60,14 +60,14 @@ public:
////////////////////////////////////////////////////////////////////////////////
Opus::File::File(FileName file, bool readProperties,
Properties::ReadStyle propertiesStyle) : Ogg::File(file)
AudioProperties::ReadStyle propertiesStyle) : Ogg::File(file)
{
d = new FilePrivate;
read(readProperties, propertiesStyle);
}
Opus::File::File(IOStream *stream, bool readProperties,
Properties::ReadStyle propertiesStyle) : Ogg::File(stream)
AudioProperties::ReadStyle propertiesStyle) : Ogg::File(stream)
{
d = new FilePrivate;
read(readProperties, propertiesStyle);
@ -93,7 +93,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;
}
@ -112,7 +112,7 @@ bool Opus::File::save()
// private members
////////////////////////////////////////////////////////////////////////////////
void Opus::File::read(bool readProperties, Properties::ReadStyle propertiesStyle)
void Opus::File::read(bool readProperties, AudioProperties::ReadStyle propertiesStyle)
{
ByteVector opusHeaderData = packet(0);
@ -133,5 +133,5 @@ void Opus::File::read(bool readProperties, Properties::ReadStyle propertiesStyle
d->comment = new Ogg::XiphComment(commentHeaderData.mid(8));
if(readProperties)
d->properties = new Properties(this, propertiesStyle);
d->properties = new AudioProperties(this, propertiesStyle);
}

View File

@ -61,7 +61,7 @@ namespace TagLib {
* false, \a propertiesStyle is ignored.
*/
File(FileName file, bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
/*!
* Contructs a Opus file from \a file. If \a readProperties is true the
@ -72,7 +72,7 @@ namespace TagLib {
* 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.
@ -102,7 +102,7 @@ namespace TagLib {
* Returns the Opus::Properties for this file. If no audio properties
* were read then this will return a null pointer.
*/
virtual Properties *audioProperties() const;
virtual AudioProperties *audioProperties() const;
virtual bool save();
@ -110,7 +110,7 @@ namespace TagLib {
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;

View File

@ -38,7 +38,7 @@
using namespace TagLib;
using namespace TagLib::Ogg;
class Opus::Properties::PropertiesPrivate
class Opus::AudioProperties::PropertiesPrivate
{
public:
PropertiesPrivate(File *f, ReadStyle s) :
@ -61,28 +61,29 @@ public:
// public members
////////////////////////////////////////////////////////////////////////////////
Opus::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style)
Opus::AudioProperties::AudioProperties(File *file, ReadStyle style)
: TagLib::AudioProperties(style)
{
d = new PropertiesPrivate(file, style);
read();
}
Opus::Properties::~Properties()
Opus::AudioProperties::~AudioProperties()
{
delete d;
}
int Opus::Properties::length() const
int Opus::AudioProperties::length() const
{
return d->length;
}
int Opus::Properties::bitrate() const
int Opus::AudioProperties::bitrate() const
{
return 0;
}
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
@ -90,17 +91,17 @@ int Opus::Properties::sampleRate() const
return 48000;
}
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;
}
@ -109,7 +110,7 @@ int Opus::Properties::opusVersion() const
// private members
////////////////////////////////////////////////////////////////////////////////
void Opus::Properties::read()
void Opus::AudioProperties::read()
{
// Get the identification header from the Ogg implementation.

View File

@ -47,19 +47,19 @@ namespace TagLib {
* API.
*/
class TAGLIB_EXPORT Properties : public AudioProperties
class TAGLIB_EXPORT AudioProperties : public TagLib::AudioProperties
{
public:
/*!
* Create an instance of Opus::Properties with the data read from the
* Opus::File \a file.
* 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();
// Reimplementations.
@ -81,8 +81,8 @@ namespace TagLib {
int opusVersion() const;
private:
Properties(const Properties &);
Properties &operator=(const Properties &);
AudioProperties(const AudioProperties &);
AudioProperties &operator=(const AudioProperties &);
void read();

View File

@ -52,7 +52,7 @@ public:
}
Ogg::XiphComment *comment;
Properties *properties;
AudioProperties *properties;
};
////////////////////////////////////////////////////////////////////////////////
@ -60,7 +60,7 @@ public:
////////////////////////////////////////////////////////////////////////////////
Speex::File::File(FileName file, bool readProperties,
Properties::ReadStyle propertiesStyle) : Ogg::File(file)
AudioProperties::ReadStyle propertiesStyle) : Ogg::File(file)
{
d = new FilePrivate;
if(isOpen())
@ -68,7 +68,7 @@ Speex::File::File(FileName file, bool readProperties,
}
Speex::File::File(IOStream *stream, bool readProperties,
Properties::ReadStyle propertiesStyle) : Ogg::File(stream)
AudioProperties::ReadStyle propertiesStyle) : Ogg::File(stream)
{
d = new FilePrivate;
if(isOpen())
@ -95,7 +95,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;
}
@ -114,7 +114,7 @@ bool Speex::File::save()
// private members
////////////////////////////////////////////////////////////////////////////////
void Speex::File::read(bool readProperties, Properties::ReadStyle propertiesStyle)
void Speex::File::read(bool readProperties, AudioProperties::ReadStyle propertiesStyle)
{
ByteVector speexHeaderData = packet(0);
@ -128,5 +128,5 @@ void Speex::File::read(bool readProperties, Properties::ReadStyle propertiesStyl
d->comment = new Ogg::XiphComment(commentHeaderData);
if(readProperties)
d->properties = new Properties(this, propertiesStyle);
d->properties = new AudioProperties(this, propertiesStyle);
}

View File

@ -61,7 +61,7 @@ namespace TagLib {
* false, \a propertiesStyle is ignored.
*/
File(FileName file, bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
/*!
* Contructs a Speex file from \a file. If \a readProperties is true the
@ -72,7 +72,7 @@ namespace TagLib {
* 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.
@ -102,7 +102,7 @@ namespace TagLib {
* Returns the Speex::Properties for this file. If no audio properties
* were read then this will return a null pointer.
*/
virtual Properties *audioProperties() const;
virtual AudioProperties *audioProperties() const;
@ -112,7 +112,7 @@ namespace TagLib {
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;

View File

@ -38,7 +38,7 @@
using namespace TagLib;
using namespace TagLib::Ogg;
class Speex::Properties::PropertiesPrivate
class Speex::AudioProperties::PropertiesPrivate
{
public:
PropertiesPrivate(File *f, ReadStyle s) :
@ -67,38 +67,39 @@ public:
// public members
////////////////////////////////////////////////////////////////////////////////
Speex::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style)
Speex::AudioProperties::AudioProperties(File *file, ReadStyle style)
: TagLib::AudioProperties(style)
{
d = new PropertiesPrivate(file, style);
read();
}
Speex::Properties::~Properties()
Speex::AudioProperties::~AudioProperties()
{
delete d;
}
int Speex::Properties::length() const
int Speex::AudioProperties::length() const
{
return d->length;
}
int Speex::Properties::bitrate() const
int Speex::AudioProperties::bitrate() const
{
return int(float(d->bitrate) / float(1000) + 0.5);
}
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;
}
@ -107,7 +108,7 @@ int Speex::Properties::speexVersion() const
// private members
////////////////////////////////////////////////////////////////////////////////
void Speex::Properties::read()
void Speex::AudioProperties::read()
{
// Get the identification header from the Ogg implementation.

View File

@ -47,19 +47,19 @@ namespace TagLib {
* API.
*/
class TAGLIB_EXPORT Properties : public AudioProperties
class TAGLIB_EXPORT AudioProperties : public 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();
// Reimplementations.
@ -74,8 +74,8 @@ namespace TagLib {
int speexVersion() const;
private:
Properties(const Properties &);
Properties &operator=(const Properties &);
AudioProperties(const AudioProperties &);
AudioProperties &operator=(const AudioProperties &);
void read();

View File

@ -48,7 +48,7 @@ public:
}
Ogg::XiphComment *comment;
Properties *properties;
AudioProperties *properties;
};
namespace TagLib {
@ -64,7 +64,7 @@ namespace TagLib {
////////////////////////////////////////////////////////////////////////////////
Ogg::Vorbis::File::File(FileName file, bool readProperties,
Properties::ReadStyle propertiesStyle) : Ogg::File(file)
AudioProperties::ReadStyle propertiesStyle) : Ogg::File(file)
{
d = new FilePrivate;
if(isOpen())
@ -72,7 +72,7 @@ Ogg::Vorbis::File::File(FileName file, bool readProperties,
}
Ogg::Vorbis::File::File(IOStream *stream, bool readProperties,
Properties::ReadStyle propertiesStyle) : Ogg::File(stream)
AudioProperties::ReadStyle propertiesStyle) : Ogg::File(stream)
{
d = new FilePrivate;
if(isOpen())
@ -99,7 +99,7 @@ PropertyMap Ogg::Vorbis::File::setProperties(const PropertyMap &properties)
return d->comment->setProperties(properties);
}
Ogg::Vorbis::Properties *Ogg::Vorbis::File::audioProperties() const
Ogg::Vorbis::AudioProperties *Ogg::Vorbis::File::audioProperties() const
{
return d->properties;
}
@ -121,7 +121,7 @@ bool Ogg::Vorbis::File::save()
// private members
////////////////////////////////////////////////////////////////////////////////
void Ogg::Vorbis::File::read(bool readProperties, Properties::ReadStyle propertiesStyle)
void Ogg::Vorbis::File::read(bool readProperties, AudioProperties::ReadStyle propertiesStyle)
{
ByteVector commentHeaderData = packet(1);
@ -134,5 +134,5 @@ void Ogg::Vorbis::File::read(bool readProperties, Properties::ReadStyle properti
d->comment = new Ogg::XiphComment(commentHeaderData.mid(7));
if(readProperties)
d->properties = new Properties(this, propertiesStyle);
d->properties = new AudioProperties(this, propertiesStyle);
}

View File

@ -59,7 +59,7 @@ namespace TagLib {
* false, \a propertiesStyle is ignored.
*/
File(FileName file, bool readProperties = true,
Properties::ReadStyle propertiesStyle = Properties::Average);
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
/*!
* Contructs a Vorbis file from \a file. If \a readProperties is true the
@ -70,7 +70,7 @@ namespace TagLib {
* 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.
@ -101,7 +101,7 @@ namespace TagLib {
* Returns the Vorbis::Properties for this file. If no audio properties
* were read then this will return a null pointer.
*/
virtual Properties *audioProperties() const;
virtual AudioProperties *audioProperties() const;
virtual bool save();
@ -109,7 +109,7 @@ namespace TagLib {
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;

View File

@ -33,7 +33,7 @@
using namespace TagLib;
class Ogg::Vorbis::Properties::PropertiesPrivate
class Ogg::Vorbis::AudioProperties::PropertiesPrivate
{
public:
PropertiesPrivate(File *f, ReadStyle s) :
@ -72,58 +72,59 @@ namespace TagLib {
// public members
////////////////////////////////////////////////////////////////////////////////
Ogg::Vorbis::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style)
Ogg::Vorbis::AudioProperties::AudioProperties(File *file, ReadStyle style)
: TagLib::AudioProperties(style)
{
d = new PropertiesPrivate(file, style);
read();
}
Ogg::Vorbis::Properties::~Properties()
Ogg::Vorbis::AudioProperties::~AudioProperties()
{
delete d;
}
int Ogg::Vorbis::Properties::length() const
int Ogg::Vorbis::AudioProperties::length() const
{
return d->length;
}
int Ogg::Vorbis::Properties::bitrate() const
int Ogg::Vorbis::AudioProperties::bitrate() const
{
return int(float(d->bitrate) / float(1000) + 0.5);
}
int Ogg::Vorbis::Properties::sampleRate() const
int Ogg::Vorbis::AudioProperties::sampleRate() const
{
return d->sampleRate;
}
int Ogg::Vorbis::Properties::channels() const
int Ogg::Vorbis::AudioProperties::channels() const
{
return d->channels;
}
int Ogg::Vorbis::Properties::vorbisVersion() const
int Ogg::Vorbis::AudioProperties::vorbisVersion() const
{
return d->vorbisVersion;
}
int Ogg::Vorbis::Properties::bitrateMaximum() const
int Ogg::Vorbis::AudioProperties::bitrateMaximum() const
{
return d->bitrateMaximum;
}
int Ogg::Vorbis::Properties::bitrateNominal() const
int Ogg::Vorbis::AudioProperties::bitrateNominal() const
{
return d->bitrateNominal;
}
int Ogg::Vorbis::Properties::bitrateMinimum() const
int Ogg::Vorbis::AudioProperties::bitrateMinimum() const
{
return d->bitrateMinimum;
}
String Ogg::Vorbis::Properties::toString() const
String Ogg::Vorbis::AudioProperties::toString() const
{
StringList desc;
desc.append("Ogg Vorbis audio (version " + String::number(vorbisVersion()) + ")");
@ -136,7 +137,7 @@ String Ogg::Vorbis::Properties::toString() const
// private members
////////////////////////////////////////////////////////////////////////////////
void Ogg::Vorbis::Properties::read()
void Ogg::Vorbis::AudioProperties::read()
{
// Get the identification header from the Ogg implementation.

View File

@ -44,19 +44,19 @@ namespace TagLib {
* API.
*/
class TAGLIB_EXPORT Properties : public AudioProperties
class TAGLIB_EXPORT AudioProperties : public TagLib::AudioProperties
{
public:
/*!
* Create an instance of Vorbis::Properties 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();
// Reimplementations.
@ -90,8 +90,8 @@ namespace TagLib {
int bitrateMinimum() const;
private:
Properties(const Properties &);
Properties &operator=(const Properties &);
AudioProperties(const AudioProperties &);
AudioProperties &operator=(const AudioProperties &);
void read();