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