2008-01-25 00:12:25 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 by Dominik Wenger
|
2008-06-30 22:09:45 +00:00
|
|
|
* $Id$
|
2008-01-25 00:12:25 +00:00
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2008-01-25 00:12:25 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef RBSETTINGS_H
|
|
|
|
#define RBSETTINGS_H
|
|
|
|
|
2008-02-10 18:25:49 +00:00
|
|
|
#include <QtCore>
|
|
|
|
|
2008-01-25 00:12:25 +00:00
|
|
|
class QSettings;
|
|
|
|
|
|
|
|
class RbSettings : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
RbSettings() {}
|
2008-10-24 18:41:04 +00:00
|
|
|
|
2008-01-25 00:12:25 +00:00
|
|
|
//! open the settings files
|
|
|
|
void open();
|
|
|
|
//! call this to flush the user Settings
|
|
|
|
void sync();
|
2008-10-24 18:41:04 +00:00
|
|
|
|
2008-01-25 00:12:25 +00:00
|
|
|
// returns the filename of the usersettings file
|
|
|
|
QString userSettingFilename();
|
2008-10-24 18:41:04 +00:00
|
|
|
|
2008-01-25 00:12:25 +00:00
|
|
|
//! access functions for the settings
|
2008-07-07 21:40:44 +00:00
|
|
|
QString curVersion();
|
2008-01-25 00:12:25 +00:00
|
|
|
bool cacheOffline();
|
|
|
|
bool cacheDisabled();
|
|
|
|
QString mountpoint();
|
|
|
|
QString manualUrl();
|
|
|
|
QString bleedingUrl();
|
|
|
|
QString cachePath();
|
2008-12-19 22:18:07 +00:00
|
|
|
QString build(void);
|
2008-01-25 00:12:25 +00:00
|
|
|
QString bootloaderUrl();
|
|
|
|
QString bootloaderInfoUrl();
|
|
|
|
QString fontUrl();
|
|
|
|
QString voiceUrl();
|
|
|
|
QString doomUrl();
|
2008-10-18 16:19:07 +00:00
|
|
|
QString releaseUrl();
|
2008-01-25 00:12:25 +00:00
|
|
|
QString dailyUrl();
|
|
|
|
QString serverConfUrl();
|
|
|
|
QString themeUrl();
|
|
|
|
QString genlangUrl();
|
|
|
|
QString proxyType();
|
|
|
|
QString proxy();
|
|
|
|
QString bleedingInfo();
|
|
|
|
QString ofPath();
|
|
|
|
QString lastTalkedFolder();
|
|
|
|
QString voiceLanguage();
|
|
|
|
int wavtrimTh();
|
|
|
|
QString ttsPath(QString tts);
|
|
|
|
QString ttsOptions(QString tts);
|
|
|
|
QString ttsVoice(QString tts);
|
|
|
|
int ttsSpeed(QString tts);
|
|
|
|
QString ttsLang(QString tts);
|
2008-02-11 17:39:07 +00:00
|
|
|
bool ttsUseSapi4();
|
2008-01-25 00:12:25 +00:00
|
|
|
QString encoderPath(QString enc);
|
|
|
|
QString encoderOptions(QString enc);
|
|
|
|
double encoderQuality(QString enc);
|
|
|
|
int encoderComplexity(QString enc);
|
|
|
|
double encoderVolume(QString enc);
|
|
|
|
bool encoderNarrowband(QString enc);
|
2009-01-25 17:48:38 +00:00
|
|
|
|
2009-03-14 23:34:40 +00:00
|
|
|
QStringList allPlatforms(void);
|
|
|
|
QStringList allLanguages(void);
|
|
|
|
|
2008-01-25 00:12:25 +00:00
|
|
|
QString name(QString plattform);
|
|
|
|
QString brand(QString plattform);
|
2009-03-14 23:34:40 +00:00
|
|
|
|
2008-04-03 20:05:13 +00:00
|
|
|
QMap<int, QString> usbIdMap();
|
|
|
|
QMap<int, QString> usbIdErrorMap();
|
2008-04-05 21:48:54 +00:00
|
|
|
QMap<int, QString> usbIdIncompatMap();
|
2009-01-25 17:48:38 +00:00
|
|
|
|
2008-01-25 00:12:25 +00:00
|
|
|
QString curBrand();
|
|
|
|
QString curName();
|
|
|
|
QString curPlatform();
|
2008-02-13 18:25:01 +00:00
|
|
|
QString curPlatformName();
|
2008-01-25 00:12:25 +00:00
|
|
|
QString curManual();
|
|
|
|
QString curBootloaderMethod();
|
|
|
|
QString curBootloaderName();
|
|
|
|
QString curVoiceName();
|
|
|
|
QString curLang();
|
|
|
|
QString curEncoder();
|
|
|
|
QString curTTS();
|
|
|
|
QString curResolution();
|
2008-09-28 17:02:36 +00:00
|
|
|
QString curBootloaderFile();
|
2008-01-25 00:12:25 +00:00
|
|
|
int curTargetId();
|
2008-02-10 18:25:49 +00:00
|
|
|
|
2008-07-07 21:40:44 +00:00
|
|
|
//! Set Functions
|
|
|
|
void setCurVersion(QString version);
|
2008-01-25 00:12:25 +00:00
|
|
|
void setOfPath(QString path);
|
|
|
|
void setCachePath(QString path);
|
|
|
|
void setBuild(QString build);
|
|
|
|
void setLastTalkedDir(QString dir);
|
|
|
|
void setVoiceLanguage(QString lang);
|
|
|
|
void setWavtrimTh(int th);
|
|
|
|
void setProxy(QString proxy);
|
|
|
|
void setProxyType(QString proxytype);
|
|
|
|
void setLang(QString lang);
|
|
|
|
void setMountpoint(QString mp);
|
|
|
|
void setCurPlatform(QString platt);
|
|
|
|
void setCacheDisable(bool on);
|
|
|
|
void setCacheOffline(bool on);
|
|
|
|
void setCurTTS(QString tts);
|
|
|
|
void setTTSPath(QString tts, QString path);
|
|
|
|
void setTTSOptions(QString tts, QString options);
|
|
|
|
void setTTSSpeed(QString tts, int speed);
|
|
|
|
void setTTSVoice(QString tts, QString voice);
|
|
|
|
void setTTSLang(QString tts, QString lang);
|
2008-02-11 17:39:07 +00:00
|
|
|
void setTTSUseSapi4(bool value);
|
2008-01-25 00:12:25 +00:00
|
|
|
void setEncoderPath(QString enc, QString path);
|
|
|
|
void setEncoderOptions(QString enc, QString options);
|
|
|
|
void setEncoderQuality(QString enc, double q);
|
|
|
|
void setEncoderComplexity(QString enc, int c);
|
|
|
|
void setEncoderVolume(QString enc,double v);
|
|
|
|
void setEncoderNarrowband(QString enc,bool nb);
|
2008-02-10 18:25:49 +00:00
|
|
|
|
2008-01-25 00:12:25 +00:00
|
|
|
private:
|
2009-01-25 17:48:38 +00:00
|
|
|
|
2008-04-24 20:40:33 +00:00
|
|
|
//! helper function to get an entry in the current platform section
|
|
|
|
QVariant deviceSettingCurGet(QString entry,QString def="");
|
|
|
|
//! helper function to get an entry out of a group in the userSettings
|
|
|
|
QVariant userSettingsGroupGet(QString group,QString entry,QVariant def="");
|
|
|
|
//! helper function to set an entry in a group in the userSettings
|
|
|
|
void userSettingsGroupSet(QString group,QString entry,QVariant value);
|
2009-01-25 17:48:38 +00:00
|
|
|
|
|
|
|
|
2008-04-24 20:40:33 +00:00
|
|
|
//! private copy constructors to prvent copying
|
2008-04-24 21:42:31 +00:00
|
|
|
RbSettings& operator= (const RbSettings& other)
|
|
|
|
{ (void)other; return *this; }
|
2008-04-25 19:47:06 +00:00
|
|
|
RbSettings(const RbSettings& other) :QObject()
|
2008-04-24 21:42:31 +00:00
|
|
|
{ (void)other; }
|
2009-01-25 17:48:38 +00:00
|
|
|
|
2008-04-24 20:40:33 +00:00
|
|
|
//! pointers to our setting objects
|
2008-01-25 00:12:25 +00:00
|
|
|
QSettings *devices;
|
|
|
|
QSettings *userSettings;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|