annotate src/vamp-plugin-sdk-2.4/skeleton/plugins.cpp @ 23:619f715526df sv_v2.1

Update Vamp plugin SDK to 2.5
author Chris Cannam
date Thu, 09 May 2013 10:52:46 +0100
parents b7bda433d832
children
rev   line source
Chris@12 1
Chris@12 2 // This is a skeleton file for use in creating your own plugin
Chris@12 3 // libraries. Replace MyPlugin and myPlugin throughout with the name
Chris@12 4 // of your first plugin class, and fill in the gaps as appropriate.
Chris@12 5
Chris@12 6
Chris@12 7 #include <vamp/vamp.h>
Chris@12 8 #include <vamp-sdk/PluginAdapter.h>
Chris@12 9
Chris@12 10 #include "MyPlugin.h"
Chris@12 11
Chris@12 12
Chris@12 13 // Declare one static adapter here for each plugin class in this library.
Chris@12 14
Chris@12 15 static Vamp::PluginAdapter<MyPlugin> myPluginAdapter;
Chris@12 16
Chris@12 17
Chris@12 18 // This is the entry-point for the library, and the only function that
Chris@12 19 // needs to be publicly exported.
Chris@12 20
Chris@12 21 const VampPluginDescriptor *
Chris@12 22 vampGetPluginDescriptor(unsigned int version, unsigned int index)
Chris@12 23 {
Chris@12 24 if (version < 1) return 0;
Chris@12 25
Chris@12 26 // Return a different plugin adaptor's descriptor for each index,
Chris@12 27 // and return 0 for the first index after you run out of plugins.
Chris@12 28 // (That's how the host finds out how many plugins are in this
Chris@12 29 // library.)
Chris@12 30
Chris@12 31 switch (index) {
Chris@12 32 case 0: return myPluginAdapter.getDescriptor();
Chris@12 33 default: return 0;
Chris@12 34 }
Chris@12 35 }
Chris@12 36
Chris@12 37