예제 #1
0
파일: lua_video.cpp 프로젝트: LuaAV/LuaAV
/*! Video position (as a percentage)
	@param position The position
	@LuaMethod GETSET
	@name M.pos
*/
int lua_video_pos(lua_State *L) {
	Video *s = Glue<Video>::checkto(L, 1);
	if(s) {
		if(lua::is<float>(L, 2)) {
			float pct = lua::to<float>(L, 2);
			s->set_position(pct);
			return 0;
		}
		else {
			lua::push(L, s->get_position());
			return 1;
		}
	}
	else {
		luaL_error(L, "Video.pos: invalid arguments");
	}
	return 0;
}