[Gambas-user] Triggering org.freedesktop.DBus.Properties.PropertiesChanged

Bruce Steers bsteers4 at gmail.com
Tue Feb 7 16:44:51 CET 2023


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"

End


Public Sub DBusSignal_Signal(Sig As String, arg As Variant[])

  If Sig <> "PropertiesChanged" Then Return
  If arg[0] <> "org.mpris.MediaPlayer2.Player" Then Return

  Dim c As Collection = arg[1]
  For Each v As Variant In c
'    Print c.Key, v
    Select c.Key
      Case "Volume"
        CheckVolumes()
      Case "PlaybackStatus"
        CheckPlayStates()
      Case Else
        Print "unhandled:";; c.Key, v

    End Select
  Next

End

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
event
Is it not supposed to be automatic?
the PlaybackStatus property is read only so i cannot set it directly.

Any clues?
Anyone crossed this bridge before and figured a way to trigger the
PropertiesChanged event?
Am i missing something obvious?

Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230207/a9f62816/attachment.htm>


More information about the User mailing list