| 197 | } |
| 198 | |
| 199 | void 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 | |
| 248 | void DspHost::updateCompander(DspConfig *config) |
| 249 | { |
nothing calls this directly
no test coverage detected