From: <fea...@li...> - 2006-03-09 20:43:28
|
Revision: 63 Author: alex_lerch Date: 2006-03-09 12:42:36 -0800 (Thu, 09 Mar 2006) ViewCVS: http://svn.sourceforge.net/feapi/?rev=63&view=rev Log Message: ----------- - added loudness plugin to examples - added spectral features plugin to examples - added HostUtilities and HostDeclarations to Host_C examples/host/Host_C/FEAPIExampleHost_C.cpp - changed some license headers in examples Modified Paths: -------------- trunk/FEAPI/build/Win/FEAPI.dsw trunk/FEAPI/build/Win/FEAPIHost_C/FEAPITestCL.dsp trunk/FEAPI/examples/host/Host_C/FEAPIExampleHost_C.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginFindMax/FEAPIExamplePluginFindMax.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginZeroCrossings/FEAPIExamplePluginZeroCrossings.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginZeroCrossings/RingBuffer.h trunk/FEAPI/examples/plugin/FEAPIExamplePluginZeroCrossings/fft.h trunk/FEAPI/examples/plugin/FEAPIExamplePluginZeroCrossings/zplFFTGen.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginZeroCrossings/zplFFT_If.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginZeroCrossings/zplVecLib.h trunk/FEAPI/examples/plugin/FEAPIExamplePluginZeroCrossings/zplVecLibDispatch.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginZeroCrossings/zplVecLibGen.cpp trunk/FEAPI/sdk/host/src/FEAPIHostUtilities.cpp Added Paths: ----------- trunk/FEAPI/build/Win/ExamplePluginLoudness/ trunk/FEAPI/build/Win/ExamplePluginLoudness/ExamplePluginLoudness.def trunk/FEAPI/build/Win/ExamplePluginLoudness/ExamplePluginLoudness.dsp trunk/FEAPI/build/Win/ExamplePluginSpectral/ trunk/FEAPI/build/Win/ExamplePluginSpectral/ExamplePluginSpectral.def trunk/FEAPI/build/Win/ExamplePluginSpectral/ExamplePluginSpectral.dsp trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/ trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/FEAPIExamplePluginLoudness.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/FEAPIExamplePluginLoudness.h trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/RingBuffer.h trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/fft.h trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/zplFFTGen.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/zplFFTGenCore.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/zplFFT_If.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/zplVecLib.h trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/zplVecLibDispatch.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/zplVecLibGen.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginSpectral/ trunk/FEAPI/examples/plugin/FEAPIExamplePluginSpectral/FEAPIExamplePluginSpectral.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginSpectral/FEAPIExamplePluginSpectral.h trunk/FEAPI/examples/plugin/FEAPIExamplePluginSpectral/RingBuffer.h trunk/FEAPI/examples/plugin/FEAPIExamplePluginSpectral/fft.h trunk/FEAPI/examples/plugin/FEAPIExamplePluginSpectral/zplFFTGen.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginSpectral/zplFFTGenCore.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginSpectral/zplFFT_If.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginSpectral/zplVecLib.h trunk/FEAPI/examples/plugin/FEAPIExamplePluginSpectral/zplVecLibDispatch.cpp trunk/FEAPI/examples/plugin/FEAPIExamplePluginSpectral/zplVecLibGen.cpp Added: trunk/FEAPI/build/Win/ExamplePluginLoudness/ExamplePluginLoudness.def =================================================================== --- trunk/FEAPI/build/Win/ExamplePluginLoudness/ExamplePluginLoudness.def (rev 0) +++ trunk/FEAPI/build/Win/ExamplePluginLoudness/ExamplePluginLoudness.def 2006-03-09 20:42:36 UTC (rev 63) @@ -0,0 +1,102 @@ +;//////////////////////////////////////////////////////////////////////////////////// +;// /*! \file FEAPI.def: \brief declares the module parameters +;// for the DLL */ +;// +;// Copyright (c) 2004-2005, Alexander Lerch, zplane.development GbR +;// All rights reserved. +;// +;// Redistribution and use in source and binary forms, with or without +;// modification, are permitted provided that the following conditions +;// are met: +;// +;// * Redistributions of source code must retain the above copyright +;// notice, this list of conditions and the following disclaimer. +;// * Redistributions in binary form must link to the feapi website +;// http://www.sf.net/projects/feapi, +;// reproduce this list of conditions and the following +;// disclaimer in the documentation and/or other materials +;// provided with the distribution. +;// * The name of the contributors to this software must not be used +;// to endorse or promote products derived from this software +;// without specific prior written permission. +;// +;// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +;// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +;// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +;// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +;// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +;// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +;// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +;// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +;// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +;// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +;// POSSIBILITY OF SUCH DAMAGE. +;// +;//////////////////////////////////////////////////////////////////////////////////// +;// CVS INFORMATION +;// +;// $RCSfile$ +;// $Author: KoenTanghe $ +;// $Date: 2006-03-08 14:59:10 +0100 (Mi, 08 Mrz 2006) $ +;// +;// $Log$ +;// Revision 1.1.2.1 2006/01/19 13:52:07 remymuller +;// directory reorganization +;// +;// Revision 1.2 2005/05/20 17:09:21 alex_lerch +;// - changed function PluginCanDo to PluginGetProperty and changed the function itself to return values instead of bools +;// - cosmetic changes +;// +;// Revision 1.1.1.1 2005/03/30 14:54:40 alex_lerch +;// first draft version requiring several updates: +;// - interface check +;// - check of plugin base class +;// - implementation of host base class +;// - update of outdated documentation +;// +;// Revision 1.1 2004/11/12 20:54:28 lerch +;// - added example feature FindAbsoluteMax +;// +;// +;// +;//////////////////////////////////////////////////////////////////////////////////// + +LIBRARY "Loudness" +DESCRIPTION 'FEAPI FEAPI Example PlugIn' + +EXPORTS + ; Explicit exports can go here + FEAPI_CreatePluginInstance @01 + FEAPI_DestroyPluginInstance @02 + FEAPI_GetPluginAPIVersion @03 + FEAPI_InitializePlugin @04 + + FEAPI_GetPluginProperty @11 + FEAPI_GetPluginName @12 + FEAPI_GetPluginVendor @13 + FEAPI_GetPluginVendorVersion @14 + FEAPI_GetPluginDescription @15 + FEAPI_GetPluginCopyright @16 + FEAPI_GetPluginId @17 + + FEAPI_GetPluginNumOfInputs @21 + FEAPI_GetPluginInputDescription @22 + + FEAPI_GetPluginNumOfParameters @31 + FEAPI_GetPluginParameterDescription @32 + FEAPI_SetPluginParameter @33 + FEAPI_GetPluginParameter @34 + + FEAPI_GetPluginNumOfResults @41 + FEAPI_GetPluginResultDescription @42 + FEAPI_GetPluginResultLatency @43 + FEAPI_GetPluginSizeOfResult @44 + FEAPI_GetPluginResult @45 + + FEAPI_ProcessPlugin @51 + FEAPI_ProcessPluginDone @52 + + FEAPI_ResetPlugin @61 + + Added: trunk/FEAPI/build/Win/ExamplePluginLoudness/ExamplePluginLoudness.dsp =================================================================== --- trunk/FEAPI/build/Win/ExamplePluginLoudness/ExamplePluginLoudness.dsp (rev 0) +++ trunk/FEAPI/build/Win/ExamplePluginLoudness/ExamplePluginLoudness.dsp 2006-03-09 20:42:36 UTC (rev 63) @@ -0,0 +1,192 @@ +# Microsoft Developer Studio Project File - Name="Loudness" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=Loudness - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ExamplePluginLoudness.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ExamplePluginLoudness.mak" CFG="Loudness - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Loudness - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "Loudness - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "Loudness - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../../../lib" +# PROP Intermediate_Dir "../../../tmp/" +# PROP Ignore_Export_Lib 1 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /Ob2 /I "../../../include" /I "../../../sdk/plugin/include" /I "../../../examples/plugin/FEAPIExamplePluginLoudness" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x407 /d "NDEBUG" +# ADD RSC /l 0x407 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"../../../bin/Loudness.dll" + +!ELSEIF "$(CFG)" == "Loudness - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../../../lib/Debug" +# PROP Intermediate_Dir "../../../tmp/Debug" +# PROP Ignore_Export_Lib 1 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../sdk/plugin/include" /I "../../../examples/plugin/FEAPIExamplePluginLoudness" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x407 /d "_DEBUG" +# ADD RSC /l 0x407 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"../../../bin/Debug/Loudness.dll" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "Loudness - Win32 Release" +# Name "Loudness - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginLoudness\FEAPIExamplePluginLoudness.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginLoudness\zplFFT_If.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginLoudness\zplFFTGen.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginLoudness\zplFFTGenCore.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginLoudness\zplVecLibDispatch.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginLoudness\zplVecLibGen.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginLoudness\FEAPIExamplePluginLoudness.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginLoudness\fft.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginLoudness\RingBuffer.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginLoudness\zplVecLib.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Group "Definition Files" + +# PROP Default_Filter "def" +# Begin Source File + +SOURCE=.\ExamplePluginLoudness.def +# End Source File +# End Group +# Begin Group "FEAPI" + +# PROP Default_Filter "" +# Begin Group "sdk" + +# PROP Default_Filter "" +# Begin Group "src" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\sdk\plugin\src\FEAPIPluginBase.cpp +# End Source File +# End Group +# Begin Group "include" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\sdk\plugin\include\FEAPIEntryPoints.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\sdk\plugin\include\FEAPIPluginBase.h +# End Source File +# End Group +# End Group +# End Group +# Begin Group "Documentation Files" + +# PROP Default_Filter ".txt" +# Begin Source File + +SOURCE=..\..\..\doc\docugenPlug.txt +# End Source File +# Begin Source File + +SOURCE=..\..\..\license\license.txt +# End Source File +# End Group +# End Target +# End Project Added: trunk/FEAPI/build/Win/ExamplePluginSpectral/ExamplePluginSpectral.def =================================================================== --- trunk/FEAPI/build/Win/ExamplePluginSpectral/ExamplePluginSpectral.def (rev 0) +++ trunk/FEAPI/build/Win/ExamplePluginSpectral/ExamplePluginSpectral.def 2006-03-09 20:42:36 UTC (rev 63) @@ -0,0 +1,75 @@ +;//////////////////////////////////////////////////////////////////////////////////// +;// /*! \file FEAPI.def: \brief declares the module parameters +;// for the DLL */ +;// +;// Copyright (c) 2004-2005, Alexander Lerch, zplane.development GbR +;// All rights reserved. +;// +;// Redistribution and use in source and binary forms, with or without +;// modification, are permitted provided that the following conditions +;// are met: +;// +;// * Redistributions of source code must retain the above copyright +;// notice, this list of conditions and the following disclaimer. +;// * Redistributions in binary form must link to the feapi website +;// http://www.sf.net/projects/feapi, +;// reproduce this list of conditions and the following +;// disclaimer in the documentation and/or other materials +;// provided with the distribution. +;// * The name of the contributors to this software must not be used +;// to endorse or promote products derived from this software +;// without specific prior written permission. +;// +;// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +;// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +;// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +;// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +;// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +;// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +;// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +;// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +;// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +;// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +;// POSSIBILITY OF SUCH DAMAGE. +;// +;//////////////////////////////////////////////////////////////////////////////////// + +LIBRARY "Spectral" +DESCRIPTION 'FEAPI FEAPI Example PlugIn' + +EXPORTS + ; Explicit exports can go here + FEAPI_CreatePluginInstance @01 + FEAPI_DestroyPluginInstance @02 + FEAPI_GetPluginAPIVersion @03 + FEAPI_InitializePlugin @04 + + FEAPI_GetPluginProperty @11 + FEAPI_GetPluginName @12 + FEAPI_GetPluginVendor @13 + FEAPI_GetPluginVendorVersion @14 + FEAPI_GetPluginDescription @15 + FEAPI_GetPluginCopyright @16 + FEAPI_GetPluginId @17 + + FEAPI_GetPluginNumOfInputs @21 + FEAPI_GetPluginInputDescription @22 + + FEAPI_GetPluginNumOfParameters @31 + FEAPI_GetPluginParameterDescription @32 + FEAPI_SetPluginParameter @33 + FEAPI_GetPluginParameter @34 + + FEAPI_GetPluginNumOfResults @41 + FEAPI_GetPluginResultDescription @42 + FEAPI_GetPluginResultLatency @43 + FEAPI_GetPluginSizeOfResult @44 + FEAPI_GetPluginResult @45 + + FEAPI_ProcessPlugin @51 + FEAPI_ProcessPluginDone @52 + + FEAPI_ResetPlugin @61 + + Added: trunk/FEAPI/build/Win/ExamplePluginSpectral/ExamplePluginSpectral.dsp =================================================================== --- trunk/FEAPI/build/Win/ExamplePluginSpectral/ExamplePluginSpectral.dsp (rev 0) +++ trunk/FEAPI/build/Win/ExamplePluginSpectral/ExamplePluginSpectral.dsp 2006-03-09 20:42:36 UTC (rev 63) @@ -0,0 +1,192 @@ +# Microsoft Developer Studio Project File - Name="Spectral" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=Spectral - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ExamplePluginSpectral.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ExamplePluginSpectral.mak" CFG="Spectral - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Spectral - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "Spectral - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "Spectral - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "../../../lib" +# PROP Intermediate_Dir "../../../tmp/" +# PROP Ignore_Export_Lib 1 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /Ob2 /I "../../../include" /I "../../../sdk/plugin/include" /I "../../../examples/plugin/FEAPIExamplePluginSpectral" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x407 /d "NDEBUG" +# ADD RSC /l 0x407 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"../../../bin/Spectral.dll" + +!ELSEIF "$(CFG)" == "Spectral - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "../../../lib/Debug" +# PROP Intermediate_Dir "../../../tmp/Debug" +# PROP Ignore_Export_Lib 1 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../../../sdk/plugin/include" /I "../../../examples/plugin/FEAPIExamplePluginSpectral" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x407 /d "_DEBUG" +# ADD RSC /l 0x407 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"../../../bin/Debug/Spectral.dll" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "Spectral - Win32 Release" +# Name "Spectral - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginSpectral\FEAPIExamplePluginSpectral.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginSpectral\zplFFT_If.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginSpectral\zplFFTGen.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginSpectral\zplFFTGenCore.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginSpectral\zplVecLibDispatch.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginSpectral\zplVecLibGen.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginSpectral\FEAPIExamplePluginSpectral.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginSpectral\fft.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginSpectral\RingBuffer.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\examples\plugin\FEAPIExamplePluginSpectral\zplVecLib.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Group "Definition Files" + +# PROP Default_Filter "def" +# Begin Source File + +SOURCE=.\ExamplePluginSpectral.def +# End Source File +# End Group +# Begin Group "FEAPI" + +# PROP Default_Filter "" +# Begin Group "sdk" + +# PROP Default_Filter "" +# Begin Group "src" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\sdk\plugin\src\FEAPIPluginBase.cpp +# End Source File +# End Group +# Begin Group "include" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\sdk\plugin\include\FEAPIEntryPoints.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\sdk\plugin\include\FEAPIPluginBase.h +# End Source File +# End Group +# End Group +# End Group +# Begin Group "Documentation Files" + +# PROP Default_Filter ".txt" +# Begin Source File + +SOURCE=..\..\..\doc\docugenPlug.txt +# End Source File +# Begin Source File + +SOURCE=..\..\..\license\license.txt +# End Source File +# End Group +# End Target +# End Project Modified: trunk/FEAPI/build/Win/FEAPI.dsw =================================================================== (Binary files differ) Modified: trunk/FEAPI/build/Win/FEAPIHost_C/FEAPITestCL.dsp =================================================================== (Binary files differ) Modified: trunk/FEAPI/examples/host/Host_C/FEAPIExampleHost_C.cpp =================================================================== --- trunk/FEAPI/examples/host/Host_C/FEAPIExampleHost_C.cpp 2006-03-09 18:18:47 UTC (rev 62) +++ trunk/FEAPI/examples/host/Host_C/FEAPIExampleHost_C.cpp 2006-03-09 20:42:36 UTC (rev 63) @@ -22,6 +22,8 @@ // include project specific headers #include "sndfile.h" // libsndfile is used for audio file parsing #include "FEAPI.h" // Feature Extraction API +#include "FEAPIHostDeclarations.h" +#include "FEAPIHostUtilities.h" ///////////////////////////////////////////////////////////////////////////////// @@ -32,51 +34,6 @@ -//////////////////////////////////////////////////////////////////////////////// -// local structures -/*! structure containing the pointers to the functions of one plug-in */ -typedef struct PluginFunctions_ -{ - - // declare function pointers - FEAPI_CreatePluginInstance_t pFunCreateInstance; - FEAPI_DestroyPluginInstance_t pFunDestroyInstance; - FEAPI_GetPluginAPIVersion_t pFunGetApiVersion; - FEAPI_InitializePlugin_t pFunInitializePlugin; - FEAPI_GetPluginName_t pFunGetPluginName; - FEAPI_GetPluginVendor_t pFunGetPluginVendor; - FEAPI_GetPluginProperty_t pFunGetPluginProperty; - FEAPI_GetPluginId_t pFunGetPluginId; - FEAPI_GetPluginVendorVersion_t pFunGetPluginVendorVersion; - FEAPI_GetPluginDescription_t pFunGetPluginDescription; - FEAPI_GetPluginCopyright_t pFunGetPluginCopyright; - FEAPI_GetPluginNumOfInputs_t pFunGetNumberOfInputs; - FEAPI_GetPluginInputDescription_t pFunGetInputDescription; - FEAPI_GetPluginNumOfResults_t pFunGetNumberOfResults; - FEAPI_GetPluginResultDescription_t pFunGetResultDescription; - FEAPI_GetPluginNumOfParameters_t pFunGetNumberOfParameters; - FEAPI_GetPluginParameterDescription_t pFunGetParameterDescription; - FEAPI_SetPluginParameter_t pFunSetParameter; - FEAPI_GetPluginParameter_t pFunGetParameter; - FEAPI_ProcessPlugin_t pFunProcess; - FEAPI_ProcessPluginDone_t pFunProcessDone; - FEAPI_GetPluginSizeOfResult_t pFunGetSizeOfResult; - FEAPI_GetPluginResult_t pFunGetResult; - FEAPI_GetPluginResultLatency_t pFunGetResultLatency; - FEAPI_ResetPlugin_t pFunReset; -} PluginFunctions_t; - - -typedef struct PluginFileNames_ PluginFileNames_t; -/*! structure containing all detected plug-in dlls names in a list */ -struct PluginFileNames_ -{ - char acFilename[4096]; - int iMajorVersion; - PluginFileNames_t *pNextPlugin; -}; - - ///////////////////////////////////////////////////////////////////////////////// // local function declarations @@ -109,27 +66,6 @@ */ static void CLShowProcessedTime (clock_t clTime); -/*! - * retrieve function pointers from a plug-in dll \todo update docu - * - * @param *phDllHandle : dll handle - * @param *pstPluginFunctions : structure with function pointers, to be written - * - * @return static bool : - */ -#ifdef WIN32 -static bool GetFunctionPointers (HMODULE *phDllHandle, PluginFunctions_t *pstPluginFunctions); -#elif MAC -static bool GetFunctionPointers (CFBundleRef cfBundle, PluginFunctions_t *pstPluginFunctions); -#endif -/*! - * parse the current working directory for plug-ins - * - * @param *pstFileNames : list of detected plug-ins, to be written - * - * @return static int : number of detected plug-ins - */ -static int FindPlugins (PluginFileNames_t *pstFileNames); @@ -169,17 +105,13 @@ float *pfDataInterleaved = 0, **ppfDataSorted = 0, **ppfResult = 0; -#ifdef WIN32 - HMODULE hDllHandle = 0; -#elif MAC - CFBundleRef cfBundle; -#endif - PluginFileNames_t *pCurrentPlugin = 0; + FEAPI_ModuleHandle_t hDllHandle = 0; + FEAPI_PluginFileNames_t *pCurrentPlugin = 0; FEAPI_PluginInstance_t hPluginInstance; - PluginFunctions_t stPluginFunctions; - PluginFileNames_t stPluginFileNames; + FEAPI_PluginFunctions_t stPluginFunctions; + FEAPI_PluginFileNames_t stPluginFileNames; FEAPI_SignalDescription_t stSignalDescription; FEAPI_ParameterDescription_t stParameterDescription; @@ -254,36 +186,13 @@ } // load plugin dll -#ifdef WIN32 - hDllHandle = LoadLibrary (pCurrentPlugin->acFilename); - - // get pointers to API functions - if (!GetFunctionPointers (&hDllHandle, &stPluginFunctions)) - { - if (hDllHandle) - FreeLibrary (hDllHandle); + hDllHandle = 0; + LoadPluginModule (pCurrentPlugin->acFilename, &hDllHandle); + if (!hDllHandle) return -1; - } -#elif MAC - CFStringRef bundlePath = CFStringCreateWithCString(kCFAllocatorDefault,pCurrentPlugin->acFilename,kCFStringEncodingMacRoman); - CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,bundlePath,kCFURLPOSIXPathStyle,true); - cfBundle = CFBundleCreate(kCFAllocatorDefault,bundleURL); - CFRelease(bundlePath); - CFRelease(bundleURL); + else + GetFunctionPointers (hDllHandle, &stPluginFunctions); - // get pointers to API functions - if (!GetFunctionPointers (cfBundle, &stPluginFunctions)) - { - if (cfBundle) - { - CFBundleUnloadExecutable(cfBundle); - CFRelease(cfBundle); - } - return -1; - } -#endif - - // open input audio file if (pcInputPath == 0) return -1; @@ -581,17 +490,9 @@ fprintf (stdout, " Succeeded\n"); else fprintf (stdout, " Failed\n"); -#ifdef WIN32 - if (hDllHandle) - FreeLibrary (hDllHandle); -#elif MAC - if (cfBundle) - { - CFBundleUnloadExecutable(cfBundle); - CFRelease(cfBundle); - } -#endif + UnloadPluginModule (hDllHandle); + // free allocated memory for (i = 0; i < iNumResults; i++) if (ppfResult[i]) @@ -611,7 +512,7 @@ // delete plug-in list while (stPluginFileNames.pNextPlugin) { - PluginFileNames_t *pLastPlugin = &stPluginFileNames; + FEAPI_PluginFileNames_t *pLastPlugin = &stPluginFileNames; pCurrentPlugin = stPluginFileNames.pNextPlugin; while (pCurrentPlugin) { @@ -684,282 +585,4 @@ return; } -#ifdef WIN32 -static bool GetFunctionPointers(HMODULE *phDllHandle, PluginFunctions_t *pstPluginFunctions) -{ - // get exports from dll - pstPluginFunctions->pFunCreateInstance = (FEAPI_CreatePluginInstance_t) GetProcAddress (*phDllHandle, "FEAPI_CreatePluginInstance"); - if (!pstPluginFunctions->pFunCreateInstance) - return false; - pstPluginFunctions->pFunDestroyInstance = (FEAPI_DestroyPluginInstance_t) GetProcAddress (*phDllHandle, "FEAPI_DestroyPluginInstance"); - if (!pstPluginFunctions->pFunDestroyInstance) - return false; - pstPluginFunctions->pFunGetApiVersion = (FEAPI_GetPluginAPIVersion_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginAPIVersion"); - if (!pstPluginFunctions->pFunGetApiVersion) - return false; - pstPluginFunctions->pFunInitializePlugin = (FEAPI_InitializePlugin_t) GetProcAddress (*phDllHandle, "FEAPI_InitializePlugin"); - if (!pstPluginFunctions->pFunInitializePlugin) - return false; - pstPluginFunctions->pFunGetPluginName = (FEAPI_GetPluginName_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginName"); ; - if (!pstPluginFunctions->pFunGetPluginName) - return false; - pstPluginFunctions->pFunGetPluginVendor = (FEAPI_GetPluginVendor_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginVendor"); ; - if (!pstPluginFunctions->pFunGetPluginVendor) - return false; - pstPluginFunctions->pFunGetPluginProperty = (FEAPI_GetPluginProperty_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginProperty"); ; - if (!pstPluginFunctions->pFunGetPluginVendor) - return false; - pstPluginFunctions->pFunGetPluginId = (FEAPI_GetPluginId_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginId"); ; - if (!pstPluginFunctions->pFunGetPluginId) - return false; - pstPluginFunctions->pFunGetPluginVendorVersion = (FEAPI_GetPluginVendorVersion_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginVendorVersion"); ; - if (!pstPluginFunctions->pFunGetPluginVendorVersion) - return false; - pstPluginFunctions->pFunGetPluginDescription = (FEAPI_GetPluginDescription_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginDescription"); ; - if (!pstPluginFunctions->pFunGetPluginDescription) - return false; - pstPluginFunctions->pFunGetPluginCopyright = (FEAPI_GetPluginCopyright_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginCopyright"); ; - if (!pstPluginFunctions->pFunGetPluginCopyright) - return false; - pstPluginFunctions->pFunGetNumberOfInputs = (FEAPI_GetPluginNumOfInputs_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginNumOfInputs"); ; - if (!pstPluginFunctions->pFunGetNumberOfInputs) - return false; - pstPluginFunctions->pFunGetInputDescription = (FEAPI_GetPluginInputDescription_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginInputDescription"); ; - if (!pstPluginFunctions->pFunGetInputDescription) - return false; - pstPluginFunctions->pFunGetNumberOfResults = (FEAPI_GetPluginNumOfResults_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginNumOfResults"); ; - if (!pstPluginFunctions->pFunGetNumberOfResults) - return false; - pstPluginFunctions->pFunGetResultDescription = (FEAPI_GetPluginResultDescription_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginResultDescription"); ; - if (!pstPluginFunctions->pFunGetResultDescription) - return false; - pstPluginFunctions->pFunGetNumberOfParameters = (FEAPI_GetPluginNumOfParameters_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginNumOfParameters"); ; - if (!pstPluginFunctions->pFunGetNumberOfParameters) - return false; - pstPluginFunctions->pFunGetParameterDescription = (FEAPI_GetPluginParameterDescription_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginParameterDescription"); ; - if (!pstPluginFunctions->pFunGetParameterDescription) - return false; - pstPluginFunctions->pFunSetParameter = (FEAPI_SetPluginParameter_t) GetProcAddress (*phDllHandle, "FEAPI_SetPluginParameter"); ; - if (!pstPluginFunctions->pFunSetParameter) - return false; - pstPluginFunctions->pFunGetParameter = (FEAPI_GetPluginParameter_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginParameter"); ; - if (!pstPluginFunctions->pFunGetParameter) - return false; - pstPluginFunctions->pFunProcess = (FEAPI_ProcessPlugin_t) GetProcAddress (*phDllHandle, "FEAPI_ProcessPlugin"); ; - if (!pstPluginFunctions->pFunProcess) - return false; - pstPluginFunctions->pFunProcessDone = (FEAPI_ProcessPluginDone_t) GetProcAddress (*phDllHandle, "FEAPI_ProcessPluginDone"); ; - if (!pstPluginFunctions->pFunProcessDone) - return false; - pstPluginFunctions->pFunGetSizeOfResult = (FEAPI_GetPluginSizeOfResult_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginSizeOfResult"); ; - if (!pstPluginFunctions->pFunGetSizeOfResult) - return false; - pstPluginFunctions->pFunGetResult = (FEAPI_GetPluginResult_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginResult"); ; - if (!pstPluginFunctions->pFunGetResult) - return false; - pstPluginFunctions->pFunGetResultLatency = (FEAPI_GetPluginResultLatency_t) GetProcAddress (*phDllHandle, "FEAPI_GetPluginResultLatency"); ; - if (!pstPluginFunctions->pFunGetResultLatency) - return false; - pstPluginFunctions->pFunReset = (FEAPI_ResetPlugin_t) GetProcAddress (*phDllHandle, "FEAPI_ResetPlugin"); ; - if (!pstPluginFunctions->pFunReset) - return false; - return true; -} -#elif MAC -static bool GetFunctionPointers(CFBundleRef cfBundle, PluginFunctions_t *pstPluginFunctions) -{ - // get exports from dll - pstPluginFunctions->pFunCreateInstance = (FEAPI_CreatePluginInstance_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_CreatePluginInstance")); - if (!pstPluginFunctions->pFunCreateInstance) - return false; - pstPluginFunctions->pFunDestroyInstance = (FEAPI_DestroyPluginInstance_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_DestroyPluginInstance")); - if (!pstPluginFunctions->pFunDestroyInstance) - return false; - pstPluginFunctions->pFunGetApiVersion = (FEAPI_GetPluginAPIVersion_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginAPIVersion")); - if (!pstPluginFunctions->pFunGetApiVersion) - return false; - pstPluginFunctions->pFunInitializePlugin = (FEAPI_InitializePlugin_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_InitializePlugin")); - if (!pstPluginFunctions->pFunInitializePlugin) - return false; - pstPluginFunctions->pFunGetPluginName = (FEAPI_GetPluginName_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginName")); - if (!pstPluginFunctions->pFunGetPluginName) - return false; - pstPluginFunctions->pFunGetPluginVendor = (FEAPI_GetPluginVendor_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginVendor")); - if (!pstPluginFunctions->pFunGetPluginVendor) - return false; - pstPluginFunctions->pFunGetPluginProperty = (FEAPI_GetPluginProperty_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginProperty")); - if (!pstPluginFunctions->pFunGetPluginVendor) - return false; - pstPluginFunctions->pFunGetPluginId = (FEAPI_GetPluginId_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginId")); - if (!pstPluginFunctions->pFunGetPluginId) - return false; - pstPluginFunctions->pFunGetPluginVendorVersion = (FEAPI_GetPluginVendorVersion_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginVendorVersion")); - if (!pstPluginFunctions->pFunGetPluginVendorVersion) - return false; - pstPluginFunctions->pFunGetPluginDescription = (FEAPI_GetPluginDescription_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginDescription")); - if (!pstPluginFunctions->pFunGetPluginDescription) - return false; - pstPluginFunctions->pFunGetPluginCopyright = (FEAPI_GetPluginCopyright_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginCopyright")); - if (!pstPluginFunctions->pFunGetPluginCopyright) - return false; - pstPluginFunctions->pFunGetNumberOfInputs = (FEAPI_GetPluginNumOfInputs_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginNumOfInputs")); - if (!pstPluginFunctions->pFunGetNumberOfInputs) - return false; - pstPluginFunctions->pFunGetInputDescription = (FEAPI_GetPluginInputDescription_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginInputDescription")); - if (!pstPluginFunctions->pFunGetInputDescription) - return false; - pstPluginFunctions->pFunGetNumberOfResults = (FEAPI_GetPluginNumOfResults_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginNumOfResults")); - if (!pstPluginFunctions->pFunGetNumberOfResults) - return false; - pstPluginFunctions->pFunGetResultDescription = (FEAPI_GetPluginResultDescription_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginResultDescription")); - if (!pstPluginFunctions->pFunGetResultDescription) - return false; - pstPluginFunctions->pFunGetNumberOfParameters = (FEAPI_GetPluginNumOfParameters_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginNumOfParameters")); - if (!pstPluginFunctions->pFunGetNumberOfParameters) - return false; - pstPluginFunctions->pFunGetParameterDescription = (FEAPI_GetPluginParameterDescription_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginParameterDescription")); - if (!pstPluginFunctions->pFunGetParameterDescription) - return false; - pstPluginFunctions->pFunSetParameter = (FEAPI_SetPluginParameter_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_SetPluginParameter")); - if (!pstPluginFunctions->pFunSetParameter) - return false; - pstPluginFunctions->pFunGetParameter = (FEAPI_GetPluginParameter_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginParameter")); - if (!pstPluginFunctions->pFunGetParameter) - return false; - pstPluginFunctions->pFunProcess = (FEAPI_ProcessPlugin_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_ProcessPlugin")); - if (!pstPluginFunctions->pFunProcess) - return false; - pstPluginFunctions->pFunProcessDone = (FEAPI_ProcessPluginDone_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_ProcessPluginDone")); - if (!pstPluginFunctions->pFunProcessDone) - return false; - pstPluginFunctions->pFunGetSizeOfResult = (FEAPI_GetPluginSizeOfResult_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginSizeOfResult")); - if (!pstPluginFunctions->pFunGetSizeOfResult) - return false; - pstPluginFunctions->pFunGetResult = (FEAPI_GetPluginResult_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginResult")); - if (!pstPluginFunctions->pFunGetResult) - return false; - pstPluginFunctions->pFunGetResultLatency = (FEAPI_GetPluginResultLatency_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_GetPluginResultLatency")); - if (!pstPluginFunctions->pFunGetResultLatency) - return false; - pstPluginFunctions->pFunReset = (FEAPI_ResetPlugin_t) CFBundleGetFunctionPointerForName (cfBundle, CFSTR("FEAPI_ResetPlugin")); - if (!pstPluginFunctions->pFunReset) - return false; - - return true; -} -#endif - -#ifdef WIN32 -int FindPlugins (PluginFileNames_t *pstFileNames) -{ - struct _finddata_t DllFile; - long hFile; - int iNumOfPlugins = 0; - PluginFileNames_t *pCurrentStruct = pstFileNames; - PluginFunctions_t stPluginFunctions; - - /* Find first .dll file in current directory */ - if( (hFile = _findfirst( "*.dll", &DllFile )) == -1L ) - return iNumOfPlugins; - else - { - HMODULE hDllHandle; - - hDllHandle = LoadLibrary (DllFile.name); - - if (GetFunctionPointers(&hDllHandle, &stPluginFunctions)) - { - // add to list - strcpy(pCurrentStruct->acFilename, DllFile.name); - pCurrentStruct->iMajorVersion = stPluginFunctions.pFunGetApiVersion (FEAPI_kMajorVersion); - pCurrentStruct->pNextPlugin = new PluginFileNames_t; - pCurrentStruct = pCurrentStruct->pNextPlugin; - pCurrentStruct->pNextPlugin = 0; - iNumOfPlugins++; - } - - if (hDllHandle) - FreeLibrary (hDllHandle); - - /* Find the rest of the .dll files */ - while( _findnext( hFile, &DllFile ) == 0 ) - { - hDllHandle = LoadLibrary (DllFile.name); - - if (GetFunctionPointers(&hDllHandle, &stPluginFunctions)) - { - // add to list - strcpy(pCurrentStruct->acFilename, DllFile.name); - pCurrentStruct->iMajorVersion = stPluginFunctions.pFunGetApiVersion (FEAPI_kMajorVersion); - pCurrentStruct->pNextPlugin = new PluginFileNames_t; - pCurrentStruct = pCurrentStruct->pNextPlugin; - pCurrentStruct->pNextPlugin = 0; - iNumOfPlugins++; - } - if (hDllHandle) - FreeLibrary (hDllHandle); - } - - _findclose( hFile ); - } - - return iNumOfPlugins; -} - -#elif MAC - -int FindPlugins (PluginFileNames_t *pstFileNames) -{ - int iNumOfPlugins = 0; - PluginFileNames_t *pCurrentStruct = pstFileNames; - PluginFunctions_t stPluginFunctions; - - char acFeapiPath[1024]; - strcpy(acFeapiPath,getenv("HOME")); - strcat(acFeapiPath,"/library/Audio/Plug-Ins/FEAPI"); - - CFStringRef cfFeapiPlugInPath = CFStringCreateWithCString(kCFAllocatorDefault,acFeapiPath,kCFStringEncodingMacRoman); - CFURLRef cfFeapiPluginsURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,cfFeapiPlugInPath,kCFURLPOSIXPathStyle,true); - - // do we need to release and/or unload the bundles when created like that? - CFArrayRef bundleArray = CFBundleCreateBundlesFromDirectory(kCFAllocatorDefault,cfFeapiPluginsURL,NULL); - CFIndex iNumOfBundles = CFArrayGetCount(bundleArray); - - if( iNumOfBundles <= 0 ) - { - CFRelease(cfFeapiPlugInPath); - CFRelease(cfFeapiPluginsURL); - CFRelease(bundleArray); - return iNumOfPlugins; - } - - // search all bundles for FEAPI plugins - for(int i=0; i<iNumOfBundles; ++i) - { - CFBundleRef cfBundle = (CFBundleRef) CFArrayGetValueAtIndex(bundleArray,i); - - if (GetFunctionPointers(cfBundle, &stPluginFunctions)) - { - // add to list - CFURLRef cfBundleURL = CFBundleCopyBundleURL(cfBundle); - char acBundlePath[1024]; - CFURLGetFileSystemRepresentation(cfBundleURL,true,(UInt8 *)acBundlePath,1024); - strcpy(pCurrentStruct->acFilename, (const char*)acBundlePath); - - pCurrentStruct->iMajorVersion = stPluginFunctions.pFunGetApiVersion (FEAPI_kMajorVersion); - pCurrentStruct->pNextPlugin = new PluginFileNames_t; - pCurrentStruct = pCurrentStruct->pNextPlugin; - pCurrentStruct->pNextPlugin = 0; - iNumOfPlugins++; - } - } - - CFRelease(cfFeapiPlugInPath); - CFRelease(cfFeapiPluginsURL); - CFRelease(bundleArray); - - return iNumOfPlugins; -} - -#endif Modified: trunk/FEAPI/examples/plugin/FEAPIExamplePluginFindMax/FEAPIExamplePluginFindMax.cpp =================================================================== --- trunk/FEAPI/examples/plugin/FEAPIExamplePluginFindMax/FEAPIExamplePluginFindMax.cpp 2006-03-09 18:18:47 UTC (rev 62) +++ trunk/FEAPI/examples/plugin/FEAPIExamplePluginFindMax/FEAPIExamplePluginFindMax.cpp 2006-03-09 20:42:36 UTC (rev 63) @@ -359,6 +359,7 @@ return -1; } + /////////////////////////////////////// // entry points #ifdef __cplusplus Added: trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/FEAPIExamplePluginLoudness.cpp =================================================================== --- trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/FEAPIExamplePluginLoudness.cpp (rev 0) +++ trunk/FEAPI/examples/plugin/FEAPIExamplePluginLoudness/FEAPIExamplePluginLoudness.cpp 2006-03-09 20:42:36 UTC (rev 63) @@ -0,0 +1,1263 @@ +//////////////////////////////////////////////////////////////////////////////////// +// /*! \file FEAPIExamplePluginLoudness.cpp: \brief implementation of the CLoudnessFeatures class. */ +// +// Copyright (c) 2004-2006 +// zplane.development +// Flohrer Lerch Schwerdtfeger GbR +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must link to the FEAPI_ website +// http://www.sf.net/projects/FEAPI_, +// reproduce this list of conditions and the following +// disclaimer in the documentation and/or other materials +// provided with the distribution. +// * The name of the contributors to this software must not be used +// to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +//////////////////////////////////////////////////////////////////////////////////// + + +#include <string> +#include <iostream> +#include <math.h> + +#include "zplVecLib.h" + +#include "FEAPI.h" +#include "FEAPIExamplePluginLoudness.h" + +#ifndef FLT_MAX +#define FLT_MAX 3.402823466e+38F +#endif + +///////////////////////////////////////////////////////////////////////////// +#if !defined(_PI) +#define _PI (float)(3.1415926535897932384626433832795) //!< pi +#endif +#if !defined(_PI2) +#define _PI2 (float)(1.570796326794897) //!< pi/2 +#endif +#if !defined(_PI4) +#define _PI4 (float)(7.853981633974483e-001) //!< pi/4 +#endif +#if !defined(_2PI) +#define _2PI (float)(6.283185307179586476925286766559) //!< 2*pi +#endif +#if !defined(_LN10) +#define _LN10 (float)(2.30258509299405) //!< ln(10) +#endif +#if !defined(_INVLN10) +#define _INVLN10 (float)(0.4342944819032518) //!< 1/ln(10) +#endif +#if !defined(_10INVLN10) +#define _10INVLN10 (float)(4.342944819032518) //!< 10/ln(10) +#endif +#if !defined(_20INVLN10) +#define _20INVLN10 (float)(8.685889638065035) //!< 20/ln(10) +#endif +#if !defined(_INVLN2) +#define _INVLN2 (float)(1.442695040888963) //!< 1/ln(2) +#endif +#if !defined(_SQRT2) +#define _SQRT2 (float)(1.4142135623730950488016887242097) //!< sqrt(2) +#endif +#if !defined(_INVSQRT2) +#define _INVSQRT2 (float)(0.70710678118654752440084436210485) //!< 1/sqrt(2) +#endif +#if !defined(_SQRT10) +#define _SQRT10 (float)(3.162277660168380) //!< sqrt(10) +#endif +#if !defined(_SQRT3) +#define _SQRT3 (float)(1.732050807568877) //!< sqrt(3) +#endif +#if !defined(_SQRT5) +#define _SQRT5 (float)(2.236067977499790) //!< sqrt(5) +#endif +#if !defined(_SQRT4) +#define _SQRT4 (float)(2.0) //!< sqrt(4) +#endif + //! returns the absolute value of a +#define ZABS(a) (((a) > (0)) ? (a) : -(a)) + //! find minimum of a and b +#define ZMIN(a,b) (((a) < (b)) ? (a) : (b)) + //! find maxmimum of a and b +#define ZMAX(a,b) (((a) > (b)) ? (a) : (b)) + //! calc sqr(a) +#define ZSQR(a) (float)((a)*(a)) + //! calc sqrt(a) +#define ZSQRT(a) (float)(sqrt(a)) + //! calc 10^a +#define ZPOW10(a) (float)(exp(_LN10*(a))) + //! swap values of a and b +#define SWAPINT(a,b) {zINT iTmp = (a); (a) = (b); (b) = (iTmp);} +///////////////////////////////////////////////////////////////////////////////// + + +#define kDefaultNumOfResults 8 +#define kDefaultRollOff 0.85F + +/*! this defines the version of the PlugIn itself */ +#define _MY_MAJOR_VERSION 0x00000000 +#define _MY_MINOR_VERSION 0x00000000 +#define _MY_SUB_VERSION 0x00000001 + + +// defines for plug in name etc. +#define _MY_PLUGIN_NAME "Loudness" +#define _MY_PLUGIN_VENDOR "zplane.development" +#define _MY_PLUGIN_DESCRIPTION "This PlugIn calculates the zwicker loundess per channel. " +#define _MY_PLUGIN_COPYRIGHT "(c) 2005-2006 by zplane.development" +#define _MY_PLUGIN_ID "zplLoudness" + + + + +enum LoudnessParameters_t +{ + kParamBlockSize = 0, + kParamHopSize = 1, + kParamChannelMode = 2, + kParamWindowType = 3, + kParamLowFreqBound = 4, + kParamZeroPad = 5, + + kNumParameters +}; + +enum LoudnessFeatures_t +{ + kLoudness1 = 0, + kLoudness2 = 1, + + kNumFeatures +}; + +#define kReferenceLevel (.5F*_SQRT2/20e-6F) + +#define kNumMidFreqs 28 +static const float fMidFreqs[kNumMidFreqs] = +{ + 25, + 31.5, + 40, + 50, + 63, + 80, + 100, + 125, + 160, + 200, + 250, + 315, + 400, + 500, + 630, + 800, + 1000, + 1250, + 1600, + 2000, + 2500, + 3150, + 4000, + 5000, + 6300, + 8000, + 10000, + 12500 +}; + +static const FEAPI_ParameterDescription_t LoudnessParameterDescription[kNumParameters] = +{ + //Name, Unit, Description, RangeMin, RangeMax, Default, Quantized, Realtime + {"Analysis Block Length", "Frames", "Length of analysis window for one result", 4, (float)((1<<30)-1), 32768, 4, false}, + {"Analysis Hop-Size", "ms", "Distance between two analysis block beginnings", 1, (float)((1<<30)-1), 10, -1, false}, + {"Individual Channels or Sum Channel", "", "Determines wether the calculation should be done on the sum of all input channels ('0') or on each individual channel ('1')", 0, 1, 0, 1, false}, + {"FFT Window", "", "Window Type for FFT analysis (0: rectangular, 1: hanning, 2: hamming, 3: blackman)", 0, 3, 1, 1, false}, + {"Low Frequency Cutoff", "Hz", "Only take into account frequencies above this frequency", 0, (float)((1<<30)-1), 0, -1, true}, + {"Zero Pad Factor", "", "Factor for zeropadding the FFT, has to be pow of two", 1, 256, 1, -1, false}, + +}; + +static const FEAPI_SignalDescription_t LoudnessFeatureDescription[kNumFeatures] = +{ + //Name, Unit, Description, RangeMin, RangeMax, Quantized SampleRate + {"Loudness 1", "", "loudness roughly after DIN standard", ... [truncated message content] |