| 246 | } |
| 247 | |
| 248 | void DspHost::updateCompander(DspConfig *config) |
| 249 | { |
| 250 | int granularity = max(config->get<int>(DspConfig::compander_granularity), 2); |
| 251 | float timeconstant = max(config->get<float>(DspConfig::compander_timeconstant), 0.22); |
| 252 | int tftransforms = config->get<int>(DspConfig::compander_time_freq_transforms); |
| 253 | |
| 254 | std::string str = chopDoubleQuotes(config->get<QString>(DspConfig::compander_response)).toStdString(); |
| 255 | std::vector<string> v; |
| 256 | std::stringstream ss(str); |
| 257 | |
| 258 | while (ss.good()) { |
| 259 | std::string substr; |
| 260 | getline(ss, substr, ';'); |
| 261 | v.push_back(substr); |
| 262 | } |
| 263 | |
| 264 | if(v.size() != 14) |
| 265 | { |
| 266 | util::warning("Invalid compander data. 14 semicolon-separateds field expected, " |
| 267 | "found " + std::to_string(v.size()) + " fields instead."); |
| 268 | return; |
| 269 | } |
| 270 | |
| 271 | double param[14]; |
| 272 | for (int i = 0; i < 14; i++) |
| 273 | { |
| 274 | param[i] = (double)std::stod(v[i]); |
| 275 | } |
| 276 | |
| 277 | CompressorSetParam(cast(this->_dsp), timeconstant, granularity, tftransforms, 0); |
| 278 | CompressorSetGain(cast(this->_dsp), param, param + 7, 1); |
| 279 | } |
| 280 | |
| 281 | void DspHost::updateStereoWide(DspConfig *config) |
| 282 | { |
nothing calls this directly
no test coverage detected