diff options
author | Chris Robinson <[email protected]> | 2021-04-27 08:26:42 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-04-27 08:26:42 -0700 |
commit | ff380298e4086490584707b8ffde44c5ad64830f (patch) | |
tree | 313288fbfdc2ea7824508e85d264966db6078368 | |
parent | 99157f149f180cfcc2e4be6a3d2a54843411e87a (diff) |
Move BufferStorage and Voice to core
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | al/buffer.cpp | 4 | ||||
-rw-r--r-- | al/buffer.h | 2 | ||||
-rw-r--r-- | al/source.h | 2 | ||||
-rw-r--r-- | al/state.cpp | 2 | ||||
-rw-r--r-- | alc/alc.cpp | 2 | ||||
-rw-r--r-- | alc/alu.cpp | 4 | ||||
-rw-r--r-- | alc/effects/convolution.cpp | 2 | ||||
-rw-r--r-- | core/buffer_storage.cpp (renamed from alc/buffer_storage.cpp) | 2 | ||||
-rw-r--r-- | core/buffer_storage.h (renamed from alc/buffer_storage.h) | 10 | ||||
-rw-r--r-- | core/voice.cpp (renamed from alc/voice.cpp) | 54 | ||||
-rw-r--r-- | core/voice.h (renamed from alc/voice.h) | 31 |
12 files changed, 52 insertions, 73 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ef4ef720..11c3975b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -655,6 +655,8 @@ set(CORE_OBJS core/bsinc_tables.cpp core/bsinc_tables.h core/bufferline.h + core/buffer_storage.cpp + core/buffer_storage.h core/context.cpp core/context.h core/converter.cpp @@ -692,6 +694,8 @@ set(CORE_OBJS core/uhjfilter.cpp core/uhjfilter.h core/uiddefs.cpp + core/voice.cpp + core/voice.h core/voice_change.h) set(HAVE_RTKIT 0) @@ -765,8 +769,6 @@ set(ALC_OBJS alc/alconfig.cpp alc/alconfig.h alc/alcontext.h - alc/buffer_storage.cpp - alc/buffer_storage.h alc/effectslot.cpp alc/effectslot.h alc/effects/base.h @@ -785,9 +787,7 @@ set(ALC_OBJS alc/effects/reverb.cpp alc/effects/vmorpher.cpp alc/inprogext.h - alc/panning.cpp - alc/voice.cpp - alc/voice.h) + alc/panning.cpp) # Include SIMD mixers set(CPU_EXTS "Default") diff --git a/al/buffer.cpp b/al/buffer.cpp index 906b40fc..21f46fc8 100644 --- a/al/buffer.cpp +++ b/al/buffer.cpp @@ -50,10 +50,10 @@ #include "aloptional.h" #include "atomic.h" #include "core/except.h" -#include "inprogext.h" #include "core/logging.h" +#include "core/voice.h" +#include "inprogext.h" #include "opthelpers.h" -#include "voice.h" namespace { diff --git a/al/buffer.h b/al/buffer.h index a9bc0e71..fe37b0af 100644 --- a/al/buffer.h +++ b/al/buffer.h @@ -8,7 +8,7 @@ #include "albyte.h" #include "almalloc.h" #include "atomic.h" -#include "buffer_storage.h" +#include "core/buffer_storage.h" #include "inprogext.h" #include "vector.h" diff --git a/al/source.h b/al/source.h index 4f4832e5..2063068a 100644 --- a/al/source.h +++ b/al/source.h @@ -17,9 +17,9 @@ #include "alnumeric.h" #include "alu.h" #include "atomic.h" +#include "core/voice.h" #include "math_defs.h" #include "vector.h" -#include "voice.h" struct ALbuffer; struct ALeffectslot; diff --git a/al/state.cpp b/al/state.cpp index 86a85b4d..950d64fc 100644 --- a/al/state.cpp +++ b/al/state.cpp @@ -40,11 +40,11 @@ #include "alu.h" #include "atomic.h" #include "core/except.h" +#include "core/voice.h" #include "event.h" #include "inprogext.h" #include "opthelpers.h" #include "strutils.h" -#include "voice.h" namespace { diff --git a/alc/alc.cpp b/alc/alc.cpp index 858fe278..1f7b999d 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1131,7 +1131,7 @@ void alc_initconfig(void) AllowRTTimeLimit = *limopt; aluInit(); - aluInitMixer(ConfigValueStr(nullptr, nullptr, "resampler")); + Voice::InitMixer(ConfigValueStr(nullptr, nullptr, "resampler")); auto traperr = al::getenv("ALSOFT_TRAP_ERROR"); if(traperr && (al::strcasecmp(traperr->c_str(), "true") == 0 diff --git a/alc/alu.cpp b/alc/alu.cpp index 250d4ee4..d370aba7 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -44,7 +44,6 @@ #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" @@ -52,6 +51,7 @@ #include "core/bsinc_defs.h" #include "core/bsinc_tables.h" #include "core/bufferline.h" +#include "core/buffer_storage.h" #include "core/context.h" #include "core/cpu_caps.h" #include "core/devformat.h" @@ -66,6 +66,7 @@ #include "core/mixer/hrtfdefs.h" #include "core/resampler_limits.h" #include "core/uhjfilter.h" +#include "core/voice.h" #include "core/voice_change.h" #include "effects/base.h" #include "effectslot.h" @@ -77,7 +78,6 @@ #include "threads.h" #include "vecmat.h" #include "vector.h" -#include "voice.h" struct CTag; #ifdef HAVE_SSE diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp index 90907a40..b460904b 100644 --- a/alc/effects/convolution.cpp +++ b/alc/effects/convolution.cpp @@ -23,10 +23,10 @@ #include "almalloc.h" #include "alnumeric.h" #include "alspan.h" -#include "buffer_storage.h" #include "config.h" #include "core/ambidefs.h" #include "core/bufferline.h" +#include "core/buffer_storage.h" #include "core/devformat.h" #include "core/device.h" #include "core/filters/splitter.h" diff --git a/alc/buffer_storage.cpp b/core/buffer_storage.cpp index 3eb1e28a..5179db13 100644 --- a/alc/buffer_storage.cpp +++ b/core/buffer_storage.cpp @@ -3,7 +3,7 @@ #include "buffer_storage.h" -#include <cstdint> +#include <stdint.h> uint BytesFromFmt(FmtType type) noexcept diff --git a/alc/buffer_storage.h b/core/buffer_storage.h index 733a62e3..59280354 100644 --- a/alc/buffer_storage.h +++ b/core/buffer_storage.h @@ -1,5 +1,5 @@ -#ifndef ALC_BUFFER_STORAGE_H -#define ALC_BUFFER_STORAGE_H +#ifndef CORE_BUFFER_STORAGE_H +#define CORE_BUFFER_STORAGE_H #include <atomic> @@ -28,8 +28,8 @@ enum FmtChannels : unsigned char { FmtBFormat2D, FmtBFormat3D, FmtUHJ2, /* 2-channel UHJ, aka "BHJ", stereo-compatible */ - FmtUHJ3, /* 3-channel UHJ, aka "THJ", first-two channels are stereo-compatible */ - FmtUHJ4, /* 4-channel UHJ, aka "PHJ", first-two channels are stereo-compatible */ + FmtUHJ3, /* 3-channel UHJ, aka "THJ" */ + FmtUHJ4, /* 4-channel UHJ, aka "PHJ" */ }; enum class AmbiLayout : unsigned char { @@ -72,4 +72,4 @@ struct BufferStorage { { return mChannels == FmtBFormat2D || mChannels == FmtBFormat3D; } }; -#endif /* ALC_BUFFER_STORAGE_H */ +#endif /* CORE_BUFFER_STORAGE_H */ diff --git a/alc/voice.cpp b/core/voice.cpp index 686f4c9b..c764a277 100644 --- a/alc/voice.cpp +++ b/core/voice.cpp @@ -1,22 +1,3 @@ -/** - * OpenAL cross platform audio library - * Copyright (C) 1999-2007 by authors. - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * Or go to http://www.gnu.org/copyleft/lgpl.html - */ #include "config.h" @@ -39,26 +20,26 @@ #include "aloptional.h" #include "alspan.h" #include "alstring.h" +#include "ambidefs.h" +#include "async_event.h" #include "buffer_storage.h" -#include "core/ambidefs.h" -#include "core/async_event.h" -#include "core/context.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/fmt_traits.h" -#include "core/logging.h" -#include "core/mixer.h" -#include "core/mixer/defs.h" -#include "core/mixer/hrtfdefs.h" -#include "core/resampler_limits.h" -#include "core/voice_change.h" +#include "context.h" +#include "cpu_caps.h" +#include "devformat.h" +#include "device.h" +#include "filters/biquad.h" +#include "filters/nfc.h" +#include "filters/splitter.h" +#include "fmt_traits.h" +#include "logging.h" +#include "mixer.h" +#include "mixer/defs.h" +#include "mixer/hrtfdefs.h" #include "opthelpers.h" +#include "resampler_limits.h" #include "ringbuffer.h" #include "vector.h" +#include "voice_change.h" struct CTag; #ifdef HAVE_SSE @@ -128,8 +109,7 @@ inline HrtfMixerBlendFunc SelectHrtfBlendMixer() } // namespace - -void aluInitMixer(al::optional<std::string> resampler) +void Voice::InitMixer(al::optional<std::string> resampler) { if(resampler) { diff --git a/alc/voice.h b/core/voice.h index 937294e3..c3347cda 100644 --- a/alc/voice.h +++ b/core/voice.h @@ -1,27 +1,26 @@ -#ifndef VOICE_H -#define VOICE_H - -#include <stddef.h> +#ifndef CORE_VOICE_H +#define CORE_VOICE_H #include <array> #include <atomic> #include <memory> +#include <stddef.h> #include <string> #include "albyte.h" #include "almalloc.h" #include "aloptional.h" #include "alspan.h" +#include "bufferline.h" #include "buffer_storage.h" -#include "core/bufferline.h" -#include "core/devformat.h" -#include "core/filters/biquad.h" -#include "core/filters/nfc.h" -#include "core/filters/splitter.h" -#include "core/mixer/defs.h" -#include "core/mixer/hrtfdefs.h" -#include "core/resampler_limits.h" -#include "core/uhjfilter.h" +#include "devformat.h" +#include "filters/biquad.h" +#include "filters/nfc.h" +#include "filters/splitter.h" +#include "mixer/defs.h" +#include "mixer/hrtfdefs.h" +#include "resampler_limits.h" +#include "uhjfilter.h" #include "vector.h" struct ContextBase; @@ -261,11 +260,11 @@ struct Voice { void prepare(DeviceBase *device); + static void InitMixer(al::optional<std::string> resampler); + DEF_NEWDEL(Voice) }; extern Resampler ResamplerDefault; -void aluInitMixer(al::optional<std::string> resampler); - -#endif /* VOICE_H */ +#endif /* CORE_VOICE_H */ |