Sayonara Player
Equalizer.h
1 /* Equalizer.h */
2 /*
3  * Copyright (C) 2011-2020 Michael Lugmair
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #ifndef SAYONARA_PLAYER_EQUALIZER_H
21 #define SAYONARA_PLAYER_EQUALIZER_H
22 
23 #include "Utils/Pimpl.h"
24 
25 #include <QObject>
26 #include <QList>
27 
28 class SoundModifier;
29 class EqualizerSetting;
30 class QString;
31 class Equalizer : public QObject
32 {
33  Q_OBJECT
34  PIMPL(Equalizer)
35 
36  signals:
37  void sigValueChanged(int band, int value);
38 
39  public:
40  enum RenameError
41  {
42  NoError=0,
43  DbError,
44  EmptyName,
45  NameAlreadyKnown,
46  InvalidIndex
47  };
48 
49  Equalizer(SoundModifier* soundModifier, QObject* parent=nullptr);
50  ~Equalizer() noexcept;
51 
52  const EqualizerSetting& equalizerSetting(int index) const;
53  EqualizerSetting& equalizerSetting(int index);
54  const EqualizerSetting& currentSetting() const;
55 
56  QStringList names() const;
57  QStringList defaultNames() const;
58 
59  void changeValue(int index, int band, int value);
60  void resetPreset(int presetIndex);
61  RenameError renamePreset(int index, const QString& newName);
62  bool deletePreset(int presetIndex);
63  RenameError saveCurrentEqualizerAs(const QString& name);
64 
65  int currentIndex() const;
66  void setCurrentIndex(int index);
67 
68  int count() const;
69 
70  void setGaussEnabled(bool enabled);
71  bool isGaussEnabled() const;
72 
73  void startValueChange();
74  void endValueChange();
75 };
76 
77 #endif //SAYONARA_PLAYER_EQUALIZER_H
Equalizer
Definition: Equalizer.h:32
SoundModifier
Definition: SoundModifier.h:24
EqualizerSetting
The EQ_Setting class. Container for Equalizer configurations.
Definition: EqualizerSetting.h:35