From f1882e2dd6604a01510275c6529719d9d0fadc16 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Thu, 23 Jun 2016 23:34:04 +0200 Subject: [PATCH] Rename ImaAdpcmLoader to *Reader and move it to FileFormats --- OpenRA.Mods.Common/AudioLoaders/WavLoader.cs | 3 ++- .../ImaAdpcmLoader.cs => FileFormats/ImaAdpcmReader.cs} | 6 ++++-- OpenRA.Mods.Common/OpenRA.Mods.Common.csproj | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) rename OpenRA.Mods.Common/{AudioLoaders/ImaAdpcmLoader.cs => FileFormats/ImaAdpcmReader.cs} (92%) diff --git a/OpenRA.Mods.Common/AudioLoaders/WavLoader.cs b/OpenRA.Mods.Common/AudioLoaders/WavLoader.cs index c9c5df9cfe..c1d593e3d8 100644 --- a/OpenRA.Mods.Common/AudioLoaders/WavLoader.cs +++ b/OpenRA.Mods.Common/AudioLoaders/WavLoader.cs @@ -11,6 +11,7 @@ using System; using System.IO; +using OpenRA.Mods.Common.FileFormats; namespace OpenRA.Mods.Common.AudioLoaders { @@ -220,7 +221,7 @@ namespace OpenRA.Mods.Common.AudioLoaders { // Decode 4 bytes (to 16 bytes of output) per channel var chunk = s.ReadBytes(4); - var decoded = ImaAdpcmLoader.LoadImaAdpcmSound(chunk, ref index[c], ref predictor[c]); + var decoded = ImaAdpcmReader.LoadImaAdpcmSound(chunk, ref index[c], ref predictor[c]); // Interleave output, one sample per channel var outOffsetChannel = outOffset + (2 * c); diff --git a/OpenRA.Mods.Common/AudioLoaders/ImaAdpcmLoader.cs b/OpenRA.Mods.Common/FileFormats/ImaAdpcmReader.cs similarity index 92% rename from OpenRA.Mods.Common/AudioLoaders/ImaAdpcmLoader.cs rename to OpenRA.Mods.Common/FileFormats/ImaAdpcmReader.cs index 0aa47be2cf..7fb8c0a6a2 100644 --- a/OpenRA.Mods.Common/AudioLoaders/ImaAdpcmLoader.cs +++ b/OpenRA.Mods.Common/FileFormats/ImaAdpcmReader.cs @@ -11,7 +11,7 @@ using System.IO; -namespace OpenRA.Mods.Common.AudioLoaders +namespace OpenRA.Mods.Common.FileFormats { struct ImaAdpcmChunk { @@ -29,7 +29,9 @@ namespace OpenRA.Mods.Common.AudioLoaders } } - public static class ImaAdpcmLoader + // Mostly a duplicate of AudReader, with some difference when loading + // TODO: Investigate whether they can be fused to get rid of some duplication + public class ImaAdpcmReader { static readonly int[] IndexAdjust = { -1, -1, -1, -1, 2, 4, 6, 8 }; static readonly int[] StepTable = diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index eb41d49bb9..335e4c4e9f 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -147,7 +147,6 @@ - @@ -729,6 +728,7 @@ +