1 /** \file audiod.h symbols exported from audiod.c */
2 int num_filters(int audio_format_num);
3 int get_audio_format_num(char *name);
5 /* audio formats supportedby para_audiod */
6 enum { AUDIOD_AUDIO_FORMATS_ENUM};
8 extern const char *audio_formats[];
9 #define DEFINE_AUDIO_FORMAT_ARRAY const char *audio_formats[] = {"mp3", "ogg", "aac", NULL}
10 #define MAX_STREAM_SLOTS 5
12 * the possible modes of operation
14 * - off: disconnect from para_server
15 * - on: receive status information from para_server and play the audio stream
16 * - sb: only receive status information but not the audio stream
18 enum {AUDIOD_OFF, AUDIOD_ON, AUDIOD_STANDBY};
21 * describes one instance of a receiver-filter-writer chain
23 * \sa receier_node, receiver, filter, filter_node, filter_chain, writer,
24 * writer_node, writer_node_group.
27 /** number of the audio format in this slot */
29 /** writer start time */
30 struct timeval wstime;
31 /** the receiver info associated with this slot */
32 struct receiver_node *receiver_node;
33 /** the active filter chain */
34 struct filter_chain *fc;
35 /** the active writer node group */
36 struct writer_node_group *wng;
40 * the main task of audiod
42 * \sa struct task, struct sched
50 * the task for audiod's child (para_client stat)
52 * \sa struct task, struct sched
55 /** the associated task structure of audiod */
57 struct private_client_data *pcd;
58 /** the array of status items sent by para_server */
59 char *stat_item_values[NUM_STAT_ITEMS];
60 /** do not restart client command until this time */
61 struct timeval restart_barrier;
62 /** last time we received status data from para_server */
63 struct timeval last_status_read;
64 /** the offset value announced by para_server */
66 /** the length of the current audio file as announced by para_server */
68 /** the start of the current stream from the view of para_server */
69 struct timeval server_stream_start;
70 /** the averaged time deviation between para_server and para_audiod */
71 struct timeval sa_time_diff;
72 /** whether client time is ahead of server time */
73 int sa_time_diff_sign;
74 /** non-zero if \a af_status is "playing" */
78 extern struct status_task *stat_task;
79 extern struct slot_info slot[MAX_STREAM_SLOTS];
80 extern struct audiod_args_info conf;
81 extern int audiod_status;
82 extern const char *status_item_list[NUM_STAT_ITEMS];
84 void __noreturn clean_exit(int status, const char *msg);
85 int handle_connect(int accept_fd);
86 void audiod_status_dump(void);
87 void dump_empty_status(void);
89 /** iterate over all slots */
90 #define FOR_EACH_SLOT(_slot) for (_slot = 0; _slot < MAX_STREAM_SLOTS; _slot++)