Chris@1: Chris@1: Chris@1:
Chris@1: Chris@3: Chris@1:
Chris@1: VampPluginSDK
Chris@3: 2.4
Chris@1:
Chris@1:
Chris@1: |
Chris@1:
Chris@1:
Chris@1:
Chris@1:
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@1: 00002 Chris@1: 00003 /* Chris@1: 00004 Vamp Chris@1: 00005 Chris@1: 00006 An API for audio analysis and feature extraction plugins. Chris@1: 00007 Chris@1: 00008 Centre for Digital Music, Queen Mary, University of London. Chris@1: 00009 Copyright 2006 Chris Cannam. Chris@1: 00010 Chris@1: 00011 Permission is hereby granted, free of charge, to any person Chris@1: 00012 obtaining a copy of this software and associated documentation Chris@1: 00013 files (the "Software"), to deal in the Software without Chris@1: 00014 restriction, including without limitation the rights to use, copy, Chris@1: 00015 modify, merge, publish, distribute, sublicense, and/or sell copies Chris@1: 00016 of the Software, and to permit persons to whom the Software is Chris@1: 00017 furnished to do so, subject to the following conditions: Chris@1: 00018 Chris@1: 00019 The above copyright notice and this permission notice shall be Chris@1: 00020 included in all copies or substantial portions of the Software. Chris@1: 00021 Chris@1: 00022 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, Chris@1: 00023 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF Chris@1: 00024 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND Chris@1: 00025 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR Chris@1: 00026 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF Chris@1: 00027 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION Chris@1: 00028 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Chris@1: 00029 Chris@1: 00030 Except as contained in this notice, the names of the Centre for Chris@1: 00031 Digital Music; Queen Mary, University of London; and Chris Cannam Chris@1: 00032 shall not be used in advertising or otherwise to promote the sale, Chris@1: 00033 use or other dealings in this Software without prior written Chris@1: 00034 authorization. Chris@1: 00035 */ Chris@1: 00036 Chris@1: 00037 #ifndef _VAMP_SDK_PLUGIN_BASE_H_ Chris@1: 00038 #define _VAMP_SDK_PLUGIN_BASE_H_ Chris@1: 00039 Chris@1: 00040 #include <string> Chris@1: 00041 #include <vector> Chris@1: 00042 Chris@3: 00043 #include "plugguard.h" Chris@3: 00044 _VAMP_SDK_PLUGSPACE_BEGIN(PluginBase.h) Chris@3: 00045 Chris@3: 00046 namespace Vamp { Chris@3: 00047 Chris@3: 00060 class PluginBase Chris@3: 00061 { Chris@3: 00062 public: Chris@3: 00063 virtual ~PluginBase() { } Chris@3: 00064 Chris@3: 00068 virtual unsigned int getVampApiVersion() const { return 2; } Chris@3: 00069 Chris@3: 00083 virtual std::string getIdentifier() const = 0; Chris@3: 00084 Chris@3: 00093 virtual std::string getName() const = 0; Chris@3: 00094 Chris@3: 00103 virtual std::string getDescription() const = 0; Chris@3: 00104 Chris@3: 00111 virtual std::string getMaker() const = 0; Chris@3: 00112 Chris@3: 00118 virtual std::string getCopyright() const = 0; Chris@3: 00119 Chris@3: 00123 virtual int getPluginVersion() const = 0; Chris@3: 00124 Chris@3: 00125 Chris@3: 00126 struct ParameterDescriptor Chris@3: 00127 { Chris@3: 00133 std::string identifier; Chris@3: 00134 Chris@3: 00138 std::string name; Chris@3: 00139 Chris@3: 00144 std::string description; Chris@3: 00145 Chris@3: 00149 std::string unit; Chris@3: 00150 Chris@3: 00154 float minValue; Chris@3: 00155 Chris@3: 00159 float maxValue; Chris@3: 00160 Chris@3: 00167 float defaultValue; Chris@3: 00168 Chris@3: 00173 bool isQuantized; Chris@3: 00174 Chris@3: 00180 float quantizeStep; Chris@3: 00181 Chris@3: 00193 std::vector<std::string> valueNames; Chris@3: 00194 Chris@3: 00195 ParameterDescriptor() : // the defaults are invalid: you must set them Chris@3: 00196 minValue(0), maxValue(0), defaultValue(0), isQuantized(false) { } Chris@3: 00197 }; Chris@1: 00198 Chris@3: 00199 typedef std::vector<ParameterDescriptor> ParameterList; Chris@3: 00200 Chris@3: 00204 virtual ParameterList getParameterDescriptors() const { Chris@3: 00205 return ParameterList(); Chris@3: 00206 } Chris@3: 00207 Chris@3: 00212 virtual float getParameter(std::string) const { return 0.0; } Chris@3: 00213 Chris@3: 00218 virtual void setParameter(std::string, float) { } Chris@3: 00219 Chris@3: 00220 Chris@3: 00221 typedef std::vector<std::string> ProgramList; Chris@3: 00222 Chris@3: 00233 virtual ProgramList getPrograms() const { return ProgramList(); } Chris@3: 00234 Chris@3: 00238 virtual std::string getCurrentProgram() const { return ""; } Chris@3: 00239 Chris@3: 00244 virtual void selectProgram(std::string) { } Chris@3: 00245 Chris@3: 00251 virtual std::string getType() const = 0; Chris@3: 00252 }; Chris@3: 00253 Chris@3: 00254 } Chris@3: 00255 Chris@3: 00256 _VAMP_SDK_PLUGSPACE_END(PluginBase.h) Chris@1: 00257 Chris@3: 00258 #endif Chris@3: