mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Rename Source/SoundData/Decoder:getChannels to getChannelCount (resolves issue #1307). Deprecate the old methods rather than completely removing them.
--HG-- branch : minor
This commit is contained in:
@@ -51,10 +51,10 @@ int w_SoundData_clone(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_SoundData_getChannels(lua_State *L)
|
||||
int w_SoundData_getChannelCount(lua_State *L)
|
||||
{
|
||||
SoundData *t = luax_checksounddata(L, 1);
|
||||
lua_pushinteger(L, t->getChannels());
|
||||
lua_pushinteger(L, t->getChannelCount());
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -105,16 +105,26 @@ int w_SoundData_getSample(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_SoundData_getChannels(lua_State *L)
|
||||
{
|
||||
luax_markdeprecated(L, "SoundData:getChannels", DEPRECATED_RENAMED, "SoundData:getChannelCount");
|
||||
return w_SoundData_getChannelCount(L);
|
||||
}
|
||||
|
||||
static const luaL_Reg w_SoundData_functions[] =
|
||||
{
|
||||
{ "clone", w_SoundData_clone },
|
||||
{ "getChannels", w_SoundData_getChannels },
|
||||
{ "getChannelCount", w_SoundData_getChannelCount },
|
||||
{ "getBitDepth", w_SoundData_getBitDepth },
|
||||
{ "getSampleRate", w_SoundData_getSampleRate },
|
||||
{ "getSampleCount", w_SoundData_getSampleCount },
|
||||
{ "getDuration", w_SoundData_getDuration },
|
||||
{ "setSample", w_SoundData_setSample },
|
||||
{ "getSample", w_SoundData_getSample },
|
||||
|
||||
// Deprecated
|
||||
{ "getChannels", w_SoundData_getChannels },
|
||||
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user