-/**
- * describes one instance of a receiver-filter-writer chain
- *
- * \sa receier_node, receiver, filter, filter_node, filter_chain_info
- */
-struct slot_info {
-/** number of the audio format in this slot */
- int format;
-/** the file descriptor of the writer */
- int write_fd;
-/** the process id of the writer */
- pid_t wpid;
-/** time of the last successful read from the receiver */
- struct timeval rtime;
-/** time the last write to the write fd happend */
- struct timeval wtime;
-/** writer start time */
- struct timeval wstime;
-/** did we include \a write_fd in the fdset */
- int wcheck;
-/** set to one if we have sent the TERM signal to \a wpid */
- int wkilled;
-/** the receiver info associated with this slot */
- struct receiver_node *receiver_node;
-/** the active filter chain */
- struct filter_chain_info *fci;
-};
-
-static struct slot_info slot[MAX_STREAM_SLOTS];
-
-/** defines one command of para_audiod */
-struct audiod_command {
-/** the name of the command */
-const char *name;
-/** pointer to the function that handles the command */
-int (*handler)(int, int, char**);
-/** one-line description of the command */
-const char *description;
-/** summary of the command line options */
-const char *synopsis;
-/** the long help text */
-const char *help;
-};
-
-extern const char *status_item_list[NUM_STAT_ITEMS];
-
-static int com_grab(int, int, char **);
-static int com_cycle(int, int, char **);
-static int com_help(int, int, char **);
-static int com_off(int, int, char **);
-static int com_on(int, int, char **);
-static int com_sb(int, int, char **);
-static int com_stat(int, int, char **);
-static int com_term(int, int, char **);
-static int stat_pipe = -1, signal_pipe;
-
-static struct gengetopt_args_info conf;
-static struct timeval server_stream_start, sa_time_diff;
-static int playing, current_decoder = -1,
- audiod_status = AUDIOD_ON, offset_seconds, length_seconds,
- sa_time_diff_sign = 1, audiod_socket = -1;
-static char *af_status, /* the audio format announced in server status */
- *socket_name, *hostname;
-/** how many status items to remember */
-#define RINGBUFFER_SIZE 32
-static void *stat_item_ringbuf;
-static FILE *logfile;
-static const struct timeval restart_delay = {0, 300 * 1000};
-
-static struct audio_format_info afi[] = {
-
-[AUDIO_FORMAT_MP3] =
- {
- .write_cmd = "para_play",
- },
-[AUDIO_FORMAT_OGG] =
- {
- .write_cmd = "para_play",
- },
-};
-
-static struct audiod_command cmds[] = {
-{
-.name = "cycle",
-.handler = com_cycle,
-.description = "switch to next mode",
-.synopsis = "cycle",
-.help =
-
-"on -> standby -> off -> on\n"
-
-},
-{
-.name = "grab",
-.handler = com_grab,
-.description = "grab the audio stream",
-.synopsis = "-- grab [grab_options]",
-.help =
-"grab ('splice') the audio stream at any position in the filter \n"
-"chain and send that data back to the client. \n"
-"Available options:\n\n"
-GRAB_HELP_TXT
-},
-{
-.name = "help",
-.handler = com_help,
-.description = "display command list or help for given command",
-.synopsis = "help [command]",
-.help =
-
-"When I was younger, so much younger than today, I never needed\n"
-"anybody's help in any way. But now these days are gone, I'm not so\n"
-"self assured. Now I find I've changed my mind and opened up the doors.\n"
-"\n"
-" -- Beatles: Help\n"
-
-},
-{
-.name = "off",
-.handler = com_off,
-.description = "deactivate para_audiod",
-.synopsis = "off",
-.help =
-
-"Close connection to para_server and stop all decoders.\n"
-
-},
-{
-.name = "on",
-.handler = com_on,
-.description = "activate para_audiod",
-.synopsis = "on",
-.help =
-
-"Establish connection to para_server, retrieve para_server's current\n"
-"status. If playing, start corresponding decoder. Otherwise stop\n"
-"all decoders.\n"