From: <sv...@op...> - 2024-08-17 12:22:09
|
Author: manx Date: Sat Aug 17 14:22:02 2024 New Revision: 21500 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21500 Log: [Var] Run clang-format. Modified: trunk/OpenMPT/src/openmpt/soundfile_data/wav.hpp trunk/OpenMPT/src/openmpt/soundfile_write/wav_write.cpp trunk/OpenMPT/src/openmpt/soundfile_write/wav_write.hpp Modified: trunk/OpenMPT/src/openmpt/soundfile_data/wav.hpp ============================================================================== --- trunk/OpenMPT/src/openmpt/soundfile_data/wav.hpp Sat Aug 17 14:12:25 2024 (r21499) +++ trunk/OpenMPT/src/openmpt/soundfile_data/wav.hpp Sat Aug 17 14:22:02 2024 (r21500) @@ -25,15 +25,15 @@ // 32-Bit chunk identifiers enum RIFFMagic { - idRIFF = MagicLE("RIFF"), // magic for WAV files - idLIST = MagicLE("LIST"), // magic for samples in DLS banks - idWAVE = MagicLE("WAVE"), // type for WAV files - idwave = MagicLE("wave"), // type for samples in DLS banks + idRIFF = MagicLE("RIFF"), // magic for WAV files + idLIST = MagicLE("LIST"), // magic for samples in DLS banks + idWAVE = MagicLE("WAVE"), // type for WAV files + idwave = MagicLE("wave"), // type for samples in DLS banks }; - uint32le magic; // RIFF (in WAV files) or LIST (in DLS banks) - uint32le length; // Size of the file, not including magic and length - uint32le type; // WAVE (in WAV files) or wave (in DLS banks) + uint32le magic; // RIFF (in WAV files) or LIST (in DLS banks) + uint32le length; // Size of the file, not including magic and length + uint32le type; // WAVE (in WAV files) or wave (in DLS banks) }; MPT_BINARY_STRUCT(RIFFHeader, 12) @@ -45,38 +45,38 @@ // 32-Bit chunk identifiers enum ChunkIdentifiers { - idfmt_ = MagicLE("fmt "), // Sample format information - iddata = MagicLE("data"), // Sample data - idpcm_ = MagicLE("pcm "), // IMA ADPCM samples - idfact = MagicLE("fact"), // Compressed samples - idsmpl = MagicLE("smpl"), // Sampler and loop information - idinst = MagicLE("inst"), // Instrument information - idLIST = MagicLE("LIST"), // List of chunks - idxtra = MagicLE("xtra"), // OpenMPT extra infomration - idcue_ = MagicLE("cue "), // Cue points - idwsmp = MagicLE("wsmp"), // DLS bank samples - idCSET = MagicLE("CSET"), // Character Set - id____ = 0x00000000, // Found when loading buggy MPT samples + idfmt_ = MagicLE("fmt "), // Sample format information + iddata = MagicLE("data"), // Sample data + idpcm_ = MagicLE("pcm "), // IMA ADPCM samples + idfact = MagicLE("fact"), // Compressed samples + idsmpl = MagicLE("smpl"), // Sampler and loop information + idinst = MagicLE("inst"), // Instrument information + idLIST = MagicLE("LIST"), // List of chunks + idxtra = MagicLE("xtra"), // OpenMPT extra infomration + idcue_ = MagicLE("cue "), // Cue points + idwsmp = MagicLE("wsmp"), // DLS bank samples + idCSET = MagicLE("CSET"), // Character Set + id____ = 0x00000000, // Found when loading buggy MPT samples // Identifiers in "LIST" chunk - idINAM = MagicLE("INAM"), // title - idISFT = MagicLE("ISFT"), // software - idICOP = MagicLE("ICOP"), // copyright - idIART = MagicLE("IART"), // artist - idIPRD = MagicLE("IPRD"), // product (album) - idICMT = MagicLE("ICMT"), // comment - idIENG = MagicLE("IENG"), // engineer - idISBJ = MagicLE("ISBJ"), // subject - idIGNR = MagicLE("IGNR"), // genre - idICRD = MagicLE("ICRD"), // date created - - idYEAR = MagicLE("YEAR"), // year - idTRCK = MagicLE("TRCK"), // track number - idTURL = MagicLE("TURL"), // url + idINAM = MagicLE("INAM"), // title + idISFT = MagicLE("ISFT"), // software + idICOP = MagicLE("ICOP"), // copyright + idIART = MagicLE("IART"), // artist + idIPRD = MagicLE("IPRD"), // product (album) + idICMT = MagicLE("ICMT"), // comment + idIENG = MagicLE("IENG"), // engineer + idISBJ = MagicLE("ISBJ"), // subject + idIGNR = MagicLE("IGNR"), // genre + idICRD = MagicLE("ICRD"), // date created + + idYEAR = MagicLE("YEAR"), // year + idTRCK = MagicLE("TRCK"), // track number + idTURL = MagicLE("TURL"), // url }; - uint32le id; // See ChunkIdentifiers - uint32le length; // Chunk size without header + uint32le id; // See ChunkIdentifiers + uint32le length; // Chunk size without header std::size_t GetLength() const { @@ -98,21 +98,21 @@ // Sample formats enum SampleFormats { - fmtPCM = 1, - fmtFloat = 3, - fmtALaw = 6, - fmtULaw = 7, - fmtIMA_ADPCM = 17, - fmtMP3 = 85, - fmtExtensible = 0xFFFE, + fmtPCM = 1, + fmtFloat = 3, + fmtALaw = 6, + fmtULaw = 7, + fmtIMA_ADPCM = 17, + fmtMP3 = 85, + fmtExtensible = 0xFFFE, }; - uint16le format; // Sample format, see SampleFormats - uint16le numChannels; // Number of audio channels - uint32le sampleRate; // Sample rate in Hz - uint32le byteRate; // Bytes per second (should be freqHz * blockAlign) - uint16le blockAlign; // Size of a sample, in bytes (do not trust this value, it's incorrect in some files) - uint16le bitsPerSample; // Bits per sample + uint16le format; // Sample format, see SampleFormats + uint16le numChannels; // Number of audio channels + uint32le sampleRate; // Sample rate in Hz + uint32le byteRate; // Bytes per second (should be freqHz * blockAlign) + uint16le blockAlign; // Size of a sample, in bytes (do not trust this value, it's incorrect in some files) + uint16le bitsPerSample; // Bits per sample }; MPT_BINARY_STRUCT(WAVFormatChunk, 16) @@ -121,9 +121,9 @@ // Extension of the WAVFormatChunk structure, used if format == formatExtensible struct WAVFormatChunkExtension { - uint16le size; - uint16le validBitsPerSample; - uint32le channelMask; + uint16le size; + uint16le validBitsPerSample; + uint32le channelMask; mpt::GUIDms subFormat; }; @@ -133,12 +133,12 @@ // Sample cue point structure for the "cue " chunk struct WAVCuePoint { - uint32le id; // Unique identification value - uint32le position; // Play order position - uint32le riffChunkID; // RIFF ID of corresponding data chunk - uint32le chunkStart; // Byte Offset of Data Chunk - uint32le blockStart; // Byte Offset to sample of First Channel - uint32le offset; // Byte Offset to sample byte of First Channel + uint32le id; // Unique identification value + uint32le position; // Play order position + uint32le riffChunkID; // RIFF ID of corresponding data chunk + uint32le chunkStart; // Byte Offset of Data Chunk + uint32le blockStart; // Byte Offset to sample of First Channel + uint32le offset; // Byte Offset to sample byte of First Channel }; MPT_BINARY_STRUCT(WAVCuePoint, 24) Modified: trunk/OpenMPT/src/openmpt/soundfile_write/wav_write.cpp ============================================================================== --- trunk/OpenMPT/src/openmpt/soundfile_write/wav_write.cpp Sat Aug 17 14:12:25 2024 (r21499) +++ trunk/OpenMPT/src/openmpt/soundfile_write/wav_write.cpp Sat Aug 17 14:22:02 2024 (r21500) @@ -100,21 +100,21 @@ extFormat.validBitsPerSample = bitDepth; switch(numChannels) { - case 1: - extFormat.channelMask = 0x0004; // FRONT_CENTER - break; - case 2: - extFormat.channelMask = 0x0003; // FRONT_LEFT | FRONT_RIGHT - break; - case 3: - extFormat.channelMask = 0x0103; // FRONT_LEFT | FRONT_RIGHT | BACK_CENTER - break; - case 4: - extFormat.channelMask = 0x0033; // FRONT_LEFT | FRONT_RIGHT | BACK_LEFT | BACK_RIGHT - break; - default: - extFormat.channelMask = 0; - break; + case 1: + extFormat.channelMask = 0x0004; // FRONT_CENTER + break; + case 2: + extFormat.channelMask = 0x0003; // FRONT_LEFT | FRONT_RIGHT + break; + case 3: + extFormat.channelMask = 0x0103; // FRONT_LEFT | FRONT_RIGHT | BACK_CENTER + break; + case 4: + extFormat.channelMask = 0x0033; // FRONT_LEFT | FRONT_RIGHT | BACK_LEFT | BACK_RIGHT + break; + default: + extFormat.channelMask = 0; + break; } extFormat.subFormat = mpt::UUID(static_cast<uint16>(encoding), 0x0000, 0x0010, 0x800000AA00389B71ull); mpt::IO::Write(s, extFormat); @@ -131,7 +131,7 @@ mpt::IO::Write(s, mpt::as_le(uint16(0))); // dialect (unset) StartChunk(RIFFChunk::idLIST); - const char info[] = { 'I', 'N', 'F', 'O' }; + const char info[] = {'I', 'N', 'F', 'O'}; mpt::IO::Write(s, info); WriteTag(RIFFChunk::idINAM, tags.title); Modified: trunk/OpenMPT/src/openmpt/soundfile_write/wav_write.hpp ============================================================================== --- trunk/OpenMPT/src/openmpt/soundfile_write/wav_write.hpp Sat Aug 17 14:12:25 2024 (r21499) +++ trunk/OpenMPT/src/openmpt/soundfile_write/wav_write.hpp Sat Aug 17 14:22:02 2024 (r21500) @@ -56,7 +56,7 @@ public: // Finalize the file by closing the last open chunk and updating the file header. Returns total size of file. mpt::IO::Offset Finalize(); - + ~WAVWriter(); }; |