Compare commits
No commits in common. "wip/master" and "master" have entirely different histories.
wip/master
...
master
4 changed files with 1 additions and 23 deletions
|
@ -44,8 +44,7 @@ void context_event_callback(pa_context* c, pa_subscription_event_type_t event_ty
|
||||||
// Copy the `self` parameter
|
// Copy the `self` parameter
|
||||||
lua_pushvalue(L, 2);
|
lua_pushvalue(L, 2);
|
||||||
lua_pushinteger(L, event_type);
|
lua_pushinteger(L, event_type);
|
||||||
// Adjust the index to Lua's 1-base
|
lua_pushinteger(L, index);
|
||||||
lua_pushinteger(L, index + 1);
|
|
||||||
|
|
||||||
lua_call(L, 3, 0);
|
lua_call(L, 3, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -512,8 +512,6 @@ static const struct luaL_Reg context_f[] = {
|
||||||
{ "get_server_info", context_get_server_info },
|
{ "get_server_info", context_get_server_info },
|
||||||
{ "get_sinks", context_get_sink_info_list },
|
{ "get_sinks", context_get_sink_info_list },
|
||||||
{ "get_sink_info", context_get_sink_info },
|
{ "get_sink_info", context_get_sink_info },
|
||||||
{ "get_sink_info_by_name", context_get_sink_info_by_name },
|
|
||||||
{ "get_sink_info_by_index", context_get_sink_info_by_index },
|
|
||||||
{ "set_sink_volume", context_set_sink_volume },
|
{ "set_sink_volume", context_set_sink_volume },
|
||||||
{ "set_sink_mute", context_set_sink_mute },
|
{ "set_sink_mute", context_set_sink_mute },
|
||||||
{ "set_sink_suspended", context_set_sink_suspended },
|
{ "set_sink_suspended", context_set_sink_suspended },
|
||||||
|
|
|
@ -72,8 +72,6 @@ void sink_info_callback(pa_context* c, const pa_sink_info* info, int eol, void*
|
||||||
if (!eol) {
|
if (!eol) {
|
||||||
lua_pushfstring(L, "only one sink info expected, but got multiple");
|
lua_pushfstring(L, "only one sink info expected, but got multiple");
|
||||||
lua_call(L, 1, 0);
|
lua_call(L, 1, 0);
|
||||||
|
|
||||||
free_lua_callback(data);
|
|
||||||
} else {
|
} else {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
sink_info_to_lua(L, info);
|
sink_info_to_lua(L, info);
|
||||||
|
|
|
@ -124,7 +124,6 @@ void createlib_context(lua_State* L) {
|
||||||
luaL_setfuncs(L, context_mt, 0);
|
luaL_setfuncs(L, context_mt, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define enum_field(L, idx, name) (lua_pushinteger(L, PA_##name), lua_setfield(L, idx, #name))
|
|
||||||
|
|
||||||
void createlib_pulseaudio(lua_State* L) {
|
void createlib_pulseaudio(lua_State* L) {
|
||||||
luaL_newmetatable(L, LUA_PULSEAUDIO);
|
luaL_newmetatable(L, LUA_PULSEAUDIO);
|
||||||
|
@ -135,22 +134,6 @@ void createlib_pulseaudio(lua_State* L) {
|
||||||
luaL_setfuncs(L, pulseaudio_mt, 0);
|
luaL_setfuncs(L, pulseaudio_mt, 0);
|
||||||
|
|
||||||
luaL_newlib(L, pulseaudio_lib);
|
luaL_newlib(L, pulseaudio_lib);
|
||||||
|
|
||||||
// pa_subscription_event_type
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_SINK);
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_SOURCE);
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_SINK_INPUT);
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_SOURCE_OUTPUT);
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_MODULE);
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_CLIENT);
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_SAMPLE_CACHE);
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_SERVER);
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_CARD);
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_NEW);
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_CHANGE);
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_REMOVE);
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_FACILITY_MASK);
|
|
||||||
enum_field(L, -2, SUBSCRIPTION_EVENT_TYPE_MASK);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue