DBus: Difference between revisions

From VideoLAN Wiki
Jump to navigation Jump to search
Funman (talk | contribs)
No edit summary
Funman (talk | contribs)
No edit summary
Line 2: Line 2:


=== List all signals, methods with their arguments and return value ===
=== List all signals, methods with their arguments and return value ===
Decide what to do when org.videolan service is already registered by another instance of vlc: let the first instance do all the work ? replace it ? place vlc on the queue ?
Now if vlc is built with D-Bus >= 1.0.0 it will automatically register org.videolan.vlc, and no other instances of vlc will be allowed to replace it


=== Decide service bahaviour ===
=== Decide service bahaviour ===
Line 23: Line 17:




=== Clarify one instance mode ===
Now if vlc is built with D-Bus >= 1.0.0 it will automatically register org.videolan.vlc, and no other instances of vlc will be allowed to replace the service.
When vlc starts it registers the org.videolan.vlc service on the session bus
* if it succeeds, it register '/' object on it
* if it fails:
** if "one-instance" is false, just warn that it didn't register the service
** if "one-instance" is true, the mrls given on the command line are passed to the owner of org.videolan.vlc through D-Bus interface
When D-Bus control interface starts, it does:
# unregister '/'
# register '/org/videolan/vlc'


=== Missing features ===
=== Missing features ===
Line 41: Line 49:
=== Signals ===
=== Signals ===


"ItemChange" "s" : Emitted when a new input element is played, the string contains the filename, or the input name if it has some metadata.
'ItemChange' 's' : Emitted when a new input element is played, the string contains the filename, or the input name if it has some metadata.


"NewInstance" "i" : Emitted when vlc control interface is started, with vlc pid
'NewInstance' 'i' : Emitted when vlc control interface is started, with vlc pid


=== Methods ===
=== Methods ===


"GetPlayStatus" ""->"s" : return "play" "pause" "stopped" or "unknown"
'GetPlayStatus' ''->'s' : return "play" "pause" "stopped" or "unknown"


"GetPlayingItem" ""->"s" : return the filename of the current item being played, or it's name if it has some metadata. Same data provided by "ItemChange"
'GetPlayingItem' ''->'s' : return the filename of the current item being played, or it's name if it has some metadata. Same data provided by "ItemChange"


"ToglePause" ""->"b" : toggle the play/pause status, and start playing if it was stopped, return true if playing, false if paused
'ToglePause' ''->'b' : toggle the play/pause status, and start playing if it was stopped, return true if playing, false if paused


"AddMRL" "sb"->"" : add string to the playlist, and play it if bool is true
'AddMRL' 'sb'->'' : add string to the playlist, and play it if bool is true


"Nothing" ""->"" : do nothing, just here for tests, and code example
'Nothing' ''->'' : do nothing, just here for tests, and code example


"Quit" ""->"" : exits vlc
'Quit' ''->'' : exits vlc


"Stop" ""->"" : stop playlist
'Stop' ''->'' : stop playlist


"Prev" ""->"" : plays previous playlist item
'Prev' ''->'' : plays previous playlist item


"Next" ""->"" : plays next playlist item
'Next" ""->"" : plays next playlist item

Revision as of 05:53, 21 November 2006

TODO for DBus integration

List all signals, methods with their arguments and return value

Decide service bahaviour

Could vlc be a on-demand startable service, would it be useful ?

We just have to create a /usr/share/dbus-1/org.videolan.vlc.service:


[D-BUS Service]

Name=org.videolan.vlc

Exec=/usr/bin/vlc -I dummy --control dbus



Clarify one instance mode

Now if vlc is built with D-Bus >= 1.0.0 it will automatically register org.videolan.vlc, and no other instances of vlc will be allowed to replace the service.

When vlc starts it registers the org.videolan.vlc service on the session bus

  • if it succeeds, it register '/' object on it
  • if it fails:
    • if "one-instance" is false, just warn that it didn't register the service
    • if "one-instance" is true, the mrls given on the command line are passed to the owner of org.videolan.vlc through D-Bus interface


When D-Bus control interface starts, it does:

  1. unregister '/'
  2. register '/org/videolan/vlc'

Missing features

volume control => VolumeGet and VolumeSet

playlist => hard.... could we use xspf ?

timing of the input element (position, jump)

preferences ?


List of signals and methods

Signals

'ItemChange' 's' : Emitted when a new input element is played, the string contains the filename, or the input name if it has some metadata.

'NewInstance' 'i' : Emitted when vlc control interface is started, with vlc pid

Methods

'GetPlayStatus' ->'s' : return "play" "pause" "stopped" or "unknown"

'GetPlayingItem' ->'s' : return the filename of the current item being played, or it's name if it has some metadata. Same data provided by "ItemChange"

'ToglePause' ->'b' : toggle the play/pause status, and start playing if it was stopped, return true if playing, false if paused

'AddMRL' 'sb'-> : add string to the playlist, and play it if bool is true

'Nothing' -> : do nothing, just here for tests, and code example

'Quit' -> : exits vlc

'Stop' -> : stop playlist

'Prev' -> : plays previous playlist item

'Next" ""->"" : plays next playlist item