Mercurial > hg > vamp-plugin-sdk
changeset 210:a5187dad96cd
* Add example plugins VC project -- though it doesn't produce a working library yet
author | cannam |
---|---|
date | Fri, 17 Oct 2008 21:59:35 +0000 |
parents | 0f6616ef0e18 |
children | caa9d07bb9bd |
files | VampExamplePlugins.vcproj examples/PercussionOnsetDetector.cpp examples/SpectralCentroid.cpp |
diffstat | 3 files changed, 271 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/VampExamplePlugins.vcproj Fri Oct 17 21:59:35 2008 +0000 @@ -0,0 +1,258 @@ +<?xml version="1.0" encoding="UTF-8"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9.00" + Name="VampExamplePlugins" + ProjectGUID="{B3D1F5A4-4571-4D20-B184-8ACD03D6C97A}" + RootNamespace="VampExamplePlugins" + Keyword="Win32Proj" + TargetFrameworkVersion="0" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="Debug" + IntermediateDirectory="Debug" + ConfigurationType="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories=""$(ProjectDir)"" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;VAMPEXAMPLEPLUGINS_EXPORTS" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + LinkIncremental="2" + GenerateDebugInformation="true" + SubSystem="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="Release" + IntermediateDirectory="Release" + ConfigurationType="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;VAMPEXAMPLEPLUGINS_EXPORTS;" + RuntimeLibrary="2" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + LinkIncremental="2" + GenerateDebugInformation="true" + SubSystem="2" + OptimizeReferences="2" + EnableCOMDATFolding="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" + > + <File + RelativePath=".\examples\AmplitudeFollower.h" + > + </File> + <File + RelativePath=".\examples\FixedTempoEstimator.h" + > + </File> + <File + RelativePath=".\examples\PercussionOnsetDetector.h" + > + </File> + <File + RelativePath=".\vamp-sdk\Plugin.h" + > + </File> + <File + RelativePath=".\vamp-sdk\PluginAdapter.h" + > + </File> + <File + RelativePath=".\vamp-sdk\PluginBase.h" + > + </File> + <File + RelativePath=".\vamp-sdk\RealTime.h" + > + </File> + <File + RelativePath=".\examples\SpectralCentroid.h" + > + </File> + <File + RelativePath=".\vamp\vamp.h" + > + </File> + <File + RelativePath=".\examples\ZeroCrossing.h" + > + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" + > + </Filter> + <Filter + Name="Source Files" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath=".\examples\AmplitudeFollower.cpp" + > + </File> + <File + RelativePath=".\examples\FixedTempoEstimator.cpp" + > + </File> + <File + RelativePath=".\examples\PercussionOnsetDetector.cpp" + > + </File> + <File + RelativePath=".\vamp-sdk\PluginAdapter.cpp" + > + </File> + <File + RelativePath=".\examples\plugins.cpp" + > + </File> + <File + RelativePath=".\vamp-sdk\RealTime.cpp" + > + </File> + <File + RelativePath=".\examples\SpectralCentroid.cpp" + > + </File> + <File + RelativePath=".\examples\ZeroCrossing.cpp" + > + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject>
--- a/examples/PercussionOnsetDetector.cpp Thu Oct 16 16:26:00 2008 +0000 +++ b/examples/PercussionOnsetDetector.cpp Fri Oct 17 21:59:35 2008 +0000 @@ -267,7 +267,7 @@ Feature onset; onset.hasTimestamp = true; onset.timestamp = ts - Vamp::RealTime::frame2RealTime - (m_stepSize, lrintf(m_inputSampleRate)); + (m_stepSize, int(m_inputSampleRate + 0.5)); returnFeatures[0].push_back(onset); }
--- a/examples/SpectralCentroid.cpp Thu Oct 16 16:26:00 2008 +0000 +++ b/examples/SpectralCentroid.cpp Fri Oct 17 21:59:35 2008 +0000 @@ -41,8 +41,12 @@ using std::cerr; using std::endl; -#include <cmath> +#include <math.h> +#ifdef WIN32 +#define isnan(x) false +#define isinf(x) false +#endif SpectralCentroid::SpectralCentroid(float inputSampleRate) : Plugin(inputSampleRate), @@ -169,15 +173,15 @@ Feature feature; feature.hasTimestamp = false; - if (!std::isnan(centroidLog) && !std::isinf(centroidLog)) { - feature.values.push_back(centroidLog); - } + if (!isnan(centroidLog) && !isinf(centroidLog)) { + feature.values.push_back(centroidLog); + } returnFeatures[0].push_back(feature); - feature.values.clear(); - if (!std::isnan(centroidLin) && !std::isinf(centroidLin)) { - feature.values.push_back(centroidLin); - } + feature.values.clear(); + if (!isnan(centroidLin) && !isinf(centroidLin)) { + feature.values.push_back(centroidLin); + } returnFeatures[1].push_back(feature); }