Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Mediabridge DM Zones question

  1. #11
    Join Date
    Jul 2001
    Location
    Risør - Norway
    Posts
    5,477

    Default

    Thank you very much for answering! I tried a few times, but finally found the solution: I had to create a new instance with the actual name of the zone to get it.

    Edit: It actually looks like it only works on the default zone on the instance that it's working on. So the zone name has to fit with the default zone in the first instance it hits.

    Still the zone list shows me all the zones. Isn't that a bit weird? Does it mean that I have to create those instances for each zone (son all in all around 20 instances)? Also three things I would like to know, if you have the patience:

    1. I made the function global by copying it to another, similar name at the end of the script, and that seems to work. I tried to remove the local at the beginning, and that doesn't work. Is the copying the correct way to make it global?

    2. Can I control what instance of MediaBridge it works on? I have two instances, and I have my zones spread out over those with Girder using internal zone numbers 0-19 for the first instance and , so I need to do an .

    3. Final thing, is it possible to use zone number instead of zone name i any way? All my other scripts are working out of zone numbers.
    Last edited by Mastiff; March 16th, 2015 at 11:26 AM.
    Tor - managing director of the Cinema Inferno home theater and multi-zone sound system with Girder running the show in the back, NetRemote as the GUI and Media Center 17, PowerDVD and ZoomPlayer as playback software
    Hobsyssel mastiffs: http://www.hobsyssel.no

  2. #12
    Join Date
    Mar 2005
    Location
    Los Angeles, CA
    Posts
    1,003

    Default

    For variables, LUA assumes they are global, so you you can delete the whole line that starts with 'local' if you want to make them global.

    I believe multiple instances should work (perhaps Ron will chime in). I haven't had occasion to test this myself, but the interface appears to have contemplated this use case.

    It's likely that the zones enumerate in the same order as their numbers in the ZoneList array - verify that this is actually the case, but assuming it is, then indexing by number should be a quick look-up.

    Cheers,
    Tim

  3. #13
    Join Date
    Jul 2001
    Location
    Risør - Norway
    Posts
    5,477

    Default

    Right! I didn't understand that, so I tried to only remove the "local" in front of the first line, and that didn't work.

    The main thing would be to be able to find the playback status of any zone in any instance, if that is possible that would make me very happy.

    As for the final line I'm afraid youre way over my head there... I fell off on the word "enumerate"!
    Tor - managing director of the Cinema Inferno home theater and multi-zone sound system with Girder running the show in the back, NetRemote as the GUI and Media Center 17, PowerDVD and ZoomPlayer as playback software
    Hobsyssel mastiffs: http://www.hobsyssel.no

  4. #14
    Join Date
    Jul 2001
    Location
    Risør - Norway
    Posts
    5,477

    Default

    I aske at the JRMC forum and managed to get the info directly from JRMC, the web interface had a few things that I didn't know. I could query a zone directly like this:

    Code:
    Playstate = string.sub(socket.http.request("http://192.168.0.15/MCWS/v1/Playback/Info?Zone=0"), 166,166)
    print (Playstate)
    Note that if another port than 80 is used, it's necessary with ort after the IP address. Also, JRMC Zones start on 0, so 0 in the example is actually the first of the zones.

    Edit: A small mistake - this requires the zone name to be the same, with three letters... So to avoid that, I search for where in the test State (playback state) is:

    Code:
    local i = string.find(socket.http.request("http://192.168.0.15/MCWS/v1/Playback/Info?Zone=0"), 'State">')
    print (i)
    Playstate = string.sub(Page, i+7, i+7) 
    print (Playstate)
    Last edited by Mastiff; March 21st, 2015 at 09:00 AM.
    Tor - managing director of the Cinema Inferno home theater and multi-zone sound system with Girder running the show in the back, NetRemote as the GUI and Media Center 17, PowerDVD and ZoomPlayer as playback software
    Hobsyssel mastiffs: http://www.hobsyssel.no

Page 2 of 2 FirstFirst 12

Posting Permissions

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