INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Is there a way to enforce a detached display?  (Read 110 times)

haggis999

  • Galactic Citizen
  • ****
  • Posts: 465
Is there a way to enforce a detached display?
« on: Yesterday at 04:25:41 pm »

I would like to find a way to enforce the use of a detached display for the MC zone I use for playing videos.

An old thread https://yabb.jriver.com/interact/index.php?topic=79166.msg537977 includes a script for doing just that. I updated the code to use MC32 and to target Zone #3, as shown below. This was saved as a .wsf file but it doesn't work. It opens MC but doesn't make the switch to a detached display. Are such scripts no longer valid for MC or does it just need a little tweak?

Code: [Select]
<package>
<job id="vbs">
<script language="VBScript">

'Create our handy dandy Shell object
set WshShell = WScript.CreateObject("WScript.Shell")

'Start MC
WshShell.Run "mc32.exe"

'Pause for a bit
WScript.Sleep 1000

'Detach display on Zone 3
WshShell.Run "mc32.exe /MCC 10037, 1:2"
</script>
</job>
</package>
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2402
Re: Is there a way to enforce a detached display?
« Reply #1 on: Yesterday at 04:55:12 pm »

Try testing the mc32 commands in a cmd prompt first.
I think you need to remove the space between the MCC arguments. This works for me:

mc32 /mcc 10037,1
mc32 /mcc 10014
Logged

haggis999

  • Galactic Citizen
  • ****
  • Posts: 465
Re: Is there a way to enforce a detached display?
« Reply #2 on: Yesterday at 05:56:21 pm »

Try testing the mc32 commands in a cmd prompt first.
I think you need to remove the space between the MCC arguments. This works for me:

mc32 /mcc 10037,1
mc32 /mcc 10014

Those commands work via a command prompt but not via the .wsf script.
Logged

haggis999

  • Galactic Citizen
  • ****
  • Posts: 465
Re: Is there a way to enforce a detached display?
« Reply #3 on: Today at 03:56:13 am »

I seem to have it working now.

I was very confused about zone numbering. I've no idea what controls the order of the zones in my MC installation, but it's certainly not in alphabetical order. I was originally following the guidance provided by Glynor (the author of the wsf script) in the thread I linked in my OP, which stated "1:0 corresponds to the first zone, 1:1 to the second, 1:2 to the third and so on and so forth". That does not appear to be correct in my case.

A process of trial and error (greatly assisted by the Overview that appears at the top of the Playing Now section in the MC interface and indicates which zones have a detached display) proved that Zone 0 was my 2nd zone, Zone 2 was my 5th zone, and Zone 3 was my 4th zone. I don't know the meaning of Zone 1, as it simply generated a black rectangle and didn't trigger any detached display indicator in Playing Now: Overview.   

I tried to add another command to set Zone 0 as the current zone but mc32.exe /MCC 10011,0 doesn't work. Have I got the syntax wrong for that command?
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2402
Re: Is there a way to enforce a detached display?
« Reply #4 on: Today at 05:28:53 am »

You can list the zones and their index/internal IDs via MCWS:
http://localhost:52199/MCWS/v1/Playback/Zones?hidden=1

There's also the /Playback/SetZone MCWS command to switch zones. That one can switch by zone index, zone ID, or zone Name.
http://localhost:52199/MCWS/v1/
Logged

haggis999

  • Galactic Citizen
  • ****
  • Posts: 465
Re: Is there a way to enforce a detached display?
« Reply #5 on: Today at 06:49:42 am »

You can list the zones and their index/internal IDs via MCWS:
http://localhost:52199/MCWS/v1/Playback/Zones?hidden=1

Thanks for that very useful zone information :)

Rather non-intuitively, the successive zone IDs stepping down my zone list (as displayed in MC) are 10038, 0, 10036, 10035, 10018, etc. What is the logic behind the ordering of the zone list in MC? 

Quote
There's also the /Playback/SetZone MCWS command to switch zones. That one can switch by zone index, zone ID, or zone Name.
http://localhost:52199/MCWS/v1/

The SetZone example provided via your link let me switch to my 1st zone by using the following browser entry.

http://localhost:52199/MCWS/v1/Playback/SetZone?Zone=10038ZoneType=ID

How would I incorporate that in the SWF script mentioned earlier?

On a wider issue, that script was published in this forum long before the Adobe Flash SWF format became defunct. Is there another way to automate MC startup?
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2402
Re: Is there a way to enforce a detached display?
« Reply #6 on: Today at 07:22:31 am »

Rather non-intuitively, the successive zone IDs stepping down my zone list (as displayed in MC) are 10038, 0, 10036, 10035, 10018, etc. What is the logic behind the ordering of the zone list in MC? 
Internal IDs are... internal. No logic is required :P Maybe you should use the Index or Name instead.

Quote
How would I incorporate that in the SWF script mentioned earlier?
Use Curl to do the HTTP calls.

Quote
On a wider issue, that script was published in this forum long before the Adobe Flash SWF format became defunct. Is there another way to automate MC startup?
It's not SWF, it's WSF (Windows Script File). It's not related to Flash.
If you just need a script to run as a shortcut or as a scheduled task on windows startup/logon, you do not need a WSF file. You can use a simple .bat or .cmd file with the same commands, something like this:

Code: [Select]
@echo off
mc32
timeout 2
curl -u YourUser:YourPass http://localhost:52199/MCWS/v1/Playback/SetZone?Zone=10038ZoneType=ID
mc32 /MCC 10037,1
Logged
Pages: [1]   Go Up