19#include <QGuiApplication>
84 m_colors.reserve(maxcolors);
85 m_names.reserve(maxcolors);
86 for(
int i=0; i<maxcolors; ++i) {
87 m_colors.insert(i, QColor());
88 m_names.insert(i, QString());
133 setColor(0, QString(), qApp->palette().highlight().color());
143 setColor(0, tr(
"N"), qApp->palette().highlight().color());
144 setColor(1, tr(
"#"), QColor(
"lawngreen"));
154 setColor(0, tr(
"1"), QColor(
"red"));
155 setColor(1, tr(
"2"), QColor(
"lime"));
156 setColor(2, tr(
"3"), QColor(
"blue"));
157 setColor(3, tr(
"4"), QColor(
"gold"));
158 setColor(4, tr(
"5"), QColor(
"maroon"));
159 setColor(5, tr(
"6"), QColor(
"green"));
160 setColor(6, tr(
"7"), QColor(
"navy"));
161 setColor(7, tr(
"8"), QColor(
"darkorange"));
162 setColor(8, tr(
"9"), QColor(
"purple"));
163 setColor(9, tr(
"10"), qApp->palette().highlight().color());
164 setColor(10, tr(
"11"), QColor(
"teal"));
165 setColor(11, tr(
"12"), QColor(
"chocolate"));
166 setColor(12, tr(
"13"), QColor(
"fuchsia"));
167 setColor(13, tr(
"14"), QColor(
"olivedrab"));
168 setColor(14, tr(
"15"), QColor(
"aqua"));
169 setColor(15, tr(
"16"), QColor(
"greenyellow"));
194 setColor(0, tr(
"C"), QColor::fromRgb(255,0,0));
195 setColor(1, tr(
"C#"), QColor::fromRgb(255,127,0));
196 setColor(2, tr(
"D"), QColor::fromRgb(255,255,0));
197 setColor(3, tr(
"D#"), QColor::fromRgb(127,255,0));
198 setColor(4, tr(
"E"), QColor::fromRgb(0,255,0));
199 setColor(5, tr(
"F"), QColor::fromRgb(0,255,127));
200 setColor(6, tr(
"F#"), QColor::fromRgb(0,255,255));
201 setColor(7, tr(
"G"), QColor::fromRgb(0,127,255));
202 setColor(8, tr(
"G#"), QColor::fromRgb(0,0,255));
203 setColor(9, tr(
"A"), QColor::fromRgb(127,0,255));
204 setColor(10, tr(
"A#"), QColor::fromRgb(255,0,255));
205 setColor(11, tr(
"B"), QColor::fromRgb(255,0,127));
215 setColor(0, tr(
"N"), QColor(
"white"));
216 setColor(1, tr(
"#"), QColor(
"black"));
226 setColor(0, tr(
"N"), QColor(
"black"));
227 setColor(1, tr(
"#"), QColor(
"white"));
228 setColor(2, tr(
"N*"), QColor(
"white"));
229 setColor(3, tr(
"#*"), QColor(
"white"));
239 switch(m_paletteId) {
242 setPaletteText(tr(
"A single color to highlight all note events"));
247 setPaletteText(tr(
"One color to highlight natural notes and a different one for accidentals"));
252 setPaletteText(tr(
"A different color to highlight each MIDI channel. Enable Omni mode in the MIDI IN connection"));
257 setPaletteText(tr(
"One color for each note in the chromatic scale"));
262 setPaletteText(tr(
"One color for natural notes and another for accidentals"));
272 setPaletteText(tr(
"One color for each note in the chromatic scale"));
424 if (n < m_colors.size()) {
438 if (n < m_colors.size())
450 if (n < m_names.size())
462 if (i < m_colors.size())
475 if (i < m_names.size())
487 return m_colors.size();
497 return m_paletteName;
507 if (m_paletteName != name) {
508 m_paletteName = name;
519 return m_paletteText;
529 m_paletteText = help;
540 for(
int i=0; i<m_colors.size(); ++i) {
541 settings->setArrayIndex(i);
542 settings->setValue(
"color", m_colors[i]);
544 settings->endArray();
555 int size = settings->beginReadArray(
QSTR_PALETTEPREFIX + QString::number(m_paletteId));
556 if (size > m_colors.size())
557 size = m_colors.size();
558 for(
int i=0; i<size; ++i) {
559 settings->setArrayIndex(i);
560 QColor c = settings->value(
"color", QColor()).value<QColor>();
563 settings->endArray();
574 return (m_paletteId == other.m_paletteId) &&
575 (m_colors == other.m_colors);
586 return !(*
this == other);
597 stream << palette.m_paletteId;
598 stream << palette.m_colors;
599 stream << palette.m_names;
600 stream << palette.m_paletteName;
601 stream << palette.m_paletteText;
613 stream >> palette.m_paletteId;
614 stream >> palette.m_colors;
615 stream >> palette.m_names;
616 stream >> palette.m_paletteName;
617 stream >> palette.m_paletteText;
Piano Palette declarations.
SettingsFactory class declaration.