taglib: Rename Properties to AudioProperties

This commit is contained in:
Jonas Kvinge
2020-06-22 00:49:25 +02:00
parent f49c47c20d
commit 3a3dc02a66
80 changed files with 740 additions and 789 deletions

View File

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

View File

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

View 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;
}

View File

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