summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/ttssapi.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2011-04-22 18:58:01 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2011-04-22 18:58:01 +0000
commit3467ee8dddbeb6be616aac6928190f92978473e6 (patch)
treef56b731cee90268e311bf03fca95012b94a8dd87 /rbutil/rbutilqt/base/ttssapi.cpp
parentc6a8efb8afb848e0001eacdb8376f1aa46a33733 (diff)
downloadrockbox-3467ee8dddbeb6be616aac6928190f92978473e6.tar.gz
rockbox-3467ee8dddbeb6be616aac6928190f92978473e6.tar.bz2
rockbox-3467ee8dddbeb6be616aac6928190f92978473e6.zip
Fix SAPI default speed being way too fast.
The settings currently can't differentiate between default values for different subitems (i.e. different TTS systems). As a result the default value returned for SAPI speed was way out of bounds, leading to the upper limit getting used. Work around this limitation by checking the value for bounds and use a sensible value in that case. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29763 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/base/ttssapi.cpp')
-rw-r--r--rbutil/rbutilqt/base/ttssapi.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/rbutil/rbutilqt/base/ttssapi.cpp b/rbutil/rbutilqt/base/ttssapi.cpp
index 2cc95cd4aa..cd9ced8083 100644
--- a/rbutil/rbutilqt/base/ttssapi.cpp
+++ b/rbutil/rbutilqt/base/ttssapi.cpp
@@ -52,8 +52,11 @@ void TTSSapi::generateSettings()
connect(setting,SIGNAL(refresh()),this,SLOT(updateVoiceList()));
insertSetting(eVOICE,setting);
//speed
- insertSetting(eSPEED,new EncTtsSetting(this,EncTtsSetting::eINT,
- tr("Speed:"),RbSettings::subValue("sapi",RbSettings::TtsSpeed),-10,10));
+ int speed = RbSettings::subValue("sapi", RbSettings::TtsSpeed).toInt();
+ if(speed > 10 || speed < -10)
+ speed = 0;
+ insertSetting(eSPEED, new EncTtsSetting(this, EncTtsSetting::eINT,
+ tr("Speed:"), speed, -10, 10));
// options
insertSetting(eOPTIONS,new EncTtsSetting(this,EncTtsSetting::eSTRING,
tr("Options:"),RbSettings::subValue("sapi",RbSettings::TtsOptions)));