1 /*
2     MIDI Virtual Piano Keyboard
3     Copyright (C) 2008-2021, Pedro Lopez-Cabanillas <plcl@users.sf.net>
4 
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 3 of the License, or
8     (at your option) any later version.
9 
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14 
15     You should have received a copy of the GNU General Public License along
16     with this program; If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef COLORDIALOG_H
20 #define COLORDIALOG_H
21 
22 #include <QDialog>
23 #include <QAbstractButton>
24 #include <drumstick/pianopalette.h>
25 
26 namespace Ui {
27     class ColorDialog;
28 }
29 
30 using namespace drumstick::widgets;
31 
32 class ColorDialog : public QDialog
33 {
34     Q_OBJECT
35 public:
36     explicit ColorDialog(bool hiliteOnly, QWidget *parent = nullptr);
37     ~ColorDialog();
38     void retranslateUi();
39     int selectedPalette() const;
40 
41 public slots:
42     void loadPalette(int i);
43     void accept() override;
44 
45 private slots:
46     void onAnyColorWidgetClicked(int i);
47     void resetCurrentPalette();
48 
49 private:
50     void refreshPalette();
51 
52     Ui::ColorDialog* m_ui;
53     bool m_hilite;
54     PianoPalette m_workingPalette;
55 };
56 
57 #endif // COLORDIALOG_H
58