blob: 8ef9b4a65380900fa749c931237c15632e6e0231 [file] [log] [blame]
Dominik Wenger3a54c9b2008-01-25 00:12:25 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2007 by Dominik Wenger
10 * $Id: rbsettings.h 16059 2008-01-11 23:59:12Z domonoky $
11 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * 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.
Dominik Wenger3a54c9b2008-01-25 00:12:25 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef RBSETTINGS_H
23#define RBSETTINGS_H
24
Dominik Riebelingee09cb72008-02-10 18:25:49 +000025#include <QtCore>
26
Dominik Wenger3a54c9b2008-01-25 00:12:25 +000027class QSettings;
28
29class RbSettings : public QObject
30{
31 Q_OBJECT
32
33 public:
34 RbSettings() {}
35
36 //! open the settings files
37 void open();
38 //! call this to flush the user Settings
39 void sync();
40
41 // returns the filename of the usersettings file
42 QString userSettingFilename();
43
44 //! access functions for the settings
45 bool cacheOffline();
46 bool cacheDisabled();
47 QString mountpoint();
48 QString manualUrl();
49 QString bleedingUrl();
50 QString lastRelease();
51 QString cachePath();
52 QString bootloaderUrl();
53 QString bootloaderInfoUrl();
54 QString fontUrl();
55 QString voiceUrl();
56 QString doomUrl();
57 QString downloadUrl();
58 QString dailyUrl();
59 QString serverConfUrl();
60 QString themeUrl();
61 QString genlangUrl();
62 QString proxyType();
63 QString proxy();
64 QString bleedingInfo();
65 QString ofPath();
66 QString lastTalkedFolder();
67 QString voiceLanguage();
68 int wavtrimTh();
69 QString ttsPath(QString tts);
70 QString ttsOptions(QString tts);
71 QString ttsVoice(QString tts);
72 int ttsSpeed(QString tts);
73 QString ttsLang(QString tts);
Dominik Wenger5f641ed2008-02-11 17:39:07 +000074 bool ttsUseSapi4();
Dominik Wenger3a54c9b2008-01-25 00:12:25 +000075 QString encoderPath(QString enc);
76 QString encoderOptions(QString enc);
77 double encoderQuality(QString enc);
78 int encoderComplexity(QString enc);
79 double encoderVolume(QString enc);
80 bool encoderNarrowband(QString enc);
81
82 QStringList allPlatforms();
83 QString name(QString plattform);
84 QString brand(QString plattform);
85 QStringList allLanguages();
Dominik Wenger6b0a1ec2008-06-23 20:31:44 +000086 QString nameOfTargetId(int id);
Dominik Wenger13638812008-04-03 20:05:13 +000087 QMap<int, QString> usbIdMap();
88 QMap<int, QString> usbIdErrorMap();
Dominik Riebeling229c64b2008-04-05 21:48:54 +000089 QMap<int, QString> usbIdIncompatMap();
Dominik Wenger13638812008-04-03 20:05:13 +000090
Dominik Wenger3a54c9b2008-01-25 00:12:25 +000091 bool curNeedsBootloader();
92 QString curBrand();
93 QString curName();
94 QString curPlatform();
Dominik Wengerb30181a2008-02-13 18:25:01 +000095 QString curPlatformName();
Dominik Wenger3a54c9b2008-01-25 00:12:25 +000096 QString curManual();
97 bool curReleased();
98 QString curBootloaderMethod();
99 QString curBootloaderName();
100 QString curVoiceName();
101 QString curLang();
102 QString curEncoder();
103 QString curTTS();
104 QString curResolution();
105 int curTargetId();
Dominik Riebelingee09cb72008-02-10 18:25:49 +0000106
Dominik Wenger74497512008-04-24 20:40:33 +0000107 //! Set Fucntions
Dominik Wenger3a54c9b2008-01-25 00:12:25 +0000108 void setOfPath(QString path);
109 void setCachePath(QString path);
110 void setBuild(QString build);
111 void setLastTalkedDir(QString dir);
112 void setVoiceLanguage(QString lang);
113 void setWavtrimTh(int th);
114 void setProxy(QString proxy);
115 void setProxyType(QString proxytype);
116 void setLang(QString lang);
117 void setMountpoint(QString mp);
118 void setCurPlatform(QString platt);
119 void setCacheDisable(bool on);
120 void setCacheOffline(bool on);
121 void setCurTTS(QString tts);
Dominik Wenger3a54c9b2008-01-25 00:12:25 +0000122 void setTTSPath(QString tts, QString path);
123 void setTTSOptions(QString tts, QString options);
124 void setTTSSpeed(QString tts, int speed);
125 void setTTSVoice(QString tts, QString voice);
126 void setTTSLang(QString tts, QString lang);
Dominik Wenger5f641ed2008-02-11 17:39:07 +0000127 void setTTSUseSapi4(bool value);
Dominik Wenger3a54c9b2008-01-25 00:12:25 +0000128 void setEncoderPath(QString enc, QString path);
129 void setEncoderOptions(QString enc, QString options);
130 void setEncoderQuality(QString enc, double q);
131 void setEncoderComplexity(QString enc, int c);
132 void setEncoderVolume(QString enc,double v);
133 void setEncoderNarrowband(QString enc,bool nb);
Dominik Riebelingee09cb72008-02-10 18:25:49 +0000134
Dominik Wenger3a54c9b2008-01-25 00:12:25 +0000135 private:
Dominik Wenger74497512008-04-24 20:40:33 +0000136
137 //! helper function to get an entry in the current platform section
138 QVariant deviceSettingCurGet(QString entry,QString def="");
139 //! helper function to get an entry out of a group in the userSettings
140 QVariant userSettingsGroupGet(QString group,QString entry,QVariant def="");
141 //! helper function to set an entry in a group in the userSettings
142 void userSettingsGroupSet(QString group,QString entry,QVariant value);
143
144
145 //! private copy constructors to prvent copying
Dominik Riebeling6a471d82008-04-24 21:42:31 +0000146 RbSettings& operator= (const RbSettings& other)
147 { (void)other; return *this; }
Dominik Wengerdb733392008-04-25 19:47:06 +0000148 RbSettings(const RbSettings& other) :QObject()
Dominik Riebeling6a471d82008-04-24 21:42:31 +0000149 { (void)other; }
Dominik Wenger74497512008-04-24 20:40:33 +0000150
151 //! pointers to our setting objects
Dominik Wenger3a54c9b2008-01-25 00:12:25 +0000152 QSettings *devices;
153 QSettings *userSettings;
154
155};
156
157#endif