Mercurial > hg > vamp-plugin-sdk
comparison vamp-sdk/hostext/PluginInputDomainAdapter.h @ 62:fe5486ee1c70 host-factory-stuff
* Documentation
author | cannam |
---|---|
date | Fri, 01 Jun 2007 15:00:51 +0000 |
parents | 97c5ac99d725 |
children |
comparison
equal
deleted
inserted
replaced
61:97c5ac99d725 | 62:fe5486ee1c70 |
---|---|
42 namespace Vamp { | 42 namespace Vamp { |
43 | 43 |
44 namespace HostExt { | 44 namespace HostExt { |
45 | 45 |
46 /** | 46 /** |
47 * An adapter that converts time-domain input into frequency-domain | 47 * PluginInputDomainAdapter is a Vamp plugin adapter that converts |
48 * input for plugins that need it. In every other respect this | 48 * time-domain input into frequency-domain input for plugins that need |
49 * adapter behaves like the plugin it wraps. The wrapped plugin may | 49 * it. This permits a host to use time- and frequency-domain plugins |
50 * be a time-domain plugin, in which case this wrapper does nothing. | 50 * interchangeably without needing to handle the conversion itself. |
51 * | 51 * |
52 * Uses a Hanning windowed FFT. The FFT implementation is not the | 52 * This adapter uses a basic Hanning windowed FFT that supports |
53 * fastest, so a host can do much better if it cares enough, but it is | 53 * power-of-two block sizes only. If a frequency domain plugin |
54 * simple and self-contained. | 54 * requests a non-power-of-two blocksize, the adapter will adjust it |
55 * to a nearby power of two instead. Thus, getPreferredBlockSize() | |
56 * will always return a power of two if the wrapped plugin is a | |
57 * frequency domain one. If the plugin doesn't accept the adjusted | |
58 * power of two block size, initialise() will fail. | |
55 * | 59 * |
56 * Note that this adapter does not support non-power-of-two block | 60 * The adapter provides no way for the host to discover whether the |
57 * sizes. | 61 * underlying plugin is actually a time or frequency domain plugin |
62 * (except that if the preferred block size is not a power of two, it | |
63 * must be a time domain plugin). | |
64 * | |
65 * The FFT implementation is simple and self-contained, but unlikely | |
66 * to be the fastest available: a host can usually do better if it | |
67 * cares enough. | |
68 * | |
69 * In every respect other than its input domain handling, the | |
70 * PluginInputDomainAdapter behaves identically to the plugin that it | |
71 * wraps. The wrapped plugin will be deleted when the wrapper is | |
72 * deleted. | |
58 */ | 73 */ |
59 | |
60 //!!! It would also be nice to have a channel wrapper, which deals | |
61 //with mixing down channels if the plugin needs a different number | |
62 //from the input source. It would have some sort of mixdown/channel | |
63 //input policy selection. Probably this class and that one should | |
64 //both inherit a PluginAdapter class which contains a plugin and | |
65 //delegates all calls through to it; the subclass can then override | |
66 //only the ones it needs to handle. | |
67 | 74 |
68 class PluginInputDomainAdapter : public PluginWrapper | 75 class PluginInputDomainAdapter : public PluginWrapper |
69 { | 76 { |
70 public: | 77 public: |
71 PluginInputDomainAdapter(Plugin *plugin); // I take ownership of plugin | 78 PluginInputDomainAdapter(Plugin *plugin); // I take ownership of plugin |