annotate skeleton/plugins.cpp @ 541:0e32c328b02a tip

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