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

Method updateCompander

src/audio/base/DspHost.cpp:248–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248void 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
281void DspHost::updateStereoWide(DspConfig *config)
282{

Callers

nothing calls this directly

Calls 7

chopDoubleQuotesFunction · 0.85
to_stringFunction · 0.85
CompressorSetParamFunction · 0.85
castFunction · 0.85
CompressorSetGainFunction · 0.85
push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected