[Gambas-user] Dbus mpris setting volume needs type d, but how? (Bruce Steers)

Bruce Steers bsteers4 at gmail.com
Mon Jan 30 01:12:27 CET 2023


On Sun, 29 Jan 2023 at 12:08, Bruce Steers <bsteers4 at gmail.com> wrote:

>
>
> On Sun, 29 Jan 2023 at 08:46, CD <claude.dessere at orange.fr> wrote:
>
>> Hi,
>>
>> may be this can help :
>>
>> https://gambaswiki.org/wiki/doc/dbus#t10
>>
>> regards
>>
>
> Sadly not , that's info I already know , d is Double in C or Float in
> gambas.
> But thanks anyway.
>
> I tried
> Dim f As Float = 0.5
> DBus["session://" & cp.Address]["/org/mpris/MediaPlayer2",
> "org.mpris.MediaPlayer2.Player"].Volume = f
> Also...
> DBus["session://" & cp.Address]["/org/mpris/MediaPlayer2",
> "org.mpris.MediaPlayer2.Player"].Volume = CFloat(f)
>
> It still fails saying I'm using v (Variable) and should use d (Float) type
>
> Benoit is it a bug or am i missing something?
>
> Respects
> BruceS
>

Maybe i was missing something..

I got it working doing this...

    DBus["session://" & $hPlayer.Address]["/org/mpris/MediaPlayer2",
"org.freedesktop.DBus.Properties"].Set("org.mpris.MediaPlayer2.Player",
"Volume", Slider2.Value / 100)

Thanks anyway all :)
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230130/1358266d/attachment.htm>


More information about the User mailing list