X-Git-Url: https://git.kaliko.me/?p=python-musicpd.git;a=blobdiff_plain;f=doc%2Fsource%2Fexamples.rst;fp=doc%2Fsource%2Fexamples.rst;h=291344cd104298fb40d6b17dc80111ab4fbbff10;hp=0000000000000000000000000000000000000000;hb=c7b2fbbb9689a180f220322b21e2b0bef798eb68;hpb=43a63d085fab34f337ceec232e29e5760f4fcc25 diff --git a/doc/source/examples.rst b/doc/source/examples.rst new file mode 100644 index 0000000..291344c --- /dev/null +++ b/doc/source/examples.rst @@ -0,0 +1,44 @@ +.. SPDX-FileCopyrightText: 2018-2023 kaliko +.. SPDX-License-Identifier: LGPL-3.0-or-later + +.. _examples: + +Examples +======== + +Plain examples +-------------- + +Connect, if playing, get currently playing track, the next one: + +.. literalinclude:: examples/connect.py + :language: python + :linenos: + +Connect a specific password protected host: + +.. literalinclude:: examples/connect_host.py + :language: python + :linenos: + +Start playing current queue and set the volume: + +.. literalinclude:: examples/playback.py + :language: python + :linenos: + +Clear the queue, search artist, queue what's found and play: + +.. literalinclude:: examples/findadd.py + :language: python + :linenos: + +Object Oriented example +----------------------- + +A plain client monitoring changes on MPD. + +.. literalinclude:: examples/client.py + :language: python + :linenos: +