From 03b615324413e240a1c21b1ea3a2e4daab4609db Mon Sep 17 00:00:00 2001 From: "Stephen F. Booth" Date: Sun, 8 Dec 2024 18:00:51 -0600 Subject: [PATCH] Rename some variables --- taglib/shn/shnfile.cpp | 22 +++++++++++----------- taglib/shn/shnproperties.cpp | 12 ++++++------ taglib/shn/shnutils.h | 10 +++++----- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/taglib/shn/shnfile.cpp b/taglib/shn/shnfile.cpp index 1fdc337c..22bd00de 100644 --- a/taglib/shn/shnfile.cpp +++ b/taglib/shn/shnfile.cpp @@ -281,7 +281,7 @@ void SHN::File::read(AudioProperties::ReadStyle propertiesStyle) setValid(false); return; } - props.internal_file_type = static_cast(internalFileType); + props.internalFileType = static_cast(internalFileType); // Read number of channels uint32_t channelCount = 0; @@ -290,7 +290,7 @@ void SHN::File::read(AudioProperties::ReadStyle propertiesStyle) setValid(false); return; } - props.channel_count = static_cast(channelCount); + props.channelCount = static_cast(channelCount); // Read blocksize if version > 0 if(version > 0) { @@ -409,10 +409,10 @@ void SHN::File::read(AudioProperties::ReadStyle propertiesStyle) auto channels = chunkData.toUShort(offset, false); offset += 2; - if(props.channel_count != channels) + if(props.channelCount != channels) debug("SHN::File::read() -- Channel count mismatch between Shorten and 'fmt ' chunk."); - props.sample_rate = static_cast(chunkData.toUInt(offset, false)); + props.sampleRate = static_cast(chunkData.toUInt(offset, false)); offset += 4; // Skip average bytes per second @@ -421,7 +421,7 @@ void SHN::File::read(AudioProperties::ReadStyle propertiesStyle) blockAlign = chunkData.toUShort(offset, false); offset += 2; - props.bits_per_sample = static_cast(chunkData.toUShort(offset, false)); + props.bitsPerSample = static_cast(chunkData.toUShort(offset, false)); offset += 2; sawFormatChunk = true; @@ -442,7 +442,7 @@ void SHN::File::read(AudioProperties::ReadStyle propertiesStyle) } if(dataChunkSize && blockAlign) - props.sample_frames = static_cast(dataChunkSize / blockAlign); + props.sampleFrames = static_cast(dataChunkSize / blockAlign); } // AIFF else if(chunkID == 0x464f524d /*'FORM'*/) { @@ -481,13 +481,13 @@ void SHN::File::read(AudioProperties::ReadStyle propertiesStyle) auto channels = chunkData.toUShort(offset, true); offset += 2; - if(props.channel_count != channels) + if(props.channelCount != channels) debug("SHN::File::read() -- Channel count mismatch between Shorten and 'COMM' chunk."); - props.sample_frames = static_cast(chunkData.toUInt(offset, true)); + props.sampleFrames = static_cast(chunkData.toUInt(offset, true)); offset += 4; - props.bits_per_sample = static_cast(chunkData.toUShort(offset, true)); + props.bitsPerSample = static_cast(chunkData.toUShort(offset, true)); offset += 2; // sample rate is IEEE 754 80-bit extended float (16-bit exponent, 1-bit integer part, 63-bit fraction) @@ -502,9 +502,9 @@ void SHN::File::read(AudioProperties::ReadStyle propertiesStyle) auto frac = chunkData.toULongLong(offset, true); offset += 8; if(exp >= 0) - props.sample_rate = static_cast(frac << exp); + props.sampleRate = static_cast(frac << exp); else - props.sample_rate = static_cast((frac + (static_cast(1) << (-exp - 1))) >> -exp); + props.sampleRate = static_cast((frac + (static_cast(1) << (-exp - 1))) >> -exp); sawCommonChunk = true; diff --git a/taglib/shn/shnproperties.cpp b/taglib/shn/shnproperties.cpp index 6f15edad..d1dfe20c 100644 --- a/taglib/shn/shnproperties.cpp +++ b/taglib/shn/shnproperties.cpp @@ -42,9 +42,9 @@ public: int version { 0 }; int internalFileType { 0 }; int channelCount { 0 }; - unsigned long sampleFrames { 0 }; int sampleRate { 0 }; int bitsPerSample { 0 }; + unsigned long sampleFrames { 0 }; // Computed int bitrate { 0 }; @@ -57,11 +57,11 @@ SHN::Properties::Properties(const PropertyValues *values, ReadStyle style) : { if(values) { d->version = values->version; - d->internalFileType = values->internal_file_type; - d->channelCount = values->channel_count; - d->sampleRate = values->sample_rate; - d->bitsPerSample = values->bits_per_sample; - d->sampleFrames = values->sample_frames; + d->internalFileType = values->internalFileType; + d->channelCount = values->channelCount; + d->sampleRate = values->sampleRate; + d->bitsPerSample = values->bitsPerSample; + d->sampleFrames = values->sampleFrames; d->bitrate = static_cast(d->sampleRate * d->bitsPerSample * d->channelCount / 1000.0 + 0.5); if(d->sampleRate > 0) diff --git a/taglib/shn/shnutils.h b/taglib/shn/shnutils.h index a9ac2df5..48ca1d94 100644 --- a/taglib/shn/shnutils.h +++ b/taglib/shn/shnutils.h @@ -33,11 +33,11 @@ namespace TagLib { struct PropertyValues { int version { 0 }; - int internal_file_type { 0 }; - int channel_count { 0 }; - int sample_rate { 0 }; - int bits_per_sample { 0 }; - unsigned long sample_frames { 0 }; + int internalFileType { 0 }; + int channelCount { 0 }; + int sampleRate { 0 }; + int bitsPerSample { 0 }; + unsigned long sampleFrames { 0 }; }; } // namespace SHN } // namespace TagLib