sclu1034 / lua-libpulse-glib Goto Github PK
View Code? Open in Web Editor NEWMirror of https://git.sclu1034.dev/lucas/lua-libpulse-glib
Home Page: https://git.sclu1034.dev/lucas/lua-libpulse-glib
License: GNU General Public License v3.0
Mirror of https://git.sclu1034.dev/lucas/lua-libpulse-glib
Home Page: https://git.sclu1034.dev/lucas/lua-libpulse-glib
License: GNU General Public License v3.0
I think it makes sense to call it in context_state_callback
with PA_SUBSCRIPTION_MASK_ALL
when the state is ready.
Thanks for the library! PipeWire proves to be incredibly hard to work with for something simple like programmatically changing the volume of the current sink, so your library is a savior (assuming I'll end up at the goal, of course - I just started experimenting).
Couldn't install the library with luarocks
, had to compile manually.
Callbacks for both ctx:connect
and ctx:get_sinks
now receive something extra as the first argument, which at least in my case is always nil
. So I had to change the code from the README to this (note the underscores):
ctx:connect(nil, function(_, state)
if state == 4 then
print("Connection is ready")
ctx:get_sinks(function(_, sinks)
ppretty.dump(sinks)
loop:quit()
end)
end
end)
Same with get_sink_info_by_name
, getting bad argument #1 to 'get_sink_info_by_name' (function expected, got string)
.
I think the line simple_callback_data* data = prepare_lua_callback(L, 2);
should use 3 instead of 2.
$ lua
Lua 5.3.6 Copyright (C) 1994-2020 Lua.org, PUC-Rio
> require('lua_libpulse_glib').new():context('a')
pulseaudio.context: 0x55ddb22b3a38
>
But:
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libselinux.so.1 lua
Lua 5.3.6 Copyright (C) 1994-2020 Lua.org, PUC-Rio
> require('lua_libpulse_glib').new():context('a')
>
Seems like this function overrides the one from this library: https://www.mankier.com/3/context_new.
The fix would be to replace #define LUA_MOD_EXPORT extern
(extern
on defined functions doesn't make sense anyway, AFAIK) with #define LUA_MOD_EXPORT __attribute__((visibility("default")))
and to add -fvisibility=hidden
to CFLAGS
in the Makefile
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.