1 /* Copyright (C) 2012 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
3 /** \file check_wav.h Detect, process and cut a wav header. */
5 struct check_wav_context;
8 * These come from the command line arguments.
10 * Different users of the check_wav API have different arg_info structs,
11 * so we need a universal variant for these.
14 /** Number of channels, or the default value. */
16 /** Whether the channel count was given. */
18 /** Same semantics as \a channels_count. */
20 /** Whether the sample rate was given. */
21 int sample_rate_given;
22 /** Same semantics as \a sample_rate. */
23 int sample_format_arg;
24 /** Whether the sample format was given. */
25 int sample_format_given;
28 #define LLS_COPY_WAV_PARMS(_dst, _pfx, _lpr) \
29 (_dst)->channels_given = lls_opt_given(lls_opt_result( \
30 _pfx ## _OPT_CHANNELS, (_lpr))); \
31 (_dst)->sample_rate_given = lls_opt_given(lls_opt_result( \
32 _pfx ## _OPT_SAMPLE_RATE, (_lpr))); \
33 (_dst)->sample_format_given = lls_opt_given(lls_opt_result( \
34 _pfx ## _OPT_SAMPLE_FORMAT, (_lpr))); \
35 (_dst)->channels_arg = lls_uint32_val(0, lls_opt_result( \
36 _pfx ## _OPT_CHANNELS, (_lpr))); \
37 (_dst)->sample_rate_arg = lls_uint32_val(0, lls_opt_result( \
38 _pfx ## _OPT_SAMPLE_RATE, (_lpr))); \
39 (_dst)->sample_format_arg = lls_uint32_val(0, lls_opt_result( \
40 _pfx ## _OPT_SAMPLE_FORMAT, (_lpr)));
42 struct check_wav_context *check_wav_init(struct btr_node *parent,
43 struct btr_node *child, struct wav_params *params,
44 struct btr_node **cw_btrn);
45 void check_wav_pre_monitor(struct sched *s, struct check_wav_context *cwc);
46 int check_wav_post_monitor(struct check_wav_context *cwc);
47 void check_wav_shutdown(struct check_wav_context *cwc);