Replace check_wav_task by write_task.
[paraslash.git] / check_wav.h
1 struct check_wav_context;
2
3 /**
4 * These come from the command line arguments.
5 *
6 * Different users of the check_wav API have different arg_info structs,
7 * so we need a universal variant for these.
8 */
9 struct wav_params {
10 /** Number of channels, or the default value. */
11 int channels_arg;
12 /** Whether the channel count was given. */
13 int channels_given;
14 /** Same semantics as \a channels_count. */
15 int sample_rate_arg;
16 /** Whether the sample rate was given. */
17 int sample_rate_given;
18 /** Same semantics as \a sample_rate. */
19 int sample_format_arg;
20 /** Whether the sample format was given. */
21 int sample_format_given;
22 };
23
24 /**
25 * Copy the wav parameters.
26 *
27 * \param dst Usually a pointer to struct wav_params.
28 * \param src Usually a pointer to some args_info struct.
29 *
30 * This can not be implemented as a function since the type of the structure
31 * pointed to by \a src depends on the application.
32 */
33 #define COPY_WAV_PARMS(dst, src) \
34 (dst)->channels_arg = (src)->channels_arg; \
35 (dst)->channels_given = (src)->channels_given; \
36 (dst)->sample_rate_arg = (src)->sample_rate_arg; \
37 (dst)->sample_rate_given = (src)->sample_rate_given; \
38 (dst)->sample_format_arg = (src)->sample_format_arg; \
39 (dst)->sample_format_given = (src)->sample_format_given;
40
41 struct check_wav_context *check_wav_init(struct btr_node *parent,
42 struct wav_params *params, struct btr_node **cw_btrn);
43 void check_wav_pre_select(struct sched *s, struct check_wav_context *cwc);
44 int check_wav_post_select(struct check_wav_context *cwc);
45 void check_wav_shutdown(struct check_wav_context *cwc);