| 155 | } |
| 156 | |
| 157 | void 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 | |
| 199 | void DspHost::updateVdc(DspConfig *config) |
| 200 | { |
nothing calls this directly
no test coverage detected