Sayonara Player
Loading...
Searching...
No Matches
VisualStyleTypes.h
1/* VisualStyleTypes.h */
2
3/* Copyright (C) 2011-2024 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
31{
32 QString name;
33 QList<QColor> colors;
34};
35
37{
38 using ColorInfo = std::vector<QHash<int, QColor>>;
39 QString name;
40
41 // list size is number or rectangles
42 // int is the step index
43 ColorInfo style;
44 ColorList colorList;
45
46 int rectHeight {-1};
47 int rectWidth {-1};
48
49 int rectCount {-1};
50 int fadingSteps {-1};
51 int horSpacing {-1};
52 int verSpacing {-1};
53
54 [[nodiscard]] bool isValid() const;
55};
56
58{
59 ColorList colorList;
60
61 int spectrumBins {20};
62
63 int rectHeightSpectrum {2};
64 int rectWidthLevel {3};
65 int rectHeightLevel {6};
66 int levelRects {0};
67
68 int fadingStepsSpectrum {20};
69 int fadingStepsLevel {20};
70
71 int horSpacingLevel {2};
72 int verSpacingLevel {2};
73
74 int horSpacingSpectrum {2};
75 int verSpacingSpectrum {1};
76
77 [[nodiscard]] QString toString() const;
78};
79
80namespace Util
81{
82 [[nodiscard]] RawColorStyle
83 convertToRawColorStyle(const ColorStyle& levelStyle, const ColorStyle& spectrumStyle);
84
85 [[nodiscard]] ColorStyle createSpectrumStyle(const RawColorStyle& rawColorStyle, int widgetHeight);
86 [[nodiscard]] ColorStyle createLevelStyle(const RawColorStyle& rawColorStyle, int widgetWidth);
87
88 [[nodiscard]] RawColorStyle createRgbStyle();
89 [[nodiscard]] RawColorStyle createBwStyle();
90}
91
92#endif // STYLETYPES_H
Definition EngineUtils.h:33
Helper functions.
Definition MetaTypeRegistry.h:25
Definition VisualStyleTypes.h:31
Definition VisualStyleTypes.h:37
Definition VisualStyleTypes.h:58