build: Run lopsubgen with absolute path.
[paraslash.git] / check_wav.h
1 /*
2  * Copyright (C) 2012 Andre Noll <maan@tuebingen.mpg.de>
3  *
4  * Licensed under the GPL v2. For licencing details see COPYING.
5  */
6
7 /** \file check_wav.h Detect, process and cut a wav header. */
8
9 struct check_wav_context;
10
11 /**
12  * These come from the command line arguments.
13  *
14  * Different users of the check_wav API have different arg_info structs,
15  * so we need a universal variant for these.
16  */
17 struct wav_params {
18         /** Number of channels, or the default value. */
19         int channels_arg;
20         /** Whether the channel count was given. */
21         int channels_given;
22         /** Same semantics as \a channels_count. */
23         int sample_rate_arg;
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;
30 };
31
32 #define LLS_COPY_WAV_PARMS(_dst, _pfx, _lpr) \
33         (_dst)->channels_given = lls_opt_given(lls_opt_result( \
34                 _pfx ## _OPT_CHANNELS, (_lpr))); \
35         (_dst)->sample_rate_given = lls_opt_given(lls_opt_result( \
36                 _pfx ## _OPT_SAMPLE_RATE, (_lpr))); \
37         (_dst)->sample_format_given = lls_opt_given(lls_opt_result( \
38                 _pfx ## _OPT_SAMPLE_FORMAT, (_lpr))); \
39         (_dst)->channels_arg = lls_uint32_val(0, lls_opt_result( \
40                 _pfx ## _OPT_CHANNELS, (_lpr))); \
41         (_dst)->sample_rate_arg = lls_uint32_val(0, lls_opt_result( \
42                 _pfx ## _OPT_SAMPLE_RATE, (_lpr))); \
43         (_dst)->sample_format_arg = lls_uint32_val(0, lls_opt_result( \
44                 _pfx ## _OPT_SAMPLE_FORMAT, (_lpr)));
45
46 struct check_wav_context *check_wav_init(struct btr_node *parent,
47                 struct btr_node *child, struct wav_params *params,
48                 struct btr_node **cw_btrn);
49 void check_wav_pre_select(struct sched *s, struct check_wav_context *cwc);
50 int check_wav_post_select(struct check_wav_context *cwc);
51 void check_wav_shutdown(struct check_wav_context *cwc);