MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / updateVdc

Method updateVdc

src/audio/base/DspHost.cpp:199–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199void DspHost::updateVdc(DspConfig *config)
200{
201 bool enableExists;
202 bool fileExists;
203
204 bool ddcEnable = config->get<bool>(DspConfig::ddc_enable, &enableExists);
205 QString ddcFile = chopDoubleQuotes(config->get<QString>(DspConfig::ddc_file, &fileExists));
206
207 if(!enableExists || !fileExists)
208 {
209 util::warning("DDC file or enable switch unset. Disabling DDC engine.");
210
211 ddcEnable = false;
212 }
213
214 if(ddcEnable)
215 {
216 QFile f(ddcFile);
217 if(!f.exists())
218 {
219 util::warning("Referenced file does not exist 'ddc_file'");
220 return;
221 }
222
223 if (!f.open(QFile::ReadOnly | QFile::Text))
224 {
225 util::error("Cannot open file path in property 'ddc_file'");
226 util::error("Disabling DDC engine");
227 DDCDisable(cast(this->_dsp));
228 return;
229 }
230 QTextStream in(&f);
231 DDCStringParser(cast(this->_dsp), in.readAll().toLocal8Bit().data());
232
233 int ret = DDCEnable(cast(this->_dsp), 1);
234 if (ret <= 0)
235 {
236 util::error("Call to DDCEnable(this->_dsp) failed. Invalid DDC parameter?");
237 util::error("Disabling DDC engine");
238 DDCDisable(cast(this->_dsp));
239 return;
240 }
241 }
242 else
243 {
244 DDCDisable(cast(this->_dsp));
245 }
246}
247
248void DspHost::updateCompander(DspConfig *config)
249{

Callers

nothing calls this directly

Calls 7

chopDoubleQuotesFunction · 0.85
DDCDisableFunction · 0.85
castFunction · 0.85
DDCStringParserFunction · 0.85
DDCEnableFunction · 0.85
existsMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected