taglib: Rename Properties to AudioProperties
This commit is contained in:
parent
f49c47c20d
commit
3a3dc02a66
|
@ -77,7 +77,7 @@ class APE::File::FilePrivate {
|
|||
|
||||
TagUnion tag;
|
||||
|
||||
Properties *properties;
|
||||
AudioProperties *properties;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -98,14 +98,14 @@ bool APE::File::isSupported(IOStream *) {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
APE::File::File(FileName file, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) {
|
||||
APE::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
||||
}
|
||||
|
||||
APE::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) {
|
||||
APE::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
@ -137,7 +137,7 @@ PropertyMap APE::File::setProperties(const PropertyMap &properties) {
|
|||
|
||||
}
|
||||
|
||||
APE::Properties *APE::File::audioProperties() const {
|
||||
APE::AudioProperties *APE::File::audioProperties() const {
|
||||
return d->properties;
|
||||
}
|
||||
|
||||
|
@ -300,7 +300,7 @@ void APE::File::read(bool readProperties) {
|
|||
seek(0);
|
||||
}
|
||||
|
||||
d->properties = new Properties(this, streamLength);
|
||||
d->properties = new AudioProperties(this, streamLength);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
* \note In the current implementation, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(FileName file, bool readProperties = true,
|
||||
Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Constructs an APE file from \a stream.
|
||||
|
@ -104,7 +104,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
* \note In the current implementation, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(IOStream *stream, bool readProperties = true,
|
||||
Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Destroys this instance of the File.
|
||||
|
@ -135,10 +135,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
PropertyMap setProperties(const PropertyMap &);
|
||||
|
||||
/*!
|
||||
* Returns the APE::Properties for this file.
|
||||
* Returns the APE::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.
|
||||
|
|
|
@ -38,9 +38,9 @@
|
|||
|
||||
using namespace Strawberry_TagLib::TagLib;
|
||||
|
||||
class APE::Properties::PropertiesPrivate {
|
||||
class APE::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : length(0),
|
||||
AudioPropertiesPrivate() : length(0),
|
||||
bitrate(0),
|
||||
sampleRate(0),
|
||||
channels(0),
|
||||
|
@ -61,43 +61,43 @@ class APE::Properties::PropertiesPrivate {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
APE::Properties::Properties(File *file, long streamLength, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) {
|
||||
APE::AudioProperties::AudioProperties(File *file, long streamLength, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) {
|
||||
read(file, streamLength);
|
||||
}
|
||||
|
||||
APE::Properties::~Properties() {
|
||||
APE::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int APE::Properties::lengthInSeconds() const {
|
||||
int APE::AudioProperties::lengthInSeconds() const {
|
||||
return d->length / 1000;
|
||||
}
|
||||
|
||||
int APE::Properties::lengthInMilliseconds() const {
|
||||
int APE::AudioProperties::lengthInMilliseconds() 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;
|
||||
}
|
||||
|
||||
unsigned int APE::Properties::sampleFrames() const {
|
||||
unsigned int APE::AudioProperties::sampleFrames() const {
|
||||
return d->sampleFrames;
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ int headerVersion(const ByteVector &header) {
|
|||
}
|
||||
} // namespace
|
||||
|
||||
void APE::Properties::read(File *file, long streamLength) {
|
||||
void APE::AudioProperties::read(File *file, long streamLength) {
|
||||
|
||||
// First, we assume that the file pointer is set at the first descriptor.
|
||||
long offset = file->tell();
|
||||
|
@ -128,7 +128,7 @@ void APE::Properties::read(File *file, long streamLength) {
|
|||
}
|
||||
|
||||
if (version < 0) {
|
||||
debug("APE::Properties::read() -- APE descriptor not found");
|
||||
debug("APE::AudioProperties::read() -- APE descriptor not found");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -147,13 +147,13 @@ void APE::Properties::read(File *file, long streamLength) {
|
|||
|
||||
}
|
||||
|
||||
void APE::Properties::analyzeCurrent(File *file) {
|
||||
void APE::AudioProperties::analyzeCurrent(File *file) {
|
||||
|
||||
// Read the descriptor
|
||||
file->seek(2, File::Current);
|
||||
const ByteVector descriptor = file->readBlock(44);
|
||||
if (descriptor.size() < 44) {
|
||||
debug("APE::Properties::analyzeCurrent() -- descriptor is too short.");
|
||||
debug("APE::AudioProperties::analyzeCurrent() -- descriptor is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ void APE::Properties::analyzeCurrent(File *file) {
|
|||
// Read the header
|
||||
const ByteVector header = file->readBlock(24);
|
||||
if (header.size() < 24) {
|
||||
debug("APE::Properties::analyzeCurrent() -- MAC header is too short.");
|
||||
debug("APE::AudioProperties::analyzeCurrent() -- MAC header is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -184,11 +184,11 @@ void APE::Properties::analyzeCurrent(File *file) {
|
|||
|
||||
}
|
||||
|
||||
void APE::Properties::analyzeOld(File *file) {
|
||||
void APE::AudioProperties::analyzeOld(File *file) {
|
||||
|
||||
const ByteVector header = file->readBlock(26);
|
||||
if (header.size() < 26) {
|
||||
debug("APE::Properties::analyzeOld() -- MAC header is too short.");
|
||||
debug("APE::AudioProperties::analyzeOld() -- MAC header is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@ void APE::Properties::analyzeOld(File *file) {
|
|||
file->seek(16, File::Current);
|
||||
const ByteVector fmt = file->readBlock(28);
|
||||
if (fmt.size() < 28 || !fmt.startsWith("WAVEfmt ")) {
|
||||
debug("APE::Properties::analyzeOld() -- fmt header is too short.");
|
||||
debug("APE::AudioProperties::analyzeOld() -- fmt header is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,18 +45,18 @@ class File;
|
|||
* This reads the data from an APE 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 APE::Properties with the data read from the APE::File \a file.
|
||||
* Create an instance of APE::AudioProperties with the data read from the APE::File \a file.
|
||||
*/
|
||||
Properties(File *file, long streamLength, ReadStyle style = Average);
|
||||
AudioProperties(File *file, long streamLength, ReadStyle style = Average);
|
||||
|
||||
/*!
|
||||
* Destroys this APE::Properties instance.
|
||||
* Destroys this APE::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,16 +105,16 @@ 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);
|
||||
|
||||
void analyzeCurrent(File *file);
|
||||
void analyzeOld(File *file);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
class AudioPropertiesPrivate;
|
||||
AudioPropertiesPrivate *d;
|
||||
};
|
||||
} // namespace APE
|
||||
} // namespace TagLib
|
||||
|
|
|
@ -68,7 +68,7 @@ class ASF::File::FilePrivate {
|
|||
unsigned long long headerSize;
|
||||
|
||||
ASF::Tag *tag;
|
||||
ASF::Properties *properties;
|
||||
ASF::AudioProperties *properties;
|
||||
|
||||
List<BaseObject *> objects;
|
||||
|
||||
|
@ -474,12 +474,12 @@ bool ASF::File::isSupported(IOStream *stream) {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ASF::File::File(FileName file, bool, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) {
|
||||
ASF::File::File(FileName file, bool, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) {
|
||||
if (isOpen())
|
||||
read();
|
||||
}
|
||||
|
||||
ASF::File::File(IOStream *stream, bool, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) {
|
||||
ASF::File::File(IOStream *stream, bool, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) {
|
||||
if (isOpen())
|
||||
read();
|
||||
}
|
||||
|
@ -504,7 +504,7 @@ PropertyMap ASF::File::setProperties(const PropertyMap &properties) {
|
|||
return d->tag->setProperties(properties);
|
||||
}
|
||||
|
||||
ASF::Properties *ASF::File::audioProperties() const {
|
||||
ASF::AudioProperties *ASF::File::audioProperties() const {
|
||||
return d->properties;
|
||||
}
|
||||
|
||||
|
@ -609,7 +609,7 @@ void ASF::File::read() {
|
|||
}
|
||||
|
||||
d->tag = new ASF::Tag();
|
||||
d->properties = new ASF::Properties();
|
||||
d->properties = new ASF::AudioProperties();
|
||||
|
||||
bool ok;
|
||||
d->headerSize = readQWORD(this, &ok);
|
||||
|
|
|
@ -54,7 +54,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
* read.
|
||||
*/
|
||||
File(FileName file, bool readProperties = true,
|
||||
Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Constructs an ASF file from \a stream.
|
||||
|
@ -66,7 +66,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
* \note TagLib will *not* take ownership of the stream, the caller is
|
||||
* responsible for deleting it after the File object.
|
||||
*/
|
||||
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.
|
||||
|
@ -103,7 +103,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
/*!
|
||||
* Returns the ASF audio properties for this file.
|
||||
*/
|
||||
virtual Properties *audioProperties() const;
|
||||
virtual AudioProperties *audioProperties() const;
|
||||
|
||||
/*!
|
||||
* Save the file.
|
||||
|
|
|
@ -29,14 +29,14 @@
|
|||
|
||||
using namespace Strawberry_TagLib::TagLib;
|
||||
|
||||
class ASF::Properties::PropertiesPrivate {
|
||||
class ASF::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : length(0),
|
||||
AudioPropertiesPrivate() : length(0),
|
||||
bitrate(0),
|
||||
sampleRate(0),
|
||||
channels(0),
|
||||
bitsPerSample(0),
|
||||
codec(ASF::Properties::Unknown),
|
||||
codec(ASF::AudioProperties::Unknown),
|
||||
encrypted(false) {}
|
||||
|
||||
int length;
|
||||
|
@ -44,7 +44,7 @@ class ASF::Properties::PropertiesPrivate {
|
|||
int sampleRate;
|
||||
int channels;
|
||||
int bitsPerSample;
|
||||
ASF::Properties::Codec codec;
|
||||
ASF::AudioProperties::Codec codec;
|
||||
String codecName;
|
||||
String codecDescription;
|
||||
bool encrypted;
|
||||
|
@ -54,51 +54,51 @@ class ASF::Properties::PropertiesPrivate {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ASF::Properties::Properties() : AudioProperties(AudioProperties::Average),
|
||||
d(new PropertiesPrivate()) {
|
||||
ASF::AudioProperties::AudioProperties() : Strawberry_TagLib::TagLib::AudioProperties(AudioProperties::Average),
|
||||
d(new AudioPropertiesPrivate()) {
|
||||
}
|
||||
|
||||
ASF::Properties::~Properties() {
|
||||
ASF::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int ASF::Properties::lengthInSeconds() const {
|
||||
int ASF::AudioProperties::lengthInSeconds() const {
|
||||
return d->length / 1000;
|
||||
}
|
||||
|
||||
int ASF::Properties::lengthInMilliseconds() const {
|
||||
int ASF::AudioProperties::lengthInMilliseconds() const {
|
||||
return d->length;
|
||||
}
|
||||
|
||||
int ASF::Properties::bitrate() const {
|
||||
int ASF::AudioProperties::bitrate() const {
|
||||
return d->bitrate;
|
||||
}
|
||||
|
||||
int ASF::Properties::sampleRate() const {
|
||||
int ASF::AudioProperties::sampleRate() const {
|
||||
return d->sampleRate;
|
||||
}
|
||||
|
||||
int ASF::Properties::channels() const {
|
||||
int ASF::AudioProperties::channels() const {
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
int ASF::Properties::bitsPerSample() const {
|
||||
int ASF::AudioProperties::bitsPerSample() const {
|
||||
return d->bitsPerSample;
|
||||
}
|
||||
|
||||
ASF::Properties::Codec ASF::Properties::codec() const {
|
||||
ASF::AudioProperties::Codec ASF::AudioProperties::codec() const {
|
||||
return d->codec;
|
||||
}
|
||||
|
||||
String ASF::Properties::codecName() const {
|
||||
String ASF::AudioProperties::codecName() const {
|
||||
return d->codecName;
|
||||
}
|
||||
|
||||
String ASF::Properties::codecDescription() const {
|
||||
String ASF::AudioProperties::codecDescription() const {
|
||||
return d->codecDescription;
|
||||
}
|
||||
|
||||
bool ASF::Properties::isEncrypted() const {
|
||||
bool ASF::AudioProperties::isEncrypted() const {
|
||||
return d->encrypted;
|
||||
}
|
||||
|
||||
|
@ -106,31 +106,31 @@ bool ASF::Properties::isEncrypted() const {
|
|||
// private members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void ASF::Properties::setLength(int /*length*/) {
|
||||
debug("ASF::Properties::setLength() -- This method is deprecated. Do not use.");
|
||||
void ASF::AudioProperties::setLength(int /*length*/) {
|
||||
debug("ASF::AudioProperties::setLength() -- This method is deprecated. Do not use.");
|
||||
}
|
||||
|
||||
void ASF::Properties::setLengthInMilliseconds(int value) {
|
||||
void ASF::AudioProperties::setLengthInMilliseconds(int value) {
|
||||
d->length = value;
|
||||
}
|
||||
|
||||
void ASF::Properties::setBitrate(int value) {
|
||||
void ASF::AudioProperties::setBitrate(int value) {
|
||||
d->bitrate = value;
|
||||
}
|
||||
|
||||
void ASF::Properties::setSampleRate(int value) {
|
||||
void ASF::AudioProperties::setSampleRate(int value) {
|
||||
d->sampleRate = value;
|
||||
}
|
||||
|
||||
void ASF::Properties::setChannels(int value) {
|
||||
void ASF::AudioProperties::setChannels(int value) {
|
||||
d->channels = value;
|
||||
}
|
||||
|
||||
void ASF::Properties::setBitsPerSample(int value) {
|
||||
void ASF::AudioProperties::setBitsPerSample(int value) {
|
||||
d->bitsPerSample = value;
|
||||
}
|
||||
|
||||
void ASF::Properties::setCodec(int value) {
|
||||
void ASF::AudioProperties::setCodec(int value) {
|
||||
|
||||
switch (value) {
|
||||
case 0x0160:
|
||||
|
@ -152,14 +152,14 @@ void ASF::Properties::setCodec(int value) {
|
|||
|
||||
}
|
||||
|
||||
void ASF::Properties::setCodecName(const String &value) {
|
||||
void ASF::AudioProperties::setCodecName(const String &value) {
|
||||
d->codecName = value;
|
||||
}
|
||||
|
||||
void ASF::Properties::setCodecDescription(const String &value) {
|
||||
void ASF::AudioProperties::setCodecDescription(const String &value) {
|
||||
d->codecDescription = value;
|
||||
}
|
||||
|
||||
void ASF::Properties::setEncrypted(bool value) {
|
||||
void ASF::AudioProperties::setEncrypted(bool value) {
|
||||
d->encrypted = value;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace TagLib {
|
|||
namespace ASF {
|
||||
|
||||
//! An implementation of ASF audio properties
|
||||
class TAGLIB_EXPORT Properties : public AudioProperties {
|
||||
class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties {
|
||||
public:
|
||||
/*!
|
||||
* Audio codec types can be used in ASF file.
|
||||
|
@ -70,12 +70,12 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
/*!
|
||||
* Creates an instance of ASF::Properties.
|
||||
*/
|
||||
Properties();
|
||||
AudioProperties();
|
||||
|
||||
/*!
|
||||
* Destroys this ASF::Properties instance.
|
||||
* Destroys this ASF::AudioProperties instance.
|
||||
*/
|
||||
virtual ~Properties();
|
||||
virtual ~AudioProperties();
|
||||
|
||||
/*!
|
||||
* Returns the length of the file in seconds. The length is rounded down to
|
||||
|
@ -160,8 +160,8 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
#endif
|
||||
|
||||
private:
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
class AudioPropertiesPrivate;
|
||||
AudioPropertiesPrivate *d;
|
||||
};
|
||||
|
||||
} // namespace ASF
|
||||
|
|
|
@ -49,41 +49,40 @@ using namespace Strawberry_TagLib::TagLib;
|
|||
// Should be true virtual functions in taglib2.
|
||||
|
||||
#define VIRTUAL_FUNCTION_WORKAROUND(function_name, default_value) \
|
||||
if (dynamic_cast<const APE::Properties*>(this)) \
|
||||
return dynamic_cast<const APE::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const ASF::Properties*>(this)) \
|
||||
return dynamic_cast<const ASF::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const FLAC::Properties*>(this)) \
|
||||
return dynamic_cast<const FLAC::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const MP4::Properties*>(this)) \
|
||||
return dynamic_cast<const MP4::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const MPC::Properties*>(this)) \
|
||||
return dynamic_cast<const MPC::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const MPEG::Properties*>(this)) \
|
||||
return dynamic_cast<const MPEG::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const Ogg::Opus::Properties*>(this)) \
|
||||
return dynamic_cast<const Ogg::Opus::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const Ogg::Speex::Properties*>(this)) \
|
||||
return dynamic_cast<const Ogg::Speex::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const TrueAudio::Properties*>(this)) \
|
||||
return dynamic_cast<const TrueAudio::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const RIFF::AIFF::Properties*>(this)) \
|
||||
return dynamic_cast<const RIFF::AIFF::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const RIFF::WAV::Properties*>(this)) \
|
||||
return dynamic_cast<const RIFF::WAV::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const Vorbis::Properties*>(this)) \
|
||||
return dynamic_cast<const Vorbis::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const WavPack::Properties*>(this)) \
|
||||
return dynamic_cast<const WavPack::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const DSF::Properties*>(this)) \
|
||||
return dynamic_cast<const DSF::Properties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const DSDIFF::Properties*>(this)) \
|
||||
return dynamic_cast<const DSDIFF::Properties*>(this)->function_name(); \
|
||||
if (dynamic_cast<const APE::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const APE::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const ASF::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const ASF::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const FLAC::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const FLAC::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const MP4::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const MP4::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const MPC::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const MPC::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const MPEG::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const MPEG::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const Ogg::Opus::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const Ogg::Opus::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const Ogg::Speex::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const Ogg::Speex::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const TrueAudio::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const TrueAudio::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const RIFF::AIFF::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const RIFF::AIFF::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const RIFF::WAV::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const RIFF::WAV::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const Vorbis::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const Vorbis::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const WavPack::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const WavPack::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const DSF::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const DSF::AudioProperties*>(this)->function_name(); \
|
||||
else if (dynamic_cast<const DSDIFF::AudioProperties*>(this)) \
|
||||
return dynamic_cast<const DSDIFF::AudioProperties*>(this)->function_name(); \
|
||||
else \
|
||||
return (default_value);
|
||||
|
||||
class AudioProperties::AudioPropertiesPrivate {
|
||||
};
|
||||
class AudioProperties::AudioPropertiesPrivate {};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// public methods
|
||||
|
|
|
@ -62,11 +62,6 @@ class TAGLIB_EXPORT AudioProperties {
|
|||
*/
|
||||
virtual ~AudioProperties();
|
||||
|
||||
/*!
|
||||
* Returns the length of the file in seconds.
|
||||
*/
|
||||
//virtual int length() const = 0;
|
||||
|
||||
/*!
|
||||
* Returns the length of the file in seconds. The length is rounded down to the nearest whole second.
|
||||
*
|
||||
|
|
|
@ -118,7 +118,7 @@ class DSDIFF::File::FilePrivate {
|
|||
*/
|
||||
int duplicateID3V2chunkIndex;
|
||||
|
||||
Properties *properties;
|
||||
AudioProperties *properties;
|
||||
|
||||
TagUnion tag;
|
||||
|
||||
|
@ -145,7 +145,7 @@ bool DSDIFF::File::isSupported(IOStream *stream) {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DSDIFF::File::File(FileName file, bool readProperties, Properties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(file) {
|
||||
DSDIFF::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(file) {
|
||||
|
||||
d = new FilePrivate;
|
||||
d->endianness = BigEndian;
|
||||
|
@ -154,7 +154,7 @@ DSDIFF::File::File(FileName file, bool readProperties, Properties::ReadStyle pro
|
|||
|
||||
}
|
||||
|
||||
DSDIFF::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(stream) {
|
||||
DSDIFF::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(stream) {
|
||||
|
||||
d = new FilePrivate;
|
||||
d->endianness = BigEndian;
|
||||
|
@ -210,7 +210,7 @@ PropertyMap DSDIFF::File::setProperties(const PropertyMap &properties) {
|
|||
return d->tag.access<ID3v2::Tag>(ID3v2Index, true)->setProperties(properties);
|
||||
}
|
||||
|
||||
DSDIFF::Properties *DSDIFF::File::audioProperties() const {
|
||||
DSDIFF::AudioProperties *DSDIFF::File::audioProperties() const {
|
||||
return d->properties;
|
||||
}
|
||||
|
||||
|
@ -582,7 +582,7 @@ void DSDIFF::File::updateRootChunksStructure(unsigned int startingChunk) {
|
|||
|
||||
}
|
||||
|
||||
void DSDIFF::File::read(bool readProperties, Properties::ReadStyle propertiesStyle) {
|
||||
void DSDIFF::File::read(bool readProperties, AudioProperties::ReadStyle propertiesStyle) {
|
||||
|
||||
bool bigEndian = (d->endianness == BigEndian);
|
||||
|
||||
|
@ -868,7 +868,7 @@ void DSDIFF::File::read(bool readProperties, Properties::ReadStyle propertiesSty
|
|||
if (lengthDSDSamplesTimeChannels > 0)
|
||||
bitrate = (audioDataSizeinBytes * 8 * sampleRate) / lengthDSDSamplesTimeChannels / 1000;
|
||||
|
||||
d->properties = new Properties(sampleRate, channels, lengthDSDSamplesTimeChannels, bitrate, propertiesStyle);
|
||||
d->properties = new AudioProperties(sampleRate, channels, lengthDSDSamplesTimeChannels, bitrate, propertiesStyle);
|
||||
}
|
||||
|
||||
if (!ID3v2Tag()) {
|
||||
|
|
|
@ -80,7 +80,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::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 DSDIFF file from \a stream.
|
||||
|
@ -91,7 +91,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
* \note In the current implementation, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(IOStream *stream, bool readProperties = true,
|
||||
Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Destroys this instance of the File.
|
||||
|
@ -144,10 +144,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
PropertyMap setProperties(const PropertyMap &properties);
|
||||
|
||||
/*!
|
||||
* Returns the AIFF::Properties for this file.
|
||||
* Returns the AIFF::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. If at least one tag -- ID3v1 or DIIN -- exists this will duplicate its content into the other tag.
|
||||
|
@ -254,7 +254,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
|
||||
void updateRootChunksStructure(unsigned int startingChunk);
|
||||
|
||||
void read(bool readProperties, Properties::ReadStyle propertiesStyle);
|
||||
void read(bool readProperties, AudioProperties::ReadStyle propertiesStyle);
|
||||
void writeChunk(const ByteVector &name, const ByteVector &data, unsigned long long offset, unsigned long replace = 0, unsigned int leadingPadding = 0);
|
||||
|
||||
class FilePrivate;
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
|
||||
using namespace Strawberry_TagLib::TagLib;
|
||||
|
||||
class DSDIFF::Properties::PropertiesPrivate {
|
||||
class DSDIFF::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : length(0),
|
||||
AudioPropertiesPrivate() : length(0),
|
||||
bitrate(0),
|
||||
sampleRate(0),
|
||||
channels(0),
|
||||
|
@ -52,9 +52,9 @@ class DSDIFF::Properties::PropertiesPrivate {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DSDIFF::Properties::Properties(const unsigned int sampleRate, const unsigned short channels, const unsigned long long samplesCount, const int bitrate, ReadStyle style) : AudioProperties(style) {
|
||||
DSDIFF::AudioProperties::AudioProperties(const unsigned int sampleRate, const unsigned short channels, const unsigned long long samplesCount, const int bitrate, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style) {
|
||||
|
||||
d = new PropertiesPrivate;
|
||||
d = new AudioPropertiesPrivate;
|
||||
|
||||
d->channels = channels;
|
||||
d->sampleCount = samplesCount;
|
||||
|
@ -65,38 +65,34 @@ DSDIFF::Properties::Properties(const unsigned int sampleRate, const unsigned sho
|
|||
|
||||
}
|
||||
|
||||
DSDIFF::Properties::~Properties() {
|
||||
DSDIFF::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int DSDIFF::Properties::length() const {
|
||||
return lengthInSeconds();
|
||||
}
|
||||
|
||||
int DSDIFF::Properties::lengthInSeconds() const {
|
||||
int DSDIFF::AudioProperties::lengthInSeconds() const {
|
||||
return d->length / 1000;
|
||||
}
|
||||
|
||||
int DSDIFF::Properties::lengthInMilliseconds() const {
|
||||
int DSDIFF::AudioProperties::lengthInMilliseconds() const {
|
||||
return d->length;
|
||||
}
|
||||
|
||||
int DSDIFF::Properties::bitrate() const {
|
||||
int DSDIFF::AudioProperties::bitrate() const {
|
||||
return d->bitrate;
|
||||
}
|
||||
|
||||
int DSDIFF::Properties::sampleRate() const {
|
||||
int DSDIFF::AudioProperties::sampleRate() const {
|
||||
return d->sampleRate;
|
||||
}
|
||||
|
||||
int DSDIFF::Properties::channels() const {
|
||||
int DSDIFF::AudioProperties::channels() const {
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
int DSDIFF::Properties::bitsPerSample() const {
|
||||
int DSDIFF::AudioProperties::bitsPerSample() const {
|
||||
return d->sampleWidth;
|
||||
}
|
||||
|
||||
long long DSDIFF::Properties::sampleCount() const {
|
||||
long long DSDIFF::AudioProperties::sampleCount() const {
|
||||
return d->sampleCount;
|
||||
}
|
||||
|
|
|
@ -40,21 +40,20 @@ class File;
|
|||
* This reads the data from an DSDIFF stream found in the AudioProperties API.
|
||||
*/
|
||||
|
||||
class TAGLIB_EXPORT Properties : public Strawberry_TagLib::TagLib::AudioProperties {
|
||||
class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties {
|
||||
public:
|
||||
/*!
|
||||
* Create an instance of DSDIFF::Properties with the data read from the ByteVector \a data.
|
||||
* Create an instance of DSDIFF::AudioProperties with the data read from the ByteVector \a data.
|
||||
*/
|
||||
Properties(const unsigned int sampleRate, const unsigned short channels, const unsigned long long samplesCount, const int bitrate, ReadStyle style);
|
||||
AudioProperties(const unsigned int sampleRate, const unsigned short channels, const unsigned long long samplesCount, const int bitrate, ReadStyle style);
|
||||
|
||||
/*!
|
||||
* Destroys this DSDIFF::Properties instance.
|
||||
* Destroys this DSDIFF::AudioProperties instance.
|
||||
*/
|
||||
virtual ~Properties();
|
||||
virtual ~AudioProperties();
|
||||
|
||||
// Reimplementations.
|
||||
|
||||
virtual int length() const;
|
||||
virtual int lengthInSeconds() const;
|
||||
virtual int lengthInMilliseconds() const;
|
||||
virtual int bitrate() const;
|
||||
|
@ -65,11 +64,11 @@ class TAGLIB_EXPORT Properties : public Strawberry_TagLib::TagLib::AudioProperti
|
|||
long long sampleCount() const;
|
||||
|
||||
private:
|
||||
Properties(const Properties &);
|
||||
Properties &operator=(const Properties &);
|
||||
AudioProperties(const AudioProperties &);
|
||||
AudioProperties &operator=(const AudioProperties &);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
class AudioPropertiesPrivate;
|
||||
AudioPropertiesPrivate *d;
|
||||
};
|
||||
|
||||
} // namespace DSDIFF
|
||||
|
|
|
@ -51,7 +51,7 @@ class DSF::File::FilePrivate {
|
|||
|
||||
long long fileSize;
|
||||
long long metadataOffset;
|
||||
Properties *properties;
|
||||
AudioProperties *properties;
|
||||
ID3v2::Tag *tag;
|
||||
};
|
||||
|
||||
|
@ -72,14 +72,14 @@ bool DSF::File::isSupported(IOStream *stream) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DSF::File::File(FileName file, bool readProperties,
|
||||
Properties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) {
|
||||
AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties, propertiesStyle);
|
||||
|
||||
}
|
||||
|
||||
DSF::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) {
|
||||
DSF::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties, propertiesStyle);
|
||||
|
@ -102,7 +102,7 @@ PropertyMap DSF::File::setProperties(const PropertyMap &properties) {
|
|||
return d->tag->setProperties(properties);
|
||||
}
|
||||
|
||||
DSF::Properties *DSF::File::audioProperties() const {
|
||||
DSF::AudioProperties *DSF::File::audioProperties() const {
|
||||
return d->properties;
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ bool DSF::File::save() {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
void DSF::File::read(bool, Properties::ReadStyle propertiesStyle) {
|
||||
void DSF::File::read(bool, AudioProperties::ReadStyle propertiesStyle) {
|
||||
|
||||
// A DSF file consists of four chunks: DSD chunk, format chunk, data chunk, and metadata chunk
|
||||
// The file format is not chunked in the sense of a RIFF File, though
|
||||
|
@ -220,7 +220,7 @@ void DSF::File::read(bool, Properties::ReadStyle propertiesStyle) {
|
|||
|
||||
chunkSize = readBlock(8).toLongLong(false);
|
||||
|
||||
d->properties = new Properties(readBlock(chunkSize), propertiesStyle);
|
||||
d->properties = new AudioProperties(readBlock(chunkSize), propertiesStyle);
|
||||
|
||||
// Skip the data chunk
|
||||
|
||||
|
|
|
@ -60,7 +60,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 DSF file from \a file.
|
||||
|
@ -68,7 +68,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
* If false, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(IOStream *stream, bool readProperties = true,
|
||||
Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Destroys this instance of the File.
|
||||
|
@ -96,7 +96,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
* Returns the DSF::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.
|
||||
|
@ -115,7 +115,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
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;
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
|
||||
using namespace Strawberry_TagLib::TagLib;
|
||||
|
||||
class DSF::Properties::PropertiesPrivate {
|
||||
class DSF::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : formatVersion(0),
|
||||
AudioPropertiesPrivate() : formatVersion(0),
|
||||
formatID(0),
|
||||
channelType(0),
|
||||
channelNum(0),
|
||||
|
@ -63,61 +63,57 @@ class DSF::Properties::PropertiesPrivate {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DSF::Properties::Properties(const ByteVector &data, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style) {
|
||||
d = new PropertiesPrivate;
|
||||
DSF::AudioProperties::AudioProperties(const ByteVector &data, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style) {
|
||||
d = new AudioPropertiesPrivate;
|
||||
read(data);
|
||||
}
|
||||
|
||||
DSF::Properties::~Properties() {
|
||||
DSF::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int DSF::Properties::length() const {
|
||||
return lengthInSeconds();
|
||||
}
|
||||
|
||||
int DSF::Properties::lengthInSeconds() const {
|
||||
int DSF::AudioProperties::lengthInSeconds() const {
|
||||
return d->length / 1000;
|
||||
}
|
||||
|
||||
int DSF::Properties::lengthInMilliseconds() const {
|
||||
int DSF::AudioProperties::lengthInMilliseconds() const {
|
||||
return d->length;
|
||||
}
|
||||
|
||||
int DSF::Properties::bitrate() const {
|
||||
int DSF::AudioProperties::bitrate() const {
|
||||
return d->bitrate;
|
||||
}
|
||||
|
||||
int DSF::Properties::sampleRate() const {
|
||||
int DSF::AudioProperties::sampleRate() const {
|
||||
return d->samplingFrequency;
|
||||
}
|
||||
|
||||
int DSF::Properties::channels() const {
|
||||
int DSF::AudioProperties::channels() const {
|
||||
return d->channelNum;
|
||||
}
|
||||
|
||||
// DSF specific
|
||||
int DSF::Properties::formatVersion() const {
|
||||
int DSF::AudioProperties::formatVersion() const {
|
||||
return d->formatVersion;
|
||||
}
|
||||
|
||||
int DSF::Properties::formatID() const {
|
||||
int DSF::AudioProperties::formatID() const {
|
||||
return d->formatID;
|
||||
}
|
||||
|
||||
int DSF::Properties::channelType() const {
|
||||
int DSF::AudioProperties::channelType() const {
|
||||
return d->channelType;
|
||||
}
|
||||
|
||||
int DSF::Properties::bitsPerSample() const {
|
||||
int DSF::AudioProperties::bitsPerSample() const {
|
||||
return d->bitsPerSample;
|
||||
}
|
||||
|
||||
long long DSF::Properties::sampleCount() const {
|
||||
long long DSF::AudioProperties::sampleCount() const {
|
||||
return d->sampleCount;
|
||||
}
|
||||
|
||||
int DSF::Properties::blockSizePerChannel() const {
|
||||
int DSF::AudioProperties::blockSizePerChannel() const {
|
||||
return d->blockSizePerChannel;
|
||||
}
|
||||
|
||||
|
@ -125,7 +121,7 @@ int DSF::Properties::blockSizePerChannel() const {
|
|||
// private members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void DSF::Properties::read(const ByteVector &data) {
|
||||
void DSF::AudioProperties::read(const ByteVector &data) {
|
||||
d->formatVersion = data.toUInt(0U, false);
|
||||
d->formatID = data.toUInt(4U, false);
|
||||
d->channelType = data.toUInt(8U, false);
|
||||
|
|
|
@ -40,21 +40,20 @@ class File;
|
|||
* This reads the data from a DSF stream found in the AudioProperties API.
|
||||
*/
|
||||
|
||||
class TAGLIB_EXPORT Properties : public Strawberry_TagLib::TagLib::AudioProperties {
|
||||
class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties {
|
||||
public:
|
||||
/*!
|
||||
* Create an instance of DSF::AudioProperties with the data read from the ByteVector \a data.
|
||||
*/
|
||||
Properties(const ByteVector &data, ReadStyle style);
|
||||
AudioProperties(const ByteVector &data, ReadStyle style);
|
||||
|
||||
/*!
|
||||
* Destroys this DSF::AudioProperties instance.
|
||||
*/
|
||||
virtual ~Properties();
|
||||
virtual ~AudioProperties();
|
||||
|
||||
// Reimplementations.
|
||||
|
||||
virtual int length() const;
|
||||
virtual int lengthInSeconds() const;
|
||||
virtual int lengthInMilliseconds() const;
|
||||
virtual int bitrate() const;
|
||||
|
@ -80,13 +79,13 @@ class TAGLIB_EXPORT Properties : public Strawberry_TagLib::TagLib::AudioProperti
|
|||
int blockSizePerChannel() const;
|
||||
|
||||
private:
|
||||
Properties(const Properties &);
|
||||
Properties &operator=(const Properties &);
|
||||
AudioProperties(const AudioProperties &);
|
||||
AudioProperties &operator=(const AudioProperties &);
|
||||
|
||||
void read(const ByteVector &data);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
class AudioPropertiesPrivate;
|
||||
AudioPropertiesPrivate *d;
|
||||
};
|
||||
} // namespace DSF
|
||||
} // namespace TagLib
|
||||
|
|
|
@ -83,7 +83,7 @@ class FLAC::File::FilePrivate {
|
|||
|
||||
TagUnion tag;
|
||||
|
||||
Properties *properties;
|
||||
AudioProperties *properties;
|
||||
ByteVector xiphCommentData;
|
||||
BlockList blocks;
|
||||
|
||||
|
@ -109,14 +109,14 @@ bool FLAC::File::isSupported(IOStream *stream) {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
FLAC::File::File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate(frameFactory)) {
|
||||
FLAC::File::File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate(frameFactory)) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
||||
}
|
||||
|
||||
FLAC::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate(frameFactory)) {
|
||||
FLAC::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate(frameFactory)) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
@ -143,7 +143,7 @@ PropertyMap FLAC::File::setProperties(const PropertyMap &properties) {
|
|||
return xiphComment(true)->setProperties(properties);
|
||||
}
|
||||
|
||||
FLAC::Properties *FLAC::File::audioProperties() const {
|
||||
FLAC::AudioProperties *FLAC::File::audioProperties() const {
|
||||
return d->properties;
|
||||
}
|
||||
|
||||
|
@ -416,7 +416,7 @@ void FLAC::File::read(bool readProperties) {
|
|||
else
|
||||
streamLength = length() - d->streamStart;
|
||||
|
||||
d->properties = new Properties(infoData, streamLength);
|
||||
d->properties = new AudioProperties(infoData, streamLength);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
*
|
||||
* \note In the current implementation, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Constructs a FLAC file from \a stream. If \a readProperties is true the file's audio properties will also be read.
|
||||
|
@ -109,7 +109,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
* \note In the current implementation, \a propertiesStyle is ignored.
|
||||
*/
|
||||
// BIC: merge with the above constructor
|
||||
File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Destroys this instance of the File.
|
||||
|
@ -141,9 +141,9 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
PropertyMap setProperties(const PropertyMap &);
|
||||
|
||||
/*!
|
||||
* Returns the FLAC::Properties for this file. If no audio properties were read then this will return a null pointer.
|
||||
* 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;
|
||||
|
||||
/*!
|
||||
* Save the file. This will primarily save the XiphComment, but will also keep any old ID3-tags up to date.
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
|
||||
using namespace Strawberry_TagLib::TagLib;
|
||||
|
||||
class FLAC::Properties::PropertiesPrivate {
|
||||
class FLAC::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : length(0),
|
||||
AudioPropertiesPrivate() : length(0),
|
||||
bitrate(0),
|
||||
sampleRate(0),
|
||||
bitsPerSample(0),
|
||||
|
@ -53,43 +53,43 @@ class FLAC::Properties::PropertiesPrivate {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
FLAC::Properties::Properties(const ByteVector &data, long streamLength, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) {
|
||||
FLAC::AudioProperties::AudioProperties(const ByteVector &data, long streamLength, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) {
|
||||
read(data, streamLength);
|
||||
}
|
||||
|
||||
FLAC::Properties::~Properties() {
|
||||
FLAC::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int FLAC::Properties::lengthInSeconds() const {
|
||||
int FLAC::AudioProperties::lengthInSeconds() const {
|
||||
return d->length / 1000;
|
||||
}
|
||||
|
||||
int FLAC::Properties::lengthInMilliseconds() const {
|
||||
int FLAC::AudioProperties::lengthInMilliseconds() const {
|
||||
return d->length;
|
||||
}
|
||||
|
||||
int FLAC::Properties::bitrate() const {
|
||||
int FLAC::AudioProperties::bitrate() const {
|
||||
return d->bitrate;
|
||||
}
|
||||
|
||||
int FLAC::Properties::sampleRate() const {
|
||||
int FLAC::AudioProperties::sampleRate() const {
|
||||
return d->sampleRate;
|
||||
}
|
||||
|
||||
int FLAC::Properties::bitsPerSample() const {
|
||||
int FLAC::AudioProperties::bitsPerSample() const {
|
||||
return d->bitsPerSample;
|
||||
}
|
||||
|
||||
int FLAC::Properties::channels() const {
|
||||
int FLAC::AudioProperties::channels() const {
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
unsigned long long FLAC::Properties::sampleFrames() const {
|
||||
unsigned long long FLAC::AudioProperties::sampleFrames() const {
|
||||
return d->sampleFrames;
|
||||
}
|
||||
|
||||
ByteVector FLAC::Properties::signature() const {
|
||||
ByteVector FLAC::AudioProperties::signature() const {
|
||||
return d->signature;
|
||||
}
|
||||
|
||||
|
@ -97,10 +97,10 @@ ByteVector FLAC::Properties::signature() const {
|
|||
// private members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void FLAC::Properties::read(const ByteVector &data, long streamLength) {
|
||||
void FLAC::AudioProperties::read(const ByteVector &data, long streamLength) {
|
||||
|
||||
if (data.size() < 18) {
|
||||
debug("FLAC::Properties::read() - FLAC properties must contain at least 18 bytes.");
|
||||
debug("FLAC::AudioProperties::read() - FLAC properties must contain at least 18 bytes.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,17 +42,17 @@ class File;
|
|||
* This reads the data from an FLAC 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 FLAC::Properties with the data read from the ByteVector \a data.
|
||||
* Create an instance of FLAC::AudioProperties with the data read from the ByteVector \a data.
|
||||
*/
|
||||
Properties(const ByteVector &data, long streamLength, ReadStyle style = Average);
|
||||
AudioProperties(const ByteVector &data, long streamLength, ReadStyle style = Average);
|
||||
|
||||
/*!
|
||||
* Destroys this FLAC::Properties instance.
|
||||
* Destroys this FLAC::AudioProperties instance.
|
||||
*/
|
||||
virtual ~Properties();
|
||||
virtual ~AudioProperties();
|
||||
|
||||
/*!
|
||||
* Returns the length of the file in seconds. The length is rounded down to the nearest whole second.
|
||||
|
@ -101,13 +101,13 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
ByteVector signature() const;
|
||||
|
||||
private:
|
||||
Properties(const Properties &);
|
||||
Properties &operator=(const Properties &);
|
||||
AudioProperties(const AudioProperties &);
|
||||
AudioProperties &operator=(const AudioProperties &);
|
||||
|
||||
void read(const ByteVector &data, long streamLength);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
class AudioPropertiesPrivate;
|
||||
AudioPropertiesPrivate *d;
|
||||
};
|
||||
} // namespace FLAC
|
||||
} // namespace TagLib
|
||||
|
|
|
@ -38,7 +38,7 @@ class IT::File::FilePrivate {
|
|||
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : properties(propertiesStyle) {}
|
||||
|
||||
Mod::Tag tag;
|
||||
IT::Properties properties;
|
||||
IT::AudioProperties properties;
|
||||
};
|
||||
|
||||
IT::File::File(FileName file, bool readProperties,
|
||||
|
@ -73,7 +73,7 @@ PropertyMap IT::File::setProperties(const PropertyMap &properties) {
|
|||
return d->tag.setProperties(properties);
|
||||
}
|
||||
|
||||
IT::Properties *IT::File::audioProperties() const {
|
||||
IT::AudioProperties *IT::File::audioProperties() const {
|
||||
return &d->properties;
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ bool IT::File::save() {
|
|||
return false;
|
||||
|
||||
unsigned long fileSize = File::length();
|
||||
if (special & Properties::MessageAttached) {
|
||||
if (special & AudioProperties::MessageAttached) {
|
||||
seek(54);
|
||||
if (!readU16L(messageLength) || !readU32L(messageOffset))
|
||||
return false;
|
||||
|
@ -219,7 +219,7 @@ void IT::File::read(bool) {
|
|||
// sample/instrument names are abused as comments so
|
||||
// I just add all together.
|
||||
String message;
|
||||
if (special & Properties::MessageAttached) {
|
||||
if (special & AudioProperties::MessageAttached) {
|
||||
READ_U16L_AS(messageLength);
|
||||
READ_U32L_AS(messageOffset);
|
||||
seek(messageOffset);
|
||||
|
|
|
@ -77,10 +77,10 @@ class TAGLIB_EXPORT File : public Mod::FileBase {
|
|||
PropertyMap setProperties(const PropertyMap &);
|
||||
|
||||
/*!
|
||||
* Returns the IT::Properties for this file. If no audio properties
|
||||
* Returns the IT::AudioProperties for this file. If no audio properties
|
||||
* were read then this will return a null pointer.
|
||||
*/
|
||||
IT::Properties *audioProperties() const;
|
||||
IT::AudioProperties *audioProperties() const;
|
||||
|
||||
/*!
|
||||
* Save the file.
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
using namespace Strawberry_TagLib::TagLib;
|
||||
using namespace IT;
|
||||
|
||||
class IT::Properties::PropertiesPrivate {
|
||||
class IT::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : channels(0),
|
||||
AudioPropertiesPrivate() : channels(0),
|
||||
lengthInPatterns(0),
|
||||
instrumentCount(0),
|
||||
sampleCount(0),
|
||||
|
@ -65,152 +65,148 @@ class IT::Properties::PropertiesPrivate {
|
|||
unsigned char pitchWheelDepth;
|
||||
};
|
||||
|
||||
IT::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) : AudioProperties(propertiesStyle), d(new PropertiesPrivate()) {}
|
||||
IT::AudioProperties::AudioProperties(AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::AudioProperties(propertiesStyle), d(new AudioPropertiesPrivate()) {}
|
||||
|
||||
IT::Properties::~Properties() {
|
||||
IT::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int IT::Properties::length() const {
|
||||
int IT::AudioProperties::lengthInSeconds() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int IT::Properties::lengthInSeconds() const {
|
||||
int IT::AudioProperties::lengthInMilliseconds() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int IT::Properties::lengthInMilliseconds() const {
|
||||
int IT::AudioProperties::bitrate() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int IT::Properties::bitrate() const {
|
||||
int IT::AudioProperties::sampleRate() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int IT::Properties::sampleRate() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int IT::Properties::channels() const {
|
||||
int IT::AudioProperties::channels() const {
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
unsigned short IT::Properties::lengthInPatterns() const {
|
||||
unsigned short IT::AudioProperties::lengthInPatterns() const {
|
||||
return d->lengthInPatterns;
|
||||
}
|
||||
|
||||
bool IT::Properties::stereo() const {
|
||||
bool IT::AudioProperties::stereo() const {
|
||||
return d->flags & Stereo;
|
||||
}
|
||||
|
||||
unsigned short IT::Properties::instrumentCount() const {
|
||||
unsigned short IT::AudioProperties::instrumentCount() const {
|
||||
return d->instrumentCount;
|
||||
}
|
||||
|
||||
unsigned short IT::Properties::sampleCount() const {
|
||||
unsigned short IT::AudioProperties::sampleCount() const {
|
||||
return d->sampleCount;
|
||||
}
|
||||
|
||||
unsigned short IT::Properties::patternCount() const {
|
||||
unsigned short IT::AudioProperties::patternCount() const {
|
||||
return d->patternCount;
|
||||
}
|
||||
|
||||
unsigned short IT::Properties::version() const {
|
||||
unsigned short IT::AudioProperties::version() const {
|
||||
return d->version;
|
||||
}
|
||||
|
||||
unsigned short IT::Properties::compatibleVersion() const {
|
||||
unsigned short IT::AudioProperties::compatibleVersion() const {
|
||||
return d->compatibleVersion;
|
||||
}
|
||||
|
||||
unsigned short IT::Properties::flags() const {
|
||||
unsigned short IT::AudioProperties::flags() const {
|
||||
return d->flags;
|
||||
}
|
||||
|
||||
unsigned short IT::Properties::special() const {
|
||||
unsigned short IT::AudioProperties::special() const {
|
||||
return d->special;
|
||||
}
|
||||
|
||||
unsigned char IT::Properties::globalVolume() const {
|
||||
unsigned char IT::AudioProperties::globalVolume() const {
|
||||
return d->globalVolume;
|
||||
}
|
||||
|
||||
unsigned char IT::Properties::mixVolume() const {
|
||||
unsigned char IT::AudioProperties::mixVolume() const {
|
||||
return d->mixVolume;
|
||||
}
|
||||
|
||||
unsigned char IT::Properties::tempo() const {
|
||||
unsigned char IT::AudioProperties::tempo() const {
|
||||
return d->tempo;
|
||||
}
|
||||
|
||||
unsigned char IT::Properties::bpmSpeed() const {
|
||||
unsigned char IT::AudioProperties::bpmSpeed() const {
|
||||
return d->bpmSpeed;
|
||||
}
|
||||
|
||||
unsigned char IT::Properties::panningSeparation() const {
|
||||
unsigned char IT::AudioProperties::panningSeparation() const {
|
||||
return d->panningSeparation;
|
||||
}
|
||||
|
||||
unsigned char IT::Properties::pitchWheelDepth() const {
|
||||
unsigned char IT::AudioProperties::pitchWheelDepth() const {
|
||||
return d->pitchWheelDepth;
|
||||
}
|
||||
|
||||
void IT::Properties::setChannels(int channels) {
|
||||
void IT::AudioProperties::setChannels(int channels) {
|
||||
d->channels = channels;
|
||||
}
|
||||
|
||||
void IT::Properties::setLengthInPatterns(unsigned short lengthInPatterns) {
|
||||
void IT::AudioProperties::setLengthInPatterns(unsigned short lengthInPatterns) {
|
||||
d->lengthInPatterns = lengthInPatterns;
|
||||
}
|
||||
|
||||
void IT::Properties::setInstrumentCount(unsigned short instrumentCount) {
|
||||
void IT::AudioProperties::setInstrumentCount(unsigned short instrumentCount) {
|
||||
d->instrumentCount = instrumentCount;
|
||||
}
|
||||
|
||||
void IT::Properties::setSampleCount(unsigned short sampleCount) {
|
||||
void IT::AudioProperties::setSampleCount(unsigned short sampleCount) {
|
||||
d->sampleCount = sampleCount;
|
||||
}
|
||||
|
||||
void IT::Properties::setPatternCount(unsigned short patternCount) {
|
||||
void IT::AudioProperties::setPatternCount(unsigned short patternCount) {
|
||||
d->patternCount = patternCount;
|
||||
}
|
||||
|
||||
void IT::Properties::setFlags(unsigned short flags) {
|
||||
void IT::AudioProperties::setFlags(unsigned short flags) {
|
||||
d->flags = flags;
|
||||
}
|
||||
|
||||
void IT::Properties::setSpecial(unsigned short special) {
|
||||
void IT::AudioProperties::setSpecial(unsigned short special) {
|
||||
d->special = special;
|
||||
}
|
||||
|
||||
void IT::Properties::setCompatibleVersion(unsigned short compatibleVersion) {
|
||||
void IT::AudioProperties::setCompatibleVersion(unsigned short compatibleVersion) {
|
||||
d->compatibleVersion = compatibleVersion;
|
||||
}
|
||||
|
||||
void IT::Properties::setVersion(unsigned short version) {
|
||||
void IT::AudioProperties::setVersion(unsigned short version) {
|
||||
d->version = version;
|
||||
}
|
||||
|
||||
void IT::Properties::setGlobalVolume(unsigned char globalVolume) {
|
||||
void IT::AudioProperties::setGlobalVolume(unsigned char globalVolume) {
|
||||
d->globalVolume = globalVolume;
|
||||
}
|
||||
|
||||
void IT::Properties::setMixVolume(unsigned char mixVolume) {
|
||||
void IT::AudioProperties::setMixVolume(unsigned char mixVolume) {
|
||||
d->mixVolume = mixVolume;
|
||||
}
|
||||
|
||||
void IT::Properties::setTempo(unsigned char tempo) {
|
||||
void IT::AudioProperties::setTempo(unsigned char tempo) {
|
||||
d->tempo = tempo;
|
||||
}
|
||||
|
||||
void IT::Properties::setBpmSpeed(unsigned char bpmSpeed) {
|
||||
void IT::AudioProperties::setBpmSpeed(unsigned char bpmSpeed) {
|
||||
d->bpmSpeed = bpmSpeed;
|
||||
}
|
||||
|
||||
void IT::Properties::setPanningSeparation(unsigned char panningSeparation) {
|
||||
void IT::AudioProperties::setPanningSeparation(unsigned char panningSeparation) {
|
||||
d->panningSeparation = panningSeparation;
|
||||
}
|
||||
|
||||
void IT::Properties::setPitchWheelDepth(unsigned char pitchWheelDepth) {
|
||||
void IT::AudioProperties::setPitchWheelDepth(unsigned char pitchWheelDepth) {
|
||||
d->pitchWheelDepth = pitchWheelDepth;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
namespace Strawberry_TagLib {
|
||||
namespace TagLib {
|
||||
namespace IT {
|
||||
class TAGLIB_EXPORT Properties : public AudioProperties {
|
||||
class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties {
|
||||
friend class File;
|
||||
|
||||
public:
|
||||
|
@ -54,10 +54,9 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
MidiConfEmbedded = 8
|
||||
};
|
||||
|
||||
Properties(AudioProperties::ReadStyle propertiesStyle);
|
||||
virtual ~Properties();
|
||||
AudioProperties(AudioProperties::ReadStyle propertiesStyle);
|
||||
virtual ~AudioProperties();
|
||||
|
||||
int length() const;
|
||||
int lengthInSeconds() const;
|
||||
int lengthInMilliseconds() const;
|
||||
int bitrate() const;
|
||||
|
@ -97,11 +96,11 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
void setPitchWheelDepth(unsigned char pitchWheelDepth);
|
||||
|
||||
private:
|
||||
Properties(const Properties &);
|
||||
Properties &operator=(const Properties &);
|
||||
AudioProperties(const AudioProperties &);
|
||||
AudioProperties &operator=(const AudioProperties &);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
class AudioPropertiesPrivate;
|
||||
AudioPropertiesPrivate *d;
|
||||
};
|
||||
} // namespace IT
|
||||
} // namespace TagLib
|
||||
|
|
|
@ -38,7 +38,7 @@ class Mod::File::FilePrivate {
|
|||
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : properties(propertiesStyle) {}
|
||||
|
||||
Mod::Tag tag;
|
||||
Mod::Properties properties;
|
||||
Mod::AudioProperties properties;
|
||||
};
|
||||
|
||||
Mod::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle propertiesStyle) : Mod::FileBase(file), d(new FilePrivate(propertiesStyle)) {
|
||||
|
@ -63,7 +63,7 @@ Mod::Tag *Mod::File::tag() const {
|
|||
return &d->tag;
|
||||
}
|
||||
|
||||
Mod::Properties *Mod::File::audioProperties() const {
|
||||
Mod::AudioProperties *Mod::File::audioProperties() const {
|
||||
return &d->properties;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,9 +77,9 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::Mod::FileBase {
|
|||
*/
|
||||
PropertyMap setProperties(const PropertyMap &);
|
||||
/*!
|
||||
* Returns the Mod::Properties for this file. If no audio properties were read then this will return a null pointer.
|
||||
* Returns the Mod::AudioProperties for this file. If no audio properties were read then this will return a null pointer.
|
||||
*/
|
||||
Mod::Properties *audioProperties() const;
|
||||
Mod::AudioProperties *audioProperties() const;
|
||||
|
||||
/*!
|
||||
* Save the file.
|
||||
|
|
|
@ -29,62 +29,58 @@
|
|||
using namespace Strawberry_TagLib::TagLib;
|
||||
using namespace Mod;
|
||||
|
||||
class Mod::Properties::PropertiesPrivate {
|
||||
class Mod::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : channels(0), instrumentCount(0), lengthInPatterns(0) {}
|
||||
AudioPropertiesPrivate() : channels(0), instrumentCount(0), lengthInPatterns(0) {}
|
||||
|
||||
int channels;
|
||||
unsigned int instrumentCount;
|
||||
unsigned char lengthInPatterns;
|
||||
};
|
||||
|
||||
Mod::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) : AudioProperties(propertiesStyle), d(new PropertiesPrivate()) {
|
||||
Mod::AudioProperties::AudioProperties(AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::AudioProperties(propertiesStyle), d(new AudioPropertiesPrivate()) {
|
||||
}
|
||||
|
||||
Mod::Properties::~Properties() {
|
||||
Mod::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int Mod::Properties::length() const {
|
||||
int Mod::AudioProperties::lengthInSeconds() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Mod::Properties::lengthInSeconds() const {
|
||||
int Mod::AudioProperties::lengthInMilliseconds() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Mod::Properties::lengthInMilliseconds() const {
|
||||
int Mod::AudioProperties::bitrate() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Mod::Properties::bitrate() const {
|
||||
int Mod::AudioProperties::sampleRate() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Mod::Properties::sampleRate() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Mod::Properties::channels() const {
|
||||
int Mod::AudioProperties::channels() const {
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
unsigned int Mod::Properties::instrumentCount() const {
|
||||
unsigned int Mod::AudioProperties::instrumentCount() const {
|
||||
return d->instrumentCount;
|
||||
}
|
||||
|
||||
unsigned char Mod::Properties::lengthInPatterns() const {
|
||||
unsigned char Mod::AudioProperties::lengthInPatterns() const {
|
||||
return d->lengthInPatterns;
|
||||
}
|
||||
|
||||
void Mod::Properties::setChannels(int channels) {
|
||||
void Mod::AudioProperties::setChannels(int channels) {
|
||||
d->channels = channels;
|
||||
}
|
||||
|
||||
void Mod::Properties::setInstrumentCount(unsigned int instrumentCount) {
|
||||
void Mod::AudioProperties::setInstrumentCount(unsigned int instrumentCount) {
|
||||
d->instrumentCount = instrumentCount;
|
||||
}
|
||||
|
||||
void Mod::Properties::setLengthInPatterns(unsigned char lengthInPatterns) {
|
||||
void Mod::AudioProperties::setLengthInPatterns(unsigned char lengthInPatterns) {
|
||||
d->lengthInPatterns = lengthInPatterns;
|
||||
}
|
||||
|
|
|
@ -33,12 +33,11 @@ namespace Strawberry_TagLib {
|
|||
namespace TagLib {
|
||||
namespace Mod {
|
||||
|
||||
class TAGLIB_EXPORT Properties : public AudioProperties {
|
||||
class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties {
|
||||
public:
|
||||
Properties(AudioProperties::ReadStyle propertiesStyle);
|
||||
virtual ~Properties();
|
||||
AudioProperties(AudioProperties::ReadStyle propertiesStyle);
|
||||
virtual ~AudioProperties();
|
||||
|
||||
int length() const;
|
||||
int lengthInSeconds() const;
|
||||
int lengthInMilliseconds() const;
|
||||
int bitrate() const;
|
||||
|
@ -56,11 +55,11 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
private:
|
||||
friend class File;
|
||||
|
||||
Properties(const Properties &);
|
||||
Properties &operator=(const Properties &);
|
||||
AudioProperties(const AudioProperties &);
|
||||
AudioProperties &operator=(const AudioProperties &);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
class AudioPropertiesPrivate;
|
||||
AudioPropertiesPrivate *d;
|
||||
};
|
||||
|
||||
} // namespace Mod
|
||||
|
|
|
@ -63,7 +63,7 @@ class MP4::File::FilePrivate {
|
|||
|
||||
MP4::Tag *tag;
|
||||
MP4::Atoms *atoms;
|
||||
MP4::Properties *properties;
|
||||
MP4::AudioProperties *properties;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -118,7 +118,7 @@ PropertyMap MP4::File::setProperties(const PropertyMap &properties) {
|
|||
return d->tag->setProperties(properties);
|
||||
}
|
||||
|
||||
MP4::Properties *
|
||||
MP4::AudioProperties *
|
||||
MP4::File::audioProperties() const {
|
||||
return d->properties;
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ void MP4::File::read(bool readProperties) {
|
|||
|
||||
d->tag = new Tag(this, d->atoms);
|
||||
if (readProperties) {
|
||||
d->properties = new Properties(this, d->atoms);
|
||||
d->properties = new AudioProperties(this, d->atoms);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
*
|
||||
* \note In the current implementation, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(FileName file, bool readProperties = true, Properties::ReadStyle audioPropertiesStyle = Properties::Average);
|
||||
File(FileName file, bool readProperties = true, AudioProperties::ReadStyle audioPropertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Constructs an MP4 file from \a stream.
|
||||
|
@ -66,7 +66,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
* \note In the current implementation, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(IOStream *stream, bool readProperties = true,
|
||||
Properties::ReadStyle audioPropertiesStyle = Properties::Average);
|
||||
AudioProperties::ReadStyle audioPropertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Destroys this instance of the File.
|
||||
|
@ -101,7 +101,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
/*!
|
||||
* Returns the MP4 audio properties for this file.
|
||||
*/
|
||||
Properties *audioProperties() const;
|
||||
AudioProperties *audioProperties() const;
|
||||
|
||||
/*!
|
||||
* Save the file.
|
||||
|
|
|
@ -31,15 +31,15 @@
|
|||
|
||||
using namespace Strawberry_TagLib::TagLib;
|
||||
|
||||
class MP4::Properties::PropertiesPrivate {
|
||||
class MP4::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : length(0),
|
||||
AudioPropertiesPrivate() : length(0),
|
||||
bitrate(0),
|
||||
sampleRate(0),
|
||||
channels(0),
|
||||
bitsPerSample(0),
|
||||
encrypted(false),
|
||||
codec(MP4::Properties::Unknown) {}
|
||||
codec(MP4::AudioProperties::Unknown) {}
|
||||
|
||||
int length;
|
||||
int bitrate;
|
||||
|
@ -54,44 +54,44 @@ class MP4::Properties::PropertiesPrivate {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
MP4::Properties::Properties(File *file, MP4::Atoms *atoms, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) {
|
||||
MP4::AudioProperties::AudioProperties(File *file, MP4::Atoms *atoms, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) {
|
||||
read(file, atoms);
|
||||
}
|
||||
|
||||
MP4::Properties::~Properties() {
|
||||
MP4::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int MP4::Properties::channels() const {
|
||||
int MP4::AudioProperties::channels() const {
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
int MP4::Properties::sampleRate() const {
|
||||
int MP4::AudioProperties::sampleRate() const {
|
||||
return d->sampleRate;
|
||||
}
|
||||
|
||||
int MP4::Properties::lengthInSeconds() const {
|
||||
int MP4::AudioProperties::lengthInSeconds() const {
|
||||
return d->length / 1000;
|
||||
}
|
||||
|
||||
int MP4::Properties::lengthInMilliseconds() const {
|
||||
int MP4::AudioProperties::lengthInMilliseconds() const {
|
||||
return d->length;
|
||||
}
|
||||
|
||||
int MP4::Properties::bitrate() const {
|
||||
int MP4::AudioProperties::bitrate() const {
|
||||
return d->bitrate;
|
||||
}
|
||||
|
||||
int MP4::Properties::bitsPerSample() const {
|
||||
int MP4::AudioProperties::bitsPerSample() const {
|
||||
return d->bitsPerSample;
|
||||
}
|
||||
|
||||
bool MP4::Properties::isEncrypted() const {
|
||||
bool MP4::AudioProperties::isEncrypted() const {
|
||||
return d->encrypted;
|
||||
}
|
||||
|
||||
MP4::Properties::Codec
|
||||
MP4::Properties::codec() const {
|
||||
MP4::AudioProperties::Codec
|
||||
MP4::AudioProperties::codec() const {
|
||||
return d->codec;
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ MP4::Properties::codec() const {
|
|||
// private members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void MP4::Properties::read(File *file, Atoms *atoms) {
|
||||
void MP4::AudioProperties::read(File *file, Atoms *atoms) {
|
||||
|
||||
MP4::Atom *moov = atoms->find("moov");
|
||||
if (!moov) {
|
||||
|
|
|
@ -37,7 +37,7 @@ class Atoms;
|
|||
class File;
|
||||
|
||||
//! An implementation of MP4 audio properties
|
||||
class TAGLIB_EXPORT Properties : public AudioProperties {
|
||||
class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties {
|
||||
public:
|
||||
enum Codec {
|
||||
Unknown = 0,
|
||||
|
@ -45,8 +45,8 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
ALAC
|
||||
};
|
||||
|
||||
Properties(File *file, Atoms *atoms, ReadStyle style = Average);
|
||||
virtual ~Properties();
|
||||
AudioProperties(File *file, Atoms *atoms, ReadStyle style = Average);
|
||||
virtual ~AudioProperties();
|
||||
|
||||
/*!
|
||||
* Returns the length of the file in seconds. The length is rounded down to the nearest whole second.
|
||||
|
@ -97,8 +97,8 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
private:
|
||||
void read(File *file, Atoms *atoms);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
class AudioPropertiesPrivate;
|
||||
AudioPropertiesPrivate *d;
|
||||
};
|
||||
|
||||
} // namespace MP4
|
||||
|
|
|
@ -69,7 +69,7 @@ class MPC::File::FilePrivate {
|
|||
|
||||
TagUnion tag;
|
||||
|
||||
Properties *properties;
|
||||
AudioProperties *properties;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -90,14 +90,14 @@ bool MPC::File::isSupported(IOStream *stream) {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
MPC::File::File(FileName file, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) {
|
||||
MPC::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
||||
}
|
||||
|
||||
MPC::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) {
|
||||
MPC::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
@ -127,7 +127,7 @@ PropertyMap MPC::File::setProperties(const PropertyMap &properties) {
|
|||
return APETag(true)->setProperties(properties);
|
||||
}
|
||||
|
||||
MPC::Properties *MPC::File::audioProperties() const {
|
||||
MPC::AudioProperties *MPC::File::audioProperties() const {
|
||||
return d->properties;
|
||||
}
|
||||
|
||||
|
@ -310,7 +310,7 @@ void MPC::File::read(bool readProperties) {
|
|||
seek(0);
|
||||
}
|
||||
|
||||
d->properties = new Properties(this, streamLength);
|
||||
d->properties = new AudioProperties(this, streamLength);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::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 MPC file from \a stream.
|
||||
|
@ -99,7 +99,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::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.
|
||||
|
@ -128,10 +128,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.
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
|
||||
using namespace Strawberry_TagLib::TagLib;
|
||||
|
||||
class MPC::Properties::PropertiesPrivate {
|
||||
class MPC::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : version(0),
|
||||
AudioPropertiesPrivate() : version(0),
|
||||
length(0),
|
||||
bitrate(0),
|
||||
sampleRate(0),
|
||||
|
@ -64,11 +64,11 @@ class MPC::Properties::PropertiesPrivate {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
MPC::Properties::Properties(const ByteVector &data, long streamLength, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) {
|
||||
MPC::AudioProperties::AudioProperties(const ByteVector &data, long streamLength, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) {
|
||||
readSV7(data, streamLength);
|
||||
}
|
||||
|
||||
MPC::Properties::Properties(File *file, long streamLength, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) {
|
||||
MPC::AudioProperties::AudioProperties(File *file, long streamLength, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) {
|
||||
|
||||
ByteVector magic = file->readBlock(4);
|
||||
if (magic == "MPCK") {
|
||||
|
@ -82,55 +82,55 @@ MPC::Properties::Properties(File *file, long streamLength, ReadStyle style) : Au
|
|||
|
||||
}
|
||||
|
||||
MPC::Properties::~Properties() {
|
||||
MPC::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int MPC::Properties::lengthInSeconds() const {
|
||||
int MPC::AudioProperties::lengthInSeconds() const {
|
||||
return d->length / 1000;
|
||||
}
|
||||
|
||||
int MPC::Properties::lengthInMilliseconds() const {
|
||||
int MPC::AudioProperties::lengthInMilliseconds() const {
|
||||
return d->length;
|
||||
}
|
||||
|
||||
int MPC::Properties::bitrate() const {
|
||||
int MPC::AudioProperties::bitrate() const {
|
||||
return d->bitrate;
|
||||
}
|
||||
|
||||
int MPC::Properties::sampleRate() const {
|
||||
int MPC::AudioProperties::sampleRate() const {
|
||||
return d->sampleRate;
|
||||
}
|
||||
|
||||
int MPC::Properties::channels() const {
|
||||
int MPC::AudioProperties::channels() const {
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
int MPC::Properties::mpcVersion() const {
|
||||
int MPC::AudioProperties::mpcVersion() const {
|
||||
return d->version;
|
||||
}
|
||||
|
||||
unsigned int MPC::Properties::totalFrames() const {
|
||||
unsigned int MPC::AudioProperties::totalFrames() const {
|
||||
return d->totalFrames;
|
||||
}
|
||||
|
||||
unsigned int MPC::Properties::sampleFrames() const {
|
||||
unsigned int MPC::AudioProperties::sampleFrames() const {
|
||||
return d->sampleFrames;
|
||||
}
|
||||
|
||||
int MPC::Properties::trackGain() const {
|
||||
int MPC::AudioProperties::trackGain() const {
|
||||
return d->trackGain;
|
||||
}
|
||||
|
||||
int MPC::Properties::trackPeak() const {
|
||||
int MPC::AudioProperties::trackPeak() const {
|
||||
return d->trackPeak;
|
||||
}
|
||||
|
||||
int MPC::Properties::albumGain() const {
|
||||
int MPC::AudioProperties::albumGain() const {
|
||||
return d->albumGain;
|
||||
}
|
||||
|
||||
int MPC::Properties::albumPeak() const {
|
||||
int MPC::AudioProperties::albumPeak() const {
|
||||
return d->albumPeak;
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ unsigned long readSize(const ByteVector &data, unsigned int &pos) {
|
|||
const unsigned short sftable[8] = { 44100, 48000, 37800, 32000, 0, 0, 0, 0 };
|
||||
} // namespace
|
||||
|
||||
void MPC::Properties::readSV8(File *file, long streamLength) {
|
||||
void MPC::AudioProperties::readSV8(File *file, long streamLength) {
|
||||
|
||||
bool readSH = false, readRG = false;
|
||||
|
||||
|
@ -195,7 +195,7 @@ void MPC::Properties::readSV8(File *file, long streamLength) {
|
|||
bool eof;
|
||||
const unsigned long packetSize = readSize(file, packetSizeLength, eof);
|
||||
if (eof) {
|
||||
debug("MPC::Properties::readSV8() - Reached to EOF.");
|
||||
debug("MPC::AudioProperties::readSV8() - Reached to EOF.");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ void MPC::Properties::readSV8(File *file, long streamLength) {
|
|||
|
||||
const ByteVector data = file->readBlock(dataSize);
|
||||
if (data.size() != dataSize) {
|
||||
debug("MPC::Properties::readSV8() - dataSize doesn't match the actual data size.");
|
||||
debug("MPC::AudioProperties::readSV8() - dataSize doesn't match the actual data size.");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ void MPC::Properties::readSV8(File *file, long streamLength) {
|
|||
// http://trac.musepack.net/wiki/SV8Specification#StreamHeaderPacket
|
||||
|
||||
if (dataSize <= 5) {
|
||||
debug("MPC::Properties::readSV8() - \"SH\" packet is too short to parse.");
|
||||
debug("MPC::AudioProperties::readSV8() - \"SH\" packet is too short to parse.");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -223,13 +223,13 @@ void MPC::Properties::readSV8(File *file, long streamLength) {
|
|||
pos += 1;
|
||||
d->sampleFrames = readSize(data, pos);
|
||||
if (pos > dataSize - 3) {
|
||||
debug("MPC::Properties::readSV8() - \"SH\" packet is corrupt.");
|
||||
debug("MPC::AudioProperties::readSV8() - \"SH\" packet is corrupt.");
|
||||
break;
|
||||
}
|
||||
|
||||
const unsigned long begSilence = readSize(data, pos);
|
||||
if (pos > dataSize - 2) {
|
||||
debug("MPC::Properties::readSV8() - \"SH\" packet is corrupt.");
|
||||
debug("MPC::AudioProperties::readSV8() - \"SH\" packet is corrupt.");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ void MPC::Properties::readSV8(File *file, long streamLength) {
|
|||
// http://trac.musepack.net/wiki/SV8Specification#ReplaygainPacket
|
||||
|
||||
if (dataSize <= 9) {
|
||||
debug("MPC::Properties::readSV8() - \"RG\" packet is too short to parse.");
|
||||
debug("MPC::AudioProperties::readSV8() - \"RG\" packet is too short to parse.");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ void MPC::Properties::readSV8(File *file, long streamLength) {
|
|||
|
||||
}
|
||||
|
||||
void MPC::Properties::readSV7(const ByteVector &data, long streamLength) {
|
||||
void MPC::AudioProperties::readSV7(const ByteVector &data, long streamLength) {
|
||||
|
||||
if (data.startsWith("MP+")) {
|
||||
d->version = data[3] & 15;
|
||||
|
|
|
@ -44,24 +44,24 @@ static const unsigned int HeaderSize = 8 * 7;
|
|||
* This reads the data from an MPC 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 MPC::Properties with the data read from the ByteVector \a data.
|
||||
* Create an instance of MPC::AudioProperties with the data read from the ByteVector \a data.
|
||||
*
|
||||
* This constructor is deprecated. It only works for MPC version up to 7.
|
||||
*/
|
||||
Properties(const ByteVector &data, long streamLength, ReadStyle style = Average);
|
||||
AudioProperties(const ByteVector &data, long streamLength, ReadStyle style = Average);
|
||||
|
||||
/*!
|
||||
* Create an instance of MPC::Properties with the data read directly from a MPC::File.
|
||||
* Create an instance of MPC::AudioProperties with the data read directly from a MPC::File.
|
||||
*/
|
||||
Properties(File *file, long streamLength, ReadStyle style = Average);
|
||||
AudioProperties(File *file, long streamLength, ReadStyle style = Average);
|
||||
|
||||
/*!
|
||||
* Destroys this MPC::Properties instance.
|
||||
* Destroys this MPC::AudioProperties instance.
|
||||
*/
|
||||
virtual ~Properties();
|
||||
virtual ~AudioProperties();
|
||||
|
||||
/*!
|
||||
* Returns the length of the file in seconds.
|
||||
|
@ -130,14 +130,14 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
int albumPeak() const;
|
||||
|
||||
private:
|
||||
Properties(const Properties &);
|
||||
Properties &operator=(const Properties &);
|
||||
AudioProperties(const AudioProperties &);
|
||||
AudioProperties &operator=(const AudioProperties &);
|
||||
|
||||
void readSV7(const ByteVector &data, long streamLength);
|
||||
void readSV8(File *file, long streamLength);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
class AudioPropertiesPrivate;
|
||||
AudioPropertiesPrivate *d;
|
||||
};
|
||||
} // namespace MPC
|
||||
} // namespace TagLib
|
||||
|
|
|
@ -71,7 +71,7 @@ class MPEG::File::FilePrivate {
|
|||
|
||||
TagUnion tag;
|
||||
|
||||
Properties *properties;
|
||||
AudioProperties *properties;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -129,14 +129,14 @@ bool MPEG::File::isSupported(IOStream *stream) {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
MPEG::File::File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate(frameFactory)) {
|
||||
MPEG::File::File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate(frameFactory)) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
||||
}
|
||||
|
||||
MPEG::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate(frameFactory)) {
|
||||
MPEG::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate(frameFactory)) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
@ -170,7 +170,7 @@ PropertyMap MPEG::File::setProperties(const PropertyMap &properties) {
|
|||
|
||||
}
|
||||
|
||||
MPEG::Properties *MPEG::File::audioProperties() const {
|
||||
MPEG::AudioProperties *MPEG::File::audioProperties() const {
|
||||
return d->properties;
|
||||
}
|
||||
|
||||
|
@ -480,7 +480,7 @@ void MPEG::File::read(bool readProperties) {
|
|||
}
|
||||
|
||||
if (readProperties)
|
||||
d->properties = new Properties(this);
|
||||
d->properties = new AudioProperties(this);
|
||||
|
||||
// Make sure that we have our default tag types available.
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
* \note In the current implementation, \a propertiesStyle is ignored.
|
||||
*/
|
||||
// BIC: merge with the above constructor
|
||||
File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Constructs an MPEG file from \a stream.
|
||||
|
@ -102,7 +102,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
*/
|
||||
File(IOStream *stream, ID3v2::FrameFactory *frameFactory,
|
||||
bool readProperties = true,
|
||||
Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Destroys this instance of the File.
|
||||
|
@ -145,10 +145,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
PropertyMap setProperties(const PropertyMap &);
|
||||
|
||||
/*!
|
||||
* Returns the MPEG::Properties for this file.
|
||||
* Returns the MPEG::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. If at least one tag -- ID3v1 or ID3v2 -- exists this will duplicate its content into the other tag.
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <tdebug.h>
|
||||
#include <tstring.h>
|
||||
|
||||
#include "audioproperties.h"
|
||||
#include "mpegproperties.h"
|
||||
#include "mpegfile.h"
|
||||
#include "xingheader.h"
|
||||
|
@ -34,9 +35,9 @@
|
|||
|
||||
using namespace Strawberry_TagLib::TagLib;
|
||||
|
||||
class MPEG::Properties::PropertiesPrivate {
|
||||
class MPEG::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : xingHeader(nullptr),
|
||||
AudioPropertiesPrivate() : xingHeader(nullptr),
|
||||
length(0),
|
||||
bitrate(0),
|
||||
sampleRate(0),
|
||||
|
@ -48,7 +49,7 @@ class MPEG::Properties::PropertiesPrivate {
|
|||
isCopyrighted(false),
|
||||
isOriginal(false) {}
|
||||
|
||||
~PropertiesPrivate() {
|
||||
~AudioPropertiesPrivate() {
|
||||
delete xingHeader;
|
||||
}
|
||||
|
||||
|
@ -69,63 +70,59 @@ class MPEG::Properties::PropertiesPrivate {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
MPEG::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) {
|
||||
MPEG::AudioProperties::AudioProperties(File *file, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) {
|
||||
read(file);
|
||||
}
|
||||
|
||||
MPEG::Properties::~Properties() {
|
||||
MPEG::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int MPEG::Properties::length() const {
|
||||
return lengthInSeconds();
|
||||
}
|
||||
|
||||
int MPEG::Properties::lengthInSeconds() const {
|
||||
int MPEG::AudioProperties::lengthInSeconds() const {
|
||||
return d->length / 1000;
|
||||
}
|
||||
|
||||
int MPEG::Properties::lengthInMilliseconds() const {
|
||||
int MPEG::AudioProperties::lengthInMilliseconds() const {
|
||||
return d->length;
|
||||
}
|
||||
|
||||
int MPEG::Properties::bitrate() const {
|
||||
int MPEG::AudioProperties::bitrate() const {
|
||||
return d->bitrate;
|
||||
}
|
||||
|
||||
int MPEG::Properties::sampleRate() const {
|
||||
int MPEG::AudioProperties::sampleRate() const {
|
||||
return d->sampleRate;
|
||||
}
|
||||
|
||||
int MPEG::Properties::channels() const {
|
||||
int MPEG::AudioProperties::channels() const {
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
const MPEG::XingHeader *MPEG::Properties::xingHeader() const {
|
||||
const MPEG::XingHeader *MPEG::AudioProperties::xingHeader() const {
|
||||
return d->xingHeader;
|
||||
}
|
||||
|
||||
MPEG::Header::Version MPEG::Properties::version() const {
|
||||
MPEG::Header::Version MPEG::AudioProperties::version() const {
|
||||
return d->version;
|
||||
}
|
||||
|
||||
int MPEG::Properties::layer() const {
|
||||
int MPEG::AudioProperties::layer() const {
|
||||
return d->layer;
|
||||
}
|
||||
|
||||
bool MPEG::Properties::protectionEnabled() const {
|
||||
bool MPEG::AudioProperties::protectionEnabled() const {
|
||||
return d->protectionEnabled;
|
||||
}
|
||||
|
||||
MPEG::Header::ChannelMode MPEG::Properties::channelMode() const {
|
||||
MPEG::Header::ChannelMode MPEG::AudioProperties::channelMode() const {
|
||||
return d->channelMode;
|
||||
}
|
||||
|
||||
bool MPEG::Properties::isCopyrighted() const {
|
||||
bool MPEG::AudioProperties::isCopyrighted() const {
|
||||
return d->isCopyrighted;
|
||||
}
|
||||
|
||||
bool MPEG::Properties::isOriginal() const {
|
||||
bool MPEG::AudioProperties::isOriginal() const {
|
||||
return d->isOriginal;
|
||||
}
|
||||
|
||||
|
@ -133,13 +130,13 @@ bool MPEG::Properties::isOriginal() const {
|
|||
// private members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void MPEG::Properties::read(File *file) {
|
||||
void MPEG::AudioProperties::read(File *file) {
|
||||
|
||||
// Only the first valid frame is required if we have a VBR header.
|
||||
|
||||
const long firstFrameOffset = file->firstFrameOffset();
|
||||
if (firstFrameOffset < 0) {
|
||||
debug("MPEG::Properties::read() -- Could not find an MPEG frame in the stream.");
|
||||
debug("MPEG::AudioProperties::read() -- Could not find an MPEG frame in the stream.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -179,7 +176,7 @@ void MPEG::Properties::read(File *file) {
|
|||
|
||||
const long lastFrameOffset = file->lastFrameOffset();
|
||||
if (lastFrameOffset < 0) {
|
||||
debug("MPEG::Properties::read() -- Could not find an MPEG frame in the stream.");
|
||||
debug("MPEG::AudioProperties::read() -- Could not find an MPEG frame in the stream.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,27 +44,17 @@ class XingHeader;
|
|||
* This reads the data from an MPEG Layer III 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 MPEG::Properties with the data read from the MPEG::File \a file.
|
||||
* Create an instance of MPEG::AudioProperties with the data read from the MPEG::File \a file.
|
||||
*/
|
||||
Properties(File *file, ReadStyle style = Average);
|
||||
AudioProperties(File *file, ReadStyle style = Average);
|
||||
|
||||
/*!
|
||||
* Destroys this MPEG Properties instance.
|
||||
* Destroys this MPEG AudioProperties instance.
|
||||
*/
|
||||
virtual ~Properties();
|
||||
|
||||
/*!
|
||||
* Returns the length of the file in seconds.
|
||||
* The length is rounded down to the nearest whole second.
|
||||
*
|
||||
* \note This method is just an alias of lengthInSeconds().
|
||||
*
|
||||
* \deprecated
|
||||
*/
|
||||
virtual int length() const;
|
||||
virtual ~AudioProperties();
|
||||
|
||||
/*!
|
||||
* Returns the length of the file in seconds. The length is rounded down to the nearest whole second.
|
||||
|
@ -133,13 +123,13 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
bool isOriginal() 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 MPEG
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.");
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class RIFF::AIFF::File::FilePrivate {
|
|||
delete tag;
|
||||
}
|
||||
|
||||
Properties *properties;
|
||||
AudioProperties *properties;
|
||||
ID3v2::Tag *tag;
|
||||
|
||||
bool hasID3v2;
|
||||
|
@ -66,13 +66,13 @@ bool RIFF::AIFF::File::isSupported(IOStream *stream) {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
RIFF::AIFF::File::File(FileName file, bool readProperties, Properties::ReadStyle) : RIFF::File(file, BigEndian), d(new FilePrivate()) {
|
||||
RIFF::AIFF::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : RIFF::File(file, BigEndian), d(new FilePrivate()) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
}
|
||||
|
||||
RIFF::AIFF::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : RIFF::File(stream, BigEndian), d(new FilePrivate()) {
|
||||
RIFF::AIFF::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle) : RIFF::File(stream, BigEndian), d(new FilePrivate()) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
@ -98,7 +98,7 @@ PropertyMap RIFF::AIFF::File::setProperties(const PropertyMap &properties) {
|
|||
return d->tag->setProperties(properties);
|
||||
}
|
||||
|
||||
RIFF::AIFF::Properties *RIFF::AIFF::File::audioProperties() const {
|
||||
RIFF::AIFF::AudioProperties *RIFF::AIFF::File::audioProperties() const {
|
||||
return d->properties;
|
||||
}
|
||||
|
||||
|
@ -160,6 +160,6 @@ void RIFF::AIFF::File::read(bool readProperties) {
|
|||
d->tag = new ID3v2::Tag();
|
||||
|
||||
if (readProperties)
|
||||
d->properties = new Properties(this, Properties::Average);
|
||||
d->properties = new AudioProperties(this, AudioProperties::Average);
|
||||
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File {
|
|||
* \note In the current implementation, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(FileName file, bool readProperties = true,
|
||||
Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Constructs an AIFF file from \a stream.
|
||||
|
@ -75,7 +75,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File {
|
|||
* \note In the current implementation, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(IOStream *stream, bool readProperties = true,
|
||||
Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Destroys this instance of the File.
|
||||
|
@ -107,10 +107,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File {
|
|||
PropertyMap setProperties(const PropertyMap &);
|
||||
|
||||
/*!
|
||||
* Returns the AIFF::Properties for this file.
|
||||
* Returns the AIFF::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.
|
||||
|
@ -143,7 +143,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File {
|
|||
|
||||
void read(bool readProperties);
|
||||
|
||||
friend class Properties;
|
||||
friend class AudioProperties;
|
||||
|
||||
class FilePrivate;
|
||||
FilePrivate *d;
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
|
||||
using namespace Strawberry_TagLib::TagLib;
|
||||
|
||||
class RIFF::AIFF::Properties::PropertiesPrivate {
|
||||
class RIFF::AIFF::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : length(0),
|
||||
AudioPropertiesPrivate() : length(0),
|
||||
bitrate(0),
|
||||
sampleRate(0),
|
||||
channels(0),
|
||||
|
@ -55,51 +55,51 @@ class RIFF::AIFF::Properties::PropertiesPrivate {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
RIFF::AIFF::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) {
|
||||
RIFF::AIFF::AudioProperties::AudioProperties(File *file, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) {
|
||||
read(file);
|
||||
}
|
||||
|
||||
RIFF::AIFF::Properties::~Properties() {
|
||||
RIFF::AIFF::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int RIFF::AIFF::Properties::lengthInSeconds() const {
|
||||
int RIFF::AIFF::AudioProperties::lengthInSeconds() const {
|
||||
return d->length / 1000;
|
||||
}
|
||||
|
||||
int RIFF::AIFF::Properties::lengthInMilliseconds() const {
|
||||
int RIFF::AIFF::AudioProperties::lengthInMilliseconds() const {
|
||||
return d->length;
|
||||
}
|
||||
|
||||
int RIFF::AIFF::Properties::bitrate() const {
|
||||
int RIFF::AIFF::AudioProperties::bitrate() const {
|
||||
return d->bitrate;
|
||||
}
|
||||
|
||||
int RIFF::AIFF::Properties::sampleRate() const {
|
||||
int RIFF::AIFF::AudioProperties::sampleRate() const {
|
||||
return d->sampleRate;
|
||||
}
|
||||
|
||||
int RIFF::AIFF::Properties::channels() const {
|
||||
int RIFF::AIFF::AudioProperties::channels() const {
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
int RIFF::AIFF::Properties::bitsPerSample() const {
|
||||
int RIFF::AIFF::AudioProperties::bitsPerSample() const {
|
||||
return d->bitsPerSample;
|
||||
}
|
||||
|
||||
unsigned int RIFF::AIFF::Properties::sampleFrames() const {
|
||||
unsigned int RIFF::AIFF::AudioProperties::sampleFrames() const {
|
||||
return d->sampleFrames;
|
||||
}
|
||||
|
||||
bool RIFF::AIFF::Properties::isAiffC() const {
|
||||
bool RIFF::AIFF::AudioProperties::isAiffC() const {
|
||||
return (!d->compressionType.isEmpty());
|
||||
}
|
||||
|
||||
ByteVector RIFF::AIFF::Properties::compressionType() const {
|
||||
ByteVector RIFF::AIFF::AudioProperties::compressionType() const {
|
||||
return d->compressionType;
|
||||
}
|
||||
|
||||
String RIFF::AIFF::Properties::compressionName() const {
|
||||
String RIFF::AIFF::AudioProperties::compressionName() const {
|
||||
return d->compressionName;
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ String RIFF::AIFF::Properties::compressionName() const {
|
|||
// private members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void RIFF::AIFF::Properties::read(File *file) {
|
||||
void RIFF::AIFF::AudioProperties::read(File *file) {
|
||||
|
||||
ByteVector data;
|
||||
unsigned int streamLength = 0;
|
||||
|
@ -117,23 +117,23 @@ void RIFF::AIFF::Properties::read(File *file) {
|
|||
if (data.isEmpty())
|
||||
data = file->chunkData(i);
|
||||
else
|
||||
debug("RIFF::AIFF::Properties::read() - Duplicate 'COMM' chunk found.");
|
||||
debug("RIFF::AIFF::AudioProperties::read() - Duplicate 'COMM' chunk found.");
|
||||
}
|
||||
else if (name == "SSND") {
|
||||
if (streamLength == 0)
|
||||
streamLength = file->chunkDataSize(i) + file->chunkPadding(i);
|
||||
else
|
||||
debug("RIFF::AIFF::Properties::read() - Duplicate 'SSND' chunk found.");
|
||||
debug("RIFF::AIFF::AudioProperties::read() - Duplicate 'SSND' chunk found.");
|
||||
}
|
||||
}
|
||||
|
||||
if (data.size() < 18) {
|
||||
debug("RIFF::AIFF::Properties::read() - 'COMM' chunk not found or too short.");
|
||||
debug("RIFF::AIFF::AudioProperties::read() - 'COMM' chunk not found or too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (streamLength == 0) {
|
||||
debug("RIFF::AIFF::Properties::read() - 'SSND' chunk not found.");
|
||||
debug("RIFF::AIFF::AudioProperties::read() - 'SSND' chunk not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,18 +41,18 @@ class File;
|
|||
* This reads the data from an AIFF 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 AIFF::Properties with the data read from the AIFF::File \a file.
|
||||
* Create an instance of AIFF::AudioProperties with the data read from the AIFF::File \a file.
|
||||
*/
|
||||
Properties(File *file, ReadStyle style);
|
||||
AudioProperties(File *file, ReadStyle style);
|
||||
|
||||
/*!
|
||||
* Destroys this AIFF::Properties instance.
|
||||
* Destroys this AIFF::AudioProperties instance.
|
||||
*/
|
||||
virtual ~Properties();
|
||||
virtual ~AudioProperties();
|
||||
|
||||
/*!
|
||||
* Returns the length of the file in seconds. The length is rounded down to the nearest whole second.
|
||||
|
@ -119,13 +119,13 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
String compressionName() 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 AIFF
|
||||
} // namespace RIFF
|
||||
|
|
|
@ -51,7 +51,7 @@ class RIFF::WAV::File::FilePrivate {
|
|||
delete properties;
|
||||
}
|
||||
|
||||
Properties *properties;
|
||||
AudioProperties *properties;
|
||||
TagUnion tag;
|
||||
|
||||
bool hasID3v2;
|
||||
|
@ -75,14 +75,14 @@ bool RIFF::WAV::File::isSupported(IOStream *stream) {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
RIFF::WAV::File::File(FileName file, bool readProperties, Properties::ReadStyle) : RIFF::File(file, LittleEndian), d(new FilePrivate()) {
|
||||
RIFF::WAV::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : RIFF::File(file, LittleEndian), d(new FilePrivate()) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
||||
}
|
||||
|
||||
RIFF::WAV::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : RIFF::File(stream, LittleEndian), d(new FilePrivate()) {
|
||||
RIFF::WAV::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle) : RIFF::File(stream, LittleEndian), d(new FilePrivate()) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
@ -132,7 +132,7 @@ PropertyMap RIFF::WAV::File::setProperties(const PropertyMap &properties) {
|
|||
|
||||
}
|
||||
|
||||
RIFF::WAV::Properties *RIFF::WAV::File::audioProperties() const {
|
||||
RIFF::WAV::AudioProperties *RIFF::WAV::File::audioProperties() const {
|
||||
return d->properties;
|
||||
}
|
||||
|
||||
|
@ -223,7 +223,7 @@ void RIFF::WAV::File::read(bool readProperties) {
|
|||
d->tag.set(InfoIndex, new RIFF::Info::Tag());
|
||||
|
||||
if (readProperties)
|
||||
d->properties = new Properties(this, Properties::Average);
|
||||
d->properties = new AudioProperties(this, AudioProperties::Average);
|
||||
}
|
||||
|
||||
void RIFF::WAV::File::removeTagChunks(TagTypes tags) {
|
||||
|
|
|
@ -75,7 +75,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::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 WAV file from \a stream.
|
||||
|
@ -85,7 +85,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::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.
|
||||
|
@ -142,10 +142,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File {
|
|||
PropertyMap setProperties(const PropertyMap &);
|
||||
|
||||
/*!
|
||||
* Returns the WAV::Properties for this file. If no audio properties
|
||||
* Returns the WAV::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.
|
||||
|
@ -187,7 +187,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::RIFF::File {
|
|||
void read(bool readProperties);
|
||||
void removeTagChunks(TagTypes tags);
|
||||
|
||||
friend class Properties;
|
||||
friend class AudioProperties;
|
||||
|
||||
class FilePrivate;
|
||||
FilePrivate *d;
|
||||
|
|
|
@ -37,9 +37,9 @@ enum WaveFormat {
|
|||
};
|
||||
} // namespace
|
||||
|
||||
class RIFF::WAV::Properties::PropertiesPrivate {
|
||||
class RIFF::WAV::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : format(0),
|
||||
AudioPropertiesPrivate() : format(0),
|
||||
length(0),
|
||||
bitrate(0),
|
||||
sampleRate(0),
|
||||
|
@ -60,43 +60,43 @@ class RIFF::WAV::Properties::PropertiesPrivate {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Strawberry_TagLib::TagLib::RIFF::WAV::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style),d(new PropertiesPrivate()) {
|
||||
Strawberry_TagLib::TagLib::RIFF::WAV::AudioProperties::AudioProperties(File *file, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style),d(new AudioPropertiesPrivate()) {
|
||||
read(file);
|
||||
}
|
||||
|
||||
RIFF::WAV::Properties::~Properties() {
|
||||
RIFF::WAV::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int RIFF::WAV::Properties::lengthInSeconds() const {
|
||||
int RIFF::WAV::AudioProperties::lengthInSeconds() const {
|
||||
return d->length / 1000;
|
||||
}
|
||||
|
||||
int RIFF::WAV::Properties::lengthInMilliseconds() const {
|
||||
int RIFF::WAV::AudioProperties::lengthInMilliseconds() const {
|
||||
return d->length;
|
||||
}
|
||||
|
||||
int RIFF::WAV::Properties::bitrate() const {
|
||||
int RIFF::WAV::AudioProperties::bitrate() const {
|
||||
return d->bitrate;
|
||||
}
|
||||
|
||||
int RIFF::WAV::Properties::sampleRate() const {
|
||||
int RIFF::WAV::AudioProperties::sampleRate() const {
|
||||
return d->sampleRate;
|
||||
}
|
||||
|
||||
int RIFF::WAV::Properties::channels() const {
|
||||
int RIFF::WAV::AudioProperties::channels() const {
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
int RIFF::WAV::Properties::bitsPerSample() const {
|
||||
int RIFF::WAV::AudioProperties::bitsPerSample() const {
|
||||
return d->bitsPerSample;
|
||||
}
|
||||
|
||||
unsigned int RIFF::WAV::Properties::sampleFrames() const {
|
||||
unsigned int RIFF::WAV::AudioProperties::sampleFrames() const {
|
||||
return d->sampleFrames;
|
||||
}
|
||||
|
||||
int RIFF::WAV::Properties::format() const {
|
||||
int RIFF::WAV::AudioProperties::format() const {
|
||||
return d->format;
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ int RIFF::WAV::Properties::format() const {
|
|||
// private members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void RIFF::WAV::Properties::read(File *file) {
|
||||
void RIFF::WAV::AudioProperties::read(File *file) {
|
||||
|
||||
ByteVector data;
|
||||
unsigned int streamLength = 0;
|
||||
|
@ -116,35 +116,35 @@ void RIFF::WAV::Properties::read(File *file) {
|
|||
if (data.isEmpty())
|
||||
data = file->chunkData(i);
|
||||
else
|
||||
debug("RIFF::WAV::Properties::read() - Duplicate 'fmt ' chunk found.");
|
||||
debug("RIFF::WAV::AudioProperties::read() - Duplicate 'fmt ' chunk found.");
|
||||
}
|
||||
else if (name == "data") {
|
||||
if (streamLength == 0)
|
||||
streamLength = file->chunkDataSize(i) + file->chunkPadding(i);
|
||||
else
|
||||
debug("RIFF::WAV::Properties::read() - Duplicate 'data' chunk found.");
|
||||
debug("RIFF::WAV::AudioProperties::read() - Duplicate 'data' chunk found.");
|
||||
}
|
||||
else if (name == "fact") {
|
||||
if (totalSamples == 0)
|
||||
totalSamples = file->chunkData(i).toUInt(0, false);
|
||||
else
|
||||
debug("RIFF::WAV::Properties::read() - Duplicate 'fact' chunk found.");
|
||||
debug("RIFF::WAV::AudioProperties::read() - Duplicate 'fact' chunk found.");
|
||||
}
|
||||
}
|
||||
|
||||
if (data.size() < 16) {
|
||||
debug("RIFF::WAV::Properties::read() - 'fmt ' chunk not found or too short.");
|
||||
debug("RIFF::WAV::AudioProperties::read() - 'fmt ' chunk not found or too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (streamLength == 0) {
|
||||
debug("RIFF::WAV::Properties::read() - 'data' chunk not found.");
|
||||
debug("RIFF::WAV::AudioProperties::read() - 'data' chunk not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
d->format = data.toShort(0, false);
|
||||
if (d->format != FORMAT_PCM && totalSamples == 0) {
|
||||
debug("RIFF::WAV::Properties::read() - Non-PCM format, but 'fact' chunk not found.");
|
||||
debug("RIFF::WAV::AudioProperties::read() - Non-PCM format, but 'fact' chunk not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,17 +46,17 @@ class File;
|
|||
* API.
|
||||
*/
|
||||
|
||||
class TAGLIB_EXPORT Properties : public AudioProperties {
|
||||
class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties {
|
||||
public:
|
||||
/*!
|
||||
* Create an instance of WAV::Properties with the data read from the WAV::File \a file.
|
||||
* Create an instance of WAV::AudioProperties with the data read from the WAV::File \a file.
|
||||
*/
|
||||
Properties(File *file, ReadStyle style);
|
||||
AudioProperties(File *file, ReadStyle style);
|
||||
|
||||
/*!
|
||||
* Destroys this WAV::Properties instance.
|
||||
* Destroys this WAV::AudioProperties instance.
|
||||
*/
|
||||
virtual ~Properties();
|
||||
virtual ~AudioProperties();
|
||||
|
||||
/*!
|
||||
* Returns the length of the file in seconds.
|
||||
|
@ -109,13 +109,13 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
int format() 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 WAV
|
||||
|
|
|
@ -40,7 +40,7 @@ class S3M::File::FilePrivate {
|
|||
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : properties(propertiesStyle) {}
|
||||
|
||||
Mod::Tag tag;
|
||||
S3M::Properties properties;
|
||||
S3M::AudioProperties properties;
|
||||
};
|
||||
|
||||
S3M::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle propertiesStyle) : Mod::FileBase(file), d(new FilePrivate(propertiesStyle)) {
|
||||
|
@ -73,7 +73,7 @@ PropertyMap S3M::File::setProperties(const PropertyMap &properties) {
|
|||
return d->tag.setProperties(properties);
|
||||
}
|
||||
|
||||
S3M::Properties *S3M::File::audioProperties() const {
|
||||
S3M::AudioProperties *S3M::File::audioProperties() const {
|
||||
return &d->properties;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,10 +77,10 @@ class TAGLIB_EXPORT File : public Mod::FileBase {
|
|||
PropertyMap setProperties(const PropertyMap &);
|
||||
|
||||
/*!
|
||||
* Returns the S3M::Properties for this file. If no audio properties
|
||||
* Returns the S3M::AudioProperties for this file. If no audio properties
|
||||
* were read then this will return a null pointer.
|
||||
*/
|
||||
S3M::Properties *audioProperties() const;
|
||||
S3M::AudioProperties *audioProperties() const;
|
||||
|
||||
/*!
|
||||
* Save the file.
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
using namespace Strawberry_TagLib::TagLib;
|
||||
using namespace S3M;
|
||||
|
||||
class S3M::Properties::PropertiesPrivate {
|
||||
class S3M::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : lengthInPatterns(0),
|
||||
AudioPropertiesPrivate() : lengthInPatterns(0),
|
||||
channels(0),
|
||||
stereo(false),
|
||||
sampleCount(0),
|
||||
|
@ -59,124 +59,120 @@ class S3M::Properties::PropertiesPrivate {
|
|||
unsigned char bpmSpeed;
|
||||
};
|
||||
|
||||
S3M::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) : AudioProperties(propertiesStyle), d(new PropertiesPrivate()) {}
|
||||
S3M::AudioProperties::AudioProperties(AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::AudioProperties(propertiesStyle), d(new AudioPropertiesPrivate()) {}
|
||||
|
||||
S3M::Properties::~Properties() {
|
||||
S3M::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int S3M::Properties::length() const {
|
||||
int S3M::AudioProperties::lengthInSeconds() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int S3M::Properties::lengthInSeconds() const {
|
||||
int S3M::AudioProperties::lengthInMilliseconds() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int S3M::Properties::lengthInMilliseconds() const {
|
||||
int S3M::AudioProperties::bitrate() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int S3M::Properties::bitrate() const {
|
||||
int S3M::AudioProperties::sampleRate() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int S3M::Properties::sampleRate() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int S3M::Properties::channels() const {
|
||||
int S3M::AudioProperties::channels() const {
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
unsigned short S3M::Properties::lengthInPatterns() const {
|
||||
unsigned short S3M::AudioProperties::lengthInPatterns() const {
|
||||
return d->lengthInPatterns;
|
||||
}
|
||||
|
||||
bool S3M::Properties::stereo() const {
|
||||
bool S3M::AudioProperties::stereo() const {
|
||||
return d->stereo;
|
||||
}
|
||||
|
||||
unsigned short S3M::Properties::sampleCount() const {
|
||||
unsigned short S3M::AudioProperties::sampleCount() const {
|
||||
return d->sampleCount;
|
||||
}
|
||||
|
||||
unsigned short S3M::Properties::patternCount() const {
|
||||
unsigned short S3M::AudioProperties::patternCount() const {
|
||||
return d->patternCount;
|
||||
}
|
||||
|
||||
unsigned short S3M::Properties::flags() const {
|
||||
unsigned short S3M::AudioProperties::flags() const {
|
||||
return d->flags;
|
||||
}
|
||||
|
||||
unsigned short S3M::Properties::trackerVersion() const {
|
||||
unsigned short S3M::AudioProperties::trackerVersion() const {
|
||||
return d->trackerVersion;
|
||||
}
|
||||
|
||||
unsigned short S3M::Properties::fileFormatVersion() const {
|
||||
unsigned short S3M::AudioProperties::fileFormatVersion() const {
|
||||
return d->fileFormatVersion;
|
||||
}
|
||||
|
||||
unsigned char S3M::Properties::globalVolume() const {
|
||||
unsigned char S3M::AudioProperties::globalVolume() const {
|
||||
return d->globalVolume;
|
||||
}
|
||||
|
||||
unsigned char S3M::Properties::masterVolume() const {
|
||||
unsigned char S3M::AudioProperties::masterVolume() const {
|
||||
return d->masterVolume;
|
||||
}
|
||||
|
||||
unsigned char S3M::Properties::tempo() const {
|
||||
unsigned char S3M::AudioProperties::tempo() const {
|
||||
return d->tempo;
|
||||
}
|
||||
|
||||
unsigned char S3M::Properties::bpmSpeed() const {
|
||||
unsigned char S3M::AudioProperties::bpmSpeed() const {
|
||||
return d->bpmSpeed;
|
||||
}
|
||||
|
||||
void S3M::Properties::setLengthInPatterns(unsigned short lengthInPatterns) {
|
||||
void S3M::AudioProperties::setLengthInPatterns(unsigned short lengthInPatterns) {
|
||||
d->lengthInPatterns = lengthInPatterns;
|
||||
}
|
||||
|
||||
void S3M::Properties::setChannels(int channels) {
|
||||
void S3M::AudioProperties::setChannels(int channels) {
|
||||
d->channels = channels;
|
||||
}
|
||||
|
||||
void S3M::Properties::setStereo(bool stereo) {
|
||||
void S3M::AudioProperties::setStereo(bool stereo) {
|
||||
d->stereo = stereo;
|
||||
}
|
||||
|
||||
void S3M::Properties::setSampleCount(unsigned short sampleCount) {
|
||||
void S3M::AudioProperties::setSampleCount(unsigned short sampleCount) {
|
||||
d->sampleCount = sampleCount;
|
||||
}
|
||||
|
||||
void S3M::Properties::setPatternCount(unsigned short patternCount) {
|
||||
void S3M::AudioProperties::setPatternCount(unsigned short patternCount) {
|
||||
d->patternCount = patternCount;
|
||||
}
|
||||
|
||||
void S3M::Properties::setFlags(unsigned short flags) {
|
||||
void S3M::AudioProperties::setFlags(unsigned short flags) {
|
||||
d->flags = flags;
|
||||
}
|
||||
|
||||
void S3M::Properties::setTrackerVersion(unsigned short trackerVersion) {
|
||||
void S3M::AudioProperties::setTrackerVersion(unsigned short trackerVersion) {
|
||||
d->trackerVersion = trackerVersion;
|
||||
}
|
||||
|
||||
void S3M::Properties::setFileFormatVersion(unsigned short fileFormatVersion) {
|
||||
void S3M::AudioProperties::setFileFormatVersion(unsigned short fileFormatVersion) {
|
||||
d->fileFormatVersion = fileFormatVersion;
|
||||
}
|
||||
|
||||
void S3M::Properties::setGlobalVolume(unsigned char globalVolume) {
|
||||
void S3M::AudioProperties::setGlobalVolume(unsigned char globalVolume) {
|
||||
d->globalVolume = globalVolume;
|
||||
}
|
||||
|
||||
void S3M::Properties::setMasterVolume(unsigned char masterVolume) {
|
||||
void S3M::AudioProperties::setMasterVolume(unsigned char masterVolume) {
|
||||
d->masterVolume = masterVolume;
|
||||
}
|
||||
|
||||
void S3M::Properties::setTempo(unsigned char tempo) {
|
||||
void S3M::AudioProperties::setTempo(unsigned char tempo) {
|
||||
d->tempo = tempo;
|
||||
}
|
||||
|
||||
void S3M::Properties::setBpmSpeed(unsigned char bpmSpeed) {
|
||||
void S3M::AudioProperties::setBpmSpeed(unsigned char bpmSpeed) {
|
||||
d->bpmSpeed = bpmSpeed;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace Strawberry_TagLib {
|
|||
namespace TagLib {
|
||||
namespace S3M {
|
||||
|
||||
class TAGLIB_EXPORT Properties : public AudioProperties {
|
||||
class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties {
|
||||
friend class File;
|
||||
|
||||
public:
|
||||
|
@ -48,10 +48,9 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
CustomData = 128
|
||||
};
|
||||
|
||||
Properties(AudioProperties::ReadStyle propertiesStyle);
|
||||
virtual ~Properties();
|
||||
AudioProperties(AudioProperties::ReadStyle propertiesStyle);
|
||||
virtual ~AudioProperties();
|
||||
|
||||
int length() const;
|
||||
int lengthInSeconds() const;
|
||||
int lengthInMilliseconds() const;
|
||||
int bitrate() const;
|
||||
|
@ -85,11 +84,11 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
void setBpmSpeed(unsigned char bpmSpeed);
|
||||
|
||||
private:
|
||||
Properties(const Properties &);
|
||||
Properties &operator=(const Properties &);
|
||||
AudioProperties(const AudioProperties &);
|
||||
AudioProperties &operator=(const AudioProperties &);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
class AudioPropertiesPrivate;
|
||||
AudioPropertiesPrivate *d;
|
||||
};
|
||||
|
||||
} // namespace S3M
|
||||
|
|
|
@ -69,7 +69,7 @@ class TrueAudio::File::FilePrivate {
|
|||
|
||||
TagUnion tag;
|
||||
|
||||
Properties *properties;
|
||||
AudioProperties *properties;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -89,28 +89,28 @@ bool TrueAudio::File::isSupported(IOStream *stream) {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TrueAudio::File::File(FileName file, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) {
|
||||
TrueAudio::File::File(FileName file, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate()) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
||||
}
|
||||
|
||||
TrueAudio::File::File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate(frameFactory)) {
|
||||
TrueAudio::File::File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(file), d(new FilePrivate(frameFactory)) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
||||
}
|
||||
|
||||
TrueAudio::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) {
|
||||
TrueAudio::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate()) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
||||
}
|
||||
|
||||
TrueAudio::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties, Properties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate(frameFactory)) {
|
||||
TrueAudio::File::File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties, AudioProperties::ReadStyle) : Strawberry_TagLib::TagLib::File(stream), d(new FilePrivate(frameFactory)) {
|
||||
|
||||
if (isOpen())
|
||||
read(readProperties);
|
||||
|
@ -142,7 +142,7 @@ PropertyMap TrueAudio::File::setProperties(const PropertyMap &properties) {
|
|||
|
||||
}
|
||||
|
||||
TrueAudio::Properties *TrueAudio::File::audioProperties() const {
|
||||
TrueAudio::AudioProperties *TrueAudio::File::audioProperties() const {
|
||||
return d->properties;
|
||||
}
|
||||
|
||||
|
@ -288,7 +288,7 @@ void TrueAudio::File::read(bool readProperties) {
|
|||
seek(0);
|
||||
}
|
||||
|
||||
d->properties = new Properties(readBlock(TrueAudio::HeaderSize), streamLength);
|
||||
d->properties = new AudioProperties(readBlock(TrueAudio::HeaderSize), streamLength);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
* \note In the current implementation, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(FileName file, bool readProperties = true,
|
||||
Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Constructs a TrueAudio file from \a file.
|
||||
|
@ -97,7 +97,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
*
|
||||
* \note In the current implementation, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
File(FileName file, ID3v2::FrameFactory *frameFactory, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Constructs a TrueAudio file from \a stream.
|
||||
|
@ -107,7 +107,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::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);
|
||||
|
||||
/*!
|
||||
* Constructs a TrueAudio file from \a stream.
|
||||
|
@ -119,7 +119,7 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
*
|
||||
* \note In the current implementation, \a propertiesStyle is ignored.
|
||||
*/
|
||||
File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average);
|
||||
File(IOStream *stream, ID3v2::FrameFactory *frameFactory, bool readProperties = true, AudioProperties::ReadStyle propertiesStyle = AudioProperties::Average);
|
||||
|
||||
/*!
|
||||
* Destroys this instance of the File.
|
||||
|
@ -146,10 +146,10 @@ class TAGLIB_EXPORT File : public Strawberry_TagLib::TagLib::File {
|
|||
void removeUnsupportedProperties(const StringList &properties);
|
||||
|
||||
/*!
|
||||
* Returns the TrueAudio::Properties for this file.
|
||||
* Returns the TrueAudio::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.
|
||||
*/
|
||||
|
|
|
@ -36,9 +36,9 @@
|
|||
|
||||
using namespace Strawberry_TagLib::TagLib;
|
||||
|
||||
class TrueAudio::Properties::PropertiesPrivate {
|
||||
class TrueAudio::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : version(0),
|
||||
AudioPropertiesPrivate() : version(0),
|
||||
length(0),
|
||||
bitrate(0),
|
||||
sampleRate(0),
|
||||
|
@ -59,43 +59,43 @@ class TrueAudio::Properties::PropertiesPrivate {
|
|||
// public members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TrueAudio::Properties::Properties(const ByteVector &data, long streamLength, ReadStyle style) : AudioProperties(style), d(new PropertiesPrivate()) {
|
||||
TrueAudio::AudioProperties::AudioProperties(const ByteVector &data, long streamLength, ReadStyle style) : Strawberry_TagLib::TagLib::AudioProperties(style), d(new AudioPropertiesPrivate()) {
|
||||
read(data, streamLength);
|
||||
}
|
||||
|
||||
TrueAudio::Properties::~Properties() {
|
||||
TrueAudio::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int TrueAudio::Properties::lengthInSeconds() const {
|
||||
int TrueAudio::AudioProperties::lengthInSeconds() const {
|
||||
return d->length / 1000;
|
||||
}
|
||||
|
||||
int TrueAudio::Properties::lengthInMilliseconds() const {
|
||||
int TrueAudio::AudioProperties::lengthInMilliseconds() const {
|
||||
return d->length;
|
||||
}
|
||||
|
||||
int TrueAudio::Properties::bitrate() const {
|
||||
int TrueAudio::AudioProperties::bitrate() const {
|
||||
return d->bitrate;
|
||||
}
|
||||
|
||||
int TrueAudio::Properties::sampleRate() const {
|
||||
int TrueAudio::AudioProperties::sampleRate() const {
|
||||
return d->sampleRate;
|
||||
}
|
||||
|
||||
int TrueAudio::Properties::bitsPerSample() const {
|
||||
int TrueAudio::AudioProperties::bitsPerSample() const {
|
||||
return d->bitsPerSample;
|
||||
}
|
||||
|
||||
int TrueAudio::Properties::channels() const {
|
||||
int TrueAudio::AudioProperties::channels() const {
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
unsigned int TrueAudio::Properties::sampleFrames() const {
|
||||
unsigned int TrueAudio::AudioProperties::sampleFrames() const {
|
||||
return d->sampleFrames;
|
||||
}
|
||||
|
||||
int TrueAudio::Properties::ttaVersion() const {
|
||||
int TrueAudio::AudioProperties::ttaVersion() const {
|
||||
return d->version;
|
||||
}
|
||||
|
||||
|
@ -103,15 +103,15 @@ int TrueAudio::Properties::ttaVersion() const {
|
|||
// private members
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TrueAudio::Properties::read(const ByteVector &data, long streamLength) {
|
||||
void TrueAudio::AudioProperties::read(const ByteVector &data, long streamLength) {
|
||||
|
||||
if (data.size() < 4) {
|
||||
debug("TrueAudio::Properties::read() -- data is too short.");
|
||||
debug("TrueAudio::AudioProperties::read() -- data is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data.startsWith("TTA")) {
|
||||
debug("TrueAudio::Properties::read() -- invalid header signature.");
|
||||
debug("TrueAudio::AudioProperties::read() -- invalid header signature.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ void TrueAudio::Properties::read(const ByteVector &data, long streamLength) {
|
|||
// TTA2 headers are in development, and have a different format
|
||||
if (1 == d->version) {
|
||||
if (data.size() < 18) {
|
||||
debug("TrueAudio::Properties::read() -- data is too short.");
|
||||
debug("TrueAudio::AudioProperties::read() -- data is too short.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,17 +46,17 @@ static const unsigned int HeaderSize = 18;
|
|||
* This reads the data from an TrueAudio 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 TrueAudio::Properties with the data read from the ByteVector \a data.
|
||||
* Create an instance of TrueAudio::AudioProperties with the data read from the ByteVector \a data.
|
||||
*/
|
||||
Properties(const ByteVector &data, long streamLength, ReadStyle style = Average);
|
||||
AudioProperties(const ByteVector &data, long streamLength, ReadStyle style = Average);
|
||||
|
||||
/*!
|
||||
* Destroys this TrueAudio::Properties instance.
|
||||
* Destroys this TrueAudio::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 ttaVersion() const;
|
||||
|
||||
private:
|
||||
Properties(const Properties &);
|
||||
Properties &operator=(const Properties &);
|
||||
AudioProperties(const AudioProperties &);
|
||||
AudioProperties &operator=(const AudioProperties &);
|
||||
|
||||
void read(const ByteVector &data, long streamLength);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
class AudioPropertiesPrivate;
|
||||
AudioPropertiesPrivate *d;
|
||||
};
|
||||
|
||||
} // namespace TrueAudio
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -307,7 +307,7 @@ class XM::File::FilePrivate {
|
|||
explicit FilePrivate(AudioProperties::ReadStyle propertiesStyle) : properties(propertiesStyle) {}
|
||||
|
||||
Mod::Tag tag;
|
||||
XM::Properties properties;
|
||||
XM::AudioProperties properties;
|
||||
};
|
||||
|
||||
XM::File::File(FileName file, bool readProperties,
|
||||
|
@ -340,7 +340,7 @@ PropertyMap XM::File::setProperties(const PropertyMap &properties) {
|
|||
return d->tag.setProperties(properties);
|
||||
}
|
||||
|
||||
XM::Properties *XM::File::audioProperties() const {
|
||||
XM::AudioProperties *XM::File::audioProperties() const {
|
||||
return &d->properties;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,10 +77,10 @@ class TAGLIB_EXPORT File : public Mod::FileBase {
|
|||
PropertyMap setProperties(const PropertyMap &);
|
||||
|
||||
/*!
|
||||
* Returns the XM::Properties for this file.
|
||||
* Returns the XM::AudioProperties for this file.
|
||||
* If no audio properties were read then this will return a null pointer.
|
||||
*/
|
||||
XM::Properties *audioProperties() const;
|
||||
XM::AudioProperties *audioProperties() const;
|
||||
|
||||
/*!
|
||||
* Save the file.
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
using namespace Strawberry_TagLib::TagLib;
|
||||
using namespace XM;
|
||||
|
||||
class XM::Properties::PropertiesPrivate {
|
||||
class XM::AudioProperties::AudioPropertiesPrivate {
|
||||
public:
|
||||
PropertiesPrivate() : lengthInPatterns(0),
|
||||
AudioPropertiesPrivate() : lengthInPatterns(0),
|
||||
channels(0),
|
||||
version(0),
|
||||
restartPosition(0),
|
||||
|
@ -55,108 +55,104 @@ class XM::Properties::PropertiesPrivate {
|
|||
unsigned short bpmSpeed;
|
||||
};
|
||||
|
||||
XM::Properties::Properties(AudioProperties::ReadStyle propertiesStyle) : AudioProperties(propertiesStyle), d(new PropertiesPrivate()) {}
|
||||
XM::AudioProperties::AudioProperties(AudioProperties::ReadStyle propertiesStyle) : Strawberry_TagLib::TagLib::AudioProperties(propertiesStyle), d(new AudioPropertiesPrivate()) {}
|
||||
|
||||
XM::Properties::~Properties() {
|
||||
XM::AudioProperties::~AudioProperties() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
int XM::Properties::length() const {
|
||||
int XM::AudioProperties::lengthInSeconds() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int XM::Properties::lengthInSeconds() const {
|
||||
int XM::AudioProperties::lengthInMilliseconds() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int XM::Properties::lengthInMilliseconds() const {
|
||||
int XM::AudioProperties::bitrate() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int XM::Properties::bitrate() const {
|
||||
int XM::AudioProperties::sampleRate() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int XM::Properties::sampleRate() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int XM::Properties::channels() const {
|
||||
int XM::AudioProperties::channels() const {
|
||||
return d->channels;
|
||||
}
|
||||
|
||||
unsigned short XM::Properties::lengthInPatterns() const {
|
||||
unsigned short XM::AudioProperties::lengthInPatterns() const {
|
||||
return d->lengthInPatterns;
|
||||
}
|
||||
|
||||
unsigned short XM::Properties::version() const {
|
||||
unsigned short XM::AudioProperties::version() const {
|
||||
return d->version;
|
||||
}
|
||||
|
||||
unsigned short XM::Properties::restartPosition() const {
|
||||
unsigned short XM::AudioProperties::restartPosition() const {
|
||||
return d->restartPosition;
|
||||
}
|
||||
|
||||
unsigned short XM::Properties::patternCount() const {
|
||||
unsigned short XM::AudioProperties::patternCount() const {
|
||||
return d->patternCount;
|
||||
}
|
||||
|
||||
unsigned short XM::Properties::instrumentCount() const {
|
||||
unsigned short XM::AudioProperties::instrumentCount() const {
|
||||
return d->instrumentCount;
|
||||
}
|
||||
|
||||
unsigned int XM::Properties::sampleCount() const {
|
||||
unsigned int XM::AudioProperties::sampleCount() const {
|
||||
return d->sampleCount;
|
||||
}
|
||||
|
||||
unsigned short XM::Properties::flags() const {
|
||||
unsigned short XM::AudioProperties::flags() const {
|
||||
return d->flags;
|
||||
}
|
||||
|
||||
unsigned short XM::Properties::tempo() const {
|
||||
unsigned short XM::AudioProperties::tempo() const {
|
||||
return d->tempo;
|
||||
}
|
||||
|
||||
unsigned short XM::Properties::bpmSpeed() const {
|
||||
unsigned short XM::AudioProperties::bpmSpeed() const {
|
||||
return d->bpmSpeed;
|
||||
}
|
||||
|
||||
void XM::Properties::setLengthInPatterns(unsigned short lengthInPatterns) {
|
||||
void XM::AudioProperties::setLengthInPatterns(unsigned short lengthInPatterns) {
|
||||
d->lengthInPatterns = lengthInPatterns;
|
||||
}
|
||||
|
||||
void XM::Properties::setChannels(int channels) {
|
||||
void XM::AudioProperties::setChannels(int channels) {
|
||||
d->channels = channels;
|
||||
}
|
||||
|
||||
void XM::Properties::setVersion(unsigned short version) {
|
||||
void XM::AudioProperties::setVersion(unsigned short version) {
|
||||
d->version = version;
|
||||
}
|
||||
|
||||
void XM::Properties::setRestartPosition(unsigned short restartPosition) {
|
||||
void XM::AudioProperties::setRestartPosition(unsigned short restartPosition) {
|
||||
d->restartPosition = restartPosition;
|
||||
}
|
||||
|
||||
void XM::Properties::setPatternCount(unsigned short patternCount) {
|
||||
void XM::AudioProperties::setPatternCount(unsigned short patternCount) {
|
||||
d->patternCount = patternCount;
|
||||
}
|
||||
|
||||
void XM::Properties::setInstrumentCount(unsigned short instrumentCount) {
|
||||
void XM::AudioProperties::setInstrumentCount(unsigned short instrumentCount) {
|
||||
d->instrumentCount = instrumentCount;
|
||||
}
|
||||
|
||||
void XM::Properties::setSampleCount(unsigned int sampleCount) {
|
||||
void XM::AudioProperties::setSampleCount(unsigned int sampleCount) {
|
||||
d->sampleCount = sampleCount;
|
||||
}
|
||||
|
||||
void XM::Properties::setFlags(unsigned short flags) {
|
||||
void XM::AudioProperties::setFlags(unsigned short flags) {
|
||||
d->flags = flags;
|
||||
}
|
||||
|
||||
void XM::Properties::setTempo(unsigned short tempo) {
|
||||
void XM::AudioProperties::setTempo(unsigned short tempo) {
|
||||
d->tempo = tempo;
|
||||
}
|
||||
|
||||
void XM::Properties::setBpmSpeed(unsigned short bpmSpeed) {
|
||||
void XM::AudioProperties::setBpmSpeed(unsigned short bpmSpeed) {
|
||||
d->bpmSpeed = bpmSpeed;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
namespace Strawberry_TagLib {
|
||||
namespace TagLib {
|
||||
namespace XM {
|
||||
class TAGLIB_EXPORT Properties : public AudioProperties {
|
||||
class TAGLIB_EXPORT AudioProperties : public Strawberry_TagLib::TagLib::AudioProperties {
|
||||
friend class File;
|
||||
|
||||
public:
|
||||
|
@ -42,10 +42,9 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
LinearFreqTable = 1 // otherwise its the amiga freq. table
|
||||
};
|
||||
|
||||
Properties(AudioProperties::ReadStyle propertiesStyle);
|
||||
virtual ~Properties();
|
||||
AudioProperties(AudioProperties::ReadStyle propertiesStyle);
|
||||
virtual ~AudioProperties();
|
||||
|
||||
int length() const;
|
||||
int lengthInSeconds() const;
|
||||
int lengthInMilliseconds() const;
|
||||
int bitrate() const;
|
||||
|
@ -75,11 +74,11 @@ class TAGLIB_EXPORT Properties : public AudioProperties {
|
|||
void setBpmSpeed(unsigned short bpmSpeed);
|
||||
|
||||
private:
|
||||
Properties(const Properties &);
|
||||
Properties &operator=(const Properties &);
|
||||
AudioProperties(const AudioProperties &);
|
||||
AudioProperties &operator=(const AudioProperties &);
|
||||
|
||||
class PropertiesPrivate;
|
||||
PropertiesPrivate *d;
|
||||
class AudioPropertiesPrivate;
|
||||
AudioPropertiesPrivate *d;
|
||||
};
|
||||
|
||||
} // namespace XM
|
||||
|
|
Loading…
Reference in New Issue