mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-07 15:52:11 +01:00
Adjust header levels
parent
9472bbf121
commit
73985e2a95
@ -1,17 +1,17 @@
|
||||
# Introduction
|
||||
## Introduction
|
||||
|
||||
Clementine can be controlled remotely over DBus. [DBus](http://www.freedesktop.org/wiki/Software/dbus) is a message bus that lets applications on Linux talk to each other. It replaces DCOP that was used by KDE 3 and Amarok 1.4.
|
||||
|
||||
This guide will show you how to control Clementine from the commandline and from Python scripts.
|
||||
|
||||
## The specifications
|
||||
### The specifications
|
||||
|
||||
MPRIS is a common API for controlling music players over DBus. Clementine supports MPRIS versions 1 and 2:
|
||||
|
||||
- [MPRIS 1](http://xmms2.org/wiki/MPRIS)
|
||||
- [MPRIS 2](http://www.mpris.org/2.1/spec/)
|
||||
|
||||
# Using the command line
|
||||
## Using the command line
|
||||
|
||||
Clementine has two names on the bus: `org.mpris.clementine` (the MPRIS 1 interface) and `org.mpris.MediaPlayer2.clementine` (for MPRIS 2). You can use the `qdbus` application to explore which objects and methods are available on each one, for example:
|
||||
|
||||
@ -45,7 +45,7 @@ You can see that you need to give 3 things when you use qdbus:
|
||||
|
||||
qdbus is great for finding out what methods are available on DBus objects. It also supports tab completion.
|
||||
|
||||
## What song is playing now?
|
||||
### What song is playing now?
|
||||
|
||||
The GetMetadata MPRIS 1 method gives you information about the currently playing song:
|
||||
|
||||
@ -80,7 +80,7 @@ Using MPRIS 2 to get metadata is a little more difficult because it's exposed as
|
||||
|
||||
Both MPRIS 1 and MPRIS 2 work in Clementine so you can use whichever one you prefer, although MPRIS 1 is usually a bit more straightforward.
|
||||
|
||||
## Controlling playback
|
||||
### Controlling playback
|
||||
|
||||
The `/Player` object has a load of methods like `Play`, `Pause`, `PlayPause`, `Stop`, `Next` and `Prev` that can be used to control the player:
|
||||
|
||||
@ -93,7 +93,7 @@ Some methods, like `VolumeSet`, take an argument. You just pass this to qdbus a
|
||||
|
||||
See [the MPRIS specifications](MPRIS#The_specifications) for information about the other methods that Clementine supports.
|
||||
|
||||
# Using Python
|
||||
## Using Python
|
||||
|
||||
It's easy to use the [dbus python module](http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html) to control Clementine from a Python script.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user