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
settingsforqt.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 SETTINGSFORQT_H
21 #define SETTINGSFORQT_H
22 
23 #include <QSettings>
24 #include <QString>
25 #include <vector>
26 #include "../core/settings.h"
27 
32 class SettingsForQt : public Settings
33 {
34 public:
35  // non globally stored settings ids
36  static const QString KEY_CURRENT_FILE_DIALOG_PATH;
37 public:
42  SettingsForQt();
43 
48 
49 
55  static SettingsForQt &getSingleton();
56 
61  void load();
62 
68  qlonglong getApplicationRuns() const;
69 
76 
77  virtual void setLanguageId(const std::string &s) override final;
78  virtual std::string getUserLanguageId() const override final;
79 
87  bool doNotShowAgainMessageBox(int id) const;
88 
96  void setDoNotShowAgainMessageBox(int id, bool doNotShowAgain);
97 
105 
112 
119  void setLastVisitedOptionsPage(int id);
120 
126  const QString &getInputDeviceName() const {return mInputDeviceName;}
127 
134  void setInputDeviceName(const QString &s);
135 
142 
149  void setInputDeviceSamplingRate(int rate);
150 
156  const QString &getOuputDeviceName() const {return mOutputDeviceName;}
157 
164  void setOutputDeviceName(const QString &s);
165 
172 
179  void setOutputDeviceSamplingRate(int rate);
180 
181  virtual void setLastUsedAlgorithm(const std::string &name) override final;
182  virtual void setSoundGeneratorMode(SoundGenerator::SoundGeneratorMode mode) override final;
183  virtual void setSoundGeneratorVolumeDynamic(bool dynamic) override final;
184  virtual void setStroboscopeMode(bool enable) override final;
185  virtual void setDisableAutomaticKeySelection(bool disable) override final;
186 
187 private:
193  qlonglong mApplicationRuns;
194 
196  std::vector<int> mDoNotShowAgainMessageBoxes;
197 
198 
201 
202  // Audio settings (devices, samling rates)
203 
206 
209 
212 
215 
216 private:
218  QSettings mSettings;
219 };
220 
221 #endif // SETTINGSFORQT_H
const QString & getOuputDeviceName() const
Getter function for mOutputDeviceName.
int mOutputDeviceSamplingRate
output device sampling rate
QString mInputDeviceName
input device name
static const QString KEY_CURRENT_FILE_DIALOG_PATH
Definition: settingsforqt.h:36
std::vector< int > mDoNotShowAgainMessageBoxes
store the ids of the message boxes that wont show again
void setDoNotShowAgainMessageBox(int id, bool doNotShowAgain)
Sets a AutoClosingMessageBox state whether to show again.
SoundGeneratorMode
Mode for sound generation.
QString mOutputDeviceName
output device name
int getInputDeviceSamplingRate() const
Getter function for mInputDeviceSamplingRate.
virtual void setLanguageId(const std::string &s) overridefinal
Set the language id (en, de, fr,-...)
qlonglong mApplicationRuns
Counter for the application runs.
const QString & getInputDeviceName() const
Getter function for mInputDeviceName.
virtual void setSoundGeneratorVolumeDynamic(bool dynamic) overridefinal
Set flag for dynamic volume adaption in the tuning mode.
int getLastVisitedOptionsPage() const
Getter function for mLastVisitedOptionsPage.
The Settings class.
Definition: settings.h:41
bool doNotShowAgainMessageBox(int id) const
Getter function to check if the given AutoClosingMessageBox shall not be shown again.
SettingsForQt()
Empty default constructor.
virtual void setStroboscopeMode(bool enable) overridefinal
Set flag indicating the stroboscopic mode of the tuning indicator.
void setOutputDeviceName(const QString &s)
Setter function for mOutputDeviceName.
Qt specific settings.
Definition: settingsforqt.h:32
void setLastVisitedOptionsPage(int id)
Setter function for mLastVisitedOptionsPage.
virtual void setDisableAutomaticKeySelection(bool disable) overridefinal
Set flag disabling automatic selection of the key during tuning.
void increaseApplicationRuns()
Increments mApplicationRuns.
int getOutputDeviceSamplingRate() const
Getter function for mOutputDeviceSamplingRate.
virtual void setSoundGeneratorMode(SoundGenerator::SoundGeneratorMode mode) overridefinal
Set the last operation mode of the sound generator.
void setInputDeviceName(const QString &s)
Setter function for mInputDeviceName.
int mInputDeviceSamplingRate
input device sampling rate
QSettings mSettings
The QSettings that will store all values to the storage.
void setInputDeviceSamplingRate(int rate)
Setter function for mInputDeviceSamplingRate.
qlonglong getApplicationRuns() const
Getter function for mApplicationRuns.
size_t countCurrentDoNotShowAgainMessageBoxes() const
Get the count of all do not show again message boxes whose states are stored.
void setOutputDeviceSamplingRate(int rate)
Setter function for mOutputDeviceSamplingRate.
static SettingsForQt & getSingleton()
Getter function for the singleton.
void load()
Function to load the settings from the storage.
virtual std::string getUserLanguageId() const overridefinal
Settings::getUserLanguageId.
~SettingsForQt()
Empty defaul destructor.
virtual void setLastUsedAlgorithm(const std::string &name) overridefinal
Set the name of the last used algorithm.
int mLastVisitedOptionsPage
last activated options page