diff vamp-sdk/Plugin.h @ 8:c4662bbef275

* Allow plugins to return 0 for preferred block/step size to accept a host default
author cannam
date Mon, 03 Apr 2006 14:19:02 +0000
parents 8f10d35a4090
children 44113b1e296b
line wrap: on
line diff
--- a/vamp-sdk/Plugin.h	Fri Mar 31 17:39:49 2006 +0000
+++ b/vamp-sdk/Plugin.h	Mon Apr 03 14:19:02 2006 +0000
@@ -152,19 +152,29 @@
     virtual InputDomain getInputDomain() const = 0;
 
     /**
+     * Get the preferred block size (window size -- the number of
+     * sample frames passed in each block to the process() function).
+     * This should be called before initialise().
+     *
+     * A plugin that can handle any block size may return 0.  The
+     * final block size will be set in the initialise() call.
+     */
+    virtual size_t getPreferredBlockSize() const { return 0; }
+
+    /**
      * Get the preferred step size (window increment -- the distance
      * in sample frames between the start frames of consecutive blocks
      * passed to the process() function) for the plugin.  This should
      * be called before initialise().
+     *
+     * A plugin may return 0 if it has no particular interest in the
+     * step size.  In this case, the host should make the step size
+     * equal to the block size if the plugin is accepting input in the
+     * time domain.  If the plugin is accepting input in the frequency
+     * domain, the host may use any step size.  The final step size
+     * will be set in the initialise() call.
      */
-    virtual size_t getPreferredStepSize() const = 0;
-
-    /**
-     * Get the preferred block size (window size -- the number of
-     * sample frames passed in each block to the process() function).
-     * This should be called before initialise().
-     */
-    virtual size_t getPreferredBlockSize() const { return getPreferredStepSize(); }
+    virtual size_t getPreferredStepSize() const { return 0; }
 
     /**
      * Get the minimum supported number of input channels.