forked from MusicPlayerDaemon/MPD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprotocol.xml
2530 lines (2419 loc) · 86.4 KB
/
protocol.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"docbook/dtd/xml/4.2/docbookx.dtd">
<book>
<title>The Music Player Daemon protocol</title>
<chapter id="syntax">
<title>General protocol syntax</title>
<section>
<title>Protocol overview</title>
<para>
The <application>MPD</application> command protocol exchanges
line-based text records between client and server over TCP.
Once the client is connected to the server, they conduct a
conversation until the client closes the connection. The
conversation flow is always initiated by the client.
</para>
<para>
The client transmits a command sequence, terminated by the
newline character <constant>\n</constant>. The server will
respond with one or more lines, the last of which will be a
completion code.
</para>
<para>
When the client connects to the server, the server will answer
with the following line:
<synopsis>OK MPD version</synopsis>
where <varname>version</varname> is a version identifier such as
0.12.2. This version identifier is the version of the protocol
spoken, not the real version of the daemon. (There is no way to
retrieve this real version identifier from the connection.)
</para>
</section>
<section id="request_syntax">
<title>Requests</title>
<cmdsynopsis>
<command>COMMAND</command>
<arg rep="repeat"><replaceable>ARG</replaceable></arg>
</cmdsynopsis>
<para>
If arguments contain spaces, they should be surrounded by double
quotation marks.
</para>
<para>
Argument strings are separated from the command and any other
arguments by linear white-space (' ' or '\t').
</para>
<para>
All data between the client and the server is encoded in
UTF-8. (Note: In UTF-8 all standard ansi characters, 0-127 are
the same as in standard ansi encoding. Also, no ansi character
appears in any multi-byte characters. So, you can use
standard C functions like <function>strlen</function>, and
<function>strcpy</function> just fine with UTF-8 encoded
strings. For example: <returnvalue>OK</returnvalue> encoded in
UTF-8 is simply <returnvalue>OK</returnvalue>. For more
information on UTF=8:
http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8)
</para>
</section>
<section id="response_syntax">
<title>Responses</title>
<para>
A command returns <returnvalue>OK</returnvalue> on completion or
<returnvalue>ACK some error</returnvalue> on failure. These
denote the end of command execution.
</para>
<section id="failure_response_syntax">
<title>Failure responses</title>
<para>
The nature of the error can be gleaned from the information
that follows the <returnvalue>ACK</returnvalue>.
<returnvalue>ACK</returnvalue> lines are of the form:
<synopsis>ACK [error@command_listNum] {current_command} message_text\n</synopsis>
These responses are generated by a call to
<function>commandError</function>. They contain four separate
terms. Let's look at each of them:
<itemizedlist>
<listitem>
<para>
<returnvalue>error</returnvalue>: numeric value of one
of the <constant>ACK_ERROR</constant> constants defined
in <filename>ack.h</filename>.
</para>
</listitem>
<listitem>
<para>
<returnvalue>command_listNum</returnvalue>:
offset of the command that caused the error in a <link
linkend="command_lists">Command List</link>.
An error will always cause a command list to terminate
at the command that causes the error.
</para>
</listitem>
<listitem>
<para>
<returnvalue>current_command</returnvalue>:
name of the command, in a <link
linkend="command_lists">Command List</link>,
that was executing when the error occurred.
</para>
</listitem>
<listitem>
<para>
<returnvalue>message_text</returnvalue>:
some (hopefully) informative text that describes the
nature of the error.
</para>
</listitem>
</itemizedlist>
</para>
<example>
<title>foo</title>
<para>
An example might help. Consider the following sequence
sent from the client to the server.
<synopsis>
command_list_begin
volume 86
play 10240
status
command_list_end
</synopsis>
</para>
<para>
The server responds with:
<returnvalue>
ACK [50@1] {play} song doesn't exist: "10240"
</returnvalue>
</para>
<para>
This tells us that the play command, which was the
second in the list (the first or only command is
numbered 0), failed with error 50. The number 50
translates to <constant>ACK_ERROR_NO_EXIST</constant>--the
song doesn't exist. This is reiterated by the message text
which also tells us which song doesn't exist.
</para>
</example>
</section>
</section>
<section id="command_lists">
<title>Command lists</title>
<para>
To facilitate faster adding of files etc. you can pass a list
of commands all at once using a command list. The command
list begins with <command>command_list_begin</command> or
<command>command_list_ok_begin</command> and ends with
<command>command_list_end</command>.
</para>
<para>
It does not execute any commands until the list has ended.
The return value is whatever the return for a list of commands
is. On success for all commands,
<returnvalue>OK</returnvalue> is returned. If a command
fails, no more commands are executed and the appropriate
<returnvalue>ACK</returnvalue> error is returned. If
<command>command_list_ok_begin</command> is used,
<returnvalue>list_OK</returnvalue> is returned for each
successful command executed in the command list.
</para>
</section>
<section id="range_syntax">
<title>Ranges</title>
<para>
Some commands (e.g. <link
linkend="command_delete"><command>delete</command></link>)
allow specifying a range in the form
<parameter>START:END</parameter> (the <varname>END</varname>
item is not included in the range, similar to ranges in the
Python programming language). If <varname>END</varname> is
omitted, then the maximum possible value is assumed.
</para>
</section>
</chapter>
<chapter id="recipes">
<title>Recipes</title>
<section id="queuing_recipe">
<title>Queuing</title>
<para>
Often, users run <application>MPD</application> with "<link
linkend="command_random">random</link>" enabled, but want to
be able to insert songs "before" the rest of the playlist.
That is commonly called "queuing".
</para>
<para>
<application>MPD</application> implements this by allowing the client to specify a
"priority" for each song in the playlist (commands <link
linkend="command_prio"><command>prio</command></link> and
<link
linkend="command_prioid"><command>prioid</command></link>). A
higher priority means that the song is going to be played
before the other songs.
</para>
<para>
In "random" mode, <application>MPD</application> maintains an
internal randomized sequence of songs. In this sequence,
songs with a higher priority come first, and all songs with
the same priority are shuffled (by default, all songs are
shuffled, because all have the same priority "0"). When you
increase the priority of a song, it is moved to the front of
the sequence according to its new priority, but always after
the current one. A song that has been played already (it's
"before" the current song in that sequence) will only be
scheduled for repeated playback if its priority has become
bigger than the priority of the current song. Decreasing the
priority of a song will move it farther to the end of the
sequence. Changing the priority of the current song has no
effect on the sequence. During playback, a song's priority is
reset to zero.
</para>
</section>
</chapter>
<chapter id="command_reference">
<title>Command reference</title>
<note>
<para>
For manipulating playlists and playing, there are two sets of
commands. One set uses the song id of a song in the playlist,
while another set uses the playlist position of the song. The
commands using song ids should be used instead of the commands
that manipulate and control playback based on playlist
position. Using song ids is a safer method when multiple
clients are interacting with <application>MPD</application>.
</para>
</note>
<section id="status_commands">
<title>Querying <application>MPD</application>'s status</title>
<variablelist>
<varlistentry id="command_clearerror">
<term>
<cmdsynopsis>
<command>clearerror</command>
</cmdsynopsis>
</term>
<listitem>
<para>
Clears the current error message in status (this is also
accomplished by any command that starts playback).
</para>
</listitem>
</varlistentry>
<varlistentry id="command_currentsong">
<term>
<cmdsynopsis>
<command>currentsong</command>
</cmdsynopsis>
</term>
<listitem>
<para>
Displays the song info of the current song (same song that
is identified in status).
</para>
</listitem>
</varlistentry>
<varlistentry id="command_idle">
<term>
<cmdsynopsis>
<command>idle</command>
<arg choice="opt" rep="repeat"><replaceable>SUBSYSTEMS</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
<footnote id="since_0_14"><simpara>Introduced with
<application>MPD</application> 0.14</simpara></footnote>
Waits until there is a noteworthy change in one or more
of <application>MPD</application>'s subsystems. As soon
as there is one, it lists all changed systems in a line
in the format <returnvalue>changed:
SUBSYSTEM</returnvalue>, where SUBSYSTEM is one of the
following:
</para>
<itemizedlist>
<listitem>
<para>
<returnvalue>database</returnvalue>: the song database
has been modified after <command>update</command>.
</para>
</listitem>
<listitem>
<para>
<returnvalue>update</returnvalue>: a database update
has started or finished. If the database was
modified during the update, the
<returnvalue>database</returnvalue> event is also
emitted.
</para>
</listitem>
<listitem>
<para>
<returnvalue>stored_playlist</returnvalue>: a stored
playlist has been modified, renamed, created or
deleted
</para>
</listitem>
<listitem>
<para>
<returnvalue>playlist</returnvalue>: the current
playlist has been modified
</para>
</listitem>
<listitem>
<para>
<returnvalue>player</returnvalue>: the player has been
started, stopped or seeked
</para>
</listitem>
<listitem>
<para>
<returnvalue>mixer</returnvalue>: the volume has been
changed
</para>
</listitem>
<listitem>
<para>
<returnvalue>output</returnvalue>: an audio output has
been enabled or disabled
</para>
</listitem>
<listitem>
<para>
<returnvalue>options</returnvalue>: options like
<option>repeat</option>, <option>random</option>,
<option>crossfade</option>, replay gain
</para>
</listitem>
<listitem>
<para>
<returnvalue>sticker</returnvalue>: the sticker database
has been modified.
</para>
</listitem>
<listitem>
<para>
<returnvalue>subscription</returnvalue>: a client
has subscribed or unsubscribed to a channel
</para>
</listitem>
<listitem>
<para>
<returnvalue>message</returnvalue>: a message was
received on a channel this client is subscribed to;
this event is only emitted when the queue is empty
</para>
</listitem>
</itemizedlist>
<para>
While a client is waiting for <command>idle</command>
results, the server disables timeouts, allowing a client
to wait for events as long as mpd runs. The
<command>idle</command> command can be canceled by
sending the command <command>noidle</command> (no other
commands are allowed). <application>MPD</application>
will then leave <command>idle</command> mode and print
results immediately; might be empty at this time.
</para>
<para>
If the optional <varname>SUBSYSTEMS</varname> argument
is used, <application>MPD</application> will only send
notifications when something changed in one of the
specified subsytems.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_status">
<term>
<cmdsynopsis>
<command>status</command>
</cmdsynopsis>
</term>
<listitem>
<para>
Reports the current status of the player and the volume
level.
</para>
<itemizedlist>
<listitem>
<para>
<varname>volume</varname>:
<returnvalue>0-100</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>repeat</varname>:
<returnvalue>0 or 1</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>random</varname>:
<returnvalue>0 or 1</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>single</varname>:
<footnote id="since_0_15"><simpara>Introduced with <application>MPD</application> 0.15</simpara></footnote>
<returnvalue>0 or 1</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>consume</varname>:
<footnoteref linkend="since_0_15"/>
<returnvalue>0 or 1</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>playlist</varname>:
<returnvalue>31-bit unsigned integer, the playlist
version number</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>playlistlength</varname>:
<returnvalue>integer, the length of the
playlist</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>state</varname>:
<returnvalue>play, stop, or pause</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>song</varname>:
<returnvalue> playlist song number of the current
song stopped on or playing
</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>songid</varname>:
<returnvalue>playlist songid of the current song
stopped on or playing
</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>nextsong</varname>:
<footnoteref linkend="since_0_15"/>
<returnvalue> playlist song number of the next
song to be played
</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>nextsongid</varname>:
<footnoteref linkend="since_0_15"/>
<returnvalue>playlist songid of the next song
to be played
</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>time</varname>:
<returnvalue>total time elapsed (of current
playing/paused song)</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>elapsed</varname>:
<footnote id="since_0_16"><simpara>Introduced with <application>MPD</application> 0.16</simpara></footnote>
<returnvalue>
Total time elapsed within the current song, but
with higher resolution.
</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>duration</varname>:
<footnote id="since_0_20"><simpara>Introduced with <application>MPD</application> 0.20</simpara></footnote>
<returnvalue>
Duration of the current song in seconds.
</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>bitrate</varname>:
<returnvalue>instantaneous bitrate in
kbps</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>xfade</varname>:
<returnvalue>crossfade in seconds</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>mixrampdb</varname>:
<returnvalue>mixramp threshold in dB</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>mixrampdelay</varname>:
<returnvalue>mixrampdelay in seconds</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>audio</varname>:
<returnvalue>sampleRate:bits:channels</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>updating_db</varname>:
<returnvalue>job id</returnvalue>
</para>
</listitem>
<listitem>
<para>
<varname>error</varname>:
<returnvalue>if there is an error, returns message
here</returnvalue>
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry id="command_stats">
<term>
<cmdsynopsis>
<command>stats</command>
</cmdsynopsis>
</term>
<listitem>
<para>
Displays statistics.
</para>
<itemizedlist>
<listitem>
<para>
<varname>artists</varname>: number of artists
</para>
</listitem>
<listitem>
<para>
<varname>albums</varname>: number of albums
</para>
</listitem>
<listitem>
<para>
<varname>songs</varname>: number of songs
</para>
</listitem>
<listitem>
<para>
<varname>uptime</varname>: daemon uptime in seconds
</para>
</listitem>
<listitem>
<para>
<varname>db_playtime</varname>: sum of all song
times in the db
</para>
</listitem>
<listitem>
<para>
<varname>db_update</varname>: last db update in UNIX
time
</para>
</listitem>
<listitem>
<para>
<varname>playtime</varname>: time length of music played
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</section>
<section id="playback_option_commands">
<title>Playback options</title>
<variablelist>
<varlistentry id="command_consume">
<term>
<cmdsynopsis>
<command>consume</command>
<arg choice="req"><replaceable>STATE</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
<footnoteref linkend="since_0_15"/>
Sets consume state to <varname>STATE</varname>,
<varname>STATE</varname> should be 0 or 1.
When consume is activated, each song played is removed from playlist.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_crossfade">
<term>
<cmdsynopsis>
<command>crossfade</command>
<arg choice="req"><replaceable>SECONDS</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Sets crossfading between songs.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_mixrampdb">
<term>
<cmdsynopsis>
<command>mixrampdb</command>
<arg choice="req"><replaceable>deciBels</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Sets the threshold at which songs will be overlapped. Like crossfading but doesn't fade the track volume, just overlaps. The songs need to have MixRamp tags added by an external tool. 0dB is the normalized maximum volume so use negative values, I prefer -17dB. In the absence of mixramp tags crossfading will be used. See http://sourceforge.net/projects/mixramp
</para>
</listitem>
</varlistentry>
<varlistentry id="command_mixrampdelay">
<term>
<cmdsynopsis>
<command>mixrampdelay</command>
<arg choice="req"><replaceable>SECONDS</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Additional time subtracted from the overlap calculated by mixrampdb. A value of "nan" disables MixRamp overlapping and falls back to crossfading.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_random">
<term>
<cmdsynopsis>
<command>random</command>
<arg choice="req"><replaceable>STATE</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Sets random state to <varname>STATE</varname>,
<varname>STATE</varname> should be 0 or 1.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_repeat">
<term>
<cmdsynopsis>
<command>repeat</command>
<arg choice="req"><replaceable>STATE</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Sets repeat state to <varname>STATE</varname>,
<varname>STATE</varname> should be 0 or 1.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_setvol">
<term>
<cmdsynopsis>
<command>setvol</command>
<arg choice="req"><replaceable>VOL</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Sets volume to <varname>VOL</varname>, the range of
volume is 0-100.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_single">
<term>
<cmdsynopsis>
<command>single</command>
<arg choice="req"><replaceable>STATE</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
<footnoteref linkend="since_0_15"/>
Sets single state to <varname>STATE</varname>,
<varname>STATE</varname> should be 0 or 1.
When single is activated, playback is stopped after current song, or
song is repeated if the 'repeat' mode is enabled.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_replay_gain_mode">
<term>
<cmdsynopsis>
<command>replay_gain_mode</command>
<arg choice="req"><replaceable>MODE</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Sets the replay gain mode. One of
<parameter>off</parameter>,
<parameter>track</parameter>,
<parameter>album</parameter>,
<parameter>auto</parameter><footnote
id="replay_gain_auto_since_0_16">
<simpara>added in <application>MPD</application> 0.16</simpara>
</footnote>.
</para>
<para>
Changing the mode during playback may take several
seconds, because the new settings does not affect the
buffered data.
</para>
<para>
This command triggers the
<returnvalue>options</returnvalue> idle event.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_replay_gain_status">
<term>
<cmdsynopsis>
<command>replay_gain_status</command>
</cmdsynopsis>
</term>
<listitem>
<para>
Prints replay gain options. Currently, only the
variable <varname>replay_gain_mode</varname> is
returned.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_volume">
<term>
<cmdsynopsis>
<command>volume</command>
<arg choice="req"><replaceable>CHANGE</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Changes volume by amount <varname>CHANGE</varname>.
</para>
<note>
<para>
<command>volume</command> is deprecated, use
<command>setvol</command> instead.
</para>
</note>
</listitem>
</varlistentry>
</variablelist>
</section>
<section id="playback_commands">
<title>Controlling playback</title>
<variablelist>
<varlistentry id="command_next">
<term>
<cmdsynopsis>
<command>next</command>
</cmdsynopsis>
</term>
<listitem>
<para>
Plays next song in the playlist.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_pause">
<term>
<cmdsynopsis>
<command>pause</command>
<arg choice="req"><replaceable>PAUSE</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Toggles pause/resumes playing, <varname>PAUSE</varname> is 0 or 1.
</para>
<note>
<para>
The use of pause command w/o the PAUSE argument is
deprecated.
</para>
</note>
</listitem>
</varlistentry>
<varlistentry id="command_play">
<term>
<cmdsynopsis>
<command>play</command>
<arg><replaceable>SONGPOS</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Begins playing the playlist at song number
<varname>SONGPOS</varname>.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_playid">
<term>
<cmdsynopsis>
<command>playid</command>
<arg><replaceable>SONGID</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Begins playing the playlist at song
<varname>SONGID</varname>.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_previous">
<term>
<cmdsynopsis>
<command>previous</command>
</cmdsynopsis>
</term>
<listitem>
<para>
Plays previous song in the playlist.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_seek">
<term>
<cmdsynopsis>
<command>seek</command>
<arg choice="req"><replaceable>SONGPOS</replaceable></arg>
<arg choice="req"><replaceable>TIME</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Seeks to the position <varname>TIME</varname> (in
seconds; fractions allowed) of entry
<varname>SONGPOS</varname> in the playlist.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_seekid">
<term>
<cmdsynopsis>
<command>seekid</command>
<arg choice="req"><replaceable>SONGID</replaceable></arg>
<arg choice="req"><replaceable>TIME</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Seeks to the position <varname>TIME</varname> (in
seconds; fractions allowed) of song
<varname>SONGID</varname>.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_seekcur">
<term>
<cmdsynopsis>
<command>seekcur</command>
<arg choice="req"><replaceable>TIME</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Seeks to the position <varname>TIME</varname> (in
seconds; fractions allowed) within the current song. If
prefixed by '+' or '-', then the time is relative to the
current playing position.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_stop">
<term>
<cmdsynopsis>
<command>stop</command>
</cmdsynopsis>
</term>
<listitem>
<para>
Stops playing.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section id="queue">
<title>The current playlist</title>
<variablelist>
<varlistentry id="command_add">
<term>
<cmdsynopsis>
<command>add</command>
<arg choice="req"><replaceable>URI</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Adds the file <varname>URI</varname> to the playlist
(directories add recursively). <varname>URI</varname>
can also be a single file.
</para>
</listitem>
</varlistentry>
<varlistentry id="command_addid">
<term>
<cmdsynopsis>
<command>addid</command>
<arg choice="req"><replaceable>URI</replaceable></arg>
<arg><replaceable>POSITION</replaceable></arg>
</cmdsynopsis>
</term>
<listitem>
<para>
Adds a song to the playlist (non-recursive) and returns the song id.
</para>
<para>
<varname>URI</varname> is always a single file or
URL. For example:
</para>
<screen>
addid "foo.mp3"
Id: 999
OK
</screen>
</listitem>
</varlistentry>
<varlistentry id="command_clear">
<term>
<cmdsynopsis>
<command>clear</command>
</cmdsynopsis>
</term>