Entropy Piano Tuner  1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
algorithmparameter.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright 2015 Haye Hinrichsen, Christoph Wick
3  *
4  * This file is part of Entropy Piano Tuner.
5  *
6  * Entropy Piano Tuner is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * Entropy Piano Tuner is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * Entropy Piano Tuner. If not, see http://www.gnu.org/licenses/.
18  *****************************************************************************/
19 
20 #ifndef ALGORITHMPARAMETER_H
21 #define ALGORITHMPARAMETER_H
22 
23 #include <string>
24 #include <vector>
25 
27 {
28 public:
29  using StringParameterList = std::vector<std::pair<std::string, std::string> >;
30 public:
31  enum Type {
35  };
36 
37 public:
38  // constructor for a double paramter
39  AlgorithmParameter(const std::string &id,
40  const std::string &label,
41  const std::string &description,
42  double defaultValue,
43  double minValue,
44  double maxValue,
45  int precision = -1);
46 
47  // constructor for a int parameter
48  AlgorithmParameter(const std::string &id,
49  const std::string &label,
50  const std::string &description,
51  int defaultValue,
52  int minValue,
53  int maxValue);
54 
55  // constructor for a list
56  AlgorithmParameter(const std::string &id,
57  const std::string &label,
58  const std::string &description,
59  const std::string &defaultValue,
60  const StringParameterList &list);
61 
63 
64  const std::string &getID() const {return mID;}
65  const std::string &getLabel() const {return mLabel;}
66  const std::string &getDescription() const {return mDescription;}
67  Type getType() const {return mParameterType;}
68 
69  double getDoubleDefaultValue() const {return mDoubleDefaultValue;}
70  double getDoubleMinValue() const {return mDoubleMinValue;}
71  double getDoubleMaxValue() const {return mDoubleMaxValue;}
72  int getDoublePrecision() const {return mDoublePrecision;}
73 
74  int getIntDefaultValue() const {return mIntDefaultValue;}
75  int getIntMinValue() const {return mIntMinValue;}
76  int getIntMaxValue() const {return mIntMaxValue;}
77 
78  const std::string &getStringDefaultValue() const {return mStringDefaultValue;}
80 
81 private:
83  const std::string mID;
84 
85  const std::string mLabel;
86  const std::string mDescription;
87 
88  const double mDoubleDefaultValue = 0;
89  const double mDoubleMinValue = 0;
90  const double mDoubleMaxValue = 0;
91  const int mDoublePrecision = 1;
92 
93  const int mIntDefaultValue = 0;
94  const int mIntMinValue = 0;
95  const int mIntMaxValue = 0;
96 
97  const std::string mStringDefaultValue;
99 };
100 
101 #endif // ALGORITHMPARAMETER_H
const std::string mLabel
int getDoublePrecision() const
const std::string mID
double getDoubleMaxValue() const
const std::string & getID() const
const std::string mStringDefaultValue
const std::string & getLabel() const
const StringParameterList mStringList
AlgorithmParameter(const std::string &id, const std::string &label, const std::string &description, double defaultValue, double minValue, double maxValue, int precision=-1)
int getIntMinValue() const
int getIntMaxValue() const
const std::string mDescription
const double mDoubleDefaultValue
const StringParameterList & getStringList() const
int getIntDefaultValue() const
double getDoubleDefaultValue() const
std::vector< std::pair< std::string, std::string > > StringParameterList
const std::string & getStringDefaultValue() const
const double mDoubleMinValue
double getDoubleMinValue() const
const std::string & getDescription() const
const double mDoubleMaxValue