2016-03-25 21:20:34 -05: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 12:44:32 -06:00
|
|
|
#include <cstddef>
|
2016-03-25 21:20:34 -05:00
|
|
|
|
2019-02-17 22:41:48 -06:00
|
|
|
namespace AudioCore::HLE {
|
2016-03-25 21:20:34 -05:00
|
|
|
|
2018-09-06 15:03:28 -05:00
|
|
|
constexpr std::size_t num_sources = 24;
|
2016-03-25 21:20:34 -05: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-17 19:38:01 -05:00
|
|
|
template <typename FrameT, typename FilterT>
|
2016-03-25 21:20:34 -05:00
|
|
|
void FilterFrame(FrameT& frame, FilterT& filter) {
|
2016-09-17 19:38:01 -05:00
|
|
|
std::transform(frame.begin(), frame.end(), frame.begin(),
|
|
|
|
[&filter](const auto& sample) { return filter.ProcessSample(sample); });
|
2016-03-25 21:20:34 -05:00
|
|
|
}
|
|
|
|
|
2019-02-17 22:41:48 -06:00
|
|
|
} // namespace AudioCore::HLE
|