4#include "DataStructures.hpp"
23 std::span<data_t,std::dynamic_extent> combined_buffers;
24 size_t sizeOfOneChannelInFrames = 0;
26 auto channel_at(
size_t i)
const{
27 auto ptr = combined_buffers.data()+(i*sizeOfOneChannelInFrames);
28 decltype(combined_buffers)
retview{ptr,sizeOfOneChannelInFrames};
33 using value_type =
decltype(combined_buffers)::value_type;
34 PlanarSampleBufferInlineView(
const decltype(combined_buffers)& buf,
decltype(sizeOfOneChannelInFrames) sizeOfOneChannelInFrames) : combined_buffers(buf), sizeOfOneChannelInFrames(sizeOfOneChannelInFrames){}
37 combined_buffers(data,
nframestotal), sizeOfOneChannelInFrames(sizeOfOneChannelInFrames){}
41 auto operator[](
size_t i){
44 const auto operator[](
size_t i)
const{
47 uint8_t GetNChannels()
const{
48 return combined_buffers.size() / sizeOfOneChannelInFrames;
54 return combined_buffers.size();
61 return combined_buffers.size() / GetNChannels();
65 return combined_buffers.data();
68 const auto data()
const {
69 return combined_buffers.data();
76 return sizeOfOneChannelInFrames;
79 auto bytesOneChannel()
const {
88 sizeOfOneChannelInFrames =
interleaved.size() / nchannels;
91 auto view = channel_at(i % nchannels);
98 auto bounds = std::min(A.size(),A.size());
100 for(
decltype(bounds) i = 0; i < bounds; i++){
104 inline void AdditiveBlendSamples(PlanarSampleBufferInlineView& A,
const PlanarSampleBufferInlineView& B){
105 for(uint8_t c = 0; c < std::min(A.GetNChannels(),B.GetNChannels()); c++){
107 for(
size_t i = 0; i < A.sizeOneChannel();i++){
113 class AudioGraphAsset;
121 void SetGraph(
decltype(effectGraph)
inGraph){
125 auto GetGraph()
const{
Definition AudioTypes.hpp:20
auto size() const
Definition AudioTypes.hpp:53
void ImportInterleavedData(InterleavedSampleBufferView interleaved, uint8_t nchannels)
Definition AudioTypes.hpp:87
auto sizeOneChannel() const
Definition AudioTypes.hpp:75
auto GetNumSamples() const
Definition AudioTypes.hpp:60
Definition concurrentqueue.h:747
Definition Animation.hpp:6
std::span< float, std::dynamic_extent > InterleavedSampleBufferView
Definition AudioTypes.hpp:13
Definition AudioTypes.hpp:114
void Render(PlanarSampleBufferInlineView &inputSamples, PlanarSampleBufferInlineView &intermediateBuffer, uint8_t nchannels)
Definition AudioTypes.hpp:134