Sayonara Player
EqualizerPresets.h
1 /* Equalizer_presets.h */
2 
3 /* Copyright (C) 2011 Lucio Carreras
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 
21 
22 #ifndef _EQUALIZER_PRESETS_
23 #define _EQUALIZER_PRESETS_
24 
25 
26 #include <QList>
27 #include <QString>
28 
35 {
36 
37 private:
38  QList<int> _values;
39  QString _name;
40 
41 public:
42  EQ_Setting(const QString& name=QString());
43  EQ_Setting(const EQ_Setting& s);
44  virtual ~EQ_Setting();
45 
51  bool operator==(const EQ_Setting& s) const;
52 
57  QString name() const;
58 
63  void set_name(const QString& name);
64 
69  QList<int> values() const;
70 
76  int value(int idx) const;
77 
83  void set_value(int idx, int val);
84 
91  void set_values(const QList<int> values);
92 
98  void append_value(int val);
99 
104  bool is_default() const;
105 
110  bool is_default_name() const;
111 
117 
124  static QList<int> get_default_values(const QString& name);
125 
131  static bool is_default_name(const QString& name);
132 
139  static EQ_Setting fromString(const QString& str);
140 
145  QString toString() const;
146 };
147 
148 #endif
void set_name(const QString &name)
set name of setting
bool operator==(const EQ_Setting &s) const
Compares the case insensitive string representation of two settings.
void set_value(int idx, int val)
set specific value for band
bool is_default_name() const
checks, if the preset name belongs to a default preset
QString toString() const
converts EQ_Setting to string
int value(int idx) const
get specific value for a band idx. if idx is not valid, 0 is returned
The EQ_Setting class. Container for Equalizer configurations.
Definition: EqualizerPresets.h:34
void append_value(int val)
append a value. If there are already more than 10 values, nothing happens
static QList< int > get_default_values(const QString &name)
get default values for a specific preset. If the preset does not have default values, an empty list is returned
QList< int > values() const
get database values for setting
bool is_default() const
checks, if preset is default preset
QString name() const
get name of setting
void set_values(const QList< int > values)
set all values for a specific index. If there are more than 10 values, list is stripped. If there are less, the list is filled with zeros
static EQ_Setting fromString(const QString &str)
converts a string to a EQ_Setting. If not possible a default constructed EQ_Setting is returned ...
static QList< EQ_Setting > get_defaults()
get default settings