]> git.sesse.net Git - vlc/blob - modules/visualization/visual/visual.h
d75e9a33b59639aea3c3f0ccd66eed605cfb2697
[vlc] / modules / visualization / visual / visual.h
1 /*****************************************************************************
2  * visual.h : Header for the visualisation system
3  *****************************************************************************
4  * Copyright (C) 2002-2009 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 typedef struct visual_effect_t
25 {
26     const char *psz_name;    /* Filter name*/
27
28     int        (*pf_run)( struct visual_effect_t * , aout_instance_t *,
29                           aout_buffer_t *, picture_t *);
30     void *     p_data; /* The effect stores whatever it wants here */
31     int        i_width;
32     int        i_height;
33     char *     psz_args;
34     int        i_nb_chans;
35
36     /* Channels index */
37     int        i_idx_left;
38     int        i_idx_right;
39 } visual_effect_t ;
40
41 typedef struct spectrum_data
42 {
43     int *peaks;
44     int *prev_heights;
45 } spectrum_data;
46
47
48 /*****************************************************************************
49  * aout_filter_sys_t: visualizer audio filter method descriptor
50  *****************************************************************************
51  * This structure is part of the audio filter descriptor.
52  * It describes some visualizer specific variables.
53  *****************************************************************************/
54 struct aout_filter_sys_t
55 {
56     vout_thread_t   *p_vout;
57
58     int             i_width;
59     int             i_height;
60
61     int             i_effect;
62     visual_effect_t **effect;
63 };
64
65 /* Prototypes */
66 int scope_Run
67         (visual_effect_t * , aout_instance_t *, aout_buffer_t *, picture_t *);
68 int vuMeter_Run
69         (visual_effect_t * , aout_instance_t *, aout_buffer_t *, picture_t *);
70 int dummy_Run
71         (visual_effect_t * , aout_instance_t *, aout_buffer_t *, picture_t *);
72 int random_Run
73         (visual_effect_t * , aout_instance_t *, aout_buffer_t *, picture_t *);
74 int spectrum_Run
75         (visual_effect_t * , aout_instance_t *, aout_buffer_t *, picture_t *);
76 int spectrometer_Run
77         (visual_effect_t * , aout_instance_t *, aout_buffer_t *, picture_t *);
78
79 /* Default vout size */
80 #define VOUT_WIDTH 800
81 #define VOUT_HEIGHT 640