# HG changeset patch # User Chris Cannam # Date 1144324954 0 # Node ID 991d0fe8bb274c534296aac1f66a52731592a792 # Parent c10bbd8fe62a1d1557229f27edf21c7b88f2997c * Add plugin entry point and make it build correctly diff -r c10bbd8fe62a -r 991d0fe8bb27 libmain.cpp --- /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 +#include + +#include "plugins/BeatDetect.h" +#include "plugins/ChromagramPlugin.h" +#include "plugins/TonalChangeDetect.h" + +static Vamp::PluginAdapter beatDetectorAdapter; +static Vamp::PluginAdapter chromagramPluginAdapter; +static Vamp::PluginAdapter 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; + } +} + diff -r c10bbd8fe62a -r 991d0fe8bb27 plugins/BeatDetect.cpp --- 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 +#include using std::string; using std::vector; diff -r c10bbd8fe62a -r 991d0fe8bb27 plugins/BeatDetect.h --- 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 class BeatDetectorData; diff -r c10bbd8fe62a -r 991d0fe8bb27 plugins/ChromagramPlugin.cpp --- 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 +#include using std::string; using std::vector; diff -r c10bbd8fe62a -r 991d0fe8bb27 plugins/ChromagramPlugin.h --- 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 +#include #include diff -r c10bbd8fe62a -r 991d0fe8bb27 plugins/TonalChangeDetect.cpp --- 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 +#include +#include TonalChangeDetect::TonalChangeDetect(float fInputSampleRate) : Vamp::Plugin(fInputSampleRate), diff -r c10bbd8fe62a -r 991d0fe8bb27 plugins/TonalChangeDetect.h --- 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 -#include "vamp-sdk/Plugin.h" +#include +#include +#include #include #include diff -r c10bbd8fe62a -r 991d0fe8bb27 qm-vamp-plugins.pro --- 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