Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/GameLogic/SCA_SoundActuator.h
- This file was moved from source/gameengine/Ketsji/KX_SoundActuator.h.
| Show All 19 Lines | |||||
| * | * | ||||
| * The Original Code is: all of this file. | * The Original Code is: all of this file. | ||||
| * | * | ||||
| * Contributor(s): none yet. | * Contributor(s): none yet. | ||||
| * | * | ||||
| * ***** END GPL LICENSE BLOCK ***** | * ***** END GPL LICENSE BLOCK ***** | ||||
| */ | */ | ||||
| /** \file KX_SoundActuator.h | /** \file SCA_SoundActuator.h | ||||
| * \ingroup ketsji | * \ingroup gamelogic | ||||
| */ | */ | ||||
| #ifndef __KX_SOUNDACTUATOR_H__ | #ifndef __SCA_SOUNDACTUATOR_H__ | ||||
| #define __KX_SOUNDACTUATOR_H__ | #define __SCA_SOUNDACTUATOR_H__ | ||||
| #include "SCA_IActuator.h" | #include "SCA_IActuator.h" | ||||
| #ifdef WITH_AUDASPACE | #ifdef WITH_AUDASPACE | ||||
| # include "AUD_C-API.h" | # include "AUD_C-API.h" | ||||
| # include "AUD_IFactory.h" | # include "AUD_IFactory.h" | ||||
| # include "AUD_IHandle.h" | # include "AUD_IHandle.h" | ||||
| # include <boost/shared_ptr.hpp> | # include <boost/shared_ptr.hpp> | ||||
| #endif | #endif | ||||
| #include "BKE_sound.h" | #include "BKE_sound.h" | ||||
| typedef struct KX_3DSoundSettings { | typedef struct KX_3DSoundSettings { | ||||
| float min_gain; | float min_gain; | ||||
| float max_gain; | float max_gain; | ||||
| float reference_distance; | float reference_distance; | ||||
| float max_distance; | float max_distance; | ||||
| float rolloff_factor; | float rolloff_factor; | ||||
| float cone_inner_angle; | float cone_inner_angle; | ||||
| float cone_outer_angle; | float cone_outer_angle; | ||||
| float cone_outer_gain; | float cone_outer_gain; | ||||
| } KX_3DSoundSettings; | } KX_3DSoundSettings; | ||||
| class KX_SoundActuator : public SCA_IActuator | class SCA_SoundActuator : public SCA_IActuator | ||||
| { | { | ||||
| Py_Header | Py_Header | ||||
| bool m_isplaying; | bool m_isplaying; | ||||
| boost::shared_ptr<AUD_IFactory> m_sound; | boost::shared_ptr<AUD_IFactory> m_sound; | ||||
| float m_volume; | float m_volume; | ||||
| float m_pitch; | float m_pitch; | ||||
| bool m_is3d; | bool m_is3d; | ||||
| KX_3DSoundSettings m_3d; | KX_3DSoundSettings m_3d; | ||||
| Show All 12 Lines | enum KX_SOUNDACT_TYPE | ||||
| KX_SOUNDACT_LOOPEND, | KX_SOUNDACT_LOOPEND, | ||||
| KX_SOUNDACT_LOOPBIDIRECTIONAL, | KX_SOUNDACT_LOOPBIDIRECTIONAL, | ||||
| KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP, | KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP, | ||||
| KX_SOUNDACT_MAX | KX_SOUNDACT_MAX | ||||
| }; | }; | ||||
| KX_SOUNDACT_TYPE m_type; | KX_SOUNDACT_TYPE m_type; | ||||
| KX_SoundActuator(SCA_IObject* gameobj, | SCA_SoundActuator(SCA_IObject* gameobj, | ||||
| boost::shared_ptr<AUD_IFactory> sound, | boost::shared_ptr<AUD_IFactory> sound, | ||||
| float volume, | float volume, | ||||
| float pitch, | float pitch, | ||||
| bool is3d, | bool is3d, | ||||
| KX_3DSoundSettings settings, | KX_3DSoundSettings settings, | ||||
| KX_SOUNDACT_TYPE type); | KX_SOUNDACT_TYPE type); | ||||
| ~KX_SoundActuator(); | ~SCA_SoundActuator(); | ||||
| virtual bool Update(double curtime, bool frame); | virtual bool Update(double curtime, bool frame); | ||||
| CValue* GetReplica(); | CValue* GetReplica(); | ||||
| void ProcessReplica(); | void ProcessReplica(); | ||||
| #ifdef WITH_PYTHON | #ifdef WITH_PYTHON | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /* Python interface --------------------------------------------------- */ | /* Python interface --------------------------------------------------- */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, startSound); | KX_PYMETHOD_DOC_NOARGS(SCA_SoundActuator, startSound); | ||||
| KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, pauseSound); | KX_PYMETHOD_DOC_NOARGS(SCA_SoundActuator, pauseSound); | ||||
| KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, stopSound); | KX_PYMETHOD_DOC_NOARGS(SCA_SoundActuator, stopSound); | ||||
| static int pyattr_set_3d_property(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | static int pyattr_set_3d_property(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | ||||
| static int pyattr_set_audposition(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | static int pyattr_set_audposition(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | ||||
| static int pyattr_set_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | static int pyattr_set_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | ||||
| static int pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | static int pyattr_set_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | ||||
| static int pyattr_set_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | static int pyattr_set_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | ||||
| static int pyattr_set_sound(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | static int pyattr_set_sound(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); | ||||
| static PyObject *pyattr_get_3d_property(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | static PyObject *pyattr_get_3d_property(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | ||||
| static PyObject *pyattr_get_audposition(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | static PyObject *pyattr_get_audposition(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | ||||
| static PyObject *pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | static PyObject *pyattr_get_gain(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | ||||
| static PyObject *pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | static PyObject *pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | ||||
| static PyObject *pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | static PyObject *pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | ||||
| static PyObject *pyattr_get_sound(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | static PyObject *pyattr_get_sound(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); | ||||
| #endif /* WITH_PYTHON */ | #endif /* WITH_PYTHON */ | ||||
| }; | }; | ||||
| #endif /* __KX_SOUNDACTUATOR_H__ */ | #endif /* __SCA_SOUNDACTUATOR_H__ */ | ||||