PDA

View Full Version : Setting host and zone



simonh
March 17th, 2005, 05:30 PM
I have the codes to cycle through hosts and zone in NR (fff6 0002 0012-0014 per NRPro.ccf) but is there a way to set the host/zone to a given value (previously stored) without having to cycle through and check if I've got to where I want to be? I also found values of 10 and 11 used in NRMC19.ccf for host manipulation (although they appeared noops for me) so I'm guessing there are a number of options but I'm not sure what they all are.

Thanks

Mastiff
March 18th, 2005, 10:48 AM
IR code for host 10: 5001 0000 0000 0002 fff6 0000 0010 0000
IR code for host 11: 5001 0000 0000 0002 fff5 0000 0010 0000
IR code for host 12: 5001 0000 0000 0002 fff4 0000 0010 0000

simonh
March 18th, 2005, 11:11 AM
I'm missing something here. What defines host 10 ,11, 12 - in terms of relationship to host names?

Ben S
March 18th, 2005, 06:45 PM
Hi Simon,
The numbers Mastiff refers to are plugin instance numbers (he's using 10,11, and 12).

Instead of using fff6, substitute the plugin instance number.

An easy way to do the hex conversion is to open calculator, and switch to scientific mode.

Do 65536 - [instance id] =

Now hit the "hex" radio button, which will show fff6.

simonh
March 18th, 2005, 07:07 PM
Hi Simon,
The numbers Mastiff refers to are plugin instance numbers (he's using 10,11, and 12).

Instead of using fff6, substitute the plugin instance number.

Ah! -
BUT, when I create new instances for mediabridge they get created with numbers over 1000 and there doesn't seem to be any obvious sequence. Is there a magic function to take a host name and return the instance number?

On the issue of setting zones I found this in another thread with Mastiff (http://www.promixis.com/phpBB2/viewtopic.php?t=10197)


Please try the following:



NetRemote.ExecuteAction(-10,2,255,'S MP.ZONE Stua',1);


The reason the first doesn't work is that the 2,255 command allows you to issue a MediaBridge protocol command directly. This protocol has been documented (though not revised recently), but is not (currently) available to the public. Let me talk to the guys about whether this information is okay to full release.

I tried that using the following code but it has no effect


function OnPanelLoad()
local device = NetRemote.GetVariable('NR.DeviceName');

if (device == 'JRMC1') then
if (GSPZone~="") then NetRemote.ExecuteAction(-10,2,255,'S MP.ZONE '..GSPZone,1) end
NetRemote.SetVariable( 'ZoneA', GSPZone );

else
if (remoteZone~="") then NetRemote.ExecuteAction(-10,2,255,'S MP.ZONE '..remoteZone,1) end
NetRemote.SetVariable( 'ZoneB', remoteZone );

end
end;


The SetVariable is so I can see that the fields have the value expected. The idea is to have two different (sets of) panels that display different information for two zones - just in case you were wondering!

Thanks

Simon

Rob H
March 18th, 2005, 07:16 PM
Is there a magic function to take a host name and return the instance number?


I'd like to second the request for a function to lookup a plugin instance number from a plugin name and hostname. That would certainly simplify some of the things I want to do in LDJ. Or failing that, how about a way of iterating through the plugins and accessing their properties?

Mastiff
March 19th, 2005, 08:33 AM
Click an instance and hold it, and one of the options you get is change ID. So if you've got two 1000-instances after 10, change them to 11 & 12.

simonh
March 20th, 2005, 03:38 PM
Thanks Mastiff - that's a bit of interface black magic I'd never have guessed! That would at least enable me to hard code the host switching - but I'd still prefer to be able to get to the desired host from the hostname - since that is what is available from the mediabridge interface - unless there is a MP.InstanceNumber (or somesuch) variable hidden somewhere alongside MR.HostName?

simonh
March 20th, 2005, 03:40 PM
Concerning zone switching:

- it's a case of don't believe everything Ben says - or at least not exactly in the form he writes it!

When he said: NetRemote.ExecuteAction(-10,2,255,'S MP.ZONE Stua',1);

what he actually meant was: NetRemote.ExecuteAction(-10,2,255,'S MP.Zone Stua',1);

(of course) :wink:

Ben S
March 20th, 2005, 03:44 PM
Oops!

Unfortunately right now there isn't an easy way to get the host info back out except for the current host.

If this can wait for a bit, I currently have a few things on the book that should make something like this easier.

simonh
March 21st, 2005, 12:08 PM
I can certainly live with it - I'm still struggling to get the logic right for a system which has different panels for different zones - it's quite tricky to differentiate between calls to OnVariableChange which are caused by changes within a zone and those caused when switching between zones.

If I was really trying to give you a direction I'd love to see a positiive answer to my request to get MP.Filename set for itunes and WMP... (since you seem to have been studiously ignoring that thread :wink: )

Ben S
March 21st, 2005, 09:32 PM
- it's a case of don't believe everything Ben says - or at least not exactly in the form he writes it!


Just don't tell my wife! I'm trying to train her to believe everything I say!

Sorry about that Simon, great catch!

Ben S
March 21st, 2005, 09:33 PM
If I was really trying to give you a direction I'd love to see a positiive answer to my request to get MP.Filename set for itunes and WMP... (since you seem to have been studiously ignoring that thread :wink: )

Guilty as charged. Let me drop by that thread now. :)