1 
2 #ifndef INTERFACE_H
3 #define INTERFACE_H
4 
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8 
9 /* The desired state of the client (and server). */
10 enum want_quit {
11 	NO_QUIT,	/* don't want to quit */
12 	QUIT_CLIENT,	/* only quit the client */
13 	QUIT_SERVER	/* quit the client and the server */
14 };
15 
16 /* Information about the currently played file. */
17 struct file_tags;
18 struct file_info {
19 	char *file;
20 	struct file_tags *tags;
21 	char *title;
22 	int avg_bitrate;
23 	int bitrate;
24 	int rate;
25 	int curr_time;
26 	int total_time;
27 	int channels;
28 	int state; /* STATE_* */
29 	char *block_file;
30 	int block_start;
31 	int block_end;
32 };
33 
34 struct lists_s_strs;
35 
36 void init_interface (const int sock, const int logging, struct lists_s_strs *args);
37 void interface_loop ();
38 void interface_end ();
39 int user_wants_interrupt ();
40 void interface_error (const char *msg);
41 
42 #ifdef HAVE__ATTRIBUTE__
43 void interface_fatal (const char *format, ...)
44 	__attribute__ ((format (printf, 1, 2)));
45 #else
46 void interface_fatal (const char *format, ...);
47 #endif
48 
49 void interface_cmdline_clear_plist (int server_sock);
50 void interface_cmdline_append (int server_sock, struct lists_s_strs *args);
51 void interface_cmdline_play_first (int server_sock);
52 void interface_cmdline_file_info (const int server_sock);
53 void interface_cmdline_playit (int server_sock, struct lists_s_strs *args);
54 void interface_cmdline_seek_by (int server_sock, const int seek_by);
55 void interface_cmdline_jump_to_percent (int server_sock, const int percent);
56 void interface_cmdline_jump_to (int server_sock, const int pos);
57 void interface_cmdline_adj_volume (int server_sock, const char *arg);
58 void interface_cmdline_set (int server_sock, char *arg, const int val);
59 void interface_cmdline_formatted_info (const int server_sock, const char *format_str);
60 void interface_cmdline_enqueue (int server_sock, struct lists_s_strs *args);
61 
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif
67