annotate vamp-sdk/hostext/PluginWrapper.h @ 63:c747d9b97af3 host-factory-stuff

* documentation
author cannam
date Fri, 01 Jun 2007 15:04:19 +0000
parents fe5486ee1c70
children
rev   line source
cannam@57 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
cannam@57 2
cannam@57 3 /*
cannam@57 4 Vamp
cannam@57 5
cannam@57 6 An API for audio analysis and feature extraction plugins.
cannam@57 7
cannam@57 8 Centre for Digital Music, Queen Mary, University of London.
cannam@57 9 Copyright 2006 Chris Cannam.
cannam@57 10
cannam@57 11 Permission is hereby granted, free of charge, to any person
cannam@57 12 obtaining a copy of this software and associated documentation
cannam@57 13 files (the "Software"), to deal in the Software without
cannam@57 14 restriction, including without limitation the rights to use, copy,
cannam@57 15 modify, merge, publish, distribute, sublicense, and/or sell copies
cannam@57 16 of the Software, and to permit persons to whom the Software is
cannam@57 17 furnished to do so, subject to the following conditions:
cannam@57 18
cannam@57 19 The above copyright notice and this permission notice shall be
cannam@57 20 included in all copies or substantial portions of the Software.
cannam@57 21
cannam@57 22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
cannam@57 23 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
cannam@57 24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
cannam@57 25 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
cannam@57 26 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
cannam@57 27 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
cannam@57 28 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
cannam@57 29
cannam@57 30 Except as contained in this notice, the names of the Centre for
cannam@57 31 Digital Music; Queen Mary, University of London; and Chris Cannam
cannam@57 32 shall not be used in advertising or otherwise to promote the sale,
cannam@57 33 use or other dealings in this Software without prior written
cannam@57 34 authorization.
cannam@57 35 */
cannam@57 36
cannam@59 37 #ifndef _VAMP_PLUGIN_WRAPPER_H_
cannam@59 38 #define _VAMP_PLUGIN_WRAPPER_H_
cannam@57 39
cannam@57 40 #include <vamp-sdk/Plugin.h>
cannam@57 41
cannam@57 42 namespace Vamp {
cannam@57 43
cannam@59 44 namespace HostExt {
cannam@59 45
cannam@62 46 /**
cannam@62 47 * PluginWrapper is a simple base class for adapter plugins. It takes
cannam@62 48 * a pointer to a "to be wrapped" Vamp plugin on construction, and
cannam@62 49 * provides implementations of all the Vamp plugin methods that simply
cannam@62 50 * delegate through to the wrapped plugin. A subclass can therefore
cannam@62 51 * override only the methods that are meaningful for the particular
cannam@62 52 * adapter.
cannam@62 53 */
cannam@62 54
cannam@57 55 class PluginWrapper : public Plugin
cannam@57 56 {
cannam@57 57 public:
cannam@57 58 virtual ~PluginWrapper();
cannam@57 59
cannam@57 60 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
cannam@57 61 void reset();
cannam@57 62
cannam@57 63 InputDomain getInputDomain() const;
cannam@57 64
cannam@57 65 unsigned int getVampApiVersion() const;
cannam@57 66 std::string getIdentifier() const;
cannam@57 67 std::string getName() const;
cannam@57 68 std::string getDescription() const;
cannam@57 69 std::string getMaker() const;
cannam@57 70 int getPluginVersion() const;
cannam@57 71 std::string getCopyright() const;
cannam@57 72
cannam@57 73 ParameterList getParameterDescriptors() const;
cannam@57 74 float getParameter(std::string) const;
cannam@57 75 void setParameter(std::string, float);
cannam@57 76
cannam@57 77 ProgramList getPrograms() const;
cannam@57 78 std::string getCurrentProgram() const;
cannam@57 79 void selectProgram(std::string);
cannam@57 80
cannam@57 81 size_t getPreferredStepSize() const;
cannam@57 82 size_t getPreferredBlockSize() const;
cannam@57 83
cannam@57 84 size_t getMinChannelCount() const;
cannam@57 85 size_t getMaxChannelCount() const;
cannam@57 86
cannam@57 87 OutputList getOutputDescriptors() const;
cannam@57 88
cannam@57 89 FeatureSet process(const float *const *inputBuffers, RealTime timestamp);
cannam@57 90
cannam@57 91 FeatureSet getRemainingFeatures();
cannam@57 92
cannam@57 93 protected:
cannam@57 94 PluginWrapper(Plugin *plugin); // I take ownership of plugin
cannam@57 95 Plugin *m_plugin;
cannam@57 96 };
cannam@57 97
cannam@57 98 }
cannam@57 99
cannam@59 100 }
cannam@59 101
cannam@57 102 #endif