Registered Member
|
I know that DBus is created to be a brighe between apps and if it is used to 1to1 communication - it calls to exact another app like "org.freedesktop.DBus.GLib = do smething" -
or it could do more generic 1 to Many actions like "org.freedesktop.DBus.IM.status = away" and all apps who is registered to org.freedesktop.IM would change its status |
Administrator
|
According to the Qt documentation, this is possible http://doc.trolltech.com/4.5/qtdbus.html
|
KDE Developer
|
Basically it works like this:
An application can have any number of connections with the bus. Each connection gets an unique identifier so one can send messages to a specific connection and one can check which specific connection a message came from. Connections can optionally be associated with additional names, often referred to as "well known names", e.g. org.kde.knotify There are four types of messages: method calls, method returns, errors and signals. Method calls are sent to a specific connection, same for method returns and errors. (theoretically all connections can see them, in reality they are filtered by a default filter in the library) Signals are "broadcasted" to all connections. For a use case like "set all IM apps to 'away'" one could use a signal. Another option is to make all IM apps register with a central service which forwards method calls to each registered app. The caller would then call the method on the central service and it would spread it to all actual receivers. Another option is to make all IM apps register additional names using a specified prefix. The caller would fetch a list of all connections and call the method on all connections which have a name beginning with that prefix. (this approach is for example used to control media players) They all have advantages and disadvantages, it depends on the actual use case which one might fit best. Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Registered Member
|
Te case is that I was thinking about writing a very simple remote control app for my mobile phone over http:// (in local wifi network it should work enough fast, i hope ), so I was thinking if there are global standard calls to do simple play pause vol up/down calls.
Or might be easier to simply emulate keyboard clicks like space to play/pause wheel up/down for volume. |
KDE Developer
|
I this case you might want to have a look at the MPRIS spec:
http://wiki.xmms2.xmms.se/wiki/MPRIS Quite some media players implement it can can therefore be controlled over D-Bus in a common way. More or less the last of the options I listed in my other comment. Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]