VedaLibDemo/MediaSoundEquation.h

Go to the documentation of this file.
00001 /*! \file 
00002     \brief This file applies the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1 , read file COPYING.
00003 */
00004 #ifndef COM_M4NKIND_MediaSoundEquation_H
00005 #define COM_M4NKIND_MediaSoundEquation_H
00006 
00007 #include "VirtualMedia.h"
00008 #include "PackLong_WithLimits.h"
00009 #include "PackFloatByte_Limits.h"
00010 #include "PackDynamicFloat.h"
00011 #include "PackObjectReference.h"
00012 #include "PackDynamicFloat.h"
00013 #include "PackULong_Flags.h"
00014 
00015 /*!
00016     \class  MediaSoundEquation
00017     \brief  create sounds using equations.
00018 
00019 */
00020 class MediaSoundEquation : public VirtualMedia
00021 {
00022 /*==================================================================
00023                                 PUBLIC
00024 ==================================================================*/
00025 public:
00026     /*!
00027         \brief  Constructor. There should only be members initialisation there.
00028     */
00029     MediaSoundEquation(void);
00030 
00031     /*!
00032         \brief  Class Inheritance Descriptors.
00033     */
00034     BASEOBJECT_DEFINE_CLASS(MediaSoundEquation);
00035     /*!
00036         \brief   If the media had to generate real time sounds, 
00037                 ProcessSoundInterupt will be called by a machine. There is a default 
00038                 behaviour for this method, which does nothing. the float buffer 
00039                 accumulate the whole machine sound.
00040         \param  _SoundBufferToAddYourSignal description of the buffer to fill.
00041     */
00042     virtual void ProcessSoundInterupt( VirtualMachine::SoundBufferToAddYourSignal &_SoundBufferToAddYourSignal );
00043 
00044 /*==================================================================
00045                                 PROTECTED
00046 ==================================================================*/
00047 protected:
00048     //! Flags
00049     typedef enum {
00050         ef_LoopSample=1,
00051         ef_AntiAlias=2, 
00052     } eFlags;
00053     PackULong_Flags mSer_Flags;
00054     //! base equ.
00055     PackObjectReference mSer_Equation;
00056     //! the time length of the media is precomputed in editable mode, and just read in non-editable.
00057     PackFloat   mSer_TimeLength;
00058     //! the time length of the media is precomputed in editable mode, and just read in non-editable.
00059     PackLong_WithLimits mSer_SampleFrequency;
00060     //! 0 left 1 Right
00061     PackDynamicFloat    mSer_StereoSpan;
00062     //! 
00063     PackFloatByte_Limits mSer_FadeOut;
00064 
00065     //! precomputation:
00066     float           *m_pSampleBuffer;
00067     //!
00068     unsigned int    m_SampleBufferLength;
00069     //
00070     unsigned int    m_LastBufferIndex;
00071     unsigned int    m_LastBufferIndexFrac;
00072     //! watch time continuity.
00073     int             m_LastEndSecond;
00074     unsigned int    m_LastEndSecFrac;
00075     unsigned long long m_vector;
00076     /*!
00077         \brief  Method that really build the object using the serializable parameters.
00078                 Close() should close everything opened by CreateInternal().
00079     */
00080     virtual bool CreateInternal(void);
00081 
00082 #ifdef _ENGINE_EDITABLE_
00083     /*!
00084         \brief  that closes everything. Still, the object exist and can be rebuild the same using Create()
00085     */
00086     virtual void    CloseInternal(void);
00087 #endif
00088 #ifdef _ENGINE_EDITABLE_
00089     /*!
00090         \brief  Extend this method to draw your preview !
00091         \param  _frameDate a date, in second, which defines the effect cinematic.
00092         \param  _pPreviewViewPort the viewport to render. Can't be 0L.
00093         \param  _pPreviewConfiguration Preview Configuration object. Never 0L. Do not keep a pointer to it.
00094     */
00095     virtual void ProcessPreview(double _frameDate,VirtualMachine::InternalViewPort *_pViewPort,const PreviewConfiguration *_pPreviewConfiguration);
00096 #endif  
00097 
00098 };
00099 
00100 #endif

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