1 /* 2 MIDI Virtual Piano Keyboard 3 Copyright (C) 2008-2021, Pedro Lopez-Cabanillas <plcl@users.sf.net> 4 5 This library 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 library 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 PREFERENCES_H 20 #define PREFERENCES_H 21 22 #include "ui_preferences.h" 23 #include "instrument.h" 24 #include "keyboardmap.h" 25 #include <QDialog> 26 27 class ColorDialog; 28 29 class Preferences : public QDialog 30 { 31 Q_OBJECT 32 33 public: 34 Preferences(QWidget *parent = nullptr); 35 void setInstrumentsFileName( const QString fileName ); 36 void setInstrumentName( const QString name ); 37 void apply(); 38 void setRawKeyMapFileName( const QString fileName ); 39 void setKeyMapFileName( const QString fileName ); 40 void retranslateUi(); 41 void setNoteNames(const QStringList& noteNames); 42 void populateStyles(); 43 44 public slots: 45 void slotOpenInstrumentFile(); 46 void slotSelectColor(); 47 void slotOpenKeymapFile(); 48 void slotOpenRawKeymapFile(); 49 void slotSelectFont(); 50 void slotRestoreDefaults(); 51 void accept() override; 52 53 protected: 54 void showEvent ( QShowEvent *event ) override; 55 56 private: 57 QString m_mapFile; 58 QString m_rawMapFile; 59 QString m_insFile; 60 QFont m_font; 61 Ui::PreferencesClass ui; 62 }; 63 64 #endif // PREFERENCES_H 65