diff options
Diffstat (limited to 'alc')
-rw-r--r-- | alc/alc.cpp | 62 | ||||
-rw-r--r-- | alc/alcmain.h | 7 | ||||
-rw-r--r-- | alc/alu.cpp | 2 | ||||
-rw-r--r-- | alc/bformatdec.h | 2 | ||||
-rw-r--r-- | alc/bufferline.h | 15 | ||||
-rw-r--r-- | alc/converter.h | 2 | ||||
-rw-r--r-- | alc/devformat.h | 100 | ||||
-rw-r--r-- | alc/front_stablizer.h | 2 | ||||
-rw-r--r-- | alc/hrtf.h | 2 | ||||
-rw-r--r-- | alc/panning.cpp | 2 | ||||
-rw-r--r-- | alc/voice.cpp | 2 | ||||
-rw-r--r-- | alc/voice.h | 2 |
12 files changed, 11 insertions, 189 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index 623fd688..7cf6c5a9 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -80,8 +80,8 @@ #include "bformatdec.h" #include "bs2b.h" #include "compat.h" +#include "core/devformat.h" #include "cpu_caps.h" -#include "devformat.h" #include "effects/base.h" #include "filters/nfc.h" #include "filters/splitter.h" @@ -1309,66 +1309,6 @@ BOOL APIENTRY DllMain(HINSTANCE module, DWORD reason, LPVOID /*reserved*/) /************************************************ * Device format information ************************************************/ -const ALCchar *DevFmtTypeString(DevFmtType type) noexcept -{ - switch(type) - { - case DevFmtByte: return "Int8"; - case DevFmtUByte: return "UInt8"; - case DevFmtShort: return "Int16"; - case DevFmtUShort: return "UInt16"; - case DevFmtInt: return "Int32"; - case DevFmtUInt: return "UInt32"; - case DevFmtFloat: return "Float32"; - } - return "(unknown type)"; -} -const ALCchar *DevFmtChannelsString(DevFmtChannels chans) noexcept -{ - switch(chans) - { - case DevFmtMono: return "Mono"; - case DevFmtStereo: return "Stereo"; - case DevFmtQuad: return "Quadraphonic"; - case DevFmtX51: return "5.1 Surround"; - case DevFmtX51Rear: return "5.1 Surround (Rear)"; - case DevFmtX61: return "6.1 Surround"; - case DevFmtX71: return "7.1 Surround"; - case DevFmtAmbi3D: return "Ambisonic 3D"; - } - return "(unknown channels)"; -} - -uint BytesFromDevFmt(DevFmtType type) noexcept -{ - switch(type) - { - case DevFmtByte: return sizeof(int8_t); - case DevFmtUByte: return sizeof(uint8_t); - case DevFmtShort: return sizeof(int16_t); - case DevFmtUShort: return sizeof(uint16_t); - case DevFmtInt: return sizeof(int32_t); - case DevFmtUInt: return sizeof(uint32_t); - case DevFmtFloat: return sizeof(float); - } - return 0; -} -uint ChannelsFromDevFmt(DevFmtChannels chans, uint ambiorder) noexcept -{ - switch(chans) - { - case DevFmtMono: return 1; - case DevFmtStereo: return 2; - case DevFmtQuad: return 4; - case DevFmtX51: return 6; - case DevFmtX51Rear: return 6; - case DevFmtX61: return 7; - case DevFmtX71: return 8; - case DevFmtAmbi3D: return (ambiorder+1) * (ambiorder+1); - } - return 0; -} - namespace { struct DevFmtPair { DevFmtChannels chans; DevFmtType type; }; diff --git a/alc/alcmain.h b/alc/alcmain.h index abeb0201..41906bde 100644 --- a/alc/alcmain.h +++ b/alc/alcmain.h @@ -23,8 +23,8 @@ #include "alspan.h" #include "ambidefs.h" #include "atomic.h" -#include "bufferline.h" -#include "devformat.h" +#include "core/bufferline.h" +#include "core/devformat.h" #include "filters/splitter.h" #include "hrtf.h" #include "inprogext.h" @@ -366,9 +366,6 @@ struct ALCdevice : public al::intrusive_ref<ALCdevice> { extern int RTPrioLevel; void SetRTPriority(void); -const ALCchar *DevFmtTypeString(DevFmtType type) noexcept; -const ALCchar *DevFmtChannelsString(DevFmtChannels chans) noexcept; - /** * Returns the index for the given channel name (e.g. FrontCenter), or * INVALID_CHANNEL_INDEX if it doesn't exist. diff --git a/alc/alu.cpp b/alc/alu.cpp index 7e7dabf9..10069fd1 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -59,8 +59,8 @@ #include "atomic.h" #include "bformatdec.h" #include "bs2b.h" +#include "core/devformat.h" #include "cpu_caps.h" -#include "devformat.h" #include "effects/base.h" #include "filters/biquad.h" #include "filters/nfc.h" diff --git a/alc/bformatdec.h b/alc/bformatdec.h index 03249c55..280ca2fc 100644 --- a/alc/bformatdec.h +++ b/alc/bformatdec.h @@ -11,7 +11,7 @@ #include "almalloc.h" #include "alspan.h" #include "ambidefs.h" -#include "devformat.h" +#include "core/devformat.h" #include "filters/splitter.h" struct AmbDecConf; diff --git a/alc/bufferline.h b/alc/bufferline.h deleted file mode 100644 index 79f0996c..00000000 --- a/alc/bufferline.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef ALC_BUFFERLINE_H -#define ALC_BUFFERLINE_H - -#include <array> - -/* Size for temporary storage of buffer data, in floats. Larger values need - * more memory, while smaller values may need more iterations. The value needs - * to be a sensible size, however, as it constrains the max stepping value used - * for mixing, as well as the maximum number of samples per mixing iteration. - */ -#define BUFFERSIZE 1024 - -using FloatBufferLine = std::array<float,BUFFERSIZE>; - -#endif /* ALC_BUFFERLINE_H */ diff --git a/alc/converter.h b/alc/converter.h index 17da3aae..a97d1ea5 100644 --- a/alc/converter.h +++ b/alc/converter.h @@ -10,7 +10,7 @@ #include "almalloc.h" #include "alnumeric.h" #include "alu.h" -#include "devformat.h" +#include "core/devformat.h" #include "voice.h" diff --git a/alc/devformat.h b/alc/devformat.h deleted file mode 100644 index b02ad025..00000000 --- a/alc/devformat.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef ALC_DEVFORMAT_H -#define ALC_DEVFORMAT_H - -#include <cstdint> - - -using uint = unsigned int; - -enum Channel { - FrontLeft = 0, - FrontRight, - FrontCenter, - LFE, - BackLeft, - BackRight, - BackCenter, - SideLeft, - SideRight, - - TopFrontLeft, - TopFrontCenter, - TopFrontRight, - TopCenter, - TopBackLeft, - TopBackCenter, - TopBackRight, - - MaxChannels -}; - - -/* Device formats */ -enum DevFmtType : unsigned char { - DevFmtByte, - DevFmtUByte, - DevFmtShort, - DevFmtUShort, - DevFmtInt, - DevFmtUInt, - DevFmtFloat, - - DevFmtTypeDefault = DevFmtFloat -}; -enum DevFmtChannels : unsigned char { - DevFmtMono, - DevFmtStereo, - DevFmtQuad, - DevFmtX51, - DevFmtX61, - DevFmtX71, - DevFmtAmbi3D, - - /* Similar to 5.1, except using rear channels instead of sides */ - DevFmtX51Rear, - - DevFmtChannelsDefault = DevFmtStereo -}; -#define MAX_OUTPUT_CHANNELS 16 - -/* DevFmtType traits, providing the type, etc given a DevFmtType. */ -template<DevFmtType T> -struct DevFmtTypeTraits { }; - -template<> -struct DevFmtTypeTraits<DevFmtByte> { using Type = int8_t; }; -template<> -struct DevFmtTypeTraits<DevFmtUByte> { using Type = uint8_t; }; -template<> -struct DevFmtTypeTraits<DevFmtShort> { using Type = int16_t; }; -template<> -struct DevFmtTypeTraits<DevFmtUShort> { using Type = uint16_t; }; -template<> -struct DevFmtTypeTraits<DevFmtInt> { using Type = int32_t; }; -template<> -struct DevFmtTypeTraits<DevFmtUInt> { using Type = uint32_t; }; -template<> -struct DevFmtTypeTraits<DevFmtFloat> { using Type = float; }; - - -uint BytesFromDevFmt(DevFmtType type) noexcept; -uint ChannelsFromDevFmt(DevFmtChannels chans, uint ambiorder) noexcept; -inline uint FrameSizeFromDevFmt(DevFmtChannels chans, DevFmtType type, uint ambiorder) noexcept -{ return ChannelsFromDevFmt(chans, ambiorder) * BytesFromDevFmt(type); } - -enum class DevAmbiLayout : bool { - FuMa, - ACN, - - Default = ACN -}; - -enum class DevAmbiScaling : unsigned char { - FuMa, - SN3D, - N3D, - - Default = SN3D -}; - -#endif /* ALC_DEVFORMAT_H */ diff --git a/alc/front_stablizer.h b/alc/front_stablizer.h index 5e7c267f..066a70af 100644 --- a/alc/front_stablizer.h +++ b/alc/front_stablizer.h @@ -5,7 +5,7 @@ #include <memory> #include "almalloc.h" -#include "bufferline.h" +#include "core/bufferline.h" #include "filters/splitter.h" @@ -10,7 +10,7 @@ #include "alspan.h" #include "ambidefs.h" #include "atomic.h" -#include "bufferline.h" +#include "core/bufferline.h" #include "filters/splitter.h" #include "intrusive_ptr.h" #include "vector.h" diff --git a/alc/panning.cpp b/alc/panning.cpp index adc7db30..86a71a24 100644 --- a/alc/panning.cpp +++ b/alc/panning.cpp @@ -51,7 +51,7 @@ #include "ambidefs.h" #include "bformatdec.h" #include "bs2b.h" -#include "devformat.h" +#include "core/devformat.h" #include "front_stablizer.h" #include "hrtf.h" #include "logging.h" diff --git a/alc/voice.cpp b/alc/voice.cpp index 4fe84234..174e8545 100644 --- a/alc/voice.cpp +++ b/alc/voice.cpp @@ -46,8 +46,8 @@ #include "alspan.h" #include "alstring.h" #include "alu.h" +#include "core/devformat.h" #include "cpu_caps.h" -#include "devformat.h" #include "filters/biquad.h" #include "filters/nfc.h" #include "filters/splitter.h" diff --git a/alc/voice.h b/alc/voice.h index 5900d849..5ae7a945 100644 --- a/alc/voice.h +++ b/alc/voice.h @@ -7,7 +7,7 @@ #include "alspan.h" #include "alu.h" #include "buffer_storage.h" -#include "devformat.h" +#include "core/devformat.h" #include "filters/biquad.h" #include "filters/nfc.h" #include "filters/splitter.h" |