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 <QList>
26 #include <QString>
27 
33 class EQ_Setting final
34 {
35  PIMPL(EQ_Setting)
36 
37 public:
38  EQ_Setting(const QString& name=QString());
39  EQ_Setting(const EQ_Setting& other);
40  ~EQ_Setting();
41 
42  EQ_Setting& operator=(const EQ_Setting& s);
43 
49  bool operator==(const EQ_Setting& s) const;
50 
55  QString name() const;
56 
61  void set_name(const QString& name);
62 
67  QList<int> values() const;
68 
74  int value(int idx) const;
75 
81  void set_value(int idx, int val);
82 
89  void set_values(const QList<int> values);
90 
96 // void append_value(int val);
97 
102  bool is_default() const;
103 
108  bool is_default_name() const;
109 
115 
122  static QList<int> get_default_values(const QString& name);
123 
129  static bool is_default_name(const QString& name);
130 
137  static EQ_Setting fromString(const QString& str);
138 
143  QString toString() const;
144 };
145 
146 #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:33
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