Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

KX_SoundActuator.h

Go to the documentation of this file.
00001 
00006 
00007 #ifndef __KX_SOUNDACTUATOR
00008 #define __KX_SOUNDACTUATOR
00009 
00010 #include "SCA_IActuator.h"
00011 #include "SND_SoundObject.h"
00012 
00013 class KX_SoundActuator : public SCA_IActuator
00014 {
00015         Py_Header;
00016         bool                            m_lastEvent;
00017         /* just some handles to the audio-data... */
00018         SND_SoundObject*        m_soundObject;
00019         short                           m_startFrame;
00020         short                           m_endFrame;
00021 public:
00022 
00023         enum KX_SOUNDACT_TYPE {
00024                 KX_SOUNDACT_NODEF = 0,
00025                 KX_SOUNDACT_PLAYSTOP,
00026                 KX_SOUNDACT_PLAYEND,
00027                 KX_SOUNDACT_LOOPSTOP,
00028                 KX_SOUNDACT_LOOPEND,
00029                 KX_SOUNDACT_NEWSOUND,
00030                 KX_SOUNDACT_LOWERPITCH,
00031                 KX_SOUNDACT_RAISEPITCH,
00032                 KX_SOUNDACT_MAX
00033         };
00034 
00035 
00036         KX_SOUNDACT_TYPE m_type;
00037 
00038         KX_SoundActuator(SCA_IObject* gameobj,
00039                                         SND_SoundObject* sndobj,
00040                                         KX_SOUNDACT_TYPE type,
00041                                         short start,
00042                                         short end,
00043                                         PyTypeObject* T=&Type);
00044         virtual ~KX_SoundActuator();
00045 
00046         virtual void setSoundObject(SND_SoundObject* soundobject) {m_soundObject = soundobject;}
00047         virtual bool Update(double curtime,double deltatime);
00048 
00049 
00050         virtual CValue* GetReplica() {
00051                 KX_SoundActuator* replica = new KX_SoundActuator(*this);
00052                 replica->ProcessReplica();
00053                 // this will copy properties and so on...
00054                 CValue::AddDataToReplica(replica);
00055                 return replica;
00056         };
00057 
00058 
00059         /* --------------------------------------------------------------------- */
00060         /* Python interface ---------------------------------------------------- */
00061         /* --------------------------------------------------------------------- */
00062 
00063         virtual PyObject*  _getattr(char *attr);
00064 
00065         /* 1. setFilename                                                        */
00066         KX_PYMETHOD(KX_SoundActuator,SetFilename);
00067         /* 2. getFilename                                                        */
00068         KX_PYMETHOD(KX_SoundActuator,GetFilename);
00069         
00070 
00071 };
00072 #endif //__KX_SOUNDACTUATOR

Generated at Thu Feb 1 13:03:07 2001 for Ketsji Game Engine by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000