Ardour
9.0-pre0-582-g084a23a80d
peak_reader.h
Go to the documentation of this file.
1
#ifndef AUDIOGRAPHER_PEAK_READER_H
2
#define AUDIOGRAPHER_PEAK_READER_H
3
4
#include "
audiographer/visibility.h
"
5
#include "
audiographer/sink.h
"
6
#include "
audiographer/routines.h
"
7
#include "
audiographer/utils/listed_source.h
"
8
9
namespace
AudioGrapher
10
{
11
13
class
/*LIBAUDIOGRAPHER_API*/
PeakReader
:
public
ListedSource
<float>,
public
Sink
<float>
14
{
15
public
:
17
PeakReader
() :
peak
(0.0) {}
18
20
float
get_peak
() {
return
peak
; }
21
23
void
reset
() {
peak
= 0.0; }
24
26
void
process
(
ProcessContext<float>
const
& c)
27
{
28
peak
=
Routines::compute_peak
(c.
data
(), c.
samples
(),
peak
);
29
ListedSource<float>::output
(c);
30
}
31
32
using
Sink<float>::process
;
33
34
private
:
35
float
peak
;
36
};
37
38
39
}
// namespace
40
41
#endif
// AUDIOGRAPHER_PEAK_READER_H
visibility.h
AudioGrapher::ListedSource
An generic Source that uses a std::list for managing outputs.
Definition:
listed_source.h:17
AudioGrapher::ListedSource::output
void output(ProcessContext< T > const &c)
Helper for derived classes.
Definition:
listed_source.h:28
AudioGrapher::PeakReader
A class that reads the maximum value from a stream.
Definition:
peak_reader.h:14
AudioGrapher::PeakReader::reset
void reset()
Resets the peak to 0 RT safe.
Definition:
peak_reader.h:23
AudioGrapher::PeakReader::PeakReader
PeakReader()
Constructor RT safe.
Definition:
peak_reader.h:17
AudioGrapher::PeakReader::get_peak
float get_peak()
Returns the highest absolute of the values found so far. RT safe.
Definition:
peak_reader.h:20
AudioGrapher::PeakReader::process
void process(ProcessContext< float > const &c)
Finds peaks from the data RT safe.
Definition:
peak_reader.h:26
AudioGrapher::PeakReader::peak
float peak
Definition:
peak_reader.h:35
AudioGrapher::ProcessContext
Definition:
process_context.h:25
AudioGrapher::ProcessContext::data
T const * data() const
data points to the array of data to process
Definition:
process_context.h:84
AudioGrapher::ProcessContext::samples
samplecnt_t const & samples() const
samples tells how many samples the array pointed by data contains
Definition:
process_context.h:88
AudioGrapher::Routines::compute_peak
static float compute_peak(float const *data, uint_type samples, float current_peak)
Definition:
routines.h:32
AudioGrapher::Sink
Definition:
sink.h:17
listed_source.h
AudioGrapher
Definition:
analysis_graph.h:33
routines.h
sink.h
libs
audiographer
audiographer
general
peak_reader.h
Generated on Thu Dec 26 2024 05:38:57 for Ardour by
1.9.1