INTERACT FORUM

Please login or register.

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

Author Topic: Output Mode Setting - Is there a way to set it at launch?  (Read 2177 times)

mashenden

  • Recent member
  • *
  • Posts: 39
Output Mode Setting - Is there a way to set it at launch?
« on: February 15, 2012, 07:33:27 pm »

Is there a way to set the Output Mode Setting using MC Core Commands, or by doing a MC17.exe / type command line?

Sometimes we want to listen to MC through the amp, which is connected to the PC via a optical S/PDIF (digital). Sometimes the Amp is used for other things and we want to listen to MC using the analog PC speakers.

Alternately if this cannot be done within MC, is there some other way that users easily select their PC's audio output? It seems Win 7 does not offer an easy way to toggle between audio outputs (unless I am missing something).
Logged

justsomeguy

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 525
Re: Output Mode Setting - Is there a way to set it at launch?
« Reply #1 on: February 15, 2012, 08:03:08 pm »

You could setup different zones with different output settings for each.
To switch zones from the command line you can use "MC17.exe /MMC 10011, 1" with the last number specifying the zone index number. I believe zone index numbers start at 0 for the first zone.
Logged

mashenden

  • Recent member
  • *
  • Posts: 39
Re: Output Mode Setting - Is there a way to set it at launch?
« Reply #2 on: February 16, 2012, 06:37:54 am »

Thank you, justsomeguy. I had not thought of that, but your suggestion definitely sounds worthy of a try.
Logged

mashenden

  • Recent member
  • *
  • Posts: 39
Re: Output Mode Setting - Is there a way to set it at launch?
« Reply #3 on: February 17, 2012, 11:15:35 am »

WOW!! Zones are VERY cool. I took a detour from my main objective to mess with them for a bit. Very useful and intuitive. I had not noticed prior, but my Test PC was a Zone on my "Audio Server" PC and vice versa. Without any noticeable effort to configure things, I was able to be at one PC, but feel like I was at the other. This works really well.

When I got back to trying to solve my main intent, I was able to set up one MS Shortcut as "MC17.exe /MCC 10011,0" (where 0 = Zone 1), with that Zone set to have the Output Mode Setting = PC Speakers in Options (Audio), and I also set up another MS Shortcut as "MC17.exe /MCC 10011,3" (where 3 = Zone 4), with that Zone set to have the Output Mode Setting = S/PDIF Optical output in Options. Clicking on one Shortcut vs the other on my Desktop accomplished the switching between Zones and when in the relevant Zone, the output selected in the Options was applied correctly. So far so good.

But then I hit a snag - Despite having the Startup Action in Options selected (to start playing current playlist), nothing starts playing. Before jumping to the "How hard is it to push..." defense, lets envision my MC user community as being people that are not overly technically inclined (sometimes kids and family, other times drunk guests). Things need to be either fully executed with a single button or a right click with obvious options, which explains why I try to accomplish as much as humanly possible with the click of a single button.

In an effort to overcome no music automatically playing after setting the relevant Zone (same room, but different speaker output in my case), I tried a few things, but nothing has worked yet...

Please consider the following scenarios and efforts as well as the related questions.

1) On my test PC when I start MC, it starts playing automatically. But on my Audio Server PC, that is seemingly optioned the same way, it does not. Are there any other options that I should be taking into consideration?

2) Once in the desired zone using /MCC 10011,#, if I execute another /MCC command (like 10047), then music starts playing in that zone (and each zone can play different music - Wow, impressive... I did not expect that to be so easy), but again my need is to set the zone and start the music with a single button push. Is there a way to issue multiple MCC commands in a MS Shortcut - I tried "MC17.exe /MCC 10011,0 /MCC 10047" and a few other iterations but they did not work.

3) Am I correct in my assumption that the Options in each zone should apply to that zone and be mutually exclusive from the other zones? If so, is there a known bug (or confusion on my part) that might explain why the Startup option is not working?

Thank you in advance for any assistance on these.
Logged

justsomeguy

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 525
Re: Output Mode Setting - Is there a way to set it at launch?
« Reply #4 on: February 17, 2012, 08:36:09 pm »


2) Once in the desired zone using /MCC 10011,#, if I execute another /MCC command (like 10047), then music starts playing in that zone (and each zone can play different music - Wow, impressive... I did not expect that to be so easy), but again my need is to set the zone and start the music with a single button push. Is there a way to issue multiple MCC commands in a MS Shortcut - I tried "MC17.exe /MCC 10011,0 /MCC 10047" and a few other iterations but they did not work.


It's not possible to string together commands like that. You could create a simple script or batch file and issue the commands individually.

I wrote a small program to accomplish a different task a while ago that lets me launch MC, begin playing a specific file or playlist and then when playback stops it automatically closes MC. It allows me to specify a zone to play in as well. You may not want MC to close after playback stops but you can give it try and see if it'll help you do what you want. Here's the thread for it http://yabb.jriver.com/interact/index.php?topic=65984.0
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Output Mode Setting - Is there a way to set it at launch?
« Reply #5 on: February 17, 2012, 09:24:21 pm »

Here's a post where I explain how to script MC to start up automatically (if it isn't already running), switch to a specified zone, and detach the display.  Here's another one that is even fancier and better commented (though older and doesn't deal with zones).

You could use the same strategy easily with a Windows Script to do what you want.

PS.  By the way, the Wiki is a little confusing in this section with so much information about the different (older-style) methods you can use to direct a MCC command to a particular zone, but with MC 16.0.118 and up, it is dead-simple.  You can just use the "colon syntax" as is shown in the first example on that page.

Quote
Increase volume to 25% for Zone 2 (new parameter specification available starting with MC 16.0.118)
MC16.exe /MCC 10020, 25:2

Note that the Zone Index starts at 0, so by "Zone 2" above they really mean the third zone in the list.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

mashenden

  • Recent member
  • *
  • Posts: 39
Re: Output Mode Setting - Is there a way to set it at launch?
« Reply #6 on: February 18, 2012, 08:00:51 am »

Thank you, glynor and justsomeguy. Your posts definitely answer #2 and give me solid direction to pursue. Very much appreciated. My initial reaction as an amateur and very rusty programmer was; Ugg, I don't want to figure out scripts. But thankfully with your examples it looks very straight forward. I am off to give this a try.

Any thoughts from anyone on #1 and #3 in my last post? While the scripts noted above certainly sidestep #1, I am still interested in learning how the Startup option should work (or understanding that it does not always work as intended at this point so I will not waste time on it). Similarly for #3 (how Options apply to Zones), knowing the answer to that will definitely help me understand what to try and what to expect.

---------------------------------
[Update on #1] - It dawned on me that the only known difference between my Test PC and my Media Server PC was that the latter had MC Server running. This may be the reason that the latter PC was not automatically starting music, despite both having the Startup Actions option selected. Some interesting testing…

  • Test A:  When starting MC while MC Server is running, the Startup Actions option (selected in Zone 1) is ignored. “Starting MC” meaning with the standard desktop shortcut = "C:\Program Files\J River\Media Center 17\Media Center 17.exe").
  • Test B:  When starting MC in the same manner w/o MC Server running, the selected Startup Actions option works as envisioned (assuming I have it envisioned correctly) – Music starts automatically.
  • Test C:  When starting MC Server (at boot-up as an example) the Startup Actions option is honored, when seemingly it should not be. I usually have to shut off the music in this case because rebooting a PC and wanting to listen to music are not usually in sync. I was thinking that launching MC Server upon boot-up would put it in the background so that it could then receive commands, but not start playing music. Then if MC Server receives a MC17.exe /MCC xxxxxx command it would start playing music or alternately if MC is started using the traditional command ("C:\Program Files\J River\Media Center 17\Media Center 17.exe") it would start playing music because the Startup Actions option was selected.
  • Test D: With the Startup Actions option de-selected (in Zone 1), then music does not start when launching either MC Server or MC (as was expected).

This testing seems to indicate that MC Server uses Zone 1's Options, which in turn seems to cause Server and MC to work opposite to conventional common sense in regards to when music should or should not start (Again, unless I am the one that is confused on the intent).

Based on the results of the above tests, I would like to submit the following for consideration: Revise things so that Server has its own set of Options, as if a separate Zone, rather than being tied to Zone 1. That way MC Server could be configured to not automatically start playing music (allowing further control by MC17.exe /MCC xxxxxx commands), but when MC is started with the traditional Desktop shortcuts, the Startup Actions option would take effect.

BTW - I realize that I should be able to overcome all of this by deselecting the Startup Actions option in Zone 1 and using the MCC commands and scripting to get things going as desired. My intent of bringing this up is in hopes of one day ultimately handling this scenario from within MC.
Logged

mashenden

  • Recent member
  • *
  • Posts: 39
Re: Output Mode Setting - Is there a way to set it at launch?
« Reply #7 on: February 18, 2012, 03:18:30 pm »

6 hours later and I am realizing this can be tricky, but fun stuff :) Key time saving lesson learned today: Often inserting a delay makes all the difference.

Below is my script so far. It launches MC, sets the zone (which on my system allows selecting between PC Speakers vs S/PDIF to my Amp), starts Autoplaylist (aka Play Dr), and starts up the Visualizer.

I have one more need and that is to have MC go to Audio/Artists in the tree (like setting Option Startup Interface/Location to Audio). Does anyone know the MCC Command that accomplishes this? I have tried many but it is eluding me thus far.

The reason being because people unfamiliar with MC would either hit ESC or double click to exit from the Visualizer, at which point the Audio/Artists (or possibly Album) view would allow them to select songs either by double clicking or right clicking (both intuitive actions I should not have to teach).

I am on the home stretch now !!!!

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

'Create Shell object - credit and thanks to glynor for the lead on this
Set WshShell = WScript.CreateObject("WScript.Shell")

'Start MC
WshShell.Run "MC17.exe"

'Pause for a bit
WScript.Sleep 1500

'Set to Zone 0 (0 is Zone 1= PC Speakers and 1 is Zone 2 = S/PDIF Output)
WshShell.Run "MC17.exe /MCC 10011,0"

'Pause for a bit
WScript.Sleep 1000

'Start Autoplaylist (aka Play Dr)
WshShell.Run "MC17.exe /MCC 10047"

'Pause for a bit
WScript.Sleep 1500

'Remove Dups from Playing Now
WshShell.Run "MC17.exe /MCC 10040"

                'Suffle Remaining
WshShell.Run "MC17.exe /MCC 10041"

'Attach Display
WshShell.Run "MC17.exe /MCC 10037,0"

'Set Mode to = Display (which makes the Visualizer go full screen)
WshShell.Run "MC17.exe /MCC 22000,2"

</script>
</job>
</package>
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Output Mode Setting - Is there a way to set it at launch?
« Reply #8 on: February 18, 2012, 10:19:04 pm »


I have one more need and that is to have MC go to Audio/Artists in the tree (like setting Option Startup Interface/Location to Audio). Does anyone know the MCC Command that accomplishes this? I have tried many but it is eluding me thus far.

I can get you to Audio.  You may need to adjust the "2" parameter, depending up on the items you have in the tree.

   mc17.exe /mcc 22003,2

And the Forward command will bring you to the first item:

  mc17.exe /mcc 22006,0

There is a MCC_KEYSTROKE command, but I can't get that to work:

   mc17.exe /mcc 27000,40

This should move down via the Down arrow.  See:

   http://wiki.jriver.com/index.php/MCC_KEYSTROKE

Maybe you'll have better luck with this.
Logged
The opinions I express represent my own folly.

mashenden

  • Recent member
  • *
  • Posts: 39
Re: Output Mode Setting - Is there a way to set it at launch?
« Reply #9 on: February 19, 2012, 09:18:56 am »

I can get you to Audio.  You may need to adjust the "2" parameter, depending up on the items you have in the tree.

   mc17.exe /mcc 22003,2

And the Forward command will bring you to the first item: mc17.exe /mcc 22006,0

There is a MCC_KEYSTROKE command, but I can't get that to work: mc17.exe /mcc 27000,40

...
Maybe you'll have better luck with this.

Great lead - Thank you. The 22003,2 command to get me to Audio worked great. I too could not get the keystroke command (27000) to work - probably something to do with the program being in focus or not.

I could not get 22006,0 to work either but getting to Audio was close enough to claim mission accomplished.

My final script in case anyone is interested:

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

'Create Shell object - credit and thanks to glynor for the lead on this
Set WshShell = WScript.CreateObject("WScript.Shell")

'Start MC
WshShell.Run "MC17.exe"

'Pause for a bit
WScript.Sleep 1500

'Set to Zone 0 (0 is Zone 1= PC Speakers and 1 is Zone 2 = S/PDIF Output)
WshShell.Run "MC17.exe /MCC 10011,0"

'Pause for a bit
WScript.Sleep 1000

'Start Autoplaylist (aka Play Dr)
'WshShell.Run "MC17.exe /MCC 10047"

                ' Opens the Smartlist "Not Recently Played" for Editing so a refresh can be done
                WshShell.Run "MC17.exe /MCC Command 21026, 715178384"

                ' Sends a Keyboard Enter to refresh the Smartlist
                WshShell.Run "MC17.exe /MCC Command 27000, 13"

'Pause for a bit
WScript.Sleep 1000

                ' Loads the Smartlist "Not Recently Played" into the Playlist and starts playing it.
                WshShell.Run "MC17.exe /MCC Command 30007, 715178384"
'or             'WshShell.Run "MC17.exe /PlayReplace TREEPATH=Playlists\Smartlists\Not Recently Played"

'Pause for a bit
WScript.Sleep 1500

'Remove Dups from Playing Now
WshShell.Run "MC17.exe /MCC 10040"

'Suffle Remaining
WshShell.Run "MC17.exe /MCC 10041"

'Attach Display
WshShell.Run "MC17.exe /MCC 10037,0"

'Move View to Audio so Usrs can select other songs
WshShell.Run "MC17.exe /MCC 22003,2"

'Set Mode to = Display (which makes the Visualizer go full screen)
WshShell.Run "MC17.exe /MCC 22000,2"

</script>
</job>
</package>

[Edited to add commands that refresh the Smartlist]

nPlaylistID "715178384" was identified using the process defined here:  http://yabb.jriver.com/interact/index.php?topic=10894.0
Logged
Pages: [1]   Go Up