3 -- try loading the dlog plugin
4 m:try_load_plugin('dlog')
6 -- try loading console plugin
7 m:try_load_plugin('console')
9 -- load the dbus plugin if it exists
10 if m:plugin_exists('dbus') then
14 -- try loading the signalling plugin
15 m:try_load_plugin('signalling', { address = 'internal:signalling' })
17 -- load the native resource plugin
18 if m:plugin_exists('resource-native') then
19 m:load_plugin('resource-native')
20 m:info("native resource plugin loaded")
22 m:info("No native resource plugin found...")
25 -- load the dbus resource plugin
26 if m:plugin_exists('resource-dbus') then
27 m:try_load_plugin('resource-dbus', {
29 dbus_service = "org.Murphy",
31 default_zone = "driver",
32 default_class = "implicit"
34 m:info("dbus resource plugin loaded")
36 m:info("No dbus resource plugin found...")
40 -- load the domain control plugin if it exists
41 if m:plugin_exists('domain-control') then
42 m:load_plugin('domain-control')
44 m:info("No domain-control plugin found...")
47 if m:plugin_exists('resource-asm') then
48 m:load_plugin('resource-asm', { zone = "driver" })
50 m:info("No audio session manager plugin found...")
53 -- define application classes
54 application_class { name = "navigator", priority = 8 }
55 application_class { name = "event" , priority = 7 }
56 application_class { name = "phone" , priority = 6 }
57 application_class { name = "camera" , priority = 5 }
58 application_class { name = "alert" , priority = 4 }
59 application_class { name = "game" , priority = 3 }
60 application_class { name = "radio" , priority = 2 }
61 application_class { name = "player" , priority = 1 }
62 application_class { name = "implicit" , priority = 0 }
64 -- define zone attributes
66 type = {mdb.string, "common", "rw"},
67 location = {mdb.string, "anywhere", "rw"}
75 location = "front-left"
83 location = "front-right"
91 location = "back-left"
99 location = "back-right"
107 location = "back-left"
112 -- define resource classes
114 name = "audio_playback",
117 role = { mdb.string, "music", "rw" }
122 name = "audio_recording",
127 name = "video_playback",
132 name = "video_recording",
136 -- test for creating selections
138 name = "audio_owner",
139 table = "audio_playback_owner",
140 columns = {"application_class"},
141 condition = "zone_name = 'driver'",
145 name = "speed2volume",
146 inputs = { owner = mdb.select.audio_owner, param = 5 },
147 outputs = { mdb.table { name = "speedvol",
148 index = {"zone", "device"},
149 columns = {{"zone", mdb.string, 16},
150 {"device", mdb.string, 16},
151 {"value", mdb.floating}},
155 update = function(self)
156 if (self.inputs.owner.single_value) then
157 print("*** element "..self.name.." update "..
158 self.inputs.owner.single_value)
160 print("*** element "..self.name.." update <nil>")
165 m:try_load_plugin('telephony')