xprintf("%s\n", nullcheck(utf82mb(*vec++)));
}
+static void cf_rtp_address(disorder_client *c,
+ char attribute((unused)) **argv) {
+ char *address, *port;
+
+ if(disorder_rtp_address(c, &address, &port)) exit(EXIT_FAILURE);
+ xprintf("address: %s\nport: %s\n", address, port);
+}
+
static const struct command {
const char *name;
int min, max;
"Resolve alias for TRACK" },
{ "resume", 0, 0, cf_resume, 0, "",
"Resume after a pause" },
+ { "rtp-address", 0, 0, cf_rtp_address, 0, "",
+ "Report server's broadcast address" },
{ "scratch", 0, 0, cf_scratch, 0, "",
"Scratch the currently playing track" },
{ "scratch-id", 1, 1, cf_scratch, 0, "ID",
.B resume
Resume the current track after a pause.
.TP
+.B rtp-address
+Report the RTP brodcast address used by the server (if any).
+.TP
.B scratch
Scratch the currently playing track.
.TP
You can limit the search to tracks with a particular tag, too, using the
\fBtag:\fR modifier. For example:
.IP
-.B "disorder search 'love tag:depressing'
+.B "disorder search 'love tag:depressing'"
.TP
.B set \fITRACK\fR \fIKEY\fR \fIVALUE\fR
Set the preference \fIKEY\fR for \fITRACK\fR to \fIVALUE\fR.
.B resume
Resume the current track after a \fBpause\fR command.
.TP
+.B rtp-address
+Reports the RTP broadcast (or multicast) address, in the form \fIADDRESS
+PORT\fR.
+.TP
.B scratch \fR[\fIID\fR]
Remove the track identified by \fIID\fR, or the currently playing track if no
\fIID\fR is specified. If \fBrestrict scratch\fR is enabled in the server's
Text part is just commentary; an indefinite dot-stuffed body follows. (Used
for \fBlog\fR.)
.TP
-.B 4
-Text part is just commentary; an indefinite dot-stuffed body follows. (Used
-for \fBlog\fR.)
-.TP
.B 9
The text part is just commentary (but would normally be a response for this
command) e.g. \fBplaying\fR.
return disorder_simple(c, valuep, "get-global", key, (char *)0);
}
+int disorder_rtp_address(disorder_client *c, char **addressp, char **portp) {
+ char *r;
+ int rc, n;
+ char **vec;
+
+ if((rc = disorder_simple(c, &r, "rtp-address", (char *)0)))
+ return rc;
+ vec = split(r, &n, SPLIT_QUOTES, 0, 0);
+ if(n != 2) {
+ error(0, "malformed rtp-address reply");
+ return -1;
+ }
+ *addressp = vec[0];
+ *portp = vec[1];
+ return 0;
+}
+
/*
Local Variables:
c-basic-offset:2
int max);
/* get new tracks */
+int disorder_rtp_address(disorder_client *c, char **addressp, char **portp);
+
#endif /* CLIENT_H */
/*
}
+static int c_rtp_address(struct conn *c,
+ char attribute((unused)) **vec,
+ int attribute((unused)) nvec) {
+ if(config->speaker_backend == BACKEND_NETWORK) {
+ sink_printf(ev_writer_sink(c->w), "252 %s %s\n",
+ quoteutf8(config->broadcast.s[0]),
+ quoteutf8(config->broadcast.s[1]));
+ } else
+ sink_writes(ev_writer_sink(c->w), "550 No RTP\n");
+ return 1;
+}
+
#define C_AUTH 0001 /* must be authenticated */
#define C_TRUSTED 0002 /* must be trusted user */
{ "rescan", 0, 0, c_rescan, C_AUTH|C_TRUSTED },
{ "resolve", 1, 1, c_resolve, C_AUTH },
{ "resume", 0, 0, c_resume, C_AUTH },
+ { "rtp-address", 0, 0, c_rtp_address, C_AUTH },
{ "scratch", 0, 1, c_scratch, C_AUTH },
{ "search", 1, 1, c_search, C_AUTH },
{ "set", 3, 3, c_set, C_AUTH, },