2 * Copyright (C) 2012-2013 Andre Noll <maan@systemlinux.org>
4 * Licensed under the GPL v2. For licencing details see COPYING.
7 /** \file check_wav.h Detect, process and cut a wav header. */
9 struct check_wav_context;
12 * These come from the command line arguments.
14 * Different users of the check_wav API have different arg_info structs,
15 * so we need a universal variant for these.
18 /** Number of channels, or the default value. */
20 /** Whether the channel count was given. */
22 /** Same semantics as \a channels_count. */
24 /** Whether the sample rate was given. */
25 int sample_rate_given;
26 /** Same semantics as \a sample_rate. */
27 int sample_format_arg;
28 /** Whether the sample format was given. */
29 int sample_format_given;
33 * Copy the wav parameters.
35 * \param dst Usually a pointer to struct wav_params.
36 * \param src Usually a pointer to some args_info struct.
38 * This can not be implemented as a function since the type of the structure
39 * pointed to by \a src depends on the application.
41 #define COPY_WAV_PARMS(dst, src) \
42 (dst)->channels_arg = (src)->channels_arg; \
43 (dst)->channels_given = (src)->channels_given; \
44 (dst)->sample_rate_arg = (src)->sample_rate_arg; \
45 (dst)->sample_rate_given = (src)->sample_rate_given; \
46 (dst)->sample_format_arg = (src)->sample_format_arg; \
47 (dst)->sample_format_given = (src)->sample_format_given;
49 struct check_wav_context *check_wav_init(struct btr_node *parent,
50 struct btr_node *child, struct wav_params *params,
51 struct btr_node **cw_btrn);
52 void check_wav_pre_select(struct sched *s, struct check_wav_context *cwc);
53 int check_wav_post_select(struct check_wav_context *cwc);
54 void check_wav_shutdown(struct check_wav_context *cwc);