diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index a4149f9abc..43bec191e2 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -800,6 +800,39 @@ RageSoundParams::StopMode_t RageSound::GetStopMode() const return RageSoundParams::M_STOP; } + +// lua start +#include "LuaBinding.h" + +class LunaRageSound: public Luna +{ +public: + static int pitch( T* p, lua_State *L ) + { + RageSoundParams params( p->GetParams() ); + params.m_fPitch = FArg(1); + p->SetParams( params ); + return 0; + } + + static int speed( T* p, lua_State *L ) + { + RageSoundParams params( p->GetParams() ); + params.m_fSpeed = FArg(1); + p->SetParams( params ); + return 0; + } + + LunaRageSound() + { + ADD_METHOD( pitch ); + ADD_METHOD( speed ); + } +}; + +LUA_REGISTER_CLASS( RageSound ) +// lua end + /* * Copyright (c) 2002-2004 Glenn Maynard * All rights reserved. diff --git a/stepmania/src/RageSound.h b/stepmania/src/RageSound.h index abcd07fb30..f1db8f3747 100644 --- a/stepmania/src/RageSound.h +++ b/stepmania/src/RageSound.h @@ -8,6 +8,7 @@ #include "RageSoundPosMap.h" class RageSoundReader; +struct lua_State; /* Driver interface for sounds: this is what drivers see. */ class RageSoundBase @@ -146,6 +147,11 @@ public: void SetParams( const RageSoundParams &p ); const RageSoundParams &GetParams() const { return m_Param; } + // + // Lua + // + virtual void PushSelf( lua_State *L ); + private: mutable RageMutex m_Mutex;