Debian Codegraph @

rplayd/rplayd.h

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 /* $Id: rplayd.h,v 1.3 1999/03/10 07:58:04 boyns Exp $ */
2
3 /*
4 * Copyright (C) 1993-99 Mark R. Boyns <[email protected]>
5 *
6 * This file is part of rplay.
7 *
8 * rplay is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * rplay is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with rplay; see the file COPYING. If not, write to the
20 * Free Software Foundation, Inc.,
21 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24 #ifndef _rplayd_h
25 #define _rplayd_h
26
27 #ifdef HAVE_CONFIG_H
28 #include "config.h"
29 #endif
30 #include <sys/types.h>
31 #include "rplay.h"
32 #include "misc.h"
33 #include "audio.h"
34 #include "buffer.h"
35 #include "spool.h"
36
37 /* Report levels */
38 #define REPORT_NONE 0 /* Nothing. */
39 #define REPORT_ERROR 1 /* System and rplayd errors. */
40 #define REPORT_NOTICE 2 /* ... + RPTP connections, get, put, find */
41 #define REPORT_INFO 3 /* ... + play, stop, pause, continue, etc */
42 #define REPORT_DEBUG 4 /* ... + Debug messages. */
43
44 #define REPORT_MIN 0
45 #define REPORT_MAX 4
46
47 /* $Id: rplayd.h,v 1.3 1999/03/10 07:58:04 boyns Exp $ */
48 #define SET_BIT(w, bit) ( (w) |= (bit) )
49 #define CLR_BIT(w, bit) ( (w) &= ~(bit) )
50 #define BIT(w, bit) ( (w) & (bit) )
51 #define TOGGLE_BIT(w, bit) ( (w) ^= (bit) )
52
53 /* UIO_MAXIOV probably isn't defined so lets assume it's 16. */
54 #ifndef UIO_MAXIOV
55 #define UIO_MAXIOV 16
56 #endif
57
58 /* Table of audio parameters supported by the audio device. */
59 typedef struct
60 {
61 int sample_rate;
62 int format;
63 int bits;
64 int channels;
65 }
66 RPLAY_AUDIO_TABLE;
67 extern RPLAY_AUDIO_TABLE *rplay_audio_table;
68
69
70 /* Global variables that are declared in rplayd.c.
71 (See rplayd.c for descriptions) */
72
73 extern fd_set read_mask;
74 extern fd_set write_mask;
75 extern int debug;
76 extern int rptp_timeout;
77 extern char hostname[];
78 extern char *hostaddr;
79 extern int rplay_fd;
80 extern int rptp_fd;
81 #ifdef OTHER_RPLAY_PORTS
82 extern int other_rplay_fd;
83 extern int other_rptp_fd;
84 #endif
85 extern int curr_rate;
86 #ifndef HAVE_OSS
87 extern int curr_bufsize;
88 #endif /* !HAVE_OSS */
89 extern int rplayd_pid;
90 extern time_t starttime;
91 #ifdef AUTH
92 extern int auth_enabled;
93 #endif /* AUTH */
94 extern int rplay_priority_threshold;
95 extern char *rplay_audio_device;
96 #ifndef HAVE_OSS
97 extern int rplay_audio_bufsize;
98 #endif /* !HAVE_OSS */
99 extern int rplay_audio_rate;
100 extern int rplay_audio_sample_rate;
101 extern int rplay_audio_channels;
102 extern int rplay_audio_format;
103 extern int rplay_audio_precision;
104 extern int rplay_audio_port;
105 extern int audio_enabled;
106 extern int rplay_audio_volume;
107 extern int rplay_audio_match;
108 extern int rplay_audio_size;
109 extern char *rplay_audio_buf;
110 extern int max_rplay_audio_bufsize;
111 extern int rplay_audio_left_level;
112 extern int rplay_audio_right_level;
113
114 extern int optional_sample_rate;
115 extern int optional_precision;
116 extern int optional_channels;
117 extern int optional_format;
118 extern int optional_port;
119
120 extern int default_sample_rate;
121 extern int default_precision;
122 extern int default_channels;
123 extern int default_format;
124 extern int default_port;
125
126 #ifdef HAVE_OSS
127 extern int rplay_audio_fragsize;
128 extern int optional_fragsize;
129 extern int default_fragsize;
130 #endif /* HAVE_OSS */
131
132 extern int monitor_count;
133 extern BUFFER *monitor_buffers;
134
•135 #include <errno.h>
136
137 #ifdef __STDC__
138 extern void usage ();
139 extern void done (int exit_value);
140 extern unsigned long inet_addr (char *);
141 extern char *inet_ntoa (struct in_addr);
142 extern void report (int level_mask, char *fmt,...);
143 extern void rplayd_read (int fd);
144 extern void rplayd_write (int nbytes);
145 extern void rplayd_init ();
146 extern int rplayd_play (RPLAY *rp, struct sockaddr_in sin);
147 extern int rplayd_stop (RPLAY *rp, struct sockaddr_in sin);
148 extern int rplayd_pause (RPLAY *rp, struct sockaddr_in sin);
149 extern int rplayd_continue (RPLAY *rp, struct sockaddr_in sin);
150 extern int rplayd_done (RPLAY *rp, struct sockaddr_in sin);
151 extern int rplayd_put (RPLAY *rp, struct sockaddr_in sin);
152 extern BUFFER *rplayd_status ();
153 extern void need_reset ();
154 extern int rplayd_audio_init ();
155 extern void rplayd_audio_match (SPOOL *sp);
156 #else
157 extern void usage ();
158 extern void done ( /* int exit_value */ );
159 extern unsigned long inet_addr ( /* char * */ );
160 extern char *inet_ntoa ( /* struct in_addr */ );
161 extern void report ( /* int level_mask, char *fmt, ... */ );
162 extern void rplayd_read ( /* int fd */ );
163 extern void rplayd_write ( /* int nbytes */ );
164 extern void rplayd_init ();
165 extern int rplayd_play ( /* RPLAY *rp, struct sockaddr_in sin */ );
166 extern int rplayd_stop ( /* RPLAY *rp, struct sockaddr_in sin */ );
167 extern int rplayd_pause ( /* RPLAY *rp, struct sockaddr_in sin */ );
168 extern int rplayd_continue ( /* RPLAY *rp, struct sockaddr_in sin */ );
169 extern int rplayd_done ( /* RPLAY *rp, struct sockaddr_in sin */ );
170 extern int rplayd_put ( /* RPLAY *rp, struct sockaddr_in sin */ );
171 extern BUFFER *rplayd_status ();
172 extern void need_reset ();
173 extern int rplayd_audio_init ();
174 extern void rplayd_audio_match ( /* SPOOL *sp */ );
175 #endif
176
177 /*
178 * Prototypes for the audio stubs:
179 */
180 #ifdef __STDC__
181 extern int rplay_audio_init ();
182 extern int rplay_audio_open ();
183 extern int rplay_audio_isopen ();
184 extern int rplay_audio_flush ();
185 extern int rplay_audio_close ();
186 extern int rplay_audio_write (char *buf, int nbytes);
187 extern int rplay_audio_audio_get_volume ();
188 extern int rplay_audio_audio_set_volume (int volume);
189 extern int rplay_audio_get_volume ();
190 extern int rplay_audio_set_volume (int volume);
191 #else
192 extern int rplay_audio_init ();
193 extern int rplay_audio_open ();
194 extern int rplay_audio_isopen ();
195 extern int rplay_audio_flush ();
196 extern int rplay_audio_close ();
197 extern int rplay_audio_write ( /* char *buf, int nbytes */ );
198 extern int rplay_audio_audio_get_volume ();
199 extern int rplay_audio_audio_set_volume ( /* int volume */ );
200 extern int rplay_audio_get_volume ();
201 extern int rplay_audio_set_volume ( /* int volume */ );
202 #endif
203
204 #endif /* _rplayd_h */