<?xml version="1.0" encoding="utf-8" ?>
<templates>
<!-- switches ringer on and off, stores current volume locally -->
<template name="ringer" icon="@drawable/ringer_on"> <!-- todo string for ringer -->
<keyConfiguration>
<lua>
<code><![CDATA[
local currentlyMuted = false
local path = "sound/volumes/ringing"
local configuredVolume = config.get( path )
function onConfigChanged()
local c = config.get( path )
print( c )
if not (c == "0") then
key:setLed("off")
configuredVolume = c
currentlyMuted = false
else
currentlyMuted = true
key:setLed("red")
end
end
function onKeyUp()
if currentlyMuted then
config.set( path, configuredVolume )
else
config.set( path, 0 )
end
end
config.register(path, onConfigChanged)
--]]></code>
</lua>
</keyConfiguration>
</template>
</templates>