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