summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/base/encoders.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/base/encoders.cpp')
-rw-r--r--rbutil/rbutilqt/base/encoders.cpp49
1 files changed, 25 insertions, 24 deletions
diff --git a/rbutil/rbutilqt/base/encoders.cpp b/rbutil/rbutilqt/base/encoders.cpp
index 6ff1185c82..59add74a0d 100644
--- a/rbutil/rbutilqt/base/encoders.cpp
+++ b/rbutil/rbutilqt/base/encoders.cpp
@@ -19,6 +19,7 @@
19 19
20#include "encoders.h" 20#include "encoders.h"
21#include "utils.h" 21#include "utils.h"
22#include "rbsettings.h"
22 23
23/********************************************************************* 24/*********************************************************************
24* Encoder Base 25* Encoder Base
@@ -87,24 +88,24 @@ EncExes::EncExes(QString name,QObject *parent) : EncBase(parent)
87 88
88void EncExes::generateSettings() 89void EncExes::generateSettings()
89{ 90{
90 QString exepath =settings->subValue(m_name,RbSettings::EncoderPath).toString(); 91 QString exepath =RbSettings::subValue(m_name,RbSettings::EncoderPath).toString();
91 if(exepath == "") exepath = findExecutable(m_name); 92 if(exepath == "") exepath = findExecutable(m_name);
92 93
93 insertSetting(eEXEPATH,new EncTtsSetting(this,EncTtsSetting::eSTRING,"Path to Encoder:",exepath,EncTtsSetting::eBROWSEBTN)); 94 insertSetting(eEXEPATH,new EncTtsSetting(this,EncTtsSetting::eSTRING,"Path to Encoder:",exepath,EncTtsSetting::eBROWSEBTN));
94 insertSetting(eEXEOPTIONS,new EncTtsSetting(this,EncTtsSetting::eSTRING,"Encoder options:",settings->subValue(m_name,RbSettings::EncoderOptions))); 95 insertSetting(eEXEOPTIONS,new EncTtsSetting(this,EncTtsSetting::eSTRING,"Encoder options:",RbSettings::subValue(m_name,RbSettings::EncoderOptions)));
95} 96}
96 97
97void EncExes::saveSettings() 98void EncExes::saveSettings()
98{ 99{
99 settings->setSubValue(m_name,RbSettings::EncoderPath,getSetting(eEXEPATH)->current().toString()); 100 RbSettings::setSubValue(m_name,RbSettings::EncoderPath,getSetting(eEXEPATH)->current().toString());
100 settings->setSubValue(m_name,RbSettings::EncoderOptions,getSetting(eEXEOPTIONS)->current().toString()); 101 RbSettings::setSubValue(m_name,RbSettings::EncoderOptions,getSetting(eEXEOPTIONS)->current().toString());
101 settings->sync(); 102 RbSettings::sync();
102} 103}
103 104
104bool EncExes::start() 105bool EncExes::start()
105{ 106{
106 m_EncExec = settings->subValue(m_name, RbSettings::EncoderPath).toString(); 107 m_EncExec = RbSettings::subValue(m_name, RbSettings::EncoderPath).toString();
107 m_EncOpts = settings->subValue(m_name, RbSettings::EncoderOptions).toString(); 108 m_EncOpts = RbSettings::subValue(m_name, RbSettings::EncoderOptions).toString();
108 109
109 m_EncTemplate = m_TemplateMap.value(m_name); 110 m_EncTemplate = m_TemplateMap.value(m_name);
110 111
@@ -136,7 +137,7 @@ bool EncExes::encode(QString input,QString output)
136 137
137bool EncExes::configOk() 138bool EncExes::configOk()
138{ 139{
139 QString path = settings->subValue(m_name, RbSettings::EncoderPath).toString(); 140 QString path = RbSettings::subValue(m_name, RbSettings::EncoderPath).toString();
140 141
141 if (QFileInfo(path).exists()) 142 if (QFileInfo(path).exists())
142 return true; 143 return true;
@@ -154,31 +155,31 @@ EncRbSpeex::EncRbSpeex(QObject *parent) : EncBase(parent)
154 155
155void EncRbSpeex::generateSettings() 156void EncRbSpeex::generateSettings()
156{ 157{
157 insertSetting(eVOLUME,new EncTtsSetting(this,EncTtsSetting::eDOUBLE,"Volume:",settings->subValue("rbspeex",RbSettings::EncoderVolume),1.0,10.0)); 158 insertSetting(eVOLUME,new EncTtsSetting(this,EncTtsSetting::eDOUBLE,"Volume:",RbSettings::subValue("rbspeex",RbSettings::EncoderVolume),1.0,10.0));
158 insertSetting(eQUALITY,new EncTtsSetting(this,EncTtsSetting::eDOUBLE,"Quality:",settings->subValue("rbspeex",RbSettings::EncoderQuality),0,10.0)); 159 insertSetting(eQUALITY,new EncTtsSetting(this,EncTtsSetting::eDOUBLE,"Quality:",RbSettings::subValue("rbspeex",RbSettings::EncoderQuality),0,10.0));
159 insertSetting(eCOMPLEXITY,new EncTtsSetting(this,EncTtsSetting::eINT,"Complexity:",settings->subValue("rbspeex",RbSettings::EncoderComplexity),0,10)); 160 insertSetting(eCOMPLEXITY,new EncTtsSetting(this,EncTtsSetting::eINT,"Complexity:",RbSettings::subValue("rbspeex",RbSettings::EncoderComplexity),0,10));
160 insertSetting(eNARROWBAND,new EncTtsSetting(this,EncTtsSetting::eBOOL,"Use Narrowband:",settings->subValue("rbspeex",RbSettings::EncoderNarrowBand))); 161 insertSetting(eNARROWBAND,new EncTtsSetting(this,EncTtsSetting::eBOOL,"Use Narrowband:",RbSettings::subValue("rbspeex",RbSettings::EncoderNarrowBand)));
161} 162}
162 163
163void EncRbSpeex::saveSettings() 164void EncRbSpeex::saveSettings()
164{ 165{
165 //save settings in user config 166 //save settings in user config
166 settings->setSubValue("rbspeex",RbSettings::EncoderVolume,getSetting(eVOLUME)->current().toDouble()); 167 RbSettings::setSubValue("rbspeex",RbSettings::EncoderVolume,getSetting(eVOLUME)->current().toDouble());
167 settings->setSubValue("rbspeex",RbSettings::EncoderQuality,getSetting(eQUALITY)->current().toDouble()); 168 RbSettings::setSubValue("rbspeex",RbSettings::EncoderQuality,getSetting(eQUALITY)->current().toDouble());
168 settings->setSubValue("rbspeex",RbSettings::EncoderComplexity,getSetting(eCOMPLEXITY)->current().toInt()); 169 RbSettings::setSubValue("rbspeex",RbSettings::EncoderComplexity,getSetting(eCOMPLEXITY)->current().toInt());
169 settings->setSubValue("rbspeex",RbSettings::EncoderNarrowBand,getSetting(eNARROWBAND)->current().toBool()); 170 RbSettings::setSubValue("rbspeex",RbSettings::EncoderNarrowBand,getSetting(eNARROWBAND)->current().toBool());
170 171
171 settings->sync(); 172 RbSettings::sync();
172} 173}
173 174
174bool EncRbSpeex::start() 175bool EncRbSpeex::start()
175{ 176{
176 177
177 // try to get config from settings 178 // try to get config from settings
178 quality = settings->subValue("rbspeex", RbSettings::EncoderQuality).toDouble(); 179 quality = RbSettings::subValue("rbspeex", RbSettings::EncoderQuality).toDouble();
179 complexity = settings->subValue("rbspeex", RbSettings::EncoderComplexity).toInt(); 180 complexity = RbSettings::subValue("rbspeex", RbSettings::EncoderComplexity).toInt();
180 volume = settings->subValue("rbspeex", RbSettings::EncoderVolume).toDouble(); 181 volume = RbSettings::subValue("rbspeex", RbSettings::EncoderVolume).toDouble();
181 narrowband = settings->subValue("rbspeex", RbSettings::EncoderNarrowBand).toBool(); 182 narrowband = RbSettings::subValue("rbspeex", RbSettings::EncoderNarrowBand).toBool();
182 183
183 184
184 return true; 185 return true;
@@ -219,13 +220,13 @@ bool EncRbSpeex::configOk()
219 bool result=true; 220 bool result=true;
220 // check config 221 // check config
221 222
222 if(settings->subValue("rbspeex", RbSettings::EncoderVolume).toDouble() <= 0) 223 if(RbSettings::subValue("rbspeex", RbSettings::EncoderVolume).toDouble() <= 0)
223 result =false; 224 result =false;
224 225
225 if(settings->subValue("rbspeex", RbSettings::EncoderQuality).toDouble() <= 0) 226 if(RbSettings::subValue("rbspeex", RbSettings::EncoderQuality).toDouble() <= 0)
226 result =false; 227 result =false;
227 228
228 if(settings->subValue("rbspeex", RbSettings::EncoderComplexity).toInt() <= 0) 229 if(RbSettings::subValue("rbspeex", RbSettings::EncoderComplexity).toInt() <= 0)
229 result =false; 230 result =false;
230 231
231 return result; 232 return result;