/[svn]/qsampler/trunk/src/qsamplerOptions.h
ViewVC logotype

Contents of /qsampler/trunk/src/qsamplerOptions.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4024 - (show annotations) (download) (as text)
Sun Feb 6 10:50:27 2022 UTC (2 years, 2 months ago) by capela
File MIME type: text/x-c++hdr
File size: 3776 byte(s)
- Migrated command line parsing to QCommandLineParser/Option
  (Qt >= 5.2) (EXPERIMENTAL)
1 // qsamplerOptions.h
2 //
3 /****************************************************************************
4 Copyright (C) 2004-2022, rncbc aka Rui Nuno Capela. All rights reserved.
5 Copyright (C) 2007,2008,2015 Christian Schoenebeck
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21 *****************************************************************************/
22
23 #ifndef __qsamplerOptions_h
24 #define __qsamplerOptions_h
25
26 #include <QSettings>
27 #include <QStringList>
28
29
30 class QWidget;
31 class QComboBox;
32
33 namespace QSampler {
34
35 //-------------------------------------------------------------------------
36 // QSampler::Options - Prototype settings class.
37 //
38
39 class Options
40 {
41 public:
42
43 // Constructor.
44 Options();
45 // Default destructor.
46 ~Options();
47
48 // The settings object accessor.
49 QSettings& settings();
50
51 // explicit I/O methods.
52 void loadOptions();
53 void saveOptions();
54
55 // Command line arguments parser.
56 bool parse_args(const QStringList& args);
57 #if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
58 void show_error(const QString& msg);
59 #else
60 // Command line usage helper.
61 void print_usage(const QString& arg0);
62 #endif
63
64 // Startup supplied session file.
65 QString sSessionFile;
66
67 // Server options...
68 QString sServerHost;
69 int iServerPort;
70 int iServerTimeout;
71 bool bServerStart;
72 QString sServerCmdLine;
73 int iStartDelay;
74
75 // Logging options...
76 bool bMessagesLog;
77 QString sMessagesLogPath;
78
79 // Display options...
80 QString sDisplayFont;
81 bool bDisplayEffect;
82 bool bAutoRefresh;
83 int iAutoRefreshTime;
84 int iMaxVolume;
85 QString sMessagesFont;
86 bool bMessagesLimit;
87 int iMessagesLimitLines;
88 bool bConfirmRemove;
89 bool bConfirmReset;
90 bool bConfirmRestart;
91 bool bConfirmError;
92 bool bKeepOnTop;
93 bool bStdoutCapture;
94 bool bCompletePath;
95 bool bInstrumentNames;
96 int iBaseFontSize;
97
98 QString sCustomColorTheme;
99 QString sCustomStyleTheme;
100
101 // View options...
102 bool bMenubar;
103 bool bToolbar;
104 bool bStatusbar;
105 bool bAutoArrange;
106
107 // Default options...
108 QString sSessionDir;
109 QString sInstrumentDir;
110 QString sEngineName;
111 QString sAudioDriver;
112 QString sMidiDriver;
113 int iMidiMap;
114 int iMidiBank;
115 int iMidiProg;
116 int iVolume;
117 int iLoadMode;
118
119 // Recent file list.
120 int iMaxRecentFiles;
121 QStringList recentFiles;
122
123 // Widget geometry persistence helper prototypes.
124 void saveWidgetGeometry(QWidget *pWidget, bool bVisible = false);
125 void loadWidgetGeometry(QWidget *pWidget, bool bVisible = false);
126
127 // Combo box history persistence helper prototypes.
128 void loadComboBoxHistory(QComboBox *pComboBox, int iLimit = 8);
129 void saveComboBoxHistory(QComboBox *pComboBox, int iLimit = 8);
130
131 int getMaxVoices();
132 int getEffectiveMaxVoices();
133 void setMaxVoices(int iMaxVoices);
134
135 int getMaxStreams();
136 int getEffectiveMaxStreams();
137 void setMaxStreams(int iMaxStreams);
138
139 void sendFineTuningSettings();
140
141 private:
142
143 // Settings member variables.
144 QSettings m_settings;
145
146 // Tuning
147 int iMaxVoices;
148 int iMaxStreams;
149 };
150
151 } // namespace QSampler
152
153
154 #endif // __qsamplerOptions_h
155
156
157 // end of qsamplerOptions.h
158

  ViewVC Help
Powered by ViewVC