Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 2 of 2
  1. #1
    Senior Member mswlogo's Avatar
    Join Date
    Dec 2006
    Posts
    700

    Need help with Lua/JiveDuet Applet

    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
    Transporter/DuetController > SPDIF > Meridian G68 > DSP6000, DSP5500HC, DSP5000

    "It's the speakers and room stupid".

    My Transporter Setup
    Hitch Hikers Guide to Meridian

  2. #2
    Senior Member mswlogo's Avatar
    Join Date
    Dec 2006
    Posts
    700
    Turns out there was nothing wrong.

    I was told that if you plugin headphones and use the IR you will hear a loud buzz and that when I made the change above I somehow turned on the speaker and the same buzz is coming out the speaker. I thought to myself no way the change I did turned on the speaker.

    But in fact I did, indirectly. The change was to allow items to run from the home menu. And Home Menu items turn on the speaker for a Beep tone. The IR is being sent while the beep tone is emmitted and you get the IR noise over the speaker.
    Transporter/DuetController > SPDIF > Meridian G68 > DSP6000, DSP5500HC, DSP5000

    "It's the speakers and room stupid".

    My Transporter Setup
    Hitch Hikers Guide to Meridian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •