Move some sources to a separate directory
To begin separating the ALC interfaces from internal ones.
This commit is contained in:
+4
-2
@@ -627,6 +627,10 @@ set(OPENAL_OBJS
|
||||
al/state.cpp
|
||||
)
|
||||
set(ALC_OBJS
|
||||
core/bufferline.h
|
||||
core/devformat.cpp
|
||||
core/devformat.h
|
||||
|
||||
alc/alc.cpp
|
||||
alc/alcmain.h
|
||||
alc/alu.cpp
|
||||
@@ -644,7 +648,6 @@ set(ALC_OBJS
|
||||
alc/bsinc_defs.h
|
||||
alc/bsinc_tables.cpp
|
||||
alc/bsinc_tables.h
|
||||
alc/bufferline.h
|
||||
alc/buffer_storage.cpp
|
||||
alc/buffer_storage.h
|
||||
alc/compat.h
|
||||
@@ -652,7 +655,6 @@ set(ALC_OBJS
|
||||
alc/converter.h
|
||||
alc/cpu_caps.cpp
|
||||
alc/cpu_caps.h
|
||||
alc/devformat.h
|
||||
alc/effectslot.cpp
|
||||
alc/effectslot.h
|
||||
alc/effects/base.h
|
||||
|
||||
+1
-61
@@ -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; };
|
||||
|
||||
+2
-5
@@ -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.
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
#include "almalloc.h"
|
||||
#include "alnumeric.h"
|
||||
#include "alu.h"
|
||||
#include "devformat.h"
|
||||
#include "core/devformat.h"
|
||||
#include "voice.h"
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "almalloc.h"
|
||||
#include "bufferline.h"
|
||||
#include "core/bufferline.h"
|
||||
#include "filters/splitter.h"
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef CORE_BUFFERLINE_H
|
||||
#define CORE_BUFFERLINE_H
|
||||
|
||||
#include <array>
|
||||
|
||||
/* Size for temporary storage of buffer data, in floats. Larger values need
|
||||
* more memory and are harder on cache, while smaller values may need more
|
||||
* iterations for mixing.
|
||||
*/
|
||||
#define BUFFERSIZE 1024
|
||||
|
||||
using FloatBufferLine = std::array<float,BUFFERSIZE>;
|
||||
|
||||
#endif /* CORE_BUFFERLINE_H */
|
||||
@@ -0,0 +1,65 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "devformat.h"
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
const char *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 char *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)";
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef ALC_DEVFORMAT_H
|
||||
#define ALC_DEVFORMAT_H
|
||||
#ifndef CORE_DEVFORMAT_H
|
||||
#define CORE_DEVFORMAT_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
@@ -82,6 +82,9 @@ uint ChannelsFromDevFmt(DevFmtChannels chans, uint ambiorder) noexcept;
|
||||
inline uint FrameSizeFromDevFmt(DevFmtChannels chans, DevFmtType type, uint ambiorder) noexcept
|
||||
{ return ChannelsFromDevFmt(chans, ambiorder) * BytesFromDevFmt(type); }
|
||||
|
||||
const char *DevFmtTypeString(DevFmtType type) noexcept;
|
||||
const char *DevFmtChannelsString(DevFmtChannels chans) noexcept;
|
||||
|
||||
enum class DevAmbiLayout : bool {
|
||||
FuMa,
|
||||
ACN,
|
||||
@@ -97,4 +100,4 @@ enum class DevAmbiScaling : unsigned char {
|
||||
Default = SN3D
|
||||
};
|
||||
|
||||
#endif /* ALC_DEVFORMAT_H */
|
||||
#endif /* CORE_DEVFORMAT_H */
|
||||
Reference in New Issue
Block a user