Mercurial > hg > nnls-chroma
comparison plugins.cpp @ 35:cf8898a0174c matthiasm-plugin
* Split out NNLSChroma plugin into three plugins (chroma, chordino, tuning) with a common base class.
There's still quite a lot of duplication between the getRemainingFeatures functions.
Also add copyright / copying headers, etc.
author | Chris Cannam |
---|---|
date | Fri, 22 Oct 2010 11:30:21 +0100 |
parents | 8aa2e8b3a778 |
children |
comparison
equal
deleted
inserted
replaced
34:8edcf48f4031 | 35:cf8898a0174c |
---|---|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
1 | 2 |
2 // This is a skeleton file for use in creating your own plugin | 3 /* |
3 // libraries. Replace MyPlugin and myPlugin throughout with the name | 4 NNLS-Chroma / Chordino |
4 // of your first plugin class, and fill in the gaps as appropriate. | |
5 | 5 |
6 Audio feature extraction plugins for chromagram and chord | |
7 estimation. | |
8 | |
9 Centre for Digital Music, Queen Mary University of London. | |
10 This file copyright 2008-2010 Matthias Mauch and QMUL. | |
11 | |
12 This program is free software; you can redistribute it and/or | |
13 modify it under the terms of the GNU General Public License as | |
14 published by the Free Software Foundation; either version 2 of the | |
15 License, or (at your option) any later version. See the file | |
16 COPYING included with this distribution for more information. | |
17 */ | |
6 | 18 |
7 #include <vamp/vamp.h> | 19 #include <vamp/vamp.h> |
8 #include <vamp-sdk/PluginAdapter.h> | 20 #include <vamp-sdk/PluginAdapter.h> |
9 | 21 |
10 #include "NNLSChroma.h" | 22 #include "NNLSChroma.h" |
23 #include "Chordino.h" | |
24 #include "Tuning.h" | |
11 | 25 |
12 | 26 |
13 // Declare one static adapter here for each plugin class in this library. | 27 static Vamp::PluginAdapter<NNLSChroma> chromaAdapter; |
28 static Vamp::PluginAdapter<Chordino> chordinoAdapter; | |
29 static Vamp::PluginAdapter<Tuning> tuningAdapter; | |
14 | 30 |
15 static Vamp::PluginAdapter<NNLSChroma> myPluginAdapter; | |
16 | |
17 | |
18 // This is the entry-point for the library, and the only function that | |
19 // needs to be publicly exported. | |
20 | 31 |
21 const VampPluginDescriptor * | 32 const VampPluginDescriptor * |
22 vampGetPluginDescriptor(unsigned int version, unsigned int index) | 33 vampGetPluginDescriptor(unsigned int version, unsigned int index) |
23 { | 34 { |
24 if (version < 1) return 0; | 35 if (version < 1) return 0; |
27 // and return 0 for the first index after you run out of plugins. | 38 // and return 0 for the first index after you run out of plugins. |
28 // (That's how the host finds out how many plugins are in this | 39 // (That's how the host finds out how many plugins are in this |
29 // library.) | 40 // library.) |
30 | 41 |
31 switch (index) { | 42 switch (index) { |
32 case 0: return myPluginAdapter.getDescriptor(); | 43 case 0: return chromaAdapter.getDescriptor(); |
44 case 1: return chordinoAdapter.getDescriptor(); | |
45 case 2: return tuningAdapter.getDescriptor(); | |
33 default: return 0; | 46 default: return 0; |
34 } | 47 } |
35 } | 48 } |
36 | 49 |
37 | 50 |