Sayonara Player
VisualStyleTypes.h
1 /* VisualStyleTypes.h */
2 
3 /* Copyright (C) 2011-2020 Michael Lugmair (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 <QString>
26 #include <QHash>
27 
28 #include <vector>
29 
30 struct ColorList
31 {
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  std::vector< 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 
75  {
76  col_list.name = "";
77 
78  n_rects_level = 0;
79  n_bins_spectrum = 20;
80  rect_height_spectrum = 2;
81  rect_width_level = 3;
82  rect_height_level = 6;
83  n_fading_steps_level = 20;
84  n_fading_steps_spectrum = 20;
85  hor_spacing_level = 2;
86  hor_spacing_spectrum = 2;
87  ver_spacing_level = 2;
88  ver_spacing_spectrum = 1;
89  }
90 
91  QString toString() const
92  {
93  QString ret;
94  ret += col_list.name + "";
95  ret += ", n_bins_sp: " + QString::number(n_bins_spectrum);
96  ret += ", rect_h_sp: " + QString::number(rect_height_spectrum);
97  ret += ", fad_s_sp: " + QString::number(n_fading_steps_spectrum);
98  ret += ", rect_w_lv: " + QString::number(rect_width_level);
99  ret += ", rect_h_lv: " + QString::number(rect_height_level);
100  ret += ", fad_s_lv: " + QString::number(n_fading_steps_level);
101  ret += ", hor_s_lv: " + QString::number(hor_spacing_level);
102  ret += ", ver_s_lv: " + QString::number(ver_spacing_level);
103  ret += ", hor_s_sp: " + QString::number(hor_spacing_spectrum);
104  ret += ", ver_s_sp: " + QString::number(ver_spacing_spectrum);
105 
106  return ret;
107  }
108 
109 };
110 
111 #endif // STYLETYPES_H
QList< QColor >
RawColorStyle
Definition: VisualStyleTypes.h:55
ColorList
Definition: VisualStyleTypes.h:31
ColorStyle
Definition: VisualStyleTypes.h:37