From a7d8063db457b607b0652ca1403fcea4de90d766 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 11 Jun 2021 13:38:29 +0200 Subject: [PATCH] Add getters for channel counts in audio buffers --- src/common/audio-shm.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/common/audio-shm.h b/src/common/audio-shm.h index 0608e737..73bb7c71 100644 --- a/src/common/audio-shm.h +++ b/src/common/audio-shm.h @@ -134,6 +134,14 @@ class AudioShmBuffer { */ void resize(const Config& new_config); + inline size_t num_input_channels(const uint32_t bus) const { + return config.input_offsets[bus].size(); + } + + inline size_t num_output_channels(const uint32_t bus) const { + return config.output_offsets[bus].size(); + } + /** * Get a pointer to the part of the buffer where this input audio channel is * stored in. Both the bus and the channel indices start at zero. These