Audacity
3.2.0
libraries
lib-dynamic-range-processor
DynamicRangeProcessorHistory.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
DynamicRangeProcessorHistory.h
7
8
Matthieu Hodgkinson
9
10
**********************************************************************/
11
#pragma once
12
13
#include "
DynamicRangeProcessorTypes.h
"
14
#include <memory>
15
#include <optional>
16
#include <vector>
17
18
class
DYNAMIC_RANGE_PROCESSOR_API
DynamicRangeProcessorHistory
final
19
{
20
public
:
21
DynamicRangeProcessorHistory
(
double
sampleRate
);
22
23
struct
Packet
24
{
25
float
time = 0.f;
26
float
target = 0.f;
27
float
follower = 0.f;
28
float
input = 0.f;
29
float
output = 0.f;
30
};
31
32
static
constexpr
auto
maxTimeSeconds = 2.5f;
33
34
using
Segment
= std::vector<Packet>;
35
36
void
Push(
const
std::vector<DynamicRangeProcessorOutputPacket>& packets);
37
void
BeginNewSegment();
38
const
std::vector<Segment>& GetSegments()
const
;
39
bool
IsEmpty()
const
;
40
41
private
:
42
float
GetPacketTime(
const
DynamicRangeProcessorOutputPacket
& packet)
const
;
43
44
const
double
mSampleRate
;
45
bool
mBeginNewSegment =
true
;
46
std::vector<Segment>
mSegments
;
47
std::optional<long long>
mFirstPacketFirstSampleIndex
;
48
std::optional<long long>
mExpectedNextPacketFirstSampleIndex
;
49
};
50
51
class
DynamicRangeProcessorHistory
;
DynamicRangeProcessorTypes.h
DynamicRangeProcessorHistory
Definition:
DynamicRangeProcessorHistory.h:19
DynamicRangeProcessorHistory::mSegments
std::vector< Segment > mSegments
Definition:
DynamicRangeProcessorHistory.h:46
DynamicRangeProcessorHistory::mSampleRate
const double mSampleRate
Definition:
DynamicRangeProcessorHistory.h:44
DynamicRangeProcessorHistory::mFirstPacketFirstSampleIndex
std::optional< long long > mFirstPacketFirstSampleIndex
Definition:
DynamicRangeProcessorHistory.h:47
DynamicRangeProcessorHistory::Segment
std::vector< Packet > Segment
Definition:
DynamicRangeProcessorHistory.h:34
DynamicRangeProcessorHistory::mExpectedNextPacketFirstSampleIndex
std::optional< long long > mExpectedNextPacketFirstSampleIndex
Definition:
DynamicRangeProcessorHistory.h:48
anonymous_namespace{ClipSegmentTest.cpp}::sampleRate
constexpr auto sampleRate
Definition:
ClipSegmentTest.cpp:20
DynamicRangeProcessorHistory::Packet
Definition:
DynamicRangeProcessorHistory.h:24
DynamicRangeProcessorOutputPacket
Definition:
DynamicRangeProcessorTypes.h:20
Generated by
1.9.3