Mercurial > hg > vamp-test-plugin
comparison VampTestPlugin.cpp @ 32:4834aa2b49a6
Add curve-fsr-mixed output to test hosts on fixed-sample-rate features which sometimes omit timestamps
| author | Chris Cannam | 
|---|---|
| date | Wed, 14 Sep 2016 17:13:34 +0100 | 
| parents | c5c40824800a | 
| children | 60d48ba79ca1 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 31:c5c40824800a | 32:4834aa2b49a6 | 
|---|---|
| 239 list.push_back(d); | 239 list.push_back(d); | 
| 240 | 240 | 
| 241 d.identifier = "curve-fsr-timed"; | 241 d.identifier = "curve-fsr-timed"; | 
| 242 d.name = "Curve: FixedSampleRate/Timed"; | 242 d.name = "Curve: FixedSampleRate/Timed"; | 
| 243 d.description = "A time series with a fixed sample rate (independent of process step size) but with timestamps on features"; | 243 d.description = "A time series with a fixed sample rate (independent of process step size) but with timestamps on features"; | 
| 244 d.unit = ""; | |
| 245 d.hasFixedBinCount = true; | |
| 246 d.binCount = 1; | |
| 247 d.hasKnownExtents = false; | |
| 248 d.isQuantized = false; | |
| 249 d.sampleType = OutputDescriptor::FixedSampleRate; | |
| 250 d.sampleRate = 2.5; | |
| 251 d.hasDuration = false; | |
| 252 m_outputNumbers[d.identifier] = n++; | |
| 253 list.push_back(d); | |
| 254 | |
| 255 d.identifier = "curve-fsr-mixed"; | |
| 256 d.name = "Curve: FixedSampleRate/Mixed"; | |
| 257 d.description = "A time series with a fixed sample rate (independent of process step size) and with timestamps on some features"; | |
| 244 d.unit = ""; | 258 d.unit = ""; | 
| 245 d.hasFixedBinCount = true; | 259 d.hasFixedBinCount = true; | 
| 246 d.binCount = 1; | 260 d.binCount = 1; | 
| 247 d.hasKnownExtents = false; | 261 d.hasKnownExtents = false; | 
| 248 d.isQuantized = false; | 262 d.isQuantized = false; | 
| 520 } | 534 } | 
| 521 fs[m_outputNumbers["curve-fsr-timed"]] | 535 fs[m_outputNumbers["curve-fsr-timed"]] | 
| 522 .push_back(snappedCurveValue(RealTime::fromSeconds(s), | 536 .push_back(snappedCurveValue(RealTime::fromSeconds(s), | 
| 523 RealTime::fromSeconds(snap(s, 0.4)), | 537 RealTime::fromSeconds(snap(s, 0.4)), | 
| 524 i, 10)); | 538 i, 10)); | 
| 539 } | |
| 540 | |
| 541 for (int i = 0; i < 10; ++i) { | |
| 542 static std::vector<float> times { | |
| 543 2.4, 2.9, 3.14, 3.5, 4.0, 3.7, 4, 4.4, 4.8, 5 | |
| 544 }; | |
| 545 float s = times[i]; | |
| 546 float sn = snap(s, 0.4) + 1e-5; // to avoid printing e.g. 2.799 | |
| 547 if (i == 4 || i == 8) { | |
| 548 fs[m_outputNumbers["curve-fsr-mixed"]] | |
| 549 .push_back(untimedCurveValue(RealTime::fromSeconds(s), | |
| 550 i, 10)); | |
| 551 } else { | |
| 552 fs[m_outputNumbers["curve-fsr-mixed"]] | |
| 553 .push_back(snappedCurveValue(RealTime::fromSeconds(s), | |
| 554 RealTime::fromSeconds(sn), | |
| 555 i, 10)); | |
| 556 } | |
| 525 } | 557 } | 
| 526 | 558 | 
| 527 for (int i = 0; i < 10; ++i) { | 559 for (int i = 0; i < 10; ++i) { | 
| 528 fs[m_outputNumbers["grid-fsr"]] | 560 fs[m_outputNumbers["grid-fsr"]] | 
| 529 .push_back(gridColumn(RealTime::fromSeconds(i / 2.5), i, 10)); | 561 .push_back(gridColumn(RealTime::fromSeconds(i / 2.5), i, 10)); | 
