changeset 3:991d0fe8bb27

* Add plugin entry point and make it build correctly
author Chris Cannam <c.cannam@qmul.ac.uk>
date Thu, 06 Apr 2006 12:02:34 +0000
parents c10bbd8fe62a
children ffd3c1699bee
files libmain.cpp plugins/BeatDetect.cpp plugins/BeatDetect.h plugins/ChromagramPlugin.cpp plugins/ChromagramPlugin.h plugins/TonalChangeDetect.cpp plugins/TonalChangeDetect.h qm-vamp-plugins.pro
diffstat 8 files changed, 57 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libmain.cpp	Thu Apr 06 12:02:34 2006 +0000
@@ -0,0 +1,30 @@
+/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
+
+/*
+    QM Vamp Plugin Set
+
+    Centre for Digital Music, Queen Mary, University of London.
+    All rights reserved.
+*/
+
+#include <vamp/vamp.h>
+#include <vamp-sdk/PluginAdapter.h>
+
+#include "plugins/BeatDetect.h"
+#include "plugins/ChromagramPlugin.h"
+#include "plugins/TonalChangeDetect.h"
+
+static Vamp::PluginAdapter<BeatDetector> beatDetectorAdapter;
+static Vamp::PluginAdapter<ChromagramPlugin> chromagramPluginAdapter;
+static Vamp::PluginAdapter<TonalChangeDetect> tonalChangeDetectorAdapter;
+
+const VampPluginDescriptor *vampGetPluginDescriptor(unsigned int index)
+{
+    switch (index) {
+    case  0: return beatDetectorAdapter.getDescriptor();
+    case  1: return chromagramPluginAdapter.getDescriptor();
+    case  2: return tonalChangeDetectorAdapter.getDescriptor();
+    default: return 0;
+    }
+}
+
--- a/plugins/BeatDetect.cpp	Thu Apr 06 10:45:20 2006 +0000
+++ b/plugins/BeatDetect.cpp	Thu Apr 06 12:02:34 2006 +0000
@@ -9,8 +9,8 @@
 
 #include "BeatDetect.h"
 
-#include "dsp/onsets/DetectionFunction.h"
-#include "dsp/tempotracking/TempoTrack.h"
+#include <dsp/onsets/DetectionFunction.h>
+#include <dsp/tempotracking/TempoTrack.h>
 
 using std::string;
 using std::vector;
--- a/plugins/BeatDetect.h	Thu Apr 06 10:45:20 2006 +0000
+++ b/plugins/BeatDetect.h	Thu Apr 06 12:02:34 2006 +0000
@@ -7,12 +7,10 @@
     All rights reserved.
 */
 
-//!!! This guard inadequate, must be unique to plugin if plugin is to
-//be compilable in with app as well as being, well, a plugin
 #ifndef _BEAT_DETECT_PLUGIN_H_
 #define _BEAT_DETECT_PLUGIN_H_
 
-#include "vamp-sdk/Plugin.h"
+#include <vamp-sdk/Plugin.h>
 
 class BeatDetectorData;
 
--- a/plugins/ChromagramPlugin.cpp	Thu Apr 06 10:45:20 2006 +0000
+++ b/plugins/ChromagramPlugin.cpp	Thu Apr 06 12:02:34 2006 +0000
@@ -9,8 +9,8 @@
 
 #include "ChromagramPlugin.h"
 
-#include "base/Pitch.h"
-#include "dsp/chromagram/Chromagram.h"
+#include <base/Pitch.h>
+#include <dsp/chromagram/Chromagram.h>
 
 using std::string;
 using std::vector;
--- a/plugins/ChromagramPlugin.h	Thu Apr 06 10:45:20 2006 +0000
+++ b/plugins/ChromagramPlugin.h	Thu Apr 06 12:02:34 2006 +0000
@@ -7,13 +7,11 @@
     All rights reserved.
 */
 
-//!!! This guard inadequate, must be unique to plugin if plugin is to
-//be compilable in with app as well as being, well, a plugin
 #ifndef _CHROMAGRAM_PLUGIN_H_
 #define _CHROMAGRAM_PLUGIN_H_
 
-#include "vamp-sdk/Plugin.h"
-#include "dsp/chromagram/Chromagram.h"
+#include <vamp-sdk/Plugin.h>
+#include <dsp/chromagram/Chromagram.h>
 
 #include <queue>
 
--- a/plugins/TonalChangeDetect.cpp	Thu Apr 06 10:45:20 2006 +0000
+++ b/plugins/TonalChangeDetect.cpp	Thu Apr 06 12:02:34 2006 +0000
@@ -9,9 +9,9 @@
 
 #include "TonalChangeDetect.h"
 
-#include "base/Pitch.h"
-#include "dsp/chromagram/Chromagram.h"
-#include "dsp/tonal/ChangeDetectionFunction.h"
+#include <base/Pitch.h>
+#include <dsp/chromagram/Chromagram.h>
+#include <dsp/tonal/ChangeDetectionFunction.h>
 
 TonalChangeDetect::TonalChangeDetect(float fInputSampleRate)	
     : Vamp::Plugin(fInputSampleRate),
--- a/plugins/TonalChangeDetect.h	Thu Apr 06 10:45:20 2006 +0000
+++ b/plugins/TonalChangeDetect.h	Thu Apr 06 12:02:34 2006 +0000
@@ -10,11 +10,11 @@
 #ifndef _TONALCHANGEDETECT_
 #define _TONALCHANGEDETECT_
 
-#include "dsp/chromagram/Chromagram.h"
-#include "dsp/tonal/TonalEstimator.h"
-#include "dsp/tonal/TCSgram.h"
+#include <vamp-sdk/Plugin.h>
 
-#include "vamp-sdk/Plugin.h"
+#include <dsp/chromagram/Chromagram.h>
+#include <dsp/tonal/TonalEstimator.h>
+#include <dsp/tonal/TCSgram.h>
 
 #include <queue>
 #include <vector>
--- a/qm-vamp-plugins.pro	Thu Apr 06 10:45:20 2006 +0000
+++ b/qm-vamp-plugins.pro	Thu Apr 06 12:02:34 2006 +0000
@@ -1,9 +1,16 @@
+
 TEMPLATE = lib
-CONFIG += release warn_on dll
+
+CONFIG += plugin warn_on release
+CONFIG -= qt
+
 OBJECTS_DIR = tmp_obj
 MOC_DIR = tmp_moc
 
-INCLUDEPATH += ../../sonic-visualiser/plugin/vamp-plugin-sdk ../../qm-dsp/trunk
+INCLUDEPATH += ../vamp-plugin-sdk ../qm-dsp
+LIBPATH += ../qm-dsp
+
+LIBS += -lqm-dsp
 
 DEPENDPATH += plugins
 INCLUDEPATH += . plugins
@@ -14,4 +21,7 @@
            plugins/TonalChangeDetect.h
 SOURCES += plugins/BeatDetect.cpp \
            plugins/ChromagramPlugin.cpp \
-           plugins/TonalChangeDetect.cpp
+           plugins/TonalChangeDetect.cpp \
+           ../vamp-plugin-sdk/vamp-sdk/PluginAdapter.cpp \
+           ../vamp-plugin-sdk/vamp-sdk/RealTime.cpp \
+           ./libmain.cpp