| 1 |
\input texinfo @c -*-texinfo-*- |
| 2 |
@c %**start of header |
| 3 |
@setfilename RPLAY.info |
| 4 |
@settitle The RPLAY Protocol |
| 5 |
@iftex |
| 6 |
@finalout |
| 7 |
@end iftex |
| 8 |
@setchapternewpage odd |
| 9 |
@c %**end of header |
| 10 |
|
| 11 |
@ifinfo |
| 12 |
|
| •13 |
@dircategory Development |
| 14 |
@direntry |
| 15 |
* RPLAY: (RPLAY). The RPLAY Protocol. |
| 16 |
@end direntry |
| 17 |
|
| 18 |
This file documents RPLAY protocol. |
| 19 |
|
| 20 |
Copyright (C) 1995 Mark Boyns |
| 21 |
|
| 22 |
Permission is granted to make and distribute verbatim copies of |
| 23 |
this manual provided the copyright notice and this permission notice |
| 24 |
are preserved on all copies. |
| 25 |
|
| 26 |
@ignore |
| 27 |
Permission is granted to process this file through Tex and print the |
| 28 |
results, provided the printed document carries copying permission |
| 29 |
notice identical to this one except for the removal of this paragraph |
| 30 |
(this paragraph not being relevant to the printed manual). |
| 31 |
|
| 32 |
@end ignore |
| 33 |
Permission is granted to copy and distribute modified versions of this |
| 34 |
manual under the conditions for verbatim copying, provided also that the |
| 35 |
entire resulting derived work is distributed under the terms of a |
| 36 |
permission notice identical to this one. |
| 37 |
|
| 38 |
Permission is granted to copy and distribute translations of this manual |
| 39 |
into another language, under the above conditions for modified versions. |
| 40 |
@end ifinfo |
| 41 |
|
| 42 |
@titlepage |
| 43 |
@title The RPLAY Protocol |
| 44 |
|
| 45 |
@author by Mark Boyns |
| 46 |
@page |
| 47 |
@vskip 0pt plus 1filll |
| 48 |
Copyright @copyright{} 1995 Mark Boyns |
| 49 |
|
| 50 |
Permission is granted to make and distribute verbatim copies of |
| 51 |
this manual provided the copyright notice and this permission notice |
| 52 |
are preserved on all copies. |
| 53 |
|
| 54 |
Permission is granted to copy and distribute modified versions of this |
| 55 |
manual under the conditions for verbatim copying, provided that the |
| 56 |
entire resulting derived work is distributed under the terms of a |
| 57 |
permission notice identical to this one. |
| 58 |
|
| 59 |
Permission is granted to copy and distribute translations of this manual |
| 60 |
into another language, under the above conditions for modified versions. |
| 61 |
|
| 62 |
@end titlepage |
| 63 |
@page |
| 64 |
|
| 65 |
@node Top, Overview, (dir), (dir) |
| 66 |
@top RPLAY |
| 67 |
|
| 68 |
@ifinfo |
| 69 |
This file documents the RPLAY protocol. |
| 70 |
@end ifinfo |
| 71 |
|
| 72 |
@menu |
| 73 |
* Overview:: Prelimary information |
| 74 |
* Commands:: List of supported commands. |
| 75 |
* Attributes:: List of supported command attributes. |
| 76 |
* Packet description:: What a RPLAY packet looks like. |
| 77 |
@end menu |
| 78 |
|
| 79 |
@node Overview, Commands, Top, Top |
| 80 |
@chapter Overview |
| 81 |
|
| 82 |
The @code{RPLAY} protocol uses simple binary UDP packets to control the |
| 83 |
audio server. Communication between the client and server is one-way - |
| 84 |
packets are sent to the server and the server @emph{never} replies. |
| 85 |
|
| 86 |
@node Commands, Attributes, Overview, Top |
| 87 |
@chapter Commands |
| 88 |
|
| 89 |
@code{RPLAY} is based on a small set of commands which are used to |
| 90 |
control the audio server. These commands are: |
| 91 |
|
| 92 |
@table @code |
| 93 |
@item RPLAY_PLAY |
| 94 |
Play a sound. |
| 95 |
|
| 96 |
@item RPLAY_STOP |
| 97 |
Stop a sound. |
| 98 |
|
| 99 |
@item RPLAY_PAUSE |
| 100 |
Pause a sound. |
| 101 |
|
| 102 |
@item RPLAY_CONTINUE |
| 103 |
Continue a sound. |
| 104 |
|
| 105 |
@item RPLAY_PING |
| 106 |
Wakeup the server. This command was introduced to solve a problem with |
| 107 |
TCP clients that are trying to connect to a server that's started by |
| 108 |
inetd using a UDP port. |
| 109 |
|
| 110 |
@item RPLAY_RESET |
| 111 |
Force the server to reset itself. A reset normally involves re-reading |
| 112 |
all database files, closing all connections, and stops all playing |
| 113 |
sounds. |
| 114 |
|
| 115 |
@item RPLAY_DONE |
| 116 |
Force a sound to be done. In most cases this is the same as |
| 117 |
@samp{RPLAY_STOP}. |
| 118 |
|
| 119 |
@end table |
| 120 |
|
| 121 |
@node Attributes, Packet description, Commands, Top |
| 122 |
@chapter Attributes |
| 123 |
|
| 124 |
Most @code{RPLAY} commands use attributes to modify their behaviour. |
| 125 |
These attributes are: |
| 126 |
|
| 127 |
@table @code |
| 128 |
@item RPLAY_COUNT |
| 129 |
The number of times to play a sound. The value should be between 0 and |
| 130 |
255 inclusive. A value of 0 will play the sound forever. The default |
| 131 |
is RPLAY_DEFAULT_COUNT. |
| 132 |
|
| 133 |
@item RPLAY_LIST_COUNT |
| 134 |
The number of times to play a sound list. The value should be between 0 |
| 135 |
and 255 inclusive. A value of 0 will play the sound forever. The |
| 136 |
default is RPLAY_DEFAULT_LIST_COUNT. |
| 137 |
|
| 138 |
@item RPLAY_PRIORITY |
| 139 |
The priority of a sound. The value should be between RPLAY_MIN_PRIORITY |
| 140 |
(0) and RPLAY_MAX_PRIORITY (255). The default is RPLAY_DEFAULT_PRIORITY (0). |
| 141 |
|
| 142 |
@item RPLAY_RPTP_FROM_SENDER |
| 143 |
Tell the rplay server that it should try to contact the sender's RPTP |
| 144 |
server to obtain RPLAY_SOUND. This is only used if the rplay |
| 145 |
server does not already have the sound. |
| 146 |
|
| 147 |
@item RPLAY_RPTP_SERVER |
| 148 |
Tell the rplay server which RPTP server should be used to try and obtain |
| 149 |
RPLAY_SOUND. This is only used if the rplay server does not already have |
| 150 |
the sound and RPLAY_RPTP_SEARCH is true. |
| 151 |
|
| 152 |
@item RPLAY_RPTP_SEARCH |
| 153 |
Tell the rplay server whether or not it should search for RPLAY_SOUND. |
| 154 |
|
| 155 |
@item RPLAY_RPTP_SERVER_PORT |
| 156 |
Tell the rplay server which port should be used to contact the RPTP |
| 157 |
server when using RPLAY_RPTP_SEARCH. |
| 158 |
|
| 159 |
@item RPLAY_SAMPLE_RATE |
| 160 |
Play a sound at a specified sample rate. A value of 0 will use the |
| 161 |
sound's default sample rate. The default value is |
| 162 |
RPLAY_DEFAULT_SAMPLE_RATE (0). |
| 163 |
|
| 164 |
@item RPLAY_SOUND |
| 165 |
The name of a sound. |
| 166 |
|
| 167 |
@item RPLAY_VOLUME |
| 168 |
The volume of a sound. The value should be between RPLAY_MIN_VOLUME (0) |
| 169 |
and RPLAY_MAX_VOLUME (255). The default is RPLAY_DEFAULT_VOLUME (127). |
| 170 |
|
| 171 |
@end table |
| 172 |
|
| 173 |
@node Packet description, , Attributes, Top |
| 174 |
@chapter Packet description |
| 175 |
|
| 176 |
RPLAY packets always begin with a RPLAY_ID byte followed by a RPLAY |
| 177 |
command. (@pxref{Commands}) The remaining contents is a list of |
| 178 |
attributes (@pxref{Attributes}) and their corresponding values. |
| 179 |
The packet is terminated with the RPLAY_NULL attribute. |
| 180 |
|
| 181 |
A packet will never contain an attribute that is set to a default value. |
| 182 |
This feature allows new attributes to be added without breaking old |
| 183 |
servers and it also makes packets very small. |
| 184 |
|
| 185 |
@noindent |
| 186 |
Here's an example packet: |
| 187 |
|
| 188 |
@example |
| 189 |
RPLAY_ID RPLAY_PLAY RPLAY_SOUND RPLAY_NULL |
| 190 |
30 1 5 bogus.au 0 |
| 191 |
@end example |
| 192 |
|
| 193 |
@noindent |
| 194 |
Note that numbers in RPLAY packets are stored in one byte and strings |
| 195 |
are always null-terminated. The above example in hexadecimal would be: |
| 196 |
|
| 197 |
@example |
| 198 |
1E 01 05 62 6f 67 75 73 2E 61 75 00 00 |
| 199 |
@end example |
| 200 |
|
| 201 |
@summarycontents |
| 202 |
@contents |
| 203 |
|
| 204 |
@bye |
| 205 |
|