Qmmp
replaygain_p.h
1 /***************************************************************************
2  * Copyright (C) 2009-2022 by Ilya Kotov *
3  * forkotov02@ya.ru *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #ifndef REPLAYGAIN_H
22 #define REPLAYGAIN_H
23 
24 #include <QtGlobal>
25 #include <QMap>
26 #include "effect.h"
27 #include "qmmpsettings.h"
28 #include "qmmp.h"
29 
33 class ReplayGain : public Effect
34 {
35 public:
36  ReplayGain();
37  ~ReplayGain();
38 
39  void updateSettings(QmmpSettings::ReplayGainMode mode, double preamp,
40  double default_gain, bool clip);
41  void setReplayGainInfo(const QMap<Qmmp::ReplayGainKey, double> &info);
42  void applyEffect(Buffer *b) override;
43 
44 private:
45  void updateScale();
46  QMap<Qmmp::ReplayGainKey, double> m_info;
48  double m_scale = 1.0;
49  double m_preamp = 0.0;
50  double m_default_gain = 0.0;
51  bool m_prevent_clipping = false;
52  bool m_disabled = true;
53  bool m_update = false;
54 };
55 
56 #endif // REPLAYGAIN_H
Audio buffer class.
Definition: buffer.h:21
The Effect class provides the base interface class of audio effects.
Definition: effect.h:36
virtual void applyEffect(Buffer *b)=0
ReplayGainMode
Definition: qmmpsettings.h:43
@ REPLAYGAIN_DISABLED
Definition: qmmpsettings.h:46