Giter Site home page Giter Site logo

sclu1034 / lua-libpulse-glib Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 632 KB

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

Lua 1.32% Makefile 1.98% Shell 1.33% C 95.37%
lua lua-bindings pulseaudio pulseaudio-client mirrored-repository

lua-libpulse-glib's People

Contributors

sclu1034 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

lua-libpulse-glib's Issues

On Lua 5.3 at least some callbacks seem to be getting an extra argument

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)

`get_sink_info` doesn't work for strings

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.

Impossible to use from Awesome WM due to the `context_new` function implementation being overriden by `libselinux.so.1`

$ 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.