diff vamp-sdk/hostext/PluginInputDomainAdapter.h @ 190:1982246a3902

* Provide PluginWrapper method for getting hold of a nested wrapper directly (a bit gross, but useful) * Use the above to enable the simple host to adjust timestamps appropriately when printing out results from input domain adapter wrapped plugins
author cannam
date Wed, 17 Sep 2008 13:16:09 +0000
parents 6683f99107cf
children
line wrap: on
line diff
--- a/vamp-sdk/hostext/PluginInputDomainAdapter.h	Wed Sep 17 11:00:51 2008 +0000
+++ b/vamp-sdk/hostext/PluginInputDomainAdapter.h	Wed Sep 17 13:16:09 2008 +0000
@@ -91,6 +91,29 @@
 
     FeatureSet process(const float *const *inputBuffers, RealTime timestamp);
 
+    /**
+     * Return the amount by which the timestamps supplied to process()
+     * are being incremented when they are passed to the plugin's own
+     * process() implementation.
+     *
+     * The Vamp API mandates that the timestamp passed to the plugin
+     * for time-domain input should be the time of the first sample in
+     * the block, but the timestamp passed for frequency-domain input
+     * should be the timestamp of the centre of the block.
+     *
+     * The PluginInputDomainAdapter adjusts its timestamps properly so
+     * that the plugin receives correct times, but in some
+     * circumstances (such as for establishing the correct timing of
+     * implicitly-timed features, i.e. features without their own
+     * timestamps) the host may need to be aware that this adjustment
+     * is taking place.
+     *
+     * If the plugin requires time-domain input, this function will
+     * return zero.  The result of calling this function before
+     * initialise() has been called is undefined.
+     */
+    RealTime getTimestampAdjustment() const;
+
 protected:
     class Impl;
     Impl *m_impl;