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

@ -73,7 +73,7 @@ public:
TagUnion tag;
Properties *properties;
AudioProperties *properties;
// These indicate whether the file *on disk* has these tags, not if
// this data structure does. This is used in computing offsets.
@ -87,7 +87,7 @@ public:
////////////////////////////////////////////////////////////////////////////////
APE::File::File(FileName file, bool readProperties,
Properties::ReadStyle propertiesStyle) : TagLib::File(file)
AudioProperties::ReadStyle propertiesStyle) : TagLib::File(file)
{
d = new FilePrivate;
if(isOpen())
@ -95,7 +95,7 @@ APE::File::File(FileName file, bool readProperties,
}
APE::File::File(IOStream *stream, bool readProperties,
Properties::ReadStyle propertiesStyle) : TagLib::File(stream)
AudioProperties::ReadStyle propertiesStyle) : TagLib::File(stream)
{
d = new FilePrivate;
if(isOpen())
@ -119,7 +119,7 @@ PropertyMap APE::File::setProperties(const PropertyMap &properties)
return d->tag.access<APE::Tag>(ApeAPEIndex, true)->setProperties(properties);
}
APE::Properties *APE::File::audioProperties() const
APE::AudioProperties *APE::File::audioProperties() const
{
return d->properties;
}
@ -222,7 +222,7 @@ void APE::File::strip(int tags)
// private members
////////////////////////////////////////////////////////////////////////////////
void APE::File::read(bool readProperties, Properties::ReadStyle /* propertiesStyle */)
void APE::File::read(bool readProperties, AudioProperties::ReadStyle /* propertiesStyle */)
{
// Look for an ID3v1 tag
@ -250,7 +250,7 @@ void APE::File::read(bool readProperties, Properties::ReadStyle /* propertiesSty
// Look for APE audio properties
if(readProperties) {
d->properties = new Properties(this);
d->properties = new AudioProperties(this);
}
}

View File

@ -89,7 +89,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 an WavPack file from \a file. If \a readProperties is true the
@ -100,7 +100,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.
@ -124,7 +124,7 @@ namespace TagLib {
* Returns the APE::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;
/*!
* Saves the file.
@ -175,7 +175,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();
offset_t findID3v1();
offset_t findAPE();

View File

@ -36,7 +36,7 @@
using namespace TagLib;
class APE::Properties::PropertiesPrivate
class APE::AudioProperties::PropertiesPrivate
{
public:
PropertiesPrivate(File *file, offset_t streamLength) :
@ -65,48 +65,49 @@ public:
// public members
////////////////////////////////////////////////////////////////////////////////
APE::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style)
APE::AudioProperties::AudioProperties(File *file, ReadStyle style)
: TagLib::AudioProperties(style)
{
d = new PropertiesPrivate(file, file->length());
read();
}
APE::Properties::~Properties()
APE::AudioProperties::~AudioProperties()
{
delete d;
}
int APE::Properties::length() const
int APE::AudioProperties::length() 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;
}
TagLib::uint APE::Properties::sampleFrames() const
TagLib::uint APE::AudioProperties::sampleFrames() const
{
return d->sampleFrames;
}
@ -116,7 +117,7 @@ TagLib::uint APE::Properties::sampleFrames() const
////////////////////////////////////////////////////////////////////////////////
void APE::Properties::read()
void APE::AudioProperties::read()
{
// First we are searching the descriptor
offset_t offset = findDescriptor();
@ -138,7 +139,7 @@ void APE::Properties::read()
}
}
offset_t APE::Properties::findDescriptor()
offset_t APE::AudioProperties::findDescriptor()
{
offset_t ID3v2Location = findID3v2();
long ID3v2OriginalSize = 0;
@ -164,7 +165,7 @@ offset_t APE::Properties::findDescriptor()
return offset;
}
offset_t APE::Properties::findID3v2()
offset_t APE::AudioProperties::findID3v2()
{
if(!d->file->isValid())
return -1;
@ -177,7 +178,7 @@ offset_t APE::Properties::findID3v2()
return -1;
}
void APE::Properties::analyzeCurrent()
void APE::AudioProperties::analyzeCurrent()
{
// Read the descriptor
d->file->seek(2, File::Current);
@ -205,7 +206,7 @@ void APE::Properties::analyzeCurrent()
d->bitrate = d->length > 0 ? static_cast<int>(d->streamLength * 8L / d->length / 1000) : 0;
}
void APE::Properties::analyzeOld()
void APE::AudioProperties::analyzeOld()
{
ByteVector header = d->file->readBlock(26);
const uint totalFrames = header.toUInt32LE(18);

View File

@ -46,19 +46,19 @@ namespace TagLib {
* API.
*/
class TAGLIB_EXPORT Properties : public AudioProperties
class TAGLIB_EXPORT AudioProperties : public TagLib::AudioProperties
{
public:
/*!
* Create an instance of APE::Properties with the data read from the
* ByteVector \a data.
* Create an instance of APE::AudioProperties with the data read from
* the ByteVector \a data.
*/
Properties(File *f, ReadStyle style = Average);
AudioProperties(File *f, ReadStyle style = Average);
/*!
* Destroys this APE::Properties instance.
* Destroys this APE::AudioProperties instance.
*/
virtual ~Properties();
virtual ~AudioProperties();
// Reimplementations.
@ -79,8 +79,8 @@ namespace TagLib {
int version() const;
private:
Properties(const Properties &);
Properties &operator=(const Properties &);
AudioProperties(const AudioProperties &);
AudioProperties &operator=(const AudioProperties &);
void read();