I posted this in developers but didn't get a nibble so O thought I"d try
here.

I wanted to modify an applet that has some submenu items.
I wanted to allow the user to add these submenu items to "home".

My change seems to work fine but the remote gives an off a buzz when I
call them through the new Home Menu items directly, I think indicating
an error of some sort.

Calling through the SubMenu items also works fine but with no buzz.

If there is a better way to "register" a submenu to be available to the
user customized Home I'm all ears.

To make the change all I did was

I added the 2nd and 3rd AddItems below to MeridianIRMeta.Lua

function registerApplet(meta)
jiveMain:addItem(meta:menuItem('MeridianIRApplet', 'home', "Meridian
IR", function(applet, ...) applet:menu(...) end, 22))
jiveMain:addItem(meta:menuItem('MeridianIRAppletOf f',
'MeridianIRApplet', "Meridian Off", function(applet, ...)
applet:MeridianOff(...) end))
jiveMain:addItem(meta:menuItem('MeridianIRAppletOn ',
'MeridianIRApplet', "Meridian On", function(applet, ...)
applet:MeridianOn(...) end))
end

I then added these two functions to MeridianIRApplet.Lua 

function MeridianOn(self, menuItem)
os.execute("/usr/bin/testir " .. audioOn)
end

function MeridianOff(self, menuItem)
os.execute("/usr/bin/testir " .. audioOff)
end

Original Code below in MeridianIRApplet.Lua file

function menu(self, menuItem)
local window = Window("window", "Meridian IR")
local menu = SimpleMenu("menu", {
{
text = "Meridian On",
icon = Choice("choice",
{" ", " "},
function(self1, selectedIndex)
os.execute("/usr/bin/testir " .. audioOn)
end,
1)
},
{
text = "Meridian Off",
icon = Choice("choice",
{" ", " "},
function(self1, selectedIndex)
os.execute("/usr/bin/testir " .. audioOff)
end,
1)

},
...

})

window:addWidget(menu)
window:show()

end

Thanks


-- 
mswlogo

XP > Cat5 > Transporter > SPDIF > Meridian G68 > DSP6000, DSP5500HC,
DSP5000
XP > Cat5 > SB3 > SPDIF > Meridian DSP5000
XP > Cat5 > SB3 > SPDIF > Meridian G91 > DSP5000

'My Transporter Setup'
(http://forums.slimdevices.com/showpost.php?p=350741&postcount=45)
'Hitch Hikers Guide to Meridian' (http://www.meridianunplugged.com)
------------------------------------------------------------------------
mswlogo's Profile: http://forums.slimdevices.com/member.php?userid=9090
View this thread: http://forums.slimdevices.com/showthread.php?t=62804

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to