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

FEAPIExamplePluginZeroCrossings.h

Go to the documentation of this file.
00001 
00002 //     /*! \file FEAPIExamplePluginZeroCrossings.h: \brief interface of the CZeroCrossings 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(ZERO_CROSSINGS_HEADER_INCLUDED__)
00038 #define ZERO_CROSSINGS_HEADER_INCLUDED__
00039 
00040 
00041 #include "FEAPIPluginBase.h"
00042 
00043 template <class T>  class CRingBuffer; 
00044 
00047 class CZeroCrossings : public CFeatureExtractBase
00048 {
00049 public:
00050 
00051     CZeroCrossings ();
00052     
00053     virtual ~CZeroCrossings ();
00054 
00055 
00057     // method declaration
00058     // if you do not intend to use some of these functions, just delete them and the default 
00059     // values will be returned
00060 
00061     FEAPI_Error_t      SetPluginParameter ( int iParameterIndex, 
00062                                             float fValue);
00063 
00064     float              GetPluginParameter ( int iParameterIndex);
00065 
00066 
00067     int                GetPluginResultLatency (int iResultIndex);
00068 
00069     float              GetPluginProperty (  FEAPI_PluginProperty_t ePluginProperty);
00070 
00071     FEAPI_Error_t      InitializePlugin (   float               fInputSampleRate, 
00072                                             int                 iNumberOfAudioChannels,
00073                                             int                 iHostApiMajorVersion,
00074                                             FEAPI_UserData_t     *pstUserData);
00075 
00076     FEAPI_Error_t      ProcessPlugin (  const float             **ppfInputBuffer, 
00077                                         const FEAPI_TimeStamp_t *ptFEAPI_TimeStamp,
00078                                         int                     iNumberOfFrames);
00079 
00080     FEAPI_Error_t      ProcessPluginDone ();
00081 
00082 
00083     int                GetPluginSizeOfResult (int iResultIndex);
00084 
00085     FEAPI_Error_t      GetPluginResult (     int iResultIndex, 
00086                                 float *pfResult,
00087                                 FEAPI_TimeStamp_t *ptFEAPI_TimeStamp);
00088 
00089 
00090     FEAPI_Error_t      ResetPlugin ();
00091 
00092 private:
00093 
00094     struct InternalResults_t
00095     {
00096         bool                bHoldsResult;
00097         float               fResult;
00098         FEAPI_TimeStamp_t   tTimeStamp;
00099     };
00100 
00101     void WriteResult (int iResultIdx, float fValue, FEAPI_TimeStamp_t tTimStamp);
00102 
00103     // remove and add variables acc. your needs
00104     FEAPI_SignalDescription_t m_stResultDescription;
00105     FEAPI_TimeStamp_t         *m_ptLocalTimeStamp;
00106 
00107 
00108     float   m_afParameters[3],
00109             *m_pfProcessBuffer;
00110 
00111     CRingBuffer<float>  **m_ppCRingBuffer;
00112 
00113     InternalResults_t   **m_ppResults;
00114 
00115     int                 m_iSizeOfResultBuffer;
00116 };
00117 
00118 #endif // #if !defined(ZERO_CROSSINGS_HEADER_INCLUDED__)
00119 
00120 
00121 

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