Add volume context changes; accidentally fix whitespace.
[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
29 typedef double (*mir_volume_func_t)(struct userdata *, int, mir_node *, void*);
30 typedef void (*mir_change_value_t)(struct userdata *, const char *);
31
32 struct mir_vlim {
33     size_t         maxentry;    /**< length of the class table  */
34     size_t         nclass;      /**< number of classes (0 - maxentry) */
35     int           *classes;     /**< class table  */
36     uint32_t       clmask;      /**< bits of the classes */
37     uint32_t       stamp;
38 };
39
40 struct mir_volume_suppress_arg {
41     double *attenuation;
42     struct {
43         size_t nclass;
44         int *classes;
45         uint32_t clmask;
46     } trigger;
47 };
48
49
50 pa_mir_volume *pa_mir_volume_init(struct userdata *);
51 void pa_mir_volume_done(struct userdata *);
52
53 void mir_volume_add_class_limit(struct userdata *,int,mir_volume_func_t,void*);
54 void mir_volume_add_generic_limit(struct userdata *, mir_volume_func_t,void *);
55 void mir_volume_add_maximum_limit(struct userdata *, double, size_t, int *);
56
57 void mir_volume_make_limiting(struct userdata *);
58
59 void mir_volume_add_limiting_class(struct userdata *,mir_node *,int,uint32_t);
60 double mir_volume_apply_limits(struct userdata *, mir_node *, int, uint32_t);
61
62 double mir_volume_suppress(struct userdata *, int, mir_node *, void *);
63 double mir_volume_correction(struct userdata *, int, mir_node *, void *);
64
65 void mir_volume_change_context(struct userdata *u, const char *volume_class);
66
67 #endif  /* foomirvolumefoo */
68
69
70 /*
71  * Local Variables:
72  * c-basic-offset: 4
73  * indent-tabs-mode: nil
74  * End:
75  *
76  */