Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

FEAPIExamplePluginSpectral.h

Go to the documentation of this file.
00001 
00002 //     /*! \file FEAPIExamplePluginSpectral.h: \brief interface of the CSpectralFeatures class. */
00003 //
00004 //        Copyright (c) 2005-2007, Alexander Lerch, zplane.development GbR
00005 //        All rights reserved.
00006 //
00007 //        Redistribution and use in source and binary forms, with or without 
00008 //        modification, are permitted provided that the following conditions 
00009 //        are met:
00010 //
00011 //        *   Redistributions of source code must retain the above copyright 
00012 //            notice, this list of conditions and the following disclaimer. 
00013 //        *   Redistributions in binary form must reproduce the above 
00014 //            copyright notice, this list of conditions and the following 
00015 //            disclaimer in the documentation and/or other materials 
00016 //            provided with the distribution. 
00017 //        *   Neither the name of the FEAPI development team nor the names 
00018 //            of its contributors may be used to endorse or promote products 
00019 //            derived from this software without specific prior written 
00020 //            permission. 
00021 //
00022 //        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00023 //        "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
00024 //        LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
00025 //        FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
00026 //        COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
00027 //        INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
00028 //        BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
00029 //        LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
00030 //        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
00031 //        LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
00032 //        ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
00033 //        POSSIBILITY OF SUCH DAMAGE.
00034 //
00036 
00037 #if !defined(SPECTRAL_HEADER_INCLUDED__)
00038 #define SPECTRAL_HEADER_INCLUDED__
00039 
00040 
00041 #include "FEAPIPluginBase.h"
00042 
00043 template <class T>  class CRingBuffer; 
00044 class CzplfFFT_If;
00045 
00048 class CSpectralFeatures : public CFeatureExtractBase
00049 {
00050 public:
00051 
00052     CSpectralFeatures ();
00053     
00054     virtual ~CSpectralFeatures ();
00055 
00056 
00058     // method declaration
00059     // if you do not intend to use some of these functions, just delete them and the default 
00060     // values will be returned
00061 
00062     FEAPI_Error_t      SetPluginParameter ( int iParameterIndex, 
00063                                             float fValue);
00064 
00065     float              GetPluginParameter ( int iParameterIndex);
00066 
00067 
00068     int                GetPluginResultLatency (int iResultIndex);
00069 
00070     float              GetPluginProperty (  FEAPI_PluginProperty_t ePluginProperty);
00071 
00072     FEAPI_Error_t      InitializePlugin (   float               fInputSampleRate, 
00073                                             int                 iNumberOfAudioChannels,
00074                                             int                 iHostApiMajorVersion,
00075                                             FEAPI_UserData_t     *pstUserData);
00076 
00077     FEAPI_Error_t      ProcessPlugin (  const float             **ppfInputBuffer, 
00078                                         const FEAPI_TimeStamp_t *ptFEAPI_TimeStamp,
00079                                         int                     iNumberOfFrames);
00080 
00081     FEAPI_Error_t      ProcessPluginDone ();
00082 
00083 
00084     int                GetPluginSizeOfResult (int iResultIndex);
00085 
00086     FEAPI_Error_t      GetPluginResult (     int iResultIndex, 
00087                                 float *pfResult,
00088                                 FEAPI_TimeStamp_t *ptFEAPI_TimeStamp);
00089 
00090 
00091     FEAPI_Error_t      ResetPlugin ();
00092 
00093 private:
00094 
00095     struct InternalResults_t
00096     {
00097         bool                bHoldsResult;
00098         float               fResult;
00099         FEAPI_TimeStamp_t   tTimeStamp;
00100     };
00101 
00102     void WriteResult (int iResultIdx, float fValue, FEAPI_TimeStamp_t tTimStamp);
00103     int CalcFreqTable ();
00104 
00105     // remove and add variables acc. your needs
00106     FEAPI_SignalDescription_t m_stResultDescription;
00107     FEAPI_TimeStamp_t         *m_ptLocalTimeStamp;
00108 
00109 
00110     float   *m_pfParameters,
00111             *m_pfProcessBuffer,
00112             **m_ppfFFTHistory,
00113             *m_pfHelpBuffer,
00114             *m_pfLogFreqs;
00115 
00116     CRingBuffer<float>  **m_ppCRingBuffer;
00117 
00118     InternalResults_t   **m_ppResults;
00119 
00120     CzplfFFT_If         *m_pFFTInstance;
00121 
00122     int                 m_iSizeOfResultBuffer,
00123                         m_iMPEG7SetZero;
00124 };
00125 
00126 #endif // #if !defined(SPECTRAL_HEADER_INCLUDED__)
00127 
00128 
00129 

Generated on Fri Mar 23 10:28:54 2007 for FEAPI Plugin Documentation by  doxygen 1.3.9.1