예제 #1
0
int w_SoundData_setSample(lua_State *L)
{
	SoundData *sd = luax_checksounddata(L, 1);
	int i = (int) luaL_checkinteger(L, 2);
	float sample = (float) luaL_checknumber(L, 3);

	EXCEPT_GUARD(sd->setSample(i, sample);)
	return 0;
예제 #2
0
int w_SoundData_setSample(lua_State *L)
{
	SoundData *sd = luax_checksounddata(L, 1);
	int i = (int)lua_tointeger(L, 2);
	float sample = (float)lua_tonumber(L, 3);
	sd->setSample(i, sample);
	return 0;
}
예제 #3
0
int w_SoundData_setSample(lua_State *L)
{
	SoundData *sd = luax_checksounddata(L, 1);
	int i = (int) luaL_checkinteger(L, 2);

	if (lua_gettop(L) > 3)
	{
		int channel = luaL_checkinteger(L, 3);
		float sample = (float) luaL_checknumber(L, 4);
		luax_catchexcept(L, [&](){ sd->setSample(i, channel, sample); });
	}
	else
	{
		float sample = (float) luaL_checknumber(L, 3);
		luax_catchexcept(L, [&](){ sd->setSample(i, sample); });
	}

	return 0;
}