[Gambas-user] Triggering org.freedesktop.DBus.Properties.PropertiesChanged
benoit.minisini at gambas-basic.org
Tue Feb 7 17:01:37 CET 2023
Le 07/02/2023 à 16:44, Bruce Steers a écrit :
> I'm trying to make a dbus mpris interface for a MediaView control.
> I have some stuff working like cinnamon media control applet will
> stop/pause/play okay.
> What i am stuck with at present is being able to trigger the
> PropertiesChanged event.
> I have this code...
> Public Sub _new()
> $hDSignal = New DBusSignal(DBus.Session,
> "org.freedesktop.DBus.Properties", True) As "DBusSignal"
> Public Sub DBusSignal_Signal(Sig As String, arg As Variant)
> If Sig <> "PropertiesChanged" Then Return
> If arg <> "org.mpris.MediaPlayer2.Player" Then Return
> Dim c As Collection = arg
> For Each v As Variant In c
> ' Print c.Key, v
> Select c.Key
> Case "Volume"
> Case "PlaybackStatus"
> Case Else
> Print "unhandled:";; c.Key, v
> End Select
> With that if i click Play/pause in spotify i get the PlaybackStatus
> PropertiesChanged signal.
> But i cannot get my mpris interface to trigger the above property change
> Is it not supposed to be automatic?
I don't think so. Anyway, you can raise any signal with the
More information about the User