INTERACT FORUM

Please login or register.

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

Author Topic: Feature request. Minimize JR client to Tray instead of close  (Read 1632 times)

jachin99

  • Citizen of the Universe
  • *****
  • Posts: 559
Feature request. Minimize JR client to Tray instead of close
« on: August 17, 2019, 12:09:05 pm »

I have MC setup in a client server configuration.  I don't run the server on any of the machines I use to view content but I do rely on the remote control functionality that is only available when the client is running.  I need the remote feature to do things like maximize jriver when I press the green button.  Would it be possible to add an option to jrmc to minimize the client to the system tray instead of closing it out?  Thanks
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Feature request. Minimize JR client to Tay instead of close
« Reply #1 on: August 17, 2019, 12:47:30 pm »

It already exists. Run the server on the machines. That's what it does.
Logged
"Some cultures are defined by their relationship to cheese."

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

jachin99

  • Citizen of the Universe
  • *****
  • Posts: 559
Re: Feature request. Minimize JR client to Tay instead of close
« Reply #2 on: August 17, 2019, 01:47:27 pm »

Its not working for me.  I have the server running, and I'm pressing shortcuts for theater view, Guide, Shows, etc. but JRiver isn't responding to any of it.  I need the client running for JR to respond to these commands.  I'm on MC 25 V .92

Edit:  I should be more clear.  With the server ONLY running, MC doesn't respond to remote commands.  With the client minimized, and not closed out JR still responds to the commands.  I have the minimize to try setting enabled in options but when I explicitly close it, I lose the remote.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Feature request. Minimize JR client to Tray instead of close
« Reply #3 on: August 17, 2019, 03:37:48 pm »

Ahh. Now I understand more thoroughly.

Keyboard shortcuts are only handled when the application is the foreground application. There are some exceptions (handling regular playback commands when minimized, for example), but generally that's the rule, and to do anything else would be bad app behavior. That's because other applications might be bound to those same keyboard shortcuts, which would result in chaos when you try to use them. If you're trying to route keyboard shortcuts only to the tray application (the server) that won't work because it won't listen for them, because it is never foreground (tray apps are, of course, background apps).

No worries though. The issue is that you're using keyboard shortcuts, rather than sending the commands directly to MC via any of the many means that MC will respond to, even when running in the tray:So, for example:
If you have a button that toggles MC through Theater View, instead of sending it F11 (or Shift-F11 depending on your current requirements) you can instead have the remote button run: mc25.exe /mcc 22001,0

That'll do exactly the same thing as F11 but it will work whether MC is foreground or not. There are MC Command Line Options and MC Core Commands for everything MC can do via keyboard shortcuts (and much, much, much more).

If you'd rather do things via MCWS (which has the advantage that it doesn't have to be run on the machine where you want the results to happen), you can do stuff like this simple VB script (which issues a play/pause command on the current zone via MCWS):
Code: [Select]
Option Explicit
' Enter your server and port address here
const strServerAddress = "SERVER_ADDRESS:PORT"
' Enter your authentication info here
const strUsername = "USER"
const strPassword = "PASSWORD"

' Define the URL that will be sent to the MC Server
' See: https://wiki.jriver.com/index.php/Web_Service_Interface
' NOTE: The raw command sent out looks like:
' oXMLHTTP.open "GET", "http://strServerAddress/MCWS/v1/Playback/PlayPause?Zone=-1&ZoneType=ID", False, "username", "password"
const strUrl = "http://" & strServerAddress & "/MCWS/v1/Playback/PlayPause?Zone=-1&ZoneType=ID"

' Create the HTTP object you need to send the command
Dim oXMLHTTP
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")

' Do it, Doug!
On Error Resume Next
oXMLHTTP.open "GET", strUrl, false, strUsername, strPassword
oXMLHTTP.send

' Handle Bad Errors
if Err.number <> 0 then
Wscript.echo "Error (" & Err.number & "): " & Err.Description
end if

' Report success or failure to the user
' Comment this out or modify it if you don't want the script to show a results popup
if oXMLHTTP.status = 200 then
Wscript.Echo "worked"
else
Wscript.echo "failed"
end if

Worth noting that if you go the route of using the MC Command Line Launcher, you may want to look at MCcl.exe instead of pointing directly at the launcher (so that it is easier to fix your remote when MC26 comes out inevitably).
Logged
"Some cultures are defined by their relationship to cheese."

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

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Feature request. Minimize JR client to Tray instead of close
« Reply #4 on: August 17, 2019, 04:06:05 pm »

It is also worth noting that if your remote has only simple options for what it can do with its buttons (it can only emulate key presses, for example, not run a command or script) you'll probably need to use a more powerful general scripting system for Windows.

The best one is almost certainly AutoHotKey:
https://www.autohotkey.com/

I'm old school, so I still use Promixis Girder so I don't know a huge amount about AutoHotKey. Promixis as a company sadly went under, but Girder still works fine for me. If it ever stops working, I'll switch over to AutoHotKey.
Logged
"Some cultures are defined by their relationship to cheese."

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

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Feature request. Minimize JR client to Tray instead of close
« Reply #5 on: August 17, 2019, 05:03:31 pm »

I just re-read your original post.. I apologize. You are using the built-in Remote functionality in MC to actually execute your commands. I must have read with my eyes closed the first time.

I don't know much about that. I'm pretty sure there's some way to set it to work even when MC is in the tray, but I know next to nothing about it, because I use a more general-purpose solution.
Logged
"Some cultures are defined by their relationship to cheese."

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

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Feature request. Minimize JR client to Tray instead of close
« Reply #6 on: August 17, 2019, 09:44:04 pm »

I have MC setup in a client server configuration.  I don't run the server on any of the machines I use to view content but I do rely on the remote control functionality that is only available when the client is running.  I need the remote feature to do things like maximize jriver when I press the green button.

If you run Media Server on the Client, then close MC on the Client, the Green Button will restart MC and display it in Theatre View. That works. I just confirmed it again.

The easiest way to ensure this always happens is to set Media Center and Media Server to start with Windows, or just Media Server if you like, in the setting "Options > Startup > Windows Startup".

Edit:  I should be more clear.  With the server ONLY running, MC doesn't respond to remote commands.
If the Green Button isn't working that way for you, try checking the "Options > Theatre View > Behaviour > Disable Windows Media Center..." setting. That shouldn't have any affect if you don't have WMC set up, or are on Windows 10, but it is worth a try. The Green Button works for me when running Media Server only on a Client.


If you don't want to run Media Server, as it will run in the background all the time if you use the above method, then check "Options > General > Interface > Minimise to system tray", and then always minimise MC rather than closing it when you don't want to use it. Again, that is accomplished easily by setting Media Center to start using "Options > Startup > Windows Startup" setting, and then minimising MC once it starts. Of course, if you have MC start in Theatre View as I do, then you need to exit Theatre View before you can minimise it. There is no option to start Media Center minimised, because basically that is what Media Server is. You could start it in the Mini View, but that isn't a very good solution.

You could probably add a menu item in Theatre View to minimise Media Center though, using the MCC Command 10014. See https://wiki.jriver.com/index.php/Media_Center_Core_Commands
You could also perhaps have Windows Task Scheduler minimise MC when it launches at Windows startup, possibly. You would probably have to add in a wait function before the minimise command, to allow MC to start before the minimise. I haven't looked at that.
Or you could start MC using a simple batch command file that starts MC, waits a bit, then minimises MC.
Or you could use AutoHotKey as Glynor mentions, to script around the startup and minimise MC once it has started.

So many ways to do what you want... But you do need to have Media Server or Media Center running minimised for the Green Button to work.


Would it be possible to add an option to jrmc to minimize the client to the system tray instead of closing it out?

If you mean that MC should just minimise when a user tries to close it by clicking the X in the top right of the Standard View window, that has been asked for before, and it didn't receive much traction. I think one such discussion resulted in the "Minimise to system tray" setting being added. Bottom line, you aren't going to get that.

If the problem is that other users keep closing MC instead of minimising it, then you need to do some training! A few missed recordings might facilitate a behaviour change.  ;)
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

jachin99

  • Citizen of the Universe
  • *****
  • Posts: 559
Re: Feature request. Minimize JR client to Tray instead of close
« Reply #7 on: August 18, 2019, 07:55:01 pm »

Thanks for the suggestions.  I have to be honest that I still need to read through them but I'm leaning towards mcws.  The issue I see is that I'm no trying to start the server ( but I can if need be) and I want to make sure there's no console window flash
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Feature request. Minimize JR client to Tray instead of close
« Reply #8 on: August 18, 2019, 09:49:34 pm »

I want to make sure there's no console window flash

If you use VB Script in a .vbs file it won't.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/
Pages: [1]   Go Up