From c2308daf897055e056a0a51fbc445f7902c2f90b Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 14 Sep 2024 04:15:27 -0300 Subject: Added examples for python and lua --- docs/libraries/wireplumber.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'docs/libraries/wireplumber.md') diff --git a/docs/libraries/wireplumber.md b/docs/libraries/wireplumber.md index e1c9579..0c858f0 100644 --- a/docs/libraries/wireplumber.md +++ b/docs/libraries/wireplumber.md @@ -66,17 +66,31 @@ wpctl --help ```js [ JavaScript] import Wp from "gi://AstalWp"; -const audio = Wp.get_default_wp().audio +const audio = Wp.get_default_wp().audio; -console.log(audio.volume) +console.log(audio.default_speaker.volume); ``` ```py [ Python] -# Not yet documented +import gi + +gi.require_version("AstalWp", "0.1") + +from gi.repository import AstalWp + +audio = AstalWp.get_default_wp().get_audio() + +print(audio.get_default_speaker().get_volume()) ``` ```lua [ Lua] --- Not yet documented +local lgi = require("lgi") + +local AstalWp = lgi.require("AstalWp", "0.1") + +local audio = AstalWp.get_default_wp().audio + +print(audio.default_speaker.volume) ``` ```vala [ Vala] -- cgit v1.2.3