Refactored AudioProperties classes in some ways

This commit is contained in:
Tsuda Kageyu
2013-07-13 10:38:52 +09:00
parent 6d89689c0e
commit 6d40cbc04f
44 changed files with 498 additions and 477 deletions

View File

@ -32,7 +32,13 @@ using namespace TagLib;
class ASF::AudioProperties::PropertiesPrivate
{
public:
PropertiesPrivate(): length(0), bitrate(0), sampleRate(0), channels(0), encrypted(false) {}
PropertiesPrivate() :
length(0),
bitrate(0),
sampleRate(0),
channels(0),
encrypted(false) {}
int length;
int bitrate;
int sampleRate;
@ -44,16 +50,14 @@ public:
// public members
////////////////////////////////////////////////////////////////////////////////
ASF::AudioProperties::AudioProperties()
: TagLib::AudioProperties(AudioProperties::Average)
ASF::AudioProperties::AudioProperties() :
d(new PropertiesPrivate())
{
d = new PropertiesPrivate;
}
ASF::AudioProperties::~AudioProperties()
{
if(d)
delete d;
delete d;
}
int ASF::AudioProperties::length() const

View File

@ -34,13 +34,16 @@ namespace TagLib {
namespace ASF {
class File;
//! An implementation of ASF audio properties
class TAGLIB_EXPORT AudioProperties : public TagLib::AudioProperties
{
public:
friend class File;
public:
/*!
* Create an instance of ASF::AudioProperties.
* Creates an instance of ASF::AudioProperties.
*/
AudioProperties();
@ -50,21 +53,20 @@ namespace TagLib {
virtual ~AudioProperties();
// Reimplementations.
virtual int length() const;
virtual int bitrate() const;
virtual int sampleRate() const;
virtual int channels() const;
bool isEncrypted() const;
#ifndef DO_NOT_DOCUMENT
private:
void setLength(int value);
void setBitrate(int value);
void setSampleRate(int value);
void setChannels(int value);
void setEncrypted(bool value);
#endif
private:
class PropertiesPrivate;
PropertiesPrivate *d;
};