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
settings.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 //=============================================================================
21 // Class holding the program settings on the core level
22 //=============================================================================
23 
24 #ifndef SETTINGS_H
25 #define SETTINGS_H
26 
27 #include <memory>
28 #include <string>
29 
31 
40 
41 class Settings
42 {
43 public:
44  Settings();
45  ~Settings(){}
46 
47  static Settings &getSingleton();
48 
50  const std::string &getLanguageId() const {return mLanguageId;}
52  virtual void setLanguageId(const std::string &id) {mLanguageId = id;}
53 
54  virtual std::string getUserLanguageId() const;
55 
57  const std::string &getLastUsedAlgorithm() const {return mLastUsedAlgorithm;}
59  virtual void setLastUsedAlgorithm(const std::string &name) {mLastUsedAlgorithm = name;}
60 
65 
69  virtual void setSoundGeneratorVolumeDynamic(bool dynamic) {mSoundGeneratorVolumeDynamic = dynamic;}
70 
74  virtual void setDisableAutomaticKeySelection(bool disable) {mDisableAutomaticKeySelection = disable;}
75 
77  bool isStroboscopeActive() const {return mStroboscopeActive;}
79  virtual void setStroboscopeMode(bool enable) {mStroboscopeActive = enable;}
80 
81 protected:
88  std::string mLanguageId;
89 
90  std::string mLastUsedAlgorithm;
95 
96 private:
97  static std::unique_ptr<Settings> mSingleton;
98 };
99 
100 #endif // SETTINGS_H
virtual void setStroboscopeMode(bool enable)
Set flag indicating the stroboscopic mode of the tuning indicator.
Definition: settings.h:79
static Settings & getSingleton()
Get a pointer to the singleton instance.
Definition: settings.cpp:46
std::string mLanguageId
Language Id.
Definition: settings.h:88
SoundGeneratorMode
Mode for sound generation.
std::string mLastUsedAlgorithm
The algorithm that has been used last time.
Definition: settings.h:90
const std::string & getLastUsedAlgorithm() const
Get the name of the last used algorithm.
Definition: settings.h:57
bool mDisableAutomaticKeySelection
Flag suppressing automatic key selection.
Definition: settings.h:93
bool mSoundGeneratorVolumeDynamic
Flag for automatic volume adjustment.
Definition: settings.h:92
SoundGenerator::SoundGeneratorMode getSoundGeneratorMode() const
Get the last operation mode of the sound generator.
Definition: settings.h:62
virtual void setLanguageId(const std::string &id)
Set the language id (en, de, fr,-...)
Definition: settings.h:52
The Settings class.
Definition: settings.h:41
bool isStroboscopeActive() const
Get flag indicating the stroboscopic mode of the tuning indicator.
Definition: settings.h:77
virtual void setSoundGeneratorMode(SoundGenerator::SoundGeneratorMode mode)
Set the last operation mode of the sound generator.
Definition: settings.h:64
static std::unique_ptr< Settings > mSingleton
Singleton pointer.
Definition: settings.h:97
virtual std::string getUserLanguageId() const
Settings::getUserLanguageId.
Definition: settings.cpp:62
virtual void setSoundGeneratorVolumeDynamic(bool dynamic)
Set flag for dynamic volume adaption in the tuning mode.
Definition: settings.h:69
virtual void setLastUsedAlgorithm(const std::string &name)
Set the name of the last used algorithm.
Definition: settings.h:59
bool isSoundGeneratorVolumeDynamic() const
Get flag for dynamic volume adaption in the tuning mode.
Definition: settings.h:67
virtual void setDisableAutomaticKeySelection(bool disable)
Set flag disabling automatic selection of the key during tuning.
Definition: settings.h:74
~Settings()
Empty destructor.
Definition: settings.h:45
SoundGenerator::SoundGeneratorMode mSoundGeneratorMode
The sound generator mode (sine or synthesizer)
Definition: settings.h:91
Settings()
Constructor.
Definition: settings.cpp:31
const std::string & getLanguageId() const
Get the language id (en, de, fr,-...)
Definition: settings.h:50
bool mStroboscopeActive
Flag indicating stroboscopic tuning indicator mode.
Definition: settings.h:94
bool isAutomaticKeySelectionDisabled() const
Get flag disabling automatic selection of the key during tuning.
Definition: settings.h:72