comparison plugin/FeatureExtractionPlugin.h @ 58:0a34d529f8e0

* Add C API for feature extraction plugins * First cut of an adapter class to make C++ feature extraction plugins available using the C API. This will probably mutate quite a bit and likely move to its own SDK tree.
author Chris Cannam
date Fri, 24 Mar 2006 17:36:10 +0000
parents 7439f1696314
children
comparison
equal deleted inserted replaced
57:7439f1696314 58:0a34d529f8e0
34 * 34 *
35 * Note that this class inherits several abstract methods from 35 * Note that this class inherits several abstract methods from
36 * PluginInstance, that must be implemented by the subclass. 36 * PluginInstance, that must be implemented by the subclass.
37 */ 37 */
38 38
39 /**
40 * Plugin Lifecycle
41 * ================
42 *
43 * Feature extraction plugins are managed differently from real-time
44 * plugins. The main difference is that the parameters for a feature
45 * extraction plugin are configured before the plugin is used, and do
46 * not change during use.
47 *
48 * 1. Host constructs the plugin, passing it the input sample rate.
49 * The plugin may do basic initialisation, but should not do anything
50 * computationally expensive at this point.
51 *
52 * 2. Host may query the plugin's available outputs.
53 *
54 * 3. Host queries programs and parameter descriptors, and may set
55 * some or all of them. Parameters that are not explicitly set should
56 * take their default values as specified in the parameter descriptor.
57 * When a program is set, the parameter values may change and the host
58 * will re-query them to check.
59 *
60 * 4. Host queries the preferred step size, block size, number of
61 * channels, and the number of values per feature for the plugin's
62 * outputs. These may all vary depending on the parameter values.
63 *
64 * 5. Plugin is properly initialised with a call to initialise. This
65 * fixes the step size, block size, and number of channels, as well as
66 * all of the parameter and program settings. If the values passed in
67 * to initialise do not match the plugin's advertised preferred values
68 * from step 4, the plugin may refuse to initialise and return false
69 * (although if possible it should accept the new values).
70 *
71 * 6. Host will repeatedly call the process method to pass in blocks
72 * of input data. This method may return features extracted from that
73 * data (if the plugin is causal).
74 *
75 * 7. Host will call getRemainingFeatures exactly once, after all the
76 * input data has been processed. This may return any non-causal or
77 * leftover features.
78 *
79 * 8. At any point after initialise was called, the host may
80 * optionally call the reset method and restart processing. (This
81 * does not mean it can change the parameters, which are fixed from
82 * initialise until destruction.)
83 *
84 * A plugin does not need to handle the case where setParameter or
85 * selectProgram is called after initialise has been called. It's the
86 * host's responsibility not to do that.
87 */
88
39 class FeatureExtractionPlugin : public PluginInstance 89 class FeatureExtractionPlugin : public PluginInstance
40 { 90 {
41 public: 91 public:
42 /** 92 /**
43 * Initialise a plugin to prepare it for use with the given number 93 * Initialise a plugin to prepare it for use with the given number