1 /*
2  * madplay - MPEG audio decoder and player
3  * Copyright (C) 2000-2004 Robert Leslie
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *
19  * $Id: filter.h,v 1.10 2004/02/17 02:26:43 rob Exp $
20  */
21 
22 # ifndef FILTER_H
23 # define FILTER_H
24 
25 # include <mad.h>
26 
27 typedef enum mad_flow filter_func_t(void *, struct mad_frame *);
28 
29 struct filter {
30   int flags;
31   filter_func_t *func;
32   void *data;
33   struct filter *chain;
34 };
35 
36 enum {
37   FILTER_FLAG_DMEM = 0x0001
38 };
39 
40 void filter_init(struct filter *, filter_func_t *, void *, struct filter *);
41 
42 # define filter_finish(filter)	/* nothing */
43 
44 struct filter *filter_new(filter_func_t *, void *, struct filter *);
45 void filter_free(struct filter *);
46 
47 enum mad_flow filter_run(struct filter *, struct mad_frame *);
48 
49 /* filter function prototypes */
50 
51 filter_func_t gain_filter;		/* mad_fixed_t *data */
52 filter_func_t limit_filter;		/* struct player *data */
53 filter_func_t mono_filter;		/* void *data */
54 filter_func_t fadein_filter;		/* struct player *data */
55 
56 # if defined(EXPERIMENTAL)
57 filter_func_t mixer_filter;		/* FILE *data */
58 filter_func_t experimental_filter;	/* void *data */
59 # endif
60 
61 # endif
62