69 lines
1.9 KiB
Text
69 lines
1.9 KiB
Text
= lua-libpulse-glib
|
|
:idprefix:
|
|
:idseparator: -
|
|
ifdef::env-github,env-browser[]
|
|
:toc: macro
|
|
:toclevels: 1
|
|
endif::[]
|
|
:branch: master
|
|
:status:
|
|
:outfilesuffix: .adoc
|
|
:!toc-title:
|
|
:caution-caption: :fire:
|
|
:important-caption: :exclamation:
|
|
:note-caption: :paperclip:
|
|
:tip-caption: :bulb:
|
|
:warning-caption: :warning:
|
|
:url-ci: https://ci.sclu1034.dev/teams/main/pipelines/lua-libpulse-glib
|
|
:url-ci-badge: https://ci.sclu1034.dev/api/v1/teams/main/pipelines/lua-libpulse-glib/badge
|
|
:url-license-badge: https://img.shields.io/badge/license-GPLv3-brightgreen?style=flat-square
|
|
:url-luarocks-badge: https://img.shields.io/luarocks/v/sclu1034/lua-libpulse-glib?style=flat-square
|
|
:url-luarocks-link: https://luarocks.org/modules/sclu1034/lua-libpulse-glib
|
|
|
|
image:{url-license-badge}[License]
|
|
ifdef::status[]
|
|
image:{url-ci-badge}[Build Status (Concourse CI), link={url-ci}]
|
|
endif::[]
|
|
image:{url-luarocks-badge}[LuaRocks Package, link={url-luarocks-link}]
|
|
|
|
https://freedesktop.org/software/pulseaudio/doxygen/index.html[libpulse] bindings for use with a GLib MainLoop via
|
|
https://github.com/lgi-devs/lgi/[LGI].
|
|
|
|
The project is still in a development state. It hasn't been fully tested yet, and not all functions from libpulse
|
|
have a corresponding binding yet.
|
|
Please do report anything that's missing or not working correctly.
|
|
|
|
== Quick Start
|
|
|
|
Install https://github.com/lgi-devs/lgi[lgi] and _lua_libpulse_glib_ from LuaRocks:
|
|
|
|
[source,shell]
|
|
----
|
|
luarocks install lgi
|
|
luarocks install --dev lua-libpulse-glib
|
|
----
|
|
|
|
[source,lua]
|
|
----
|
|
local lgi = require("lgi")
|
|
local pulseaudio = require("lua_libpulse_glib")
|
|
local ppretty = require("pl.pretty")
|
|
|
|
local pa = pulseaudio.new()
|
|
local ctx = pa:context("My Test App")
|
|
|
|
local loop = lgi.GLib.MainLoop.new()
|
|
|
|
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)
|
|
|
|
loop:run()
|
|
----
|