本文整理汇总了C++中SoundData::setSample方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundData::setSample方法的具体用法?C++ SoundData::setSample怎么用?C++ SoundData::setSample使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundData
的用法示例。
在下文中一共展示了SoundData::setSample方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: w_SoundData_setSample
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: w_SoundData_setSample
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: w_SoundData_setSample
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;
}