1 .. SPDX-FileCopyrightText: 2018-2023 kaliko <kaliko@azylum.org>
2 .. SPDX-License-Identifier: LGPL-3.0-or-later
12 Connect, if playing, get currently playing track, the next one:
14 .. literalinclude:: examples/connect.py
18 Connect a specific password protected host:
20 .. literalinclude:: examples/connect_host.py
24 Start playing current queue and set the volume:
26 .. literalinclude:: examples/playback.py
30 Clear the queue, search artist, queue what's found and play:
32 .. literalinclude:: examples/findadd.py
36 Object Oriented example
37 -----------------------
39 A plain client monitoring changes on MPD.
41 .. literalinclude:: examples/client.py
45 .. _exceptions_example:
47 Dealing with Exceptions
48 -----------------------
50 Musicpd module will raise it's own :py:obj:`MPDError<musicpd.MPDError>`
51 exceptions **and** python :py:obj:`OSError`. Then you can wrap
52 :py:obj:`OSError` in :py:obj:`MPDError<musicpd.MPDError>` exceptions to have to deal
53 with a single type of exceptions in your code:
55 .. literalinclude:: examples/exceptions.py