configuration: add domain control example
[profile/ivi/pulseaudio-module-murphy-ivi.git] / murphy / murphy-ivi.lua
1
2 routing_group {
3     name = "default",
4     node_type = node.output,
5     accept = builtin.method.accept_default,
6     compare = builtin.method.compare_default
7 }
8
9 routing_group {
10     name = "phone",
11     node_type = node.input,
12     accept = builtin.method.accept_phone,
13     compare = builtin.method.compare_phone
14 }
15
16 routing_group {
17     name = "phone",
18     node_type = node.output,
19     accept = builtin.method.accept_phone,
20     compare = builtin.method.compare_phone
21 }
22
23 application_class {
24     node_type = node.phone,
25     priority = 4,
26     route = {
27         input = routing_group.phone_input,
28         output = routing_group.phone_output
29     }
30 }
31
32 application_class {
33     node_type = node.radio,
34     priority = 1,
35     route = {
36         output = routing_group.default_output
37     }
38 }
39
40 application_class {
41     node_type = node.player,
42     priority = 1,
43     route = {
44         output = routing_group.default_output
45     }
46 }
47
48 application_class {
49     node_type = node.navigator,
50     priority = 2,
51     route = {
52         output = routing_group.default_output
53     }
54 }
55
56 application_class {
57     node_type = node.game,
58     priority = 3,
59     route = {
60         output = routing_group.default_output
61     }
62 }
63
64 application_class {
65     node_type = node.browser,
66     priority = 1,
67     route = {
68         output = routing_group.default_output
69     }
70 }
71
72 application_class {
73     node_type = node.event,
74     priority = 5,
75     route = {
76         output = routing_group.default_output
77     }
78 }
79
80 mdb.import {
81     table = "speedvol",
82     columns = {"value"},
83     condition = "zone = 'driver' AND device = 'speaker'",
84     maxrow = 1,
85     update = builtin.method.make_volumes
86 }
87
88 mdb.import {
89     table = "audio_playback_owner",
90     columns = {"zone_id", "application_class", "role"},
91     condition = "zone_name = 'driver'",
92     maxrow = 1,
93     update = function(self)
94         zid = self[1].zone_id
95         if (zid == nil) then zid = "<nil>" end
96         class = self[1].application_class
97         if (class == nil) then class = "<nil>" end
98         role = self[1].role
99         if (role == nil) then role = "<nil>" end
100         print("*** import "..self.table.." update: zone:"..zid.." class:"..class.." role:"..role)
101     end
102 }
103
104 volume_limit {
105     name = "speed_adjust",
106     type = volume_limit.generic,
107     limit = mdb.import.speedvol:link(1,"value"),
108     calculate = builtin.method.volume_correct
109 }
110
111 volume_limit {
112     name = "suppress",
113     type = volume_limit.class,
114     limit = -20;
115     node_type = { node.phone, node.navigator },
116     calculate = builtin.method.volume_supress
117 }