1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Wenger
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
29 class RbSettings
: public QObject
36 //! open the settings files
38 //! call this to flush the user Settings
41 // returns the filename of the usersettings file
42 QString
userSettingFilename();
44 //! access functions for the settings
50 QString
bleedingUrl();
51 QString
lastRelease(QString platform
);
53 QString
bootloaderUrl();
54 QString
bootloaderInfoUrl();
60 QString
serverConfUrl();
65 QString
bleedingInfo();
67 QString
lastTalkedFolder();
68 QString
voiceLanguage();
70 QString
ttsPath(QString tts
);
71 QString
ttsOptions(QString tts
);
72 QString
ttsVoice(QString tts
);
73 int ttsSpeed(QString tts
);
74 QString
ttsLang(QString tts
);
76 QString
encoderPath(QString enc
);
77 QString
encoderOptions(QString enc
);
78 double encoderQuality(QString enc
);
79 int encoderComplexity(QString enc
);
80 double encoderVolume(QString enc
);
81 bool encoderNarrowband(QString enc
);
83 QStringList
allPlatforms();
84 QString
name(QString plattform
);
85 QString
brand(QString plattform
);
86 QStringList
allLanguages();
87 QString
nameOfTargetId(int id
);
88 QMap
<int, QString
> usbIdMap();
89 QMap
<int, QString
> usbIdErrorMap();
90 QMap
<int, QString
> usbIdIncompatMap();
92 bool curNeedsBootloader();
95 QString
curPlatform();
96 QString
curPlatformName();
99 QString
curBootloaderMethod();
100 QString
curBootloaderName();
101 QString
curVoiceName();
103 QString
curEncoder();
105 QString
curResolution();
106 QString
curBootloaderFile();
110 void setCurVersion(QString version
);
111 void setOfPath(QString path
);
112 void setCachePath(QString path
);
113 void setBuild(QString build
);
114 void setLastTalkedDir(QString dir
);
115 void setVoiceLanguage(QString lang
);
116 void setWavtrimTh(int th
);
117 void setProxy(QString proxy
);
118 void setProxyType(QString proxytype
);
119 void setLang(QString lang
);
120 void setMountpoint(QString mp
);
121 void setCurPlatform(QString platt
);
122 void setCacheDisable(bool on
);
123 void setCacheOffline(bool on
);
124 void setCurTTS(QString tts
);
125 void setTTSPath(QString tts
, QString path
);
126 void setTTSOptions(QString tts
, QString options
);
127 void setTTSSpeed(QString tts
, int speed
);
128 void setTTSVoice(QString tts
, QString voice
);
129 void setTTSLang(QString tts
, QString lang
);
130 void setTTSUseSapi4(bool value
);
131 void setEncoderPath(QString enc
, QString path
);
132 void setEncoderOptions(QString enc
, QString options
);
133 void setEncoderQuality(QString enc
, double q
);
134 void setEncoderComplexity(QString enc
, int c
);
135 void setEncoderVolume(QString enc
,double v
);
136 void setEncoderNarrowband(QString enc
,bool nb
);
140 //! helper function to get an entry in the current platform section
141 QVariant
deviceSettingCurGet(QString entry
,QString def
="");
142 //! helper function to get an entry out of a group in the userSettings
143 QVariant
userSettingsGroupGet(QString group
,QString entry
,QVariant def
="");
144 //! helper function to set an entry in a group in the userSettings
145 void userSettingsGroupSet(QString group
,QString entry
,QVariant value
);
148 //! private copy constructors to prvent copying
149 RbSettings
& operator= (const RbSettings
& other
)
150 { (void)other
; return *this; }
151 RbSettings(const RbSettings
& other
) :QObject()
154 //! pointers to our setting objects
156 QSettings
*userSettings
;