scripting: support for zone based routing in application classes
[profile/ivi/pulseaudio-module-murphy-ivi.git] / murphy / volume.h
1 /*
2  * module-murphy-ivi -- PulseAudio module for providing audio routing support
3  * Copyright (c) 2012, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU Lesser General Public License,
7  * version 2.1, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.
12  * See the GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program; if not, write to the
16  * Free Software Foundation, Inc.,  51 Franklin St - Fifth Floor, Boston,
17  * MA 02110-1301 USA.
18  *
19  */
20 #ifndef foomirvolumefoo
21 #define foomirvolumefoo
22
23 #include <sys/types.h>
24
25 #include "userdata.h"
26 #include "list.h"
27
28 typedef double (*mir_volume_func_t)(struct userdata *, int, mir_node *, void*);
29
30
31 struct mir_vlim {
32     size_t         maxentry;    /**< length of the class table  */
33     size_t         nclass;      /**< number of classes (0 - maxentry) */
34     int           *classes;     /**< class table  */
35     uint32_t       clmask;      /**< bits of the classes */
36     uint32_t       stamp;
37 };
38
39 struct mir_volume_suppress_arg {
40     double *attenuation;
41     struct {
42         size_t nclass;
43         int *classes;
44         uint32_t clmask;
45     } trigger;
46 };
47
48
49 pa_mir_volume *pa_mir_volume_init(struct userdata *);
50 void pa_mir_volume_done(struct userdata *);
51
52 void mir_volume_add_class_limit(struct userdata *,int,mir_volume_func_t,void*);
53 void mir_volume_add_generic_limit(struct userdata *, mir_volume_func_t,void *);
54
55 void mir_volume_make_limiting(struct userdata *);
56
57 void mir_volume_add_limiting_class(struct userdata *,mir_node *,int,uint32_t);
58 double mir_volume_apply_limits(struct userdata *, mir_node *, int, uint32_t);
59
60 double mir_volume_suppress(struct userdata *, int, mir_node *, void *);
61 double mir_volume_correction(struct userdata *, int, mir_node *, void *);
62
63 #endif  /* foomirvolumefoo */
64
65
66 /*
67  * Local Variables:
68  * c-basic-offset: 4
69  * indent-tabs-mode: nil
70  * End:
71  *
72  */