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