VedaLibMath/EquationSoundSignal.h

Go to the documentation of this file.
00001 /*! \file 
00002     \author victorien ferry & www.m4nkind.com
00003     \brief This file applies the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1 , read file COPYING.
00004 */
00005 #ifndef COM_M4NKIND_EquationSoundSignal_H
00006 #define COM_M4NKIND_EquationSoundSignal_H
00007 
00008 #include "VirtualEquation.h"
00009 #include "PackFloat.h"
00010 #include "PackFloatByte_Limits.h"
00011 #include "PackULong_Flags.h"
00012 #include "PackULong_Enums.h"
00013 /*!
00014     \class  EquationSoundSignal
00015     \ingroup BaseObjectInherited_VedaLibMath BaseObjectInheritedDocGroup
00016     \brief  Return the Machine's Sound signal output as an equation:
00017             Returns the machine's current stereo sound curve. 
00018             You can define which terms of the result are affected. 
00019             The length curve definition may vary, but is scaled along [0,1] 
00020             by Input.X (see Equation List)
00021 */
00022 class EquationSoundSignal : public VirtualEquation
00023 {
00024 /*==================================================================
00025                                 PUBLIC
00026 ==================================================================*/
00027 public:
00028     /*!
00029         \brief  Constructor. There should only be members initialisation there.
00030     */
00031     EquationSoundSignal(void);
00032 
00033     /*!
00034         \brief  Class Inheritance Descriptors. Also forces a destructor. See BASEOBJECT_DECLARE_... in .cpp
00035     */
00036     BASEOBJECT_DEFINE_CLASS(EquationSoundSignal);
00037 
00038     /*!
00039         \brief   Compute a scalar value according to a parameter list (X,Y,Z,D).
00040         \param  _OutgoingParameterTable result table. elements are writen or not according to the equation.
00041         \param _IncomingParameterTable. float table, the (X,Y,Z,D) parameters.
00042     */
00043     virtual void Compute( float _OutgoingParameterTable[4] , const float _IncomingParameterTable[4] );
00044 
00045     /*!
00046         \brief  Method that really build the object using the serializable parameters.
00047                 Close() should close everything opened by CreateInternal().
00048                 ->precalculate some terms
00049     */
00050     virtual bool CreateInternal(void);
00051 
00052 /*==================================================================
00053                                 PROTECTED
00054 ==================================================================*/
00055 protected:
00056     //! the output value range
00057     PackFloat               mSer_OutputRange;
00058     typedef enum{
00059         eX=1,
00060         eY=2,
00061         eZ=4,
00062         eD=8,
00063         eUnifyOut=16,
00064     } eflagmeans;
00065     //! XYZD channels to apply
00066     PackULong_Flags mSer_ApplyChannels;
00067     //! Smooth force. apply a delay in time.
00068     PackFloatByte_Limits    mSer_SmoothForce;
00069 
00070     //!
00071     static const unsigned int m_HistoricBufferMaxLength=512;
00072     //! keep an historic buffer for smoothing equation visually.
00073     float   m_HistoryBufferLength[m_HistoricBufferMaxLength];
00074     //! 
00075     float   m_LastFramedatecheck;
00076     // some optim:
00077     //! XYZD output weight 0.0->1.0
00078     float               m_flastbufferlengthfloatversion;
00079     float               m_lowvalue;
00080     float               m_length;
00081     int                 m_ilastbufferlengthfloatversion;
00082     
00083     //! private use typedef.
00084     typedef void *(*protectedComputeType)(void);
00085     //! the compute method.
00086     protectedComputeType    m_ComputeMethod;
00087 
00088 
00089 };
00090 #endif

      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/