2016-03-26 02:20:34 +00:00
|
|
|
// Copyright 2016 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <algorithm>
|
2017-12-20 18:44:32 +00:00
|
|
|
#include <cstddef>
|
2016-03-26 02:20:34 +00:00
|
|
|
|
2019-02-18 04:41:48 +00:00
|
|
|
namespace AudioCore::HLE {
|
2016-03-26 02:20:34 +00:00
|
|
|
|
2018-09-06 20:03:28 +00:00
|
|
|
constexpr std::size_t num_sources = 24;
|
2016-03-26 02:20:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This performs the filter operation defined by FilterT::ProcessSample on the frame in-place.
|
|
|
|
* FilterT::ProcessSample is called sequentially on the samples.
|
|
|
|
*/
|
2016-09-18 00:38:01 +00:00
|
|
|
template <typename FrameT, typename FilterT>
|
2016-03-26 02:20:34 +00:00
|
|
|
void FilterFrame(FrameT& frame, FilterT& filter) {
|
2016-09-18 00:38:01 +00:00
|
|
|
std::transform(frame.begin(), frame.end(), frame.begin(),
|
|
|
|
[&filter](const auto& sample) { return filter.ProcessSample(sample); });
|
2016-03-26 02:20:34 +00:00
|
|
|
}
|
|
|
|
|
2019-02-18 04:41:48 +00:00
|
|
|
} // namespace AudioCore::HLE
|