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 TOOLGLOBALSETTINGS_PARAMETERS_H 26 #define TOOLGLOBALSETTINGS_PARAMETERS_H 27 28 #include "abstracttoolparameters.h" 29 #include "contextmanager.h" 30 #include <QVector> 31 32 class ToolGlobalSettings_parameters: public AbstractToolParameters 33 { 34 public: 35 /// Load the configuration from the ini file 36 void loadConfiguration() override; 37 38 /// Save the configuration in the ini file 39 void saveConfiguration() override; 40 getInstPattern()41 int getInstPattern() { return _instPattern; } setInstPattern(int instPattern)42 void setInstPattern(int instPattern) { _instPattern = instPattern; } 43 getPrstPattern()44 int getPrstPattern() { return _prstPattern; } setPrstPattern(int prstPattern)45 void setPrstPattern(int prstPattern) { _prstPattern = prstPattern; } 46 getInstParam()47 double getInstParam() { return _instParam; } setInstParam(double instParam)48 void setInstParam(double instParam) { _instParam = instParam; } 49 getPrstParam()50 double getPrstParam() { return _prstParam; } setPrstParam(double prstParam)51 void setPrstParam(double prstParam) { _prstParam = prstParam; } 52 getInstMin()53 double getInstMin() { return qMin(_instMin, _instMax); } setInstMin(double instMin)54 void setInstMin(double instMin) { _instMin = instMin; } 55 getPrstMin()56 double getPrstMin() { return qMin(_prstMin, _prstMax); } setPrstMin(double prstMin)57 void setPrstMin(double prstMin) { _prstMin = prstMin; } 58 getInstMax()59 double getInstMax() { return qMax(_instMin, _instMax); } setInstMax(double instMax)60 void setInstMax(double instMax) { _instMax = instMax; } 61 getPrstMax()62 double getPrstMax() { return qMax(_prstMin, _prstMax); } setPrstMax(double prstMax)63 void setPrstMax(double prstMax) { _prstMax = prstMax; } 64 getInstMinX()65 double getInstMinX() { return _instMinX; } setInstMinX(double instMinX)66 void setInstMinX(double instMinX) { _instMinX = instMinX; } 67 getPrstMinX()68 double getPrstMinX() { return _prstMinX; } setPrstMinX(double prstMinX)69 void setPrstMinX(double prstMinX) { _prstMinX = prstMinX; } 70 getInstMaxX()71 double getInstMaxX() { return _instMaxX; } setInstMaxX(double instMaxX)72 void setInstMaxX(double instMaxX) { _instMaxX = instMaxX; } 73 getPrstMaxX()74 double getPrstMaxX() { return _prstMaxX; } setPrstMaxX(double prstMaxX)75 void setPrstMaxX(double prstMaxX) { _prstMaxX = prstMaxX; } 76 getInstValues()77 QVector<double> getInstValues() { return _instValues; } setInstValues(QVector<double> instValues)78 void setInstValues(QVector<double> instValues) { _instValues = instValues; } 79 getPrstValues()80 QVector<double> getPrstValues() { return _prstValues; } setPrstValues(QVector<double> prstValues)81 void setPrstValues(QVector<double> prstValues) { _prstValues = prstValues; } 82 getInstModifType()83 int getInstModifType() { return _instModifType; } setInstModifType(int instModifType)84 void setInstModifType(int instModifType) { _instModifType = instModifType; } 85 getPrstModifType()86 int getPrstModifType() { return _prstModifType; } setPrstModifType(int prstModifType)87 void setPrstModifType(int prstModifType) { _prstModifType = prstModifType; } 88 getInstAttribute()89 int getInstAttribute() { return _instAttribute; } setInstAttribute(int instAttribute)90 void setInstAttribute(int instAttribute) { _instAttribute = instAttribute; } 91 getPrstAttribute()92 int getPrstAttribute() { return _prstAttribute; } setPrstAttribute(int prstAttribute)93 void setPrstAttribute(int prstAttribute) { _prstAttribute = prstAttribute; } 94 getInstMinVel()95 int getInstMinVel() { return qMin(_instMinVel, _instMaxVel); } setInstMinVel(int instMinVel)96 void setInstMinVel(int instMinVel) { _instMinVel = instMinVel; } 97 getPrstMinVel()98 int getPrstMinVel() { return qMin(_prstMinVel, _prstMaxVel); } setPrstMinVel(int prstMinVel)99 void setPrstMinVel(int prstMinVel) { _prstMinVel = prstMinVel; } 100 getInstMaxVel()101 int getInstMaxVel() { return qMax(_instMinVel, _instMaxVel); } setInstMaxVel(int instMaxVel)102 void setInstMaxVel(int instMaxVel) { _instMaxVel = instMaxVel; } 103 getPrstMaxVel()104 int getPrstMaxVel() { return qMax(_prstMinVel, _prstMaxVel); } setPrstMaxVel(int prstMaxVel)105 void setPrstMaxVel(int prstMaxVel) { _prstMaxVel = prstMaxVel; } 106 107 private: 108 static QVector<double> getStoredValues(ConfManager::ToolType toolType); 109 static void storeValues(QVector<double> values, ConfManager::ToolType toolType); 110 111 int _instPattern, _prstPattern; 112 double _instParam, _prstParam; 113 double _instMin, _prstMin; 114 double _instMax, _prstMax; 115 double _instMinX, _prstMinX; 116 double _instMaxX, _prstMaxX; 117 118 QVector<double> _instValues, _prstValues; 119 120 int _instModifType, _prstModifType; 121 int _instAttribute, _prstAttribute; 122 int _instMinVel, _prstMinVel; 123 int _instMaxVel, _prstMaxVel; 124 }; 125 126 #endif // TOOLGLOBALSETTINGS_PARAMETERS_H 127