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

Method updateFirEqualizer

src/audio/base/DspHost.cpp:157–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void DspHost::updateFirEqualizer(DspConfig *config)
158{
159 bool typeExists;
160 bool interpolationExists;
161
162 int filterType = config->get<float>(DspConfig::tone_filtertype, &typeExists);
163 int interpolationMode = config->get<float>(DspConfig::tone_interpolation, &interpolationExists);
164
165 if(!typeExists || !interpolationExists)
166 {
167 util::warning("Filter type or interpolation mode unset. Using defaults.");
168
169 if(!typeExists) filterType = 0;
170 else if (!interpolationExists) interpolationMode = 0;
171 }
172
173 std::string str = chopDoubleQuotes(config->get<QString>(DspConfig::tone_eq)).toStdString();
174 std::vector<string> v;
175 std::stringstream ss(str);
176
177 while (ss.good()) {
178 std::string substr;
179 getline(ss, substr, ';');
180 v.push_back(substr);
181 }
182
183 if(v.size() != 30)
184 {
185 util::warning("Invalid EQ data. 30 semicolon-separateds field expected, "
186 "found " + std::to_string(v.size()) + " fields instead.");
187 return;
188 }
189
190 double param[30];
191 for (int i = 0; i < 30; i++)
192 {
193 param[i] = (double)std::stod(v[i]);
194 }
195
196 MultimodalEqualizerAxisInterpolation(cast(this->_dsp), interpolationMode, filterType, param, param + 15);
197}
198
199void DspHost::updateVdc(DspConfig *config)
200{

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected