Mercurial > hg > vamp-plugin-sdk
diff host/vamp-simple-host.cpp @ 167:31eda4b11f2b
* First bit of Vamp v2 work -- add an optional duration to features in
a backward compatible way.
Warning: this code is unstable and experimental and may change
significantly in the coming weeks.
author | cannam |
---|---|
date | Thu, 17 Jul 2008 08:52:26 +0000 |
parents | 44e6b94c2696 |
children | 1982246a3902 |
line wrap: on
line diff
--- a/host/vamp-simple-host.cpp Wed Jul 09 11:00:16 2008 +0000 +++ b/host/vamp-simple-host.cpp Thu Jul 17 08:52:26 2008 +0000 @@ -434,7 +434,15 @@ (features[output][i].timestamp, sr); } - (out ? *out : cout) << displayFrame << ":"; + (out ? *out : cout) << displayFrame; + + if (features[output][i].hasDuration) { + displayFrame = RealTime::realTime2Frame + (features[output][i].duration, sr); + (out ? *out : cout) << "," << displayFrame; + } + + (out ? *out : cout) << ":"; } else { @@ -444,7 +452,14 @@ rt = features[output][i].timestamp; } - (out ? *out : cout) << rt.toString() << ":"; + (out ? *out : cout) << rt.toString(); + + if (features[output][i].hasDuration) { + rt = features[output][i].duration; + (out ? *out : cout) << "," << rt.toString(); + } + + (out ? *out : cout) << ":"; } for (unsigned int j = 0; j < features[output][i].values.size(); ++j) {