Audacity 3.2.0
AudioContainerHelper.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 AudioContainerHelper.h
7
8 Matthieu Hodgkinson
9
10**********************************************************************/
11#pragma once
12
13#include "AudioContainer.h"
14
15#include <cstddef>
16
18{
19public:
20 template <typename T = float>
21 static std::vector<T*>
22 GetData(const AudioContainer& container, size_t offset = 0u)
23 {
24 std::vector<T*> chars(container.channelPointers.size());
25 for (auto i = 0u; i < container.channelPointers.size(); ++i)
26 chars[i] = reinterpret_cast<T*>(container.channelPointers[i] + offset);
27 return chars;
28 }
29};
static std::vector< T * > GetData(const AudioContainer &container, size_t offset=0u)
std::vector< float * > channelPointers