1 |
// qsamplerOptions.h |
2 |
// |
3 |
/**************************************************************************** |
4 |
Copyright (C) 2004-2009, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
Copyright (C) 2007, 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 |
// Command line arguments parser. |
52 |
bool parse_args(const QStringList& args); |
53 |
// Command line usage helper. |
54 |
void print_usage(const QString& arg0); |
55 |
|
56 |
// Startup supplied session file. |
57 |
QString sSessionFile; |
58 |
|
59 |
// Server options... |
60 |
QString sServerHost; |
61 |
int iServerPort; |
62 |
int iServerTimeout; |
63 |
bool bServerStart; |
64 |
QString sServerCmdLine; |
65 |
int iStartDelay; |
66 |
|
67 |
// Logging options... |
68 |
bool bMessagesLog; |
69 |
QString sMessagesLogPath; |
70 |
|
71 |
// Display options... |
72 |
QString sDisplayFont; |
73 |
bool bDisplayEffect; |
74 |
bool bAutoRefresh; |
75 |
int iAutoRefreshTime; |
76 |
int iMaxVolume; |
77 |
QString sMessagesFont; |
78 |
bool bMessagesLimit; |
79 |
int iMessagesLimitLines; |
80 |
bool bConfirmRemove; |
81 |
bool bKeepOnTop; |
82 |
bool bStdoutCapture; |
83 |
bool bCompletePath; |
84 |
bool bInstrumentNames; |
85 |
int iBaseFontSize; |
86 |
|
87 |
// View options... |
88 |
bool bMenubar; |
89 |
bool bToolbar; |
90 |
bool bStatusbar; |
91 |
bool bAutoArrange; |
92 |
|
93 |
// Default options... |
94 |
QString sSessionDir; |
95 |
QString sInstrumentDir; |
96 |
QString sEngineName; |
97 |
QString sAudioDriver; |
98 |
QString sMidiDriver; |
99 |
int iMidiMap; |
100 |
int iMidiBank; |
101 |
int iMidiProg; |
102 |
int iVolume; |
103 |
int iLoadMode; |
104 |
|
105 |
// Recent file list. |
106 |
int iMaxRecentFiles; |
107 |
QStringList recentFiles; |
108 |
|
109 |
// Widget geometry persistence helper prototypes. |
110 |
void saveWidgetGeometry(QWidget *pWidget); |
111 |
void loadWidgetGeometry(QWidget *pWidget); |
112 |
|
113 |
// Combo box history persistence helper prototypes. |
114 |
void loadComboBoxHistory(QComboBox *pComboBox, int iLimit = 8); |
115 |
void saveComboBoxHistory(QComboBox *pComboBox, int iLimit = 8); |
116 |
|
117 |
int getMaxVoices(); |
118 |
int getEffectiveMaxVoices(); |
119 |
void setMaxVoices(int iMaxVoices); |
120 |
|
121 |
int getMaxStreams(); |
122 |
int getEffectiveMaxStreams(); |
123 |
void setMaxStreams(int iMaxStreams); |
124 |
|
125 |
void sendFineTuningSettings(); |
126 |
|
127 |
private: |
128 |
|
129 |
// Settings member variables. |
130 |
QSettings m_settings; |
131 |
|
132 |
// Tuning |
133 |
int iMaxVoices; |
134 |
int iMaxStreams; |
135 |
}; |
136 |
|
137 |
} // namespace QSampler |
138 |
|
139 |
|
140 |
#endif // __qsamplerOptions_h |
141 |
|
142 |
|
143 |
// end of qsamplerOptions.h |