00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "asSoundSourceComponent.h"
00018
00019 #ifdef __COMPILE_WITH_ANGELSCRIPT__
00020 #ifdef __COMPILE_WITH_SFML_AUDIO__
00021
00022 #include "../../ScriptHelper.h"
00023 #include "../../core/asEntityComponent.h"
00024
00025 #include "../../../components/sound/SoundSourceComponent.h"
00026
00027
00029 SoundSourceComponent* createSoundSourceComponent(Entity *parent)
00030 {
00031 return new SoundSourceComponent(parent);
00032 }
00033
00035 void bindSoundSourceComponent(asIScriptEngine *engine)
00036 {
00037
00038 int r;
00039
00040
00041 r = engine->RegisterObjectType("SoundSourceComponent", sizeof(SoundSourceComponent), asOBJ_REF); assert(r >= 0);
00042
00043
00044 bindEntityComponentBase<SoundSourceComponent>(engine, "SoundSourceComponent");
00045
00046
00047 r = engine->RegisterObjectBehaviour("SoundSourceComponent", asBEHAVE_FACTORY, "SoundSourceComponent@ f(Entity @+)",
00048 asFUNCTION(createSoundSourceComponent), asCALL_CDECL); assert(r >= 0);
00049
00050 r = engine->RegisterObjectMethod("SoundSourceComponent", "SoundSourceComponent& opAssign(const SoundSourceComponent &in)",
00051 asFUNCTION(assignT<SoundSourceComponent>), asCALL_CDECL_OBJFIRST); assert(r >= 0);
00052
00053
00054 r = engine->RegisterObjectMethod("SoundSourceComponent", "bool loadMusic(const string &in)",
00055 asMETHOD(SoundSourceComponent, loadMusic), asCALL_THISCALL); assert(r >= 0);
00056 r = engine->RegisterObjectMethod("SoundSourceComponent", "bool loadSoundBuffer(const string &in)",
00057 asMETHOD(SoundSourceComponent, loadSoundBuffer), asCALL_THISCALL); assert(r >= 0);
00058
00059 r = engine->RegisterObjectMethod("SoundSourceComponent", "void play()",
00060 asMETHOD(SoundSourceComponent, play), asCALL_THISCALL); assert(r >= 0);
00061 r = engine->RegisterObjectMethod("SoundSourceComponent", "void pause()",
00062 asMETHOD(SoundSourceComponent, play), asCALL_THISCALL); assert(r >= 0);
00063 r = engine->RegisterObjectMethod("SoundSourceComponent", "void stop()",
00064 asMETHOD(SoundSourceComponent, play), asCALL_THISCALL); assert(r >= 0);
00065
00066 r = engine->RegisterObjectMethod("SoundSourceComponent", "f32 getAttenuation()",
00067 asMETHOD(SoundSourceComponent, getAttenuation), asCALL_THISCALL); assert(r >= 0);
00068 r = engine->RegisterObjectMethod("SoundSourceComponent", "bool getIsPlaying()",
00069 asMETHOD(SoundSourceComponent, getIsPlaying), asCALL_THISCALL); assert(r >= 0);
00070 r = engine->RegisterObjectMethod("SoundSourceComponent", "bool getIsPaused()",
00071 asMETHOD(SoundSourceComponent, getIsPaused), asCALL_THISCALL); assert(r >= 0);
00072 r = engine->RegisterObjectMethod("SoundSourceComponent", "bool getIsStopped()",
00073 asMETHOD(SoundSourceComponent, getIsStopped), asCALL_THISCALL); assert(r >= 0);
00074 r = engine->RegisterObjectMethod("SoundSourceComponent", "f32 getMinDistance()",
00075 asMETHOD(SoundSourceComponent, getMinDistance), asCALL_THISCALL); assert(r >= 0);
00076 r = engine->RegisterObjectMethod("SoundSourceComponent", "f32 getOffset()",
00077 asMETHOD(SoundSourceComponent, getOffset), asCALL_THISCALL); assert(r >= 0);
00078 r = engine->RegisterObjectMethod("SoundSourceComponent", "f32 getPitch()",
00079 asMETHOD(SoundSourceComponent, getPitch), asCALL_THISCALL); assert(r >= 0);
00080 r = engine->RegisterObjectMethod("SoundSourceComponent", "f32 getVolume()",
00081 asMETHOD(SoundSourceComponent, getVolume), asCALL_THISCALL); assert(r >= 0);
00082
00083 r = engine->RegisterObjectMethod("SoundSourceComponent", "void setAttenuation(f32)",
00084 asMETHOD(SoundSourceComponent, setAttenuation), asCALL_THISCALL); assert(r >= 0);
00085 r = engine->RegisterObjectMethod("SoundSourceComponent", "void setLoop(bool)",
00086 asMETHOD(SoundSourceComponent, setLoop), asCALL_THISCALL); assert(r >= 0);
00087 r = engine->RegisterObjectMethod("SoundSourceComponent", "void setMinDistance(f32)",
00088 asMETHOD(SoundSourceComponent, setMinDistance), asCALL_THISCALL); assert(r >= 0);
00089 r = engine->RegisterObjectMethod("SoundSourceComponent", "void setOffset(f32)",
00090 asMETHOD(SoundSourceComponent, setOffset), asCALL_THISCALL); assert(r >= 0);
00091 r = engine->RegisterObjectMethod("SoundSourceComponent", "void setPitch(f32)",
00092 asMETHOD(SoundSourceComponent, setPitch), asCALL_THISCALL); assert(r >= 0);
00093 r = engine->RegisterObjectMethod("SoundSourceComponent", "void setVolume(f32)",
00094 asMETHOD(SoundSourceComponent, setVolume), asCALL_THISCALL); assert(r >= 0);
00095 }
00096
00097 #endif // __COMPILE_WITH_SFML_AUDIO__
00098 #endif // __COMPILE_WITH_ANGELSCRIPT__
00099
00100