View Full Version : How do I set Line-in mute with LUA? Problems with the dash!

January 9th, 2005, 08:00 AM
I have spent this weekend making crank calls on my free IP phone and messing around with my multi-zone system. I have one problem (in addition to angry people being bugged...), and that is Line-In volume (used with an external TV card to get the TV sound through any zone at any time). The LUA is this:

if GetLine-InMute (CC00) == 0 then
SetLine-InMute (1)

And the error is this:

error: `=' expected;
last token read: `-' at line 2 in string "?"

I know why it's happening: LUA can't handle a dash as a part of a variable, so this would probably happen with spaces as well, they will be taken as two variables (how do I for instance mute CD Digital?). But how do I mark it as part of the variable?

Rob H
January 9th, 2005, 08:16 AM
You can use an underscore instead _

January 9th, 2005, 08:29 AM
Thanks! Unfortnately that didn't work. But it may be that those mutes aren't implemented in the LUA volume library. Which is weird, since the command to check all values shows it! Perhaps Mike can answer that, whenever he wakes up...

Rob H
January 9th, 2005, 08:41 AM
I haven't used the LUA volume library - where is it?

January 9th, 2005, 08:55 AM
It's installed by default - it's a plugin you'll have to enable. Then you can download the Easy Volume group of Mike's in the download section. There's a command to show all volume sliders LUA can work with:

dofile (GetDirectory('GIRDERDIR').."\\luavolume.lua") -- Load extended volume control functions
MixerPrintDetails ()

Rob H
January 9th, 2005, 09:15 AM
Looks to me as though you should be using the GetSourceMute() and SetSourceMute() functions

January 9th, 2005, 09:25 AM
Ah! Thanks! I hate PDFs... I didn't notice the help file because I haven't got Acrobat Reader on that computer... Now that I've found it, I should be able to fix this.