# HG changeset patch # User Chris Cannam # Date 1413382816 -3600 # Node ID 3e30dbb68ca2a2c83104387c0baff9f3537bad1e # Parent e5873fb4ffb3f79f01af6966b215d0d825381aa4 Write time or start/end based simply on whether the feature has them or not, let's not get clever diff -r e5873fb4ffb3 -r 3e30dbb68ca2 runner/JAMSFeatureWriter.cpp --- a/runner/JAMSFeatureWriter.cpp Wed Oct 15 14:56:39 2014 +0100 +++ b/runner/JAMSFeatureWriter.cpp Wed Oct 15 15:20:16 2014 +0100 @@ -121,36 +121,17 @@ Plugin::Feature f(features[i]); - switch (m_tasks[transformId]) { - - case ChordTask: - case SegmentTask: - case NoteTask: - case UnknownTask: - if (f.hasDuration) { - d += QString - ("\"start\": { \"value\": %1 }, " - "\"end\": { \"value\": %2 }") - .arg(realTime2Sec(f.timestamp)) - .arg(realTime2Sec - (f.timestamp + - (f.hasDuration ? f.duration : Vamp::RealTime::zeroTime))); - break; - } else { - // don't break; fall through to simpler no-duration case - } - - case BeatTask: - case KeyTask: - case OnsetTask: + if (f.hasDuration) { + d += QString + ("\"start\": { \"value\": %1 }, " + "\"end\": { \"value\": %2 }") + .arg(realTime2Sec(f.timestamp)) + .arg(realTime2Sec + (f.timestamp + + (f.hasDuration ? f.duration : Vamp::RealTime::zeroTime))); + } else { d += QString("\"time\": { \"value\": %1 }") .arg(realTime2Sec(f.timestamp)); - break; - - case MelodyTask: - case PitchTask: - //!!! - break; } if (f.label != "") {