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
displaysize.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 DISPLAYSIZE
21 #define DISPLAYSIZE
22 
23 #include <memory>
24 #include <qnamespace.h>
25 
27  DS_XSMALL = 1, //< Normal smartphones up to 4.5'
28  DS_SMALL = 2, //< Large smartphones down to 4.5'
29  DS_MEDIUM = 3, //< Medium size, usually tablets down to 7'
30  DS_LARGE = 4, //< Normal size, suitable down to 12'
31 };
32 
34  GDM_ALL_VISIBLE, //< all graphs are visibly permanent
35  GDM_ONE_VISIBLE, //< only show one graph at the same time
36 };
37 
39  KDM_NORMAL, //< normal keyboard: completly visible, klick to select
40  KDM_POPUP, //< completly visible, click opens a fullscreen keyboard
41  KDM_SCROLLABLE_FIT_TO_HEIGHT, //< only part visible, fit to available height, scrollable
42 };
43 
45  MGBDS_NORMAL, //< normal group boxes to display
46  MGBDS_WIDGETS, //< no group boxes, use widgets instead
47 };
48 
50 private:
51  static std::unique_ptr<DisplaySizeDefines> mSingleton;
53  const double mFontPointSize;
54 
55 public:
56  DisplaySizeDefines(double displaySizeInInch, double fontPointSize);
57 
58  static DisplaySize inchToDisplaySize(double inch);
59  static const std::unique_ptr<DisplaySizeDefines> &getSingleton();
60 
61  bool isLEq(DisplaySize ds) const {return ds <= mDisplaySize;}
62  bool isGEq(DisplaySize ds) const {return ds >= mDisplaySize;}
63 
64  double getSmallIconSize();
65  double getMediumIconSize();
66  double getLargeIconSize();
67 
68  Qt::ToolButtonStyle optionsDialogToolButtonStyle() const;
69  bool showVolumeGroupBoxInTuningMode() const;
70  bool keepKeyboardRatioFixed() const;
74 
75  bool showPlotNavigationVertical() const;
76  bool abbrevPlotLabels() const;
77  bool showMuteOutputButton() const;
78 };
79 
80 #endif // DISPLAYSIZE
81 
double getMediumIconSize()
Definition: displaysize.cpp:57
bool keepKeyboardRatioFixed() const
Definition: displaysize.cpp:77
bool abbrevPlotLabels() const
bool showVolumeGroupBoxInTuningMode() const
Definition: displaysize.cpp:73
static DisplaySize inchToDisplaySize(double inch)
Definition: displaysize.cpp:41
Qt::ToolButtonStyle optionsDialogToolButtonStyle() const
Definition: displaysize.cpp:65
KeyboardDisplayMode getKeyboardDisplayMode() const
Definition: displaysize.cpp:89
bool isGEq(DisplaySize ds) const
Definition: displaysize.h:62
const DisplaySize mDisplaySize
Definition: displaysize.h:52
MainGroupBoxDisplayStyle
Definition: displaysize.h:44
DisplaySizeDefines(double displaySizeInInch, double fontPointSize)
Definition: displaysize.cpp:34
bool showMuteOutputButton() const
GraphDisplayMode
Definition: displaysize.h:33
bool showPlotNavigationVertical() const
GraphDisplayMode getGraphDisplayMode() const
Definition: displaysize.cpp:81
DisplaySize
Definition: displaysize.h:26
static std::unique_ptr< DisplaySizeDefines > mSingleton
Definition: displaysize.h:51
double getLargeIconSize()
Definition: displaysize.cpp:61
KeyboardDisplayMode
Definition: displaysize.h:38
bool isLEq(DisplaySize ds) const
Definition: displaysize.h:61
static const std::unique_ptr< DisplaySizeDefines > & getSingleton()
Definition: displaysize.cpp:29
MainGroupBoxDisplayStyle getMainGroupBoxDisplayStyle() const
Definition: displaysize.cpp:97
const double mFontPointSize
Definition: displaysize.h:53
double getSmallIconSize()
Definition: displaysize.cpp:53