Sayonara Player
StyleTypes.h
1 /* StyleTypes.h */
2 
3 /* Copyright 2011-2017 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 STYLETYPES_H
22 #define STYLETYPES_H
23 
24 #include <QColor>
25 #include <QVector>
26 #include <QString>
27 #include <QHash>
28 
29 struct ColorList {
30  QString name;
31  QList<QColor> colors;
32 };
33 
34 struct ColorStyle {
35  QString name;
36 
37  // list size is number or rectangles
38  // int is the step index
39  QVector< QHash<int, QColor> > style;
40  ColorList col_list;
41 
42  int rect_height;
43  int rect_width;
44 
45  int n_rects;
46  int n_fading_steps;
47  int hor_spacing;
48  int ver_spacing;
49 };
50 
52  ColorList col_list;
53 
54  int n_bins_spectrum;
55 
56  int rect_height_spectrum;
57  int rect_width_level;
58  int rect_height_level;
59  int n_rects_level;
60 
61  int n_fading_steps_spectrum;
62  int n_fading_steps_level;
63 
64  int hor_spacing_level;
65  int ver_spacing_level;
66 
67  int hor_spacing_spectrum;
68  int ver_spacing_spectrum;
69 
71 {
72  col_list.name = "";
73 
74  n_rects_level = 0;
75  n_bins_spectrum = 20;
76  rect_height_spectrum = 2;
77  rect_width_level = 3;
78  rect_height_level = 6;
79  n_fading_steps_level = 20;
80  n_fading_steps_spectrum = 20;
81  hor_spacing_level = 2;
82  hor_spacing_spectrum = 2;
83  ver_spacing_level = 2;
84  ver_spacing_spectrum = 1;
85  }
86 
87  QString toString() const
88 {
89  QString ret;
90  ret += col_list.name + "";
91  ret += ", n_bins_sp: " + QString::number(n_bins_spectrum);
92  ret += ", rect_h_sp: " + QString::number(rect_height_spectrum);
93  ret += ", fad_s_sp: " + QString::number(n_fading_steps_spectrum);
94  ret += ", rect_w_lv: " + QString::number(rect_width_level);
95  ret += ", rect_h_lv: " + QString::number(rect_height_level);
96  ret += ", fad_s_lv: " + QString::number(n_fading_steps_level);
97  ret += ", hor_s_lv: " + QString::number(hor_spacing_level);
98  ret += ", ver_s_lv: " + QString::number(ver_spacing_level);
99  ret += ", hor_s_sp: " + QString::number(hor_spacing_spectrum);
100  ret += ", ver_s_sp: " + QString::number(ver_spacing_spectrum);
101 
102  return ret;
103  }
104 
105 };
106 
107 #endif // STYLETYPES_H
Definition: StyleTypes.h:51
Definition: StyleTypes.h:34
Definition: StyleTypes.h:29