2 * Copyright (C) 2006-2012 Andre Noll <maan@systemlinux.org>
4 * Licensed under the GPL v2. For licencing details see COPYING.
7 /** \file audiod.h Symbols exported from audiod.c. */
10 /** enum of audio formats supported by para_audiod */
11 enum {AUDIOD_AUDIO_FORMATS_ENUM
};
13 /** array of audio format names supported by para_audiod */
14 extern const char *audio_formats
[];
16 /** maximal number of simultaneous instances */
17 #define MAX_STREAM_SLOTS 5
20 * the possible modes of operation
22 * - off: disconnect from para_server
23 * - on: receive status information from para_server and play the audio stream
24 * - sb: only receive status information but not the audio stream
26 enum audiod_status_info
{AUDIOD_OFF
, AUDIOD_ON
, AUDIOD_STANDBY
};
28 /** defines one command of para_audiod */
29 struct audiod_command
{
30 /** the name of the command */
32 /** pointer to the function that handles the command */
33 int (*handler
)(int, int, char**);
34 /** one-line description of the command */
35 const char *description
;
36 /** summary of the command line options */
38 /** the long help text */
43 * Describes one instance of a receiver-filter-writer chain.
45 * \sa receiver_node, receiver, filter, filter_node, writer, writer_node,
49 /** Number of the audio format in this slot. */
51 /** The stream_start status item announced by para_server. */
52 struct timeval server_stream_start
;
53 /** The offset status item announced by para_server. */
54 unsigned offset_seconds
;
55 /** The seconds_total status item announced by para_server. */
56 unsigned seconds_total
;
57 /** The receiver info associated with this slot. */
58 struct receiver_node
*receiver_node
;
59 /** The array of filter nodes. */
60 struct filter_node
*fns
;
61 /** The array of writers attached to the last filter. */
62 struct writer_node
*wns
;
65 extern struct slot_info slot
[MAX_STREAM_SLOTS
];
66 extern struct audiod_args_info conf
;
67 extern int audiod_status
;
69 void __noreturn
clean_exit(int status
, const char *msg
);
70 int handle_connect(int accept_fd
, fd_set
*rfds
);
71 void audiod_status_dump(void);
72 char *get_time_string(int slot_num
);
73 struct btr_node
*audiod_get_btr_root(void);
75 void stat_client_write_item(int item_num
);
76 void clear_and_dump_items(void);
78 /** iterate over all slots */
79 #define FOR_EACH_SLOT(_slot) for (_slot = 0; _slot < MAX_STREAM_SLOTS; _slot++)