citra-emu
/
citra-canary
Archived
1
0
Fork 0

Merge pull request #4652 from tgsm/audio-nested

audio_core: use nested namespaces
This commit is contained in:
Pengfei Zhu 2019-02-19 21:39:35 +08:00 committed by GitHub
commit 820e3893de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 26 additions and 52 deletions

View File

@ -11,8 +11,7 @@
#include "common/assert.h" #include "common/assert.h"
#include "common/common_types.h" #include "common/common_types.h"
namespace AudioCore { namespace AudioCore::Codec {
namespace Codec {
StereoBuffer16 DecodeADPCM(const u8* const data, const std::size_t sample_count, StereoBuffer16 DecodeADPCM(const u8* const data, const std::size_t sample_count,
const std::array<s16, 16>& adpcm_coeff, ADPCMState& state) { const std::array<s16, 16>& adpcm_coeff, ADPCMState& state) {
@ -123,5 +122,4 @@ StereoBuffer16 DecodePCM16(const unsigned num_channels, const u8* const data,
return ret; return ret;
} }
} // namespace Codec } // namespace AudioCore::Codec
} // namespace AudioCore

View File

@ -8,8 +8,7 @@
#include "audio_core/audio_types.h" #include "audio_core/audio_types.h"
#include "common/common_types.h" #include "common/common_types.h"
namespace AudioCore { namespace AudioCore::Codec {
namespace Codec {
/// See: Codec::DecodeADPCM /// See: Codec::DecodeADPCM
struct ADPCMState { struct ADPCMState {
@ -46,5 +45,4 @@ StereoBuffer16 DecodePCM8(const unsigned num_channels, const u8* const data,
*/ */
StereoBuffer16 DecodePCM16(const unsigned num_channels, const u8* const data, StereoBuffer16 DecodePCM16(const unsigned num_channels, const u8* const data,
const std::size_t sample_count); const std::size_t sample_count);
} // namespace Codec } // namespace AudioCore::Codec
} // namespace AudioCore

View File

@ -12,11 +12,9 @@
#include "common/ring_buffer.h" #include "common/ring_buffer.h"
#include "core/memory.h" #include "core/memory.h"
namespace Service { namespace Service::DSP {
namespace DSP {
class DSP_DSP; class DSP_DSP;
} // namespace DSP } // namespace Service::DSP
} // namespace Service
namespace AudioCore { namespace AudioCore {

View File

@ -7,8 +7,7 @@
#include <algorithm> #include <algorithm>
#include <cstddef> #include <cstddef>
namespace AudioCore { namespace AudioCore::HLE {
namespace HLE {
constexpr std::size_t num_sources = 24; constexpr std::size_t num_sources = 24;
@ -22,5 +21,4 @@ void FilterFrame(FrameT& frame, FilterT& filter) {
[&filter](const auto& sample) { return filter.ProcessSample(sample); }); [&filter](const auto& sample) { return filter.ProcessSample(sample); });
} }
} // namespace HLE } // namespace AudioCore::HLE
} // namespace AudioCore

View File

@ -10,8 +10,7 @@
#include "audio_core/hle/shared_memory.h" #include "audio_core/hle/shared_memory.h"
#include "common/common_types.h" #include "common/common_types.h"
namespace AudioCore { namespace AudioCore::HLE {
namespace HLE {
void SourceFilters::Reset() { void SourceFilters::Reset() {
Enable(false, false); Enable(false, false);
@ -113,5 +112,4 @@ std::array<s16, 2> SourceFilters::BiquadFilter::ProcessSample(const std::array<s
return y0; return y0;
} }
} // namespace HLE } // namespace AudioCore::HLE
} // namespace AudioCore

View File

@ -9,8 +9,7 @@
#include "audio_core/hle/shared_memory.h" #include "audio_core/hle/shared_memory.h"
#include "common/common_types.h" #include "common/common_types.h"
namespace AudioCore { namespace AudioCore::HLE {
namespace HLE {
/// Preprocessing filters. There is an independent set of filters for each Source. /// Preprocessing filters. There is an independent set of filters for each Source.
class SourceFilters final { class SourceFilters final {
@ -113,5 +112,4 @@ private:
} biquad_filter; } biquad_filter;
}; };
} // namespace HLE } // namespace AudioCore::HLE
} // namespace AudioCore

View File

@ -8,8 +8,7 @@
#include "common/assert.h" #include "common/assert.h"
#include "common/logging/log.h" #include "common/logging/log.h"
namespace AudioCore { namespace AudioCore::HLE {
namespace HLE {
void Mixers::Reset() { void Mixers::Reset() {
current_frame.fill({}); current_frame.fill({});
@ -203,5 +202,4 @@ DspStatus Mixers::GetCurrentStatus() const {
return status; return status;
} }
} // namespace HLE } // namespace AudioCore::HLE
} // namespace AudioCore

View File

@ -8,8 +8,7 @@
#include "audio_core/audio_types.h" #include "audio_core/audio_types.h"
#include "audio_core/hle/shared_memory.h" #include "audio_core/hle/shared_memory.h"
namespace AudioCore { namespace AudioCore::HLE {
namespace HLE {
class Mixers final { class Mixers final {
public: public:
@ -57,5 +56,4 @@ private:
DspStatus GetCurrentStatus() const; DspStatus GetCurrentStatus() const;
}; };
} // namespace HLE } // namespace AudioCore::HLE
} // namespace AudioCore

View File

@ -15,8 +15,7 @@
#include "common/common_types.h" #include "common/common_types.h"
#include "common/swap.h" #include "common/swap.h"
namespace AudioCore { namespace AudioCore::HLE {
namespace HLE {
// The application-accessible region of DSP memory consists of two parts. Both are marked as IO and // The application-accessible region of DSP memory consists of two parts. Both are marked as IO and
// have Read/Write permissions. // have Read/Write permissions.
@ -559,5 +558,4 @@ static_assert(offsetof(SharedMemory, unknown14) % 2 == 0,
#undef INSERT_PADDING_DSPWORDS #undef INSERT_PADDING_DSPWORDS
#undef ASSERT_DSP_STRUCT #undef ASSERT_DSP_STRUCT
} // namespace HLE } // namespace AudioCore::HLE
} // namespace AudioCore

View File

@ -12,8 +12,7 @@
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/memory.h" #include "core/memory.h"
namespace AudioCore { namespace AudioCore::HLE {
namespace HLE {
SourceStatus::Status Source::Tick(SourceConfiguration::Configuration& config, SourceStatus::Status Source::Tick(SourceConfiguration::Configuration& config,
const s16_le (&adpcm_coeffs)[16]) { const s16_le (&adpcm_coeffs)[16]) {
@ -349,5 +348,4 @@ SourceStatus::Status Source::GetCurrentStatus() {
return ret; return ret;
} }
} // namespace HLE } // namespace AudioCore::HLE
} // namespace AudioCore

View File

@ -18,8 +18,7 @@ namespace Memory {
class MemorySystem; class MemorySystem;
} }
namespace AudioCore { namespace AudioCore::HLE {
namespace HLE {
/** /**
* This module performs: * This module performs:
@ -153,5 +152,4 @@ private:
SourceStatus::Status GetCurrentStatus(); SourceStatus::Status GetCurrentStatus();
}; };
} // namespace HLE } // namespace AudioCore::HLE
} // namespace AudioCore

View File

@ -6,8 +6,7 @@
#include "audio_core/interpolate.h" #include "audio_core/interpolate.h"
#include "common/assert.h" #include "common/assert.h"
namespace AudioCore { namespace AudioCore::AudioInterp {
namespace AudioInterp {
// Calculations are done in fixed point with 24 fractional bits. // Calculations are done in fixed point with 24 fractional bits.
// (This is not verified. This was chosen for minimal error.) // (This is not verified. This was chosen for minimal error.)
@ -74,5 +73,4 @@ void Linear(State& state, StereoBuffer16& input, float rate, StereoFrame16& outp
}); });
} }
} // namespace AudioInterp } // namespace AudioCore::AudioInterp
} // namespace AudioCore

View File

@ -9,8 +9,7 @@
#include "audio_core/audio_types.h" #include "audio_core/audio_types.h"
#include "common/common_types.h" #include "common/common_types.h"
namespace AudioCore { namespace AudioCore::AudioInterp {
namespace AudioInterp {
/// A variable length buffer of signed PCM16 stereo samples. /// A variable length buffer of signed PCM16 stereo samples.
using StereoBuffer16 = std::deque<std::array<s16, 2>>; using StereoBuffer16 = std::deque<std::array<s16, 2>>;
@ -47,5 +46,4 @@ void None(State& state, StereoBuffer16& input, float rate, StereoFrame16& output
void Linear(State& state, StereoBuffer16& input, float rate, StereoFrame16& output, void Linear(State& state, StereoBuffer16& input, float rate, StereoFrame16& output,
std::size_t& outputi); std::size_t& outputi);
} // namespace AudioInterp } // namespace AudioCore::AudioInterp
} // namespace AudioCore