don't use the same serial number for multiple outgoing encoded streams,
[xiph/unicode.git] / ices / src / cfgparse.h
blob4656a327ef98d4194f763df08b22e18abd983635
1 /* config.h
2 * - configuration, and global structures built from config
4 * $Id: cfgparse.h,v 1.6 2003/12/22 14:01:09 karl Exp $
6 * Copyright (c) 2001 Michael Smith <msmith@labyrinth.net.au>
8 * This program is distributed under the terms of the GNU General
9 * Public License, version 2. You may use, modify, and redistribute
10 * it under the terms of this license. A copy should be included
11 * with this source.
14 #ifndef __CONFIG_H__
15 #define __CONFIG_H__
17 #include "stream.h"
18 #include "inputmodule.h"
20 typedef struct _module_param_tag
22 char *name;
23 char *value;
25 struct _module_param_tag *next;
26 } module_param_t;
28 /* FIXME: orward declaraction because my headers are a mess. */
29 struct buffer_queue;
31 typedef struct _instance_tag
33 char *hostname;
34 int port;
35 char *password;
36 char *user;
37 char *mount;
38 int reconnect_delay;
39 int reconnect_attempts;
40 int encode;
41 int downmix;
42 int resampleinrate;
43 int resampleoutrate;
44 int max_queue_length;
45 char *savefilename;
47 /* local metadata */
48 char *stream_name;
49 char *stream_genre;
50 char *stream_description;
51 char *stream_url;
53 /* Parameters for re-encoding */
54 int managed;
55 int min_br, nom_br, max_br;
56 float quality;
57 int samplerate;
58 int channels;
60 /* private */
61 FILE *savefile;
62 int buffer_failures;
63 int died;
64 int kill;
65 int skip;
66 int public_stream;
67 int wait_for_critical;
69 struct buffer_queue *queue;
71 struct _instance_tag *next;
72 } instance_t;
74 typedef struct _config_tag
76 int background;
77 char *logpath;
78 char *logfile;
79 char *pidfile;
80 int loglevel;
81 int log_stderr;
83 /* <stream> */
85 /* <metadata> */
87 char *stream_name;
88 char *stream_genre;
89 char *stream_description;
90 char *stream_url;
92 /* <playlist> */
94 char *playlist_module;
95 module_param_t *module_params;
97 /* <instance> */
99 instance_t *instances;
101 /* private */
102 int log_id;
103 int shutdown;
104 char *metadata_filename;
105 cond_t queue_cond;
106 cond_t event_pending_cond;
107 mutex_t refcount_lock;
108 mutex_t flush_lock;
109 input_module_t *inmod;
110 struct _config_tag *next;
111 } config_t;
113 extern config_t *ices_config;
115 void config_initialize(void);
116 void config_shutdown(void);
118 int config_read(const char *filename);
119 void config_dump(void);
121 void config_free_instance(instance_t *instance);
123 #endif /* __CONFIG_H__ */