Mercurial > hg > nnls-chroma
annotate plugins.cpp @ 184:82d5d11b68d7 tip
Update library URI so it's not document-local
author | Chris Cannam |
---|---|
date | Wed, 22 Apr 2020 14:21:25 +0100 |
parents | cf8898a0174c |
children |
rev | line source |
---|---|
Chris@35 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
matthiasm@0 | 2 |
Chris@35 | 3 /* |
Chris@35 | 4 NNLS-Chroma / Chordino |
matthiasm@0 | 5 |
Chris@35 | 6 Audio feature extraction plugins for chromagram and chord |
Chris@35 | 7 estimation. |
Chris@35 | 8 |
Chris@35 | 9 Centre for Digital Music, Queen Mary University of London. |
Chris@35 | 10 This file copyright 2008-2010 Matthias Mauch and QMUL. |
Chris@35 | 11 |
Chris@35 | 12 This program is free software; you can redistribute it and/or |
Chris@35 | 13 modify it under the terms of the GNU General Public License as |
Chris@35 | 14 published by the Free Software Foundation; either version 2 of the |
Chris@35 | 15 License, or (at your option) any later version. See the file |
Chris@35 | 16 COPYING included with this distribution for more information. |
Chris@35 | 17 */ |
matthiasm@0 | 18 |
matthiasm@0 | 19 #include <vamp/vamp.h> |
matthiasm@0 | 20 #include <vamp-sdk/PluginAdapter.h> |
matthiasm@0 | 21 |
matthiasm@0 | 22 #include "NNLSChroma.h" |
Chris@35 | 23 #include "Chordino.h" |
Chris@35 | 24 #include "Tuning.h" |
matthiasm@0 | 25 |
matthiasm@0 | 26 |
Chris@35 | 27 static Vamp::PluginAdapter<NNLSChroma> chromaAdapter; |
Chris@35 | 28 static Vamp::PluginAdapter<Chordino> chordinoAdapter; |
Chris@35 | 29 static Vamp::PluginAdapter<Tuning> tuningAdapter; |
matthiasm@0 | 30 |
matthiasm@0 | 31 |
matthiasm@0 | 32 const VampPluginDescriptor * |
matthiasm@0 | 33 vampGetPluginDescriptor(unsigned int version, unsigned int index) |
matthiasm@0 | 34 { |
matthiasm@0 | 35 if (version < 1) return 0; |
matthiasm@0 | 36 |
matthiasm@0 | 37 // Return a different plugin adaptor's descriptor for each index, |
matthiasm@0 | 38 // and return 0 for the first index after you run out of plugins. |
matthiasm@0 | 39 // (That's how the host finds out how many plugins are in this |
matthiasm@0 | 40 // library.) |
matthiasm@0 | 41 |
matthiasm@0 | 42 switch (index) { |
Chris@35 | 43 case 0: return chromaAdapter.getDescriptor(); |
Chris@35 | 44 case 1: return chordinoAdapter.getDescriptor(); |
Chris@35 | 45 case 2: return tuningAdapter.getDescriptor(); |
matthiasm@0 | 46 default: return 0; |
matthiasm@0 | 47 } |
matthiasm@0 | 48 } |
matthiasm@0 | 49 |
matthiasm@0 | 50 |