Audacity
3.2.0
libraries
lib-stretching-sequence
tests
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
17
class
AudioContainerHelper
18
{
19
public
:
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
};
AudioContainer.h
AudioContainerHelper
Definition:
AudioContainerHelper.h:18
AudioContainerHelper::GetData
static std::vector< T * > GetData(const AudioContainer &container, size_t offset=0u)
Definition:
AudioContainerHelper.h:22
AudioContainer
Definition:
AudioContainer.h:16
AudioContainer::channelPointers
std::vector< float * > channelPointers
Definition:
AudioContainer.h:20
Generated by
1.9.3