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 #ifndef _EQUALIZER_PRESETS_
22 #define _EQUALIZER_PRESETS_
23 
24 #include "Utils/Pimpl.h"
25 #include <QString>
26 
32 class EQ_Setting final
33 {
34  PIMPL(EQ_Setting)
35 
36 public:
37  EQ_Setting(const QString& name=QString());
38  EQ_Setting(const EQ_Setting& other);
39  ~EQ_Setting();
40 
41  EQ_Setting& operator=(const EQ_Setting& s);
42 
48  bool operator==(const EQ_Setting& s) const;
49 
54  QString name() const;
55 
60  void set_name(const QString& name);
61 
66  QList<int> values() const;
67 
73  int value(int idx) const;
74 
80  void set_value(int idx, int val);
81 
88  void set_values(const QList<int> values);
89 
95 // void append_value(int val);
96 
101  bool is_default() const;
102 
107  bool is_default_name() const;
108 
114 
121  static QList<int> get_default_values(const QString& name);
122 
128  static bool is_default_name(const QString& name);
129 
136  static EQ_Setting fromString(const QString& str);
137 
142  QString toString() const;
143 };
144 
145 #endif
void set_name(const QString &name)
set name of setting
void set_value(int idx, int val)
set specific value for band
The EQ_Setting class. Container for Equalizer configurations.
Definition: EqualizerPresets.h:32
int value(int idx) const
get specific value for a band idx. if idx is not valid, 0 is returned
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
QString name() const
get name of setting
bool operator==(const EQ_Setting &s) const
Compares the case insensitive string representation of two settings.
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
QString toString() const
converts EQ_Setting to string
static EQ_Setting fromString(const QString &str)
converts a string to a EQ_Setting. If not possible a default constructed EQ_Setting is returned ...
bool is_default() const
append a value. If there are already more than 10 values, nothing happens
QList< int > values() const
get database values for setting
static QList< EQ_Setting > get_defaults()
get default settings
bool is_default_name() const
checks, if the preset name belongs to a default preset
Definition: org_mpris_media_player2_adaptor.h:20