-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyzer.h
79 lines (52 loc) · 1.55 KB
/
analyzer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
This file is part of Waver
Copyright (C) 2021 Peter Papp
Please visit https://launchpad.net/waver for details
*/
#ifndef ANALYZER_H
#define ANALYZER_H
#include <QByteArray>
#include <QDateTime>
#include <QFile>
#include <QObject>
#include <QtGlobal>
#include <QTimeZone>
#include <QVariant>
#include <QVariantHash>
#include <coefficientlist.h>
#include <iirfilter.h>
#include <iirfilterchain.h>
#include <replaygaincoefficients.h>
#include "globals.h"
#include "replaygaincalculator.h"
#ifdef QT_DEBUG
#include <QDebug>
#endif
class Analyzer : public QObject
{
Q_OBJECT
public:
explicit Analyzer(QAudioFormat format, QObject *parent = nullptr);
~Analyzer();
void setBufferQueue(BufferQueue *bufferQueue, QMutex *bufferQueueMutex);
private:
static const int REPLAY_GAIN_UPDATE_INTERVAL_MICROSECONDS = 4 * 1000 * 1000;
BufferQueue *bufferQueue;
QMutex *bufferQueueMutex;
QAudioFormat format;
bool decoderFinished;
qint64 resultLastCalculated;
IIRFilter::SampleTypes sampleType;
IIRFilterChain *replayGainFilter;
ReplayGainCalculator *replayGainCalculator;
public slots:
void run();
void bufferAvailable();
void decoderDone();
void resetReplayGain();
void silencesRequested(bool addFinalSilence);
signals:
void replayGain(double replayGain);
void silences(ReplayGainCalculator::Silences silences);
};
#endif // ANALYZER_H