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 141 times)

haggis999

  • Galactic Citizen
  • ****
  • Posts: 468
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: 2404
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: 468
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: 468
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: 2404
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: 468
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: 2404
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

haggis999

  • Galactic Citizen
  • ****
  • Posts: 468
Re: Is there a way to enforce a detached display?
« Reply #7 on: Today at 08:50:09 am »

Thanks for the clarification. My OP correctly referred to a .wsf file but my aging brain subsequently converted it to .swf :(

Since my last post I had already discovered that a .bat file was an alternative to a .wsf, though batch files have the disadvantage of causing a short flash on the screen. However, I've never used Curl before, so thanks for that info.

I still have an issue with the MCC 10037 command, as it appears to be behaving in a rather erratic manner.

Using the command prompt, I can turn detached display on for the current zone with MC32 /MCC 10037,1 and turn it off with MC32 /MCC 10037,0. So far, so good, but when I specify the ZoneID the situation becomes more complicated.

MC32 /MCC 10037,1:0 correctly detaches the display for Zone 0, but MC32 /MCC 10037,1:10038 also detaches the display for Zone 0 (but not Zone 10038). The same applies when I use other ZoneIDs in the command. They all detach the display for Zone 0. What might explain such behaviour?
Logged

haggis999

  • Galactic Citizen
  • ****
  • Posts: 468
Re: Is there a way to enforce a detached display?
« Reply #8 on: Today at 09:12:00 am »

Forget that last question. That MCC command requires the Zone Index not the Zone ID!!
Logged

haggis999

  • Galactic Citizen
  • ****
  • Posts: 468
Re: Is there a way to enforce a detached display?
« Reply #9 on: Today at 11:59:17 am »

Using the command prompt to issue MCC commands is now working as expected and I can turn the detached display setting on and off for five different zones. I can also do the same thing using the following .bat file.

Code: [Select]
@echo off
MC32.exe
timeout 2

rem  ZoneIndex 0 = AV system(video)
rem  ZoneIndex 2 = Zoom Zone
rem  ZoneIndex 3 = This PC
rem  ZoneIndex 4 = Sue's projector
rem  ZoneIndex 5 = AV system (SACD)
rem  MC32.exe /MCC 10037,1:ZoneIndex

MC32.exe /MCC 10037,1:0

However, it's not working for me when I use the same MCC command in a .wsf file. What might I be doing wrong?

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
WshShell.Run "MC32.exe /MCC 10037,1:0"
</script>
</job>
</package>
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2404
Re: Is there a way to enforce a detached display?
« Reply #10 on: Today at 12:20:45 pm »

Why do you need it as a .wsf?
Maybe the sleep delay is not enough, try 5 seconds.
Logged
Pages: [1]   Go Up