Revision 52:4bd0cd3c60f3 TestDefaults.cpp
| TestDefaults.cpp | ||
|---|---|---|
| 103 | 103 |
Result res; |
| 104 | 104 |
if (options & NonDeterministic) res = note(message); |
| 105 | 105 |
else res = error(message); |
| 106 |
if (options & Verbose) dump(res, f[0], f[1]); |
|
| 106 |
if (options & Verbose) dumpDiff(res, f[0], f[1]);
|
|
| 107 | 107 |
r.push_back(res); |
| 108 | 108 |
} else {
|
| 109 | 109 |
r.push_back(success()); |
| ... | ... | |
| 163 | 163 |
Result res; |
| 164 | 164 |
if (options & NonDeterministic) res = note(message); |
| 165 | 165 |
else res = error(message); |
| 166 |
if (options & Verbose) dump(res, f[0], f[1]); |
|
| 166 |
if (options & Verbose) dumpDiff(res, f[0], f[1]);
|
|
| 167 | 167 |
r.push_back(res); |
| 168 | 168 |
} else {
|
| 169 | 169 |
r.push_back(success()); |
| ... | ... | |
| 224 | 224 |
p->setParameter(pl[i].identifier, value); |
| 225 | 225 |
} |
| 226 | 226 |
|
| 227 |
if (!initAdapted(p.get(), channels, _step, _step, r)) return r; |
|
| 227 |
if (!initAdapted(p.get(), channels, _step, _step, r)) {
|
|
| 228 |
|
|
| 229 |
// OK, plugin didn't like that. Let's try a different tack |
|
| 230 |
// -- set everything to min except those parameters whose |
|
| 231 |
// default is min, and set those to half way instead |
|
| 232 |
|
|
| 233 |
for (int i = 0; i < (int)pl.size(); ++i) {
|
|
| 234 |
float value = pl[i].minValue; |
|
| 235 |
if (value == pl[i].defaultValue) {
|
|
| 236 |
value = (pl[i].maxValue + pl[i].minValue) / 2; |
|
| 237 |
value = ceil(value / pl[i].quantizeStep) * pl[i].quantizeStep; |
|
| 238 |
if (value > pl[i].maxValue) {
|
|
| 239 |
value = pl[i].maxValue; |
|
| 240 |
} |
|
| 241 |
} |
|
| 242 |
p->setParameter(pl[i].identifier, value); |
|
| 243 |
} |
|
| 244 |
|
|
| 245 |
r = Results(); |
|
| 246 |
if (!initAdapted(p.get(), channels, _step, _step, r)) {
|
|
| 247 |
// Still didn't work, give up |
|
| 248 |
return r; |
|
| 249 |
} |
|
| 250 |
} |
|
| 228 | 251 |
|
| 229 | 252 |
// First run: construct, set params, init, process |
| 230 | 253 |
// Second run: construct, set params, init, reset, process |
| ... | ... | |
| 254 | 277 |
Result res; |
| 255 | 278 |
if (options & NonDeterministic) res = note(message); |
| 256 | 279 |
else res = error(message); |
| 257 |
if (options & Verbose) dump(res, f[0], f[1]); |
|
| 280 |
if (options & Verbose) dumpDiff(res, f[0], f[1]);
|
|
| 258 | 281 |
r.push_back(res); |
| 259 | 282 |
} else {
|
| 260 | 283 |
r.push_back(success()); |
Also available in: Unified diff