From 22a8ebff8094785ec53aadef8489dc60f6939d55 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 26 Apr 2021 07:56:00 -0700 Subject: Move GetChannelIdxByName and clean up some more includes --- alc/alcmain.h | 15 --------------- alc/alcontext.h | 1 + alc/alu.cpp | 22 +++++++++++----------- alc/alu.h | 9 --------- alc/backends/base.cpp | 11 ++++++----- alc/backends/base.h | 5 +++-- alc/backends/pulseaudio.cpp | 36 ++++++++++++++++++++++++++---------- alc/effects/convolution.cpp | 1 - alc/effects/dedicated.cpp | 1 - core/device.h | 16 ++++++++++++++++ 10 files changed, 63 insertions(+), 54 deletions(-) diff --git a/alc/alcmain.h b/alc/alcmain.h index e8875184..eb25b596 100644 --- a/alc/alcmain.h +++ b/alc/alcmain.h @@ -124,19 +124,4 @@ struct ALCdevice : public al::intrusive_ref, DeviceBase { DEF_NEWDEL(ALCdevice) }; -/* Must be less than 15 characters (16 including terminating null) for - * compatibility with pthread_setname_np limitations. */ -#define MIXER_THREAD_NAME "alsoft-mixer" - -#define RECORD_THREAD_NAME "alsoft-record" - - -/** - * Returns the index for the given channel name (e.g. FrontCenter), or - * INVALID_CHANNEL_INDEX if it doesn't exist. - */ -inline uint GetChannelIdxByName(const RealMixParams &real, Channel chan) noexcept -{ return real.ChannelIndex[chan]; } -#define INVALID_CHANNEL_INDEX ~0u - #endif diff --git a/alc/alcontext.h b/alc/alcontext.h index 3c368a64..b1b41e76 100644 --- a/alc/alcontext.h +++ b/alc/alcontext.h @@ -18,6 +18,7 @@ #include "alnumeric.h" #include "alu.h" #include "atomic.h" +#include "core/bufferline.h" #include "inprogext.h" #include "intrusive_ptr.h" #include "threads.h" diff --git a/alc/alu.cpp b/alc/alu.cpp index 14ffd8b5..168f0112 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -37,46 +36,46 @@ #include #include #include -#include +#include #include -#include "AL/al.h" -#include "AL/alc.h" -#include "AL/efx.h" - -#include "alcmain.h" #include "alcontext.h" #include "almalloc.h" #include "alnumeric.h" #include "alspan.h" #include "alstring.h" #include "atomic.h" +#include "buffer_storage.h" #include "core/ambidefs.h" #include "core/async_event.h" #include "core/bformatdec.h" #include "core/bs2b.h" +#include "core/bsinc_defs.h" #include "core/bsinc_tables.h" +#include "core/bufferline.h" #include "core/cpu_caps.h" #include "core/devformat.h" +#include "core/device.h" #include "core/filters/biquad.h" #include "core/filters/nfc.h" -#include "core/filters/splitter.h" #include "core/fpu_ctrl.h" -#include "core/front_stablizer.h" #include "core/hrtf.h" #include "core/mastering.h" #include "core/mixer.h" #include "core/mixer/defs.h" +#include "core/mixer/hrtfdefs.h" +#include "core/resampler_limits.h" #include "core/uhjfilter.h" #include "effects/base.h" #include "effectslot.h" -#include "inprogext.h" +#include "intrusive_ptr.h" #include "math_defs.h" #include "opthelpers.h" #include "ringbuffer.h" #include "strutils.h" #include "threads.h" #include "vecmat.h" +#include "vector.h" #include "voice.h" #include "voice_change.h" @@ -93,7 +92,6 @@ struct SSE4Tag; #ifdef HAVE_NEON struct NEONTag; #endif -struct CopyTag; struct PointTag; struct LerpTag; struct CubicTag; @@ -106,6 +104,8 @@ static_assert(!(MaxResamplerPadding&1), "MaxResamplerPadding is not a multiple o namespace { +using uint = unsigned int; + constexpr uint MaxPitch{10}; static_assert((BufferLineSize-1)/MaxPitch > 0, "MaxPitch is too large for BufferLineSize!"); diff --git a/alc/alu.h b/alc/alu.h index ac33de27..3ca0c6b6 100644 --- a/alc/alu.h +++ b/alc/alu.h @@ -1,22 +1,13 @@ #ifndef ALU_H #define ALU_H -#include -#include -#include #include -#include #include "aloptional.h" -#include "alspan.h" -#include "core/ambidefs.h" -#include "core/bufferline.h" -#include "core/devformat.h" struct ALCcontext; struct ALCdevice; struct EffectSlot; -struct MixParams; #define MAX_SENDS 6 diff --git a/alc/backends/base.cpp b/alc/backends/base.cpp index c4a4abeb..0c28d238 100644 --- a/alc/backends/base.cpp +++ b/alc/backends/base.cpp @@ -3,21 +3,22 @@ #include "base.h" +#include +#include #include -#include #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include #include -#endif #include "albit.h" -#include "alcmain.h" -#include "alnumeric.h" +#include "core/logging.h" #include "aloptional.h" +#endif + #include "atomic.h" -#include "core/logging.h" +#include "core/devformat.h" bool BackendBase::reset() diff --git a/alc/backends/base.h b/alc/backends/base.h index 853df893..d661bc46 100644 --- a/alc/backends/base.h +++ b/alc/backends/base.h @@ -2,12 +2,13 @@ #define ALC_BACKENDS_BASE_H #include +#include #include -#include +#include #include #include "albyte.h" -#include "alcmain.h" +#include "core/device.h" #include "core/except.h" diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp index 39eed771..da1ffcb0 100644 --- a/alc/backends/pulseaudio.cpp +++ b/alc/backends/pulseaudio.cpp @@ -23,31 +23,47 @@ #include "backends/pulseaudio.h" -#include -#include - +#include #include -#include -#include #include -#include -#include -#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "alcmain.h" -#include "alu.h" +#include "albyte.h" #include "alconfig.h" +#include "almalloc.h" +#include "alnumeric.h" +#include "aloptional.h" +#include "alspan.h" +#include "core/devformat.h" +#include "core/device.h" #include "core/helpers.h" #include "core/logging.h" #include "dynload.h" +#include "opthelpers.h" #include "strutils.h" +#include "vector.h" #include namespace { +using uint = unsigned int; + #ifdef HAVE_DYNLOAD #define PULSE_FUNCS(MAGIC) \ MAGIC(pa_mainloop_new); \ diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp index efc1c4c7..90907a40 100644 --- a/alc/effects/convolution.cpp +++ b/alc/effects/convolution.cpp @@ -18,7 +18,6 @@ #endif #include "albyte.h" -#include "alcmain.h" #include "alcomplex.h" #include "alcontext.h" #include "almalloc.h" diff --git a/alc/effects/dedicated.cpp b/alc/effects/dedicated.cpp index 78663053..6afd7baa 100644 --- a/alc/effects/dedicated.cpp +++ b/alc/effects/dedicated.cpp @@ -25,7 +25,6 @@ #include #include -#include "alcmain.h" #include "almalloc.h" #include "alspan.h" #include "core/bufferline.h" diff --git a/core/device.h b/core/device.h index bc6bae52..4cc822cc 100644 --- a/core/device.h +++ b/core/device.h @@ -271,4 +271,20 @@ struct DeviceBase { DISABLE_ALLOC() }; + +/* Must be less than 15 characters (16 including terminating null) for + * compatibility with pthread_setname_np limitations. */ +#define MIXER_THREAD_NAME "alsoft-mixer" + +#define RECORD_THREAD_NAME "alsoft-record" + + +/** + * Returns the index for the given channel name (e.g. FrontCenter), or + * INVALID_CHANNEL_INDEX if it doesn't exist. + */ +inline uint GetChannelIdxByName(const RealMixParams &real, Channel chan) noexcept +{ return real.ChannelIndex[chan]; } +#define INVALID_CHANNEL_INDEX ~0u + #endif /* CORE_DEVICE_H */ -- cgit v1.2.3