Debian Codegraph @

doc/RPTP.texi

raw ◀ ▶
1 Debian patch touch this file
1 \input texinfo @c -*-texinfo-*-
2 @c %**start of header
3 @setfilename RPTP.info
4 @settitle The RPTP Protocol
5 @defindex ev
6 @iftex
7 @finalout
8 @end iftex
9 @setchapternewpage odd
10 @c %**end of header
11
12 @ifinfo
13
•14 @dircategory Development
15 @direntry
16 * RPTP: (RPTP). The RPTP Protocol.
17 @end direntry
18
19 This file documents RPTP protocol.
20
21 Copyright (C) 1995 Mark Boyns
22
23 Permission is granted to make and distribute verbatim copies of
24 this manual provided the copyright notice and this permission notice
25 are preserved on all copies.
26
27 @ignore
28 Permission is granted to process this file through Tex and print the
29 results, provided the printed document carries copying permission
30 notice identical to this one except for the removal of this paragraph
31 (this paragraph not being relevant to the printed manual).
32
33 @end ignore
34 Permission is granted to copy and distribute modified versions of this
35 manual under the conditions for verbatim copying, provided also that the
36 entire resulting derived work is distributed under the terms of a
37 permission notice identical to this one.
38
39 Permission is granted to copy and distribute translations of this manual
40 into another language, under the above conditions for modified versions.
41 @end ifinfo
42
43 @titlepage
44 @title The RPTP Protocol
45
46 @author by Mark Boyns
47 @page
48 @vskip 0pt plus 1filll
49 Copyright @copyright{} 1995 Mark Boyns
50
51 Permission is granted to make and distribute verbatim copies of
52 this manual provided the copyright notice and this permission notice
53 are preserved on all copies.
54
55 Permission is granted to copy and distribute modified versions of this
56 manual under the conditions for verbatim copying, provided that the
57 entire resulting derived work is distributed under the terms of a
58 permission notice identical to this one.
59
60 Permission is granted to copy and distribute translations of this manual
61 into another language, under the above conditions for modified versions.
62
63 @end titlepage
64 @page
65
66 @node Top, Overview, (dir), (dir)
67 @top RPTP
68
69 This document describes the Remote Play Transfer Protocol, otherwise
70 known as RPTP.
71
72 @menu
73 * Overview::
74 * Attributes::
75 * Events::
76 * Event Notification::
77 * Commands::
78 * Connecting::
79 * Timeouts::
80 * Attribute Index:: Attribute Index.
81 * Event Index:: Event Index.
82 * Command Index:: Command Index.
83 @end menu
84
85 @node Overview, Attributes, Top, Top
86 @chapter Overview
87
88 RPTP is a command-based TCP interface to control the rplay audio server.
89 The protocol is simple, the client sends a command and the server sends
90 back a result.
91
92 Name-value pairs are used in both commands and results. A name-value
93 pair is of the form @samp{name=value} where @samp{name} is an attribute
94 name and @samp{value} is the value of the attribute. Multiple
95 name-value pairs on a line are separated by a spaces and/or tabs. When
96 @samp{value} contains spaces or tabs it must be quoted as
97 @samp{name="value"}.
98
99 Commands consist of a command name followed by command attributes. An
100 example would be @samp{play volume=50 sound=bogus.au}. In this case,
101 the command is @samp{play} and its attributes are @samp{volume=50} and
102 @samp{sound=bogus.au}.
103
104 The server responds to each command with a result line. Each result
105 line begins with a special character which is used to determine command
106 success or failure. The following characaters are defined:
107
108 @table @samp
109 @item +
110 Successful command execution (RPTP_OK)
111
112 @item -
113 Error (RPTP_ERROR)
114
115 @item !
116 Connection timeout (RPTP_TIMEOUT)
117
118 @item @@
119 Event notification (RPTP_NOTIFY)
120 @end table
121
122 After this first character, the result line contains name-value pairs.
123 For example, if the server wanted to report an error to the client,
124 the result line could be: @samp{-error="sorry, you can't do that"}.
125
126 There is one RPTP command that returns more than one line. This is the
127 list command which returns a normal result line followed by zero or more
128 lines terminated by a line containing only a @samp{.}. These additional
129 lines do not begin with any special characters. Future versions may
130 include an attribute that clients can use to determine the number of
131 lines that will be returned.
132
133 All RPTP lines are terminated using a carriage return @samp{\r} (ASCII 13)
134 followed by a newline @samp{\n} (ASCII 10).
135
136 @node Attributes, Events, Overview, Top
137 @chapter Attributes
138
139 The following is a list of attributes that can be found within
140 the name-value lists.
141
142 @defvr Attribute access
143 A set of characters defining access permissions. These characters can
144 include @samp{r} - read access, @samp{w} - write access, and
145 @samp{x} - execute access.
146
147 Example:
148 @example
149 access=rwx
150 @end example
151 @end defvr
152
153 @defvr Attribute application
154 The name of an rplay application.
155
156 Example:
157 @example
158 application="rptp 3.2.0a7"
159 @end example
160 @end defvr
161
162 @defvr Attribute audio-bits
163 The number of bits in an audio sample or audio device.
164 The value can be 8, 16, and maybe 24 and 32 in the future.
165
166 Example:
167 @example
168 audio-bits=16
169 @end example
170 @end defvr
171
172 @defvr Attribute audio-bufsize
173 The size in bytes of the audio buffer.
174
175 Example:
176 @example
177 audio-bufsize=1600
178 @end example
179 @end defvr
180
181 @defvr Attribute audio-byte-order
182 The byte order of the audio data. The value can be either
183 big-endian or little-endian.
184
185 Example:
186 @example
187 audio-byte-order=big-endian
188 @end example
189 @end defvr
190
191 @defvr Attribute audio-channels
192 The number of channels in an audio sample or audio device.
193 The value can be 1 or 2.
194
195 Example:
196 @example
197 audio-channels=2
198 @end example
199 @end defvr
200
201 @defvr Attribute audio-device
202 The name of an audio device.
203 The value can be any audio device name.
204
205 Example:
206 @example
207 audio-device=/dev/audio
208 @end example
209 @end defvr
210
211 @defvr Attribute audio-format
212 The format of an audio sample or audio device.
213 The value can be ulaw, linear-8, ulinear-8, linear-16, or ulinear-16.
214 (linear = signed, ulinear = unsigned)
215
216 Example:
217 @example
218 audio-format=ulaw
219 @end example
220 @end defvr
221
222 @defvr Attribute audio-offset
223 Number of bytes to skip from the current position in the audio data.
224
225 Example:
226 @example
227 audio-offset=32.
228 @end example
229 @end defvr
230
231 @defvr Attribute audio-port
232 Audio output ports.
233 The value can be speaker, headphone, and lineout.
234 Multiple ports should be separated using a comma.
235
236 Example:
237 @example
238 audio-port=headphone,speaker
239 @end example
240 @end defvr
241
242 @defvr Attribute audio-rate
243 The rate at which audio buffers are being written.
244
245 Example:
246 @example
247 audio-rate=10
248 @end example
249 @end defvr
250
251 @defvr Attribute audio-sample-rate
252 The sample rate of an audio sample or audio device.
253
254 Example:
255 @example
256 audio-sample-rate=11025
257 @end example
258 @end defvr
259
260 @defvr Attribute audio-volume
261 The volume of an audio sample or audio device.
262 The value can be an integer between 0 and 255.
263
264 Example:
265 @example
266 audio-volume=120
267 @end example
268 @end defvr
269
270 @defvr Attribute bits
271 See audio-bits.
272 @end defvr
273
274 @defvr Attribute channels
275 See audio-channels.
276 @end defvr
277
278 @defvr Attribute count
279 The number of times a sound will be played or
280 a generic number of items.
281
282 Example:
283 @example
284 count=5
285 @end example
286 @end defvr
287
288 @defvr Attribute event
289 The name of an RPTP event.
290
291 Example:
292 @example
293 event=play
294 @end example
295 @end defvr
296
297 @defvr Attribute error
298 An error message.
299
300 Example:
301 @example
302 error="access denied"
303 @end example
304 @end defvr
305
306 @defvr Attribute format
307 See audio-format.
308 @end defvr
309
310 @defvr Attribute host
311 A hostname.
312
313 Example:
314 @example
315 host=mojo
316 @end example
317 @end defvr
318
319 @defvr Attribute id
320 A spool id.
321 The value can be an integer between 0 and 999. A value of
322 0 refers to all ids. An id always begins with the @samp{#}
323 character since ids can be intermixed with sound names.
324 Therefore, sounds can never begin with @samp{#}.
325
326 Example:
327 @example
328 id=#219
329 @end example
330 @end defvr
331
332 @defvr Attribute idle
333 The amount of time a RPTP connection has been idle.
334
335 Example:
336 @example
337 idle=1+01:37:05
338 @end example
339 @end defvr
340
341 @defvr Attribute input
342 Where audio is coming from.
343
344 Example:
345 @example
346 input=flow
347 @end example
348 @end defvr
349
350 @defvr Attribute input-bits
351 See audio-bits.
352 @end defvr
353
354 @defvr Attribute input-byte-order
355 See audio-byte-order.
356 @end defvr
357
358 @defvr Attribute input-channels
359 See audio-channels.
360 @end defvr
361
362 @defvr Attribute input-format
363 See audio-format.
364 @end defvr
365
366 @defvr Attribute input-offset
367 See audio-offset.
368 @end defvr
369
370 @defvr Attribute input-sample-rate
371 See audio-sample-rate.
372 @end defvr
373
374 @defvr Attribute left
375 The output level of the left speaker.
376 Valid levels range from 0 to 255.
377 @end defvr
378
379 @defvr Attribute list-count
380 The number of times a list of sounds will be played.
381
382 Example:
383 @example
384 list-count=5
385 @end example
386 @end defvr
387
388 @defvr Attribute message
389 A generic message.
390
391 Example:
392 @example
393 message="stop successful"
394 @end example
395 @end defvr
396
397 @defvr Attribute notify
398 A list of RPTP events.
399 Multiple events should be separated using a comma.
400
401 Example:
402 @example
403 notify=play,pause,done
404 @end example
405 @end defvr
406
407 @defvr Attribute pause
408 The number of sounds paused.
409
410 Example:
411 @example
412 pause=1
413 @end example
414 @end defvr
415
416 @defvr Attribute play
417 The number of sounds playing.
418
419 Example:
420 @example
421 play=3
422 @end example
423 @end defvr
424
425 @defvr Attribute position
426 The current second offset in a sound.
427 @end defvr
428
429 @defvr Attribute priority
430 The priority of a sound.
431 The value should be an integer between 0 and 255 where
432 0 is the lowest priority and 255 is the highest.
433
434 Example:
435 @example
436 priority=0
437 @end example
438 @end defvr
439
440 @defvr Attribute random
441 Play a random sound from a list of sounds.
442
443 Example:
444 @example
445 random=true
446 @end example
447 @end defvr
448
449 @defvr Attribute remain
450 Number of seconds remaining in a sound.
451 @end defvr
452
453 @defvr Attribute right
454 The output level of the right speaker.
455 Valid levels range from 0 to 255.
456 @end defvr
457
458 @defvr Attribute sample
459 The current sample offset in a sound.
460 @end defvr
461
462 @defvr Attribute samples
463 The total number of samples in a sound.
464 @end defvr
465
466 @defvr Attribute sample-rate
467 See audio-sample-rate.
468 @end defvr
469
470 @defvr Attribute seconds
471 Number of seconds in a sound.
472
473 Example:
474 @example
475 seconds=247.54
476 @end example
477 @end defvr
478
479 @defvr Attribute size
480 The number of bytes in an audio file.
481
482 Example:
483 @example
484 size=1868508
485 @end example
486 @end defvr
487
488 @defvr Attribute sound
489 The name of a sound.
490
491 Example:
492 @example
493 sound=petergun.au
494 @end example
495 @end defvr
496
497 @defvr Attribute uptime
498 The amount of time an RPTP server has been running.
499
500 Example:
501 @example
502 uptime=27+09:19:10
503 @end example
504 @end defvr
505
506 @defvr Attribute version
507 The version of rplay.
508
509 Example:
510 @example
511 version=3.2.0a8
512 @end example
513 @end defvr
514
515 @defvr Attribute volume
516 See audio-volume.
517 @end defvr
518
519 @node Events, Event Notification, Attributes, Top
520 @chapter Events
521
522 RPTP supports both synchronous and asynchronous event notification.
523 Events can be use to monitor the status of the server or wait for
524 something special to happen. These events are:
525
526 @table @code
527 @item all
528 @evindex all
529 All events.
530
531 @item any
532 @evindex any
533 See all.
534
535 @item continue
536 @evindex continue
537 A sound has been continued.
538
539 @item done
540 @evindex done
541 A sound is finished.
542
543 @item level
544 @evindex level
545 Used to obtain the output level of the left and right speakers.
546 Level values range from 0 to 255.
547
548 @item none
549 @evindex none
550 No events.
551
552 @item pause
553 @evindex pause
554 A sound has been paused.
555
556 @item play
557 @evindex play
558 A sound has been played.
559
560 @item position
561 @evindex position
562 Used to obtain the current sample position of a sound that's being
563 played.
564
565 @item skip
566 @evindex skip
567 A sound has been skipped.
568
569 @item state
570 @evindex state
571 A server state change.
572
573 @item stop
574 @evindex stop
575 A sound has been stopped.
576
577 @item volume
578 @evindex volume
579 The volume has changed.
580 @end table
581
582 @node Event Notification, Commands, Events, Top
583 @chapter Event Notification
584
585 RPTP clients can receive event notification messages from the server.
586 The event notification messages sent by the server always begin with the
587 @samp{@@} character followed by a list of attributes. This character is
588 used to help RPTP clients distinguish notification messages from other
589 RPTP responses. Using a special character is especially useful for
590 clients that deal with server messages asychronously.
591
592 Each message will always contain an event attribute to inform the client
593 which event occurred. The message can also contain several other
594 attributes to provide the client with more event information.
595
596 The following is a list of sample event messages:
597 @table @code
598
599 @item continue
600 Example:
601 @example
602 @@event=continue id=#160 sound=bogus.au
603 @end example
604
605 @item done
606 Example:
607 @example
608 @@event=done id=#23 sound=bogus.au
609 @end example
610
611 @item level
612 Example:
613 @example
614 @@event=level volume=46 left=23 right=23
615 @end example
616
617 @item pause
618 Example:
619 @example
620 @@event=pause id=#160 sound=bogus.au
621 @end example
622
623 @item play
624 Example:
625 @example
626 @@event=play id=#160 sound=bogus.au volume=127 sample-rate=8000 seconds=1.19 count=1
627 @end example
628
629 @item position
630 Example:
631 @example
632 @@event=position id=#24 position=0.50 remain=0.69 seconds=1.19 sample=4000 samples=9542
633 @end example
634
635 @item skip
636 Example:
637 @example
638 @@event=skip id=#160 sound=bogus.au
639 @end example
640
641 @item state
642 Example:
643 @example
644 @@event=state play=1 pause=1 volume=120
645 @end example
646
647 @item stop
648 Example:
649 @example
650 @@event=stop id=#160 sound=bogus.au
651 @end example
652
653 @item volume
654 Example:
655 @example
656 @@event=volume volume=200
657 @end example
658 @end table
659
660 Notification messages can be enabled and disabled using the @code{set}
661 command. For example, @samp{set notify=play,pause} tells the server to
662 send notification messages when sounds are played or paused.
663
664 For fun you might try connecting to your rplay server with telnet and
665 monitor its events in real-time. This can be done using the following:
666
667 @noindent
668 @example
669 $ telnet somehost.sdsu.edu 5556
670 @end example
671
672 Once connected, type @samp{set notify=all} and you will receive
673 notification for all server events.
674
675 @node Commands, Connecting, Event Notification, Top
676 @chapter Commands
677
678 Clients use commands to interact with the server. All commands will
679 return errors using a result line beginning with @samp{-}. This line
680 will always contain the @code{error} attribute which contains a text
681 error message. An example error response would be:
682 @samp{-error="access denied"}.
683
684 The follow is a list of all the RPTP commands. Almost all commands
685 accept attributes which can be specified in any order. More commands
686 and command attributes can and probably will be added in the future.
687
688 @deffn Command access
689 Obtain client access permissions.
690
691 This command returns one line containing the @code{access} attribute.
692 @end deffn
693
694 @deffn Command application @var{name}
695 Set the name of the client application.
696
697 This command returns one line containing the @code{name} of the application.
698
699 Example:
700 @example
701 application Xrplay 2.0
702 +Xrplay 2.0
703 @end example
704
705 @strong{Caution:} This command is considered obsolete and may be removed
706 in the future. Please use the @code{set} command instead.
707 @end deffn
708
709 @deffn Command continue @var{id}|@var{sound} ...
710 Continue playing a paused sound.
711
712 This command returns one line containing the @code{message} attribute.
713
714 Example:
715 @example
716 continue sound=bogus.au
717 +message="continue successful"
718 @end example
719 @end deffn
720
721 @deffn Command done @var{id}|@var{sound} ...
722 Force a playing or paused sound to be done. In most cases this is the
723 same as stop.
724
725 This command returns one line containing the @code{message} attribute.
726
727 Example:
728 @example
729 done sound=bogus.au
730 message="done successful"
731 @end example
732 @end deffn
733
734 @deffn Command find @var{sound}
735 Search for a sound.
736
737 This command returns one line containing the @code{sound} and @code{size}
738 attributes.
739
740 Example:
741 @example
742 find sound=bogus.au
743 +sound=bogus.au size=9574
744 @end example
745 @end deffn
746
747 @deffn Command get @var{sound}
748 Retrieve a sound.
749
750 This command returns one line containing the @code{sound} and @code{size}
751 attributes followed by @code{size} bytes of audio data.
752
753 Example:
754 @example
755 get sound=bogus.au
756 +sound=bogus.au size=9574
757 ... 9574 bytes of audio data ...
758 @end example
759 @end deffn
760
761 @deffn Command help
762 Obtain a list of server-supported commands.
763 @end deffn
764
765 @deffn Command info @var{sound}
766 Obtain information about a sound.
767
768 This command returns one line containing information about the sound.
769 The following attributes may be included: @code{sound}, @code{size},
770 @code{bits}, @code{sample-rate}, and @code{channels}.
771
772 Example:
773 @example
774 info sound=bogus.au
775 +sound=bogus.au size=9574 bits=8 sample-rate=8000 channels=1
776 @end example
777 @end deffn
778
779 @deffn Command list [connections|hosts|servers|spool|sounds]
780 List the specified server information.
781
782 @table @code
783 @item connections
784 the server's RPTP connections
785
786 @item hosts
787 the server's rplay.hosts.
788
789 @item servers
790 the server's rplay.servers.
791
792 @item spool
793 the server's audio spool.
794
795 @item sounds
796 the server's rplay.conf and rplay.cache.
797 @end table
798
799 This command returns one line containing the @code{message} attribute
800 followed by zero or more lines terminated by a line containing only
801 a @samp{.}.
802
803 Example:
804 @example
805 list connections
806 +message="connections"
807 host=130.191.225.64 type=client what=idle
808 host=127.0.0.1 type=client what="notify 00000080" idle=.06 application="Xrplay 2.0"
809 .
810
811 list hosts
812 +message="hosts"
813 host=mojo access=rwx
814 host=127.0.0.1 access=rwx
815 .
816
817 list servers
818 +message="servers"
819 host=hercules.sdsu.edu port=5556
820 host=pandora.sdsu.edu port=5556
821 .
822
823 list spool
824 +message="spool"
825 id=#437 state=play sound=petergun host=130.191.225.64 volume=127 \backslash
826 priority=0 count=1 seconds=227.75 sample_rate=8000
827 .
828
829 list sounds
830 +message="sounds"
831 sound=monster2.au
832 sound=monster1.au
833 sound=monkey-3.au
834 sound=monkey-2.au
835 sound=monkey-1.au
836 .
837 @end example
838
839 @strong{Caution:} This command does not use name-value pairs as
840 arguments.
841 @end deffn
842
843 @deffn Command pause @var{id}|@var{sound}
844 Pause a playing sound.
845
846 This command returns one line containing the @code{message} attribute.
847
848 Example:
849 @example
850 pause sound=bogus.au
851 +message="pause successful"
852 @end example
853 @end deffn
854
855 @deffn Command play
856 Play a sound.
857
858 This command accepts several attribute arguments, but only the
859 @code{sound} attribute is required and it may be repeated to play a list
860 of sounds sequentially.
861
862 The @code{sound} attribute can be preceded by any of the following
863 attributes:
864 @table @code
865 @item count
866 @item list-count
867 @item priority
868 @item random
869 @item sample-rate
870 @item volume
871 @item input
872 @item input-bits
873 @item input-byte-order
874 @item input-channels
875 @item input-format
876 @item input-offset
877 @item input-sample-rate
878 @end table
879
880 This command returns one line containing the @code{id} attribute.
881
882 Example:
883 @example
884 play sample-rate=4000 priority=255 sound=Debbie
885 +id=#84
886 @end example
887 @end deffn
888
889 @deffn Command put @var{id}|@var{size}
890 Give the server an entire sound or send flow data to a particular spool
891 id.
892
893 This command returns one line containing the @code{sound} or @code{id}
894 and @code{size} attributes. After this line is received by the client,
895 the server assumes the client will then send @code{size} bytes of audio
896 data. If the specified spool id doesn't exist, the server will return
897 an error.
898
899 Example:
900 @example
901 put sound=bogus.au size=9574
902 +sound=bogus.au size=9574
903
904 or
905
906 put id=#200 size=8000
907 +id=#200 size=8000
908 @end example
909 @end deffn
910
911 @deffn Command quit
912 Terminate the RPTP session.
913
914 This command returns nothing, the server simply closes the connection.
915 @end deffn
916
917
918 @deffn Command reset
919 Tell the server to reset itself. A reset usually includes re-reading
920 all configuration files, closing all connections, and removing all
921 sounds from the spool.
922
923 If possible, the server will return one line containing the @code{message}
924 attribute. The server will probably close the connect so the line may
925 not be sent.
926 @end deffn
927
928 @deffn Command set name[=value] ...
929 Get and set server attributes. The current set of supported
930 server attributes is:
931 @table @code
932 @item application
933 @item level-notify-rate
934 @item notify
935 @item notify-rate
936 @item position-notify-rate
937 @item priority-threshold
938 @item volume
939 @end table
940
941 This command returns one line containing the server's values for the
942 specified attributes. If an attribute cannot be set, the server will
943 return a value of @code{-1} for that attribute.
944
945 Example:
946 @example
947 set application="Xrplay 2.0" notify=state volume=127
948 +application="Xrplay 2.0" notify=state volume=127
949
950 or
951
952 set volume
953 +volume=127
954 @end example
955
956 @strong{Caution:} This command does not use name-value pairs to "get"
957 the value of attributes.
958 @end deffn
959
960 @deffn Command skip @var{id}|@var{count}
961 Skip around to sounds in a sound list. The sound list must be
962 referenced by @var{id}. The number of sounds to skip (@var{count}) can
963 be negative (skip backwards), zero (skip to the beginning of the current
964 sound), or positive (skip forward). Skipping before the beginning of
965 the sound list will cause the first sound to be played. Skipping after
966 the last sound will terminate the spool entry. Skipping a paused sound
967 will cause the next sound (the skipee?) to also be paused.
968
969 This command returns one line containing the @code{message} attribute.
970
971 Example:
972 @example
973 skip id=#0 count=1
974 +message="skipped"
975 @end example
976 @end deffn
977
978 @deffn Command status
979 Obtain a server's current status.
980
981 This command returns one line containing several attributes.
982
983 Example:
984 @example
985 status
986 +host=mojo version=3.2.0a8 uptime=01:32 audio-bits=8 audio-bufsize=800 \
987 audio-channels=1 audio-device=/dev/audio audio-format=ulaw \
988 audio-port=speaker audio-rate=10 audio-sample-rate=8000 volume=127 \
989 curr-bufsize=800 curr-rate=10
990 @end example
991 @end deffn
992
993 @deffn Command stop @var{id}|@var{sound} ...
994 Stop a paused or playing sound.
995
996 This command returns one line containing the @code{message} attribute.
997
998 Example:
999 @example
1000 stop sound=bogus.au
1001 +message="stop successful"
1002 @end example
1003 @end deffn
1004
1005 @deffn Command version
1006 Obtain the version number of the server.
1007
1008 This command returns one line containing the @code{version} attribute.
1009
1010 Example:
1011 @example
1012 version
1013 +version=3.2.0a8
1014 @end example
1015 @end deffn
1016
1017 @deffn Command volume [@var{new-volume}]
1018 Get and set the volume of the audio device.
1019
1020 This command returns one line containing the volume of the audio device.
1021 @end deffn
1022
1023 @deffn Command wait @var{id}|@var{event}|@var{command}
1024 Wait for a spool id, an event, or wait for the completion of a RPTP
1025 command.
1026
1027 This comand returns one line that always contains the event attribute.
1028 Other attributes may also be included to provide more event information.
1029
1030 Example:
1031 @example
1032 wait play sound=bogus
1033 +event=done id=#267 sound=bogus.au
1034
1035 or
1036
1037 wait event=volume
1038 +event=volume volume=135
1039
1040 or
1041
1042 wait id=#300
1043 +event=done id=#300 sound=tap2.au
1044
1045 or
1046
1047 wait event=any
1048 +event=play id=#360 sound=tap2.au volume=127 sample-rate=8000 seconds=0.21 count=1
1049 @end example
1050
1051 @strong{Caution:} This command is considered obsolete and may be removed
1052 in the future. Please use the @code{set} command instead.
1053 @end deffn
1054
1055 @node Connecting, Timeouts, Commands, Top
1056 @chapter Connecting
1057 An initial connection to a RPTP server is considered to be a RPTP
1058 command. This means that the server will always send a response to
1059 every client connection. The response sent is one line that begins with
1060 @samp{+} for a successful connection and @samp{-} for errors. The rest
1061 of the line consists of server attributes that can be used to find out more
1062 information about the server. An example would be:
1063
1064 @example
1065 +host=hercules version=3.2.0b3 uptime=00:47:20 audio-bits=16 \
1066 audio-bufsize=2450 audio-byte-order=big-endian audio-channels=1 \
1067 audio-device=/dev/audio audio-format=linear-16 \
1068 audio-port=speaker,headphone,lineout audio-rate=10 \
1069 audio-sample-rate=11025 volume=120 curr-bufsize=2450 curr-rate=9 \
1070 priority-threshold=0
1071 @end example
1072
1073 Note that a @samp{\} was used in the above example to split up the long
1074 attribute line.
1075
1076 @node Timeouts, Attribute Index, Connecting, Top
1077 @chapter Timeouts
1078 RPTP servers can be configured to close connections on idle clients.
1079 Before the connection is closed, the server will send a timeout
1080 notification to the client. The notification is one line that begins
1081 with @samp{!}. The reset of the line will contain attributes which
1082 should contain information about the timeout. For example:
1083
1084 @example
1085 !message="Connection timed out after 300 idle seconds."
1086 @end example
1087
1088 @node Attribute Index, Event Index, Timeouts, Top
1089 @appendix Attribute Index
1090 @printindex vr
1091
1092 @node Event Index, Command Index, Attribute Index, Top
1093 @appendix Event Index
1094 @printindex ev
1095
1096 @node Command Index, , Event Index, Top
1097 @appendix Command Index
1098 @printindex fn
1099
1100 @summarycontents
1101 @contents
1102
1103 @bye