1 /***
2 This file is part of PulseAudio.
3
4 Copyright 2012 Flavio Ceolin <flavio.ceolin@profusion.mobi>
5
6 PulseAudio is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published
8 by the Free Software Foundation; either version 2.1 of the License,
9 or (at your option) any later version.
10
11 PulseAudio is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
18 ***/
19
20 #ifdef HAVE_CONFIG_H
21 #include <config.h>
22 #endif
23
24 #include <pulsecore/macro.h>
25 #include <pulsecore/core.h>
26 #include "stream-interaction.h"
27
28 PA_MODULE_AUTHOR("Flavio Ceolin <flavio.ceolin@profusion.mobi>");
29 PA_MODULE_DESCRIPTION("Apply a ducking effect based on streams roles");
30 PA_MODULE_VERSION(PACKAGE_VERSION);
31 PA_MODULE_LOAD_ONCE(true);
32 PA_MODULE_USAGE(
33 "trigger_roles=<Comma(and slash) separated list of roles which will trigger a ducking. Slash can divide the roles into groups>"
34 "ducking_roles=<Comma(and slash) separated list of roles which will be ducked. Slash can divide the roles into groups>"
35 "global=<Should we operate globally or only inside the same device?>"
36 "volume=<Volume for the attenuated streams. Default: -20dB. If trigger_roles and ducking_roles are separated by slash, use slash for dividing volume group>"
37 "use_source_trigger=<Do we trigger a ducking by a role of source-output as well as sink-input's? Default: false>"
38 );
39
40 static const char* const valid_modargs[] = {
41 "trigger_roles",
42 "ducking_roles",
43 "global",
44 "volume",
45 "use_source_trigger",
46 NULL
47 };
48
pa__init(pa_module * m)49 int pa__init(pa_module *m) {
50
51 pa_assert(m);
52
53 return pa_stream_interaction_init(m, valid_modargs);
54 }
55
pa__done(pa_module * m)56 void pa__done(pa_module *m) {
57
58 pa_assert(m);
59
60 pa_stream_interaction_done(m);
61 }
62