configuration: added reverse shift volume to lua config.
authorJaska Uimonen <jaska.uimonen@helsinki.fi>
Mon, 7 Jan 2013 20:25:07 +0000 (22:25 +0200)
committerJaska Uimonen <jaska.uimonen@helsinki.fi>
Tue, 8 Jan 2013 11:18:31 +0000 (13:18 +0200)
murphy/murphy-ivi.lua

index 470e131..81684ab 100644 (file)
@@ -97,10 +97,18 @@ mdb.import {
        if (class == nil) then class = "<nil>" end
        role = self[1].role
        if (role == nil) then role = "<nil>" end
-        print("*** import "..self.table.." update: zone:"..zid.." class:"..class.." role:"..role)
+--      print("*** import "..self.table.." update: zone:"..zid.." class:"..class.." role:"..role)
     end
 }
 
+mdb.import {
+    table = "amb_shift_position",
+    columns = {"shift_position"},
+    condition = "id = 0",
+    maxrow = 1,
+    update = builtin.method.make_volumes
+}
+
 volume_limit {
     name = "speed_adjust",
     type = volume_limit.generic,
@@ -115,3 +123,20 @@ volume_limit {
     node_type = { node.phone, node.navigator },
     calculate = builtin.method.volume_supress
 }
+
+volume_limit {
+    name = "video",
+    type = volume_limit.class,
+    limit = -90,
+    node_type = { node.player, node.game },
+    calculate = function(self, class, device)
+--     print("*** limit "..self.name.." class:"..class.." stream:"..device.name)
+       position = mdb.import.amb_shift_position[1].shift_position
+       if (position  and position == 128) then
+           return self.limit
+       end
+       return 0
+    end
+}
+
+