1 /*************************************************************************** 2 ** ** 3 ** Polyphone, a soundfont editor ** 4 ** Copyright (C) 2013-2020 Davy Triponney ** 5 ** ** 6 ** This program is free software: you can redistribute it and/or modify ** 7 ** it under the terms of the GNU General Public License as published by ** 8 ** the Free Software Foundation, either version 3 of the License, or ** 9 ** (at your option) any later version. ** 10 ** ** 11 ** This program is distributed in the hope that it will be useful, ** 12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 14 ** GNU General Public License for more details. ** 15 ** ** 16 ** You should have received a copy of the GNU General Public License ** 17 ** along with this program. If not, see http://www.gnu.org/licenses/. ** 18 ** ** 19 **************************************************************************** 20 ** Author: Davy Triponney ** 21 ** Website/Contact: https://www.polyphone-soundfonts.com ** 22 ** Date: 01.01.2013 ** 23 ***************************************************************************/ 24 25 #ifndef TOOLMIXTURECREATION_GUI_H 26 #define TOOLMIXTURECREATION_GUI_H 27 28 #include "abstracttoolgui.h" 29 #include "toolmixturecreation_parameters.h" 30 31 namespace Ui { 32 class ToolMixtureCreation_gui; 33 } 34 35 class ToolMixtureCreation_gui : public AbstractToolGui 36 { 37 Q_OBJECT 38 39 public: 40 explicit ToolMixtureCreation_gui(QWidget *parent = nullptr); 41 ~ToolMixtureCreation_gui(); 42 43 /// Update the interface with the parameters 44 void updateInterface(AbstractToolParameters * parameters, IdList ids) override; 45 46 /// Save the parameters based on the interface 47 void saveParameters(AbstractToolParameters * parameters) override; 48 49 private slots: 50 void on_pushAddDiv_pressed(); 51 void on_pushRemoveDiv_pressed(); 52 void on_spinDivStart_valueChanged(int arg1); 53 void on_spinDivEnd_valueChanged(int arg1); 54 void on_pushAddRank_clicked(); 55 void on_pushRemoveRank_clicked(); 56 void on_comboType1_currentIndexChanged(int index); 57 void on_comboType2_currentIndexChanged(int index); 58 void on_listDivisions_itemSelectionChanged(); 59 void on_listRangs_itemSelectionChanged(); 60 void on_pushCancel_clicked(); 61 void on_pushOk_clicked(); 62 63 private: 64 QList<QList<int> > getStoredRanks(); 65 void storeRanks(QList<QList<int> > val); 66 void dispDiv(); 67 void dispRang(int numDiv = -1); 68 static QString getText(int overtoneType, int octave); 69 int getNumDiv(); 70 int getNumRang(); 71 void dispType2(int index); 72 73 Ui::ToolMixtureCreation_gui *ui; 74 QList<DivisionInfo> _divisions; 75 }; 76 77 #endif // TOOLMIXTURECREATION_GUI_H 78