early-access version 2830

This commit is contained in:
pineappleEA
2022-07-13 16:55:33 +02:00
parent 3df4ab9726
commit 18b71d75ce
52 changed files with 3561 additions and 195 deletions

View File

@@ -4,6 +4,7 @@
#pragma once
#include <numeric>
#include <span>
#include "common/assert.h"
#include "common/common_funcs.h"
@@ -40,6 +41,25 @@ enum class SessionTypes {
FinalOutputRecorder,
};
enum class Channels : u32 {
FrontLeft,
FrontRight,
Center,
LFE,
BackLeft,
BackRight,
};
// These are used by Delay, Reverb and I3dl2Reverb prior to Revision 11.
enum class OldChannels : u32 {
FrontLeft,
FrontRight,
BackLeft,
BackRight,
Center,
LFE,
};
constexpr u32 BufferCount = 32;
constexpr u32 MaxRendererSessions = 2;
@@ -66,6 +86,27 @@ constexpr bool IsChannelCountValid(u16 channel_count) {
(channel_count == 1 || channel_count == 2 || channel_count == 4 || channel_count == 6);
}
constexpr void UseOldChannelMapping(std::span<s16> inputs, std::span<s16> outputs) {
constexpr auto old_center{static_cast<u32>(OldChannels::Center)};
constexpr auto new_center{static_cast<u32>(Channels::Center)};
constexpr auto old_lfe{static_cast<u32>(OldChannels::LFE)};
constexpr auto new_lfe{static_cast<u32>(Channels::LFE)};
auto center{inputs[old_center]};
auto lfe{inputs[old_lfe]};
inputs[old_center] = inputs[new_center];
inputs[old_lfe] = inputs[new_lfe];
inputs[new_center] = center;
inputs[new_lfe] = lfe;
center = outputs[old_center];
lfe = outputs[old_lfe];
outputs[old_center] = outputs[new_center];
outputs[old_lfe] = outputs[new_lfe];
outputs[new_center] = center;
outputs[new_lfe] = lfe;
}
constexpr u32 GetSplitterInParamHeaderMagic() {
return Common::MakeMagic('S', 'N', 'D', 'H');
}

View File

@@ -12,7 +12,7 @@
#include "common/common_types.h"
namespace AudioCore {
constexpr u32 CurrentRevision = 10;
constexpr u32 CurrentRevision = 11;
enum class SupportTags {
CommandProcessingTimeEstimatorVersion4,
@@ -40,6 +40,9 @@ enum class SupportTags {
LongSizePreDelay,
AudioUsbDeviceOutput,
DeviceApiVersion2,
DelayChannelMappingChange,
ReverbChannelMappingChange,
I3dl2ReverbChannelMappingChange,
// Not a real tag, just here to get the count.
Size
@@ -80,6 +83,9 @@ constexpr bool CheckFeatureSupported(SupportTags tag, u32 user_revision) {
{SupportTags::EffectInfoVer2, 9},
{SupportTags::CommandProcessingTimeEstimatorVersion4, 10},
{SupportTags::MultiTapBiquadFilterProcessing, 10},
{SupportTags::DelayChannelMappingChange, 11},
{SupportTags::ReverbChannelMappingChange, 11},
{SupportTags::I3dl2ReverbChannelMappingChange, 11},
}};
const auto& feature =