bind RageSound

This commit is contained in:
Glenn Maynard
2006-12-04 22:31:25 +00:00
parent c1d04c8083
commit edcc1c2f40
2 changed files with 39 additions and 0 deletions
+33
View File
@@ -800,6 +800,39 @@ RageSoundParams::StopMode_t RageSound::GetStopMode() const
return RageSoundParams::M_STOP;
}
// lua start
#include "LuaBinding.h"
class LunaRageSound: public Luna<RageSound>
{
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.
+6
View File
@@ -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;