This forum has been archived. All content is frozen. Please use KDE Discuss instead.

GetStatus D-Bus call

Tags: None
(comma "," separated)
User avatar
giucam
KDE Developer
Posts
62
Karma
1
OS

GetStatus D-Bus call

Sat Sep 13, 2008 4:44 pm
Hi all!!

i'm programming with amarok 2 and dbus. i can call without problem all methods but one: GetStatus in /Player. First of all i don't understand why it returns four values three of which are always 0. but anyway using dbus-send it works, but i can't get it via qtdbus. i tried with qdbusreply but the reply is not valid. qdbusreply makes it crash when i try to read inside the list. and then i tried like suggested here: http://wiki.kde.org/tiki-index.php?page=Porting+KDELibs+to+D-Bus just upper than "Usage of DCOPObject" but it returns always 0 and the list has only 1 item.

i don't know what to do, can you guys help me?
User avatar
markey
KDE Developer
Posts
2286
Karma
3
OS

Re: GetStatus D-Bus call

Sun Sep 14, 2008 2:04 pm
The qdbus tool cannot yet deal with complex data structures; it can currently only handle strings (support for complex types will be in Qt 4.5).

This means that you will have to use a real D-Bus library to access this function. Such libraries exist for many languages, like C++ (part of Qt), Ruby, etc.


PS: Maybe an option for you could be to implement your program as a true Amarok 2 script, in QtScript. Then you don't need to access the D-Bus interface at all.


--
Mark Kretschmann - Amarok Developer
User avatar
giucam
KDE Developer
Posts
62
Karma
1
OS

Re: GetStatus D-Bus call

Sun Sep 14, 2008 3:07 pm
thanks for the answer. i think i will use qtscript. i can use it to make a plasmoid for the kde desktop, isn't it?
User avatar
markey
KDE Developer
Posts
2286
Karma
3
OS

Re: GetStatus D-Bus call

Sun Sep 14, 2008 3:23 pm
No, you can't make a KDE desktop plasmoid with it. It's meant for internal scripting, like Firefox extensions.

http://amarok.kde.org/wiki/Development/ ... _HowTo_2.0


--
Mark Kretschmann - Amarok Developer
User avatar
giucam
KDE Developer
Posts
62
Karma
1
OS

Re: GetStatus D-Bus call

Sun Sep 14, 2008 4:41 pm
ok, but if i want i can do a script that provides some d-bus methods that i need and that are absent in the mpris standard, right?
User avatar
markey
KDE Developer
Posts
2286
Karma
3
OS

Re: GetStatus D-Bus call

Sun Sep 14, 2008 8:00 pm
Interesting idea :) It might be possible. Worth a try.


--
Mark Kretschmann - Amarok Developer
User avatar
giucam
KDE Developer
Posts
62
Karma
1
OS

Re: GetStatus D-Bus call

Mon Sep 15, 2008 7:49 pm
mmh, as i can see in the wiki entry the amarok api for the scripts isn't so big, or has the page to be completed? for example i can't see calls for the title, album and so on. but i was thinking: instead of a script can i write a plasma dataengine for amarok that takes the infos and provides them through dbus or another way to my kde plasmoid?


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], daret, Evergrowing, Google [Bot], lockheed, sandyvee, Sogou [Bot]