示例#1
0
文件: audio.c 项目: dns/CLove
static int l_audio_SourceCommon_getVolume(lua_State *state) {
	if (moduleData.audio_type == audio_type_stream){
		audio_StreamSource* source = (audio_StreamSource *)lua_touserdata(state, 1);
		lua_pushnumber(state, audio_StreamSource_getVolume(source));
	} else {
		audio_SourceCommon* source = (audio_SourceCommon*)lua_touserdata(state, 1);
		lua_pushnumber(state, audio_SourceCommon_getVolume(source));
	}
	return 1;
}
示例#2
0
文件: audio.c 项目: dns/CLove
Obj* c_audio_getVolume(void* root, Obj** env, Obj** list)
{

	if (length(*list) != 1)
		error("Expected <custom>.");

	Obj* arg = eval(root, env, &(*list)->car);
	DEFINE1(ret);
	if (moduleData.audio_type == audio_type_static)
	{
		audio_SourceCommon* source = (audio_SourceCommon*)arg->custom;
		float gain = audio_SourceCommon_getVolume(source);
		*ret = make_int(root, gain);
		return *ret;
	}

	audio_StreamSource* source = (audio_StreamSource*)arg->custom;
	float gain = audio_StreamSource_getVolume(source);
	*ret = make_int(root, gain);
	return *ret;
}
示例#3
0
文件: audio.c 项目: ezhangle/motor
static int l_audio_SourceCommon_getVolume(lua_State *state) {
  l_assertType(state, 1, isSource);
  audio_SourceCommon *source = (audio_SourceCommon*)lua_touserdata(state, 1);
  lua_pushnumber(state, audio_SourceCommon_getVolume(source));
  return 1;
}