INTERACT FORUM

Please login or register.

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

Author Topic: Custom Resource.xml not working on first program start  (Read 1216 times)

G-Light

  • Member
  • *
  • Posts: 2
Custom Resource.xml not working on first program start
« on: June 19, 2019, 06:59:01 pm »

Hi! Here is my problem.

Recently I've spent some time to adjust custom hotkeys. The only thing I found on this was the official wiki: https://wiki.jriver.com/index.php/User_Defined_Global_Keyboard_Shortcuts. I decided to give it a try. After some painful time I figured out that the example Resource.xml attached to the wiki is not supported by my JRiver version (24.0.75 64-bit). I did some googling and got it to work in another format (see below). Then I configured my hotkeys using the commands page and a little guessing: https://wiki.jriver.com/index.php/Media_Center_Core_Commands. Finally, I got everything to work as I wanted. But later I got a little frustrated when it turned out that nothing happens after system restart - the program does not fetch the hotkeys from the Custom Resources folder, which I created following the wiki guide.
Now my full xml file path is as follows: C:\Program Files\J River\Media Center 24\Data\Custom Resources\Resource.xml. And everything begins to work once I modify this Resource.xml and restart the program, but not before that, - regular program restart without file modification does not help. So I can use the player with custom hotkeys only until the next system restart.

What am I doing wrong? I've tried everything, and still no use, I am totally out of options how to make it work at the first time I run the program.

Of course, I could modify Resource.xml every time I want to use my custom hotkeys, but then what's the convenience of such hotkeys? Expecially, when you've bought the program. I hope there is a sollution for that.


My Resource.xml:

Code: [Select]
<MJRS version="1.0">

<!--
ACCELERATORS:

  Key: semi-colon delimited list of key strokes to be pressed (see list below for special keys)
    note that the only valid combinations are: [Key], [Key];Ctrl, [Key];Ctrl;Shift, [Key];Alt
  Type: the type of command (defaults to MCC)
    MCC: the command is an MC command
    Program: the command is a program to run
  Command: the MCC command index / name of program
  Param: the parameter for the MCC command / program arguments
  TranslateFlags: flags that determine when and how an accelerator is translated (binary or'd together)
    1: don't translate in edits, comboboxes, and other data entry controls
    2: don't translate in fullscreen mode or theater view
    4: don't translate in any type of popup window
    8: only translate in fullscreen
    16: don't translate in IE, VB controls, or other unknown rich controls
    32: targets playback engine / display (DVD, image playback, etc.)
    64: only translate when Action Window is focused
  NoShowAsShortcut: 1 if you don't want MC to show this shortcut in menus, tooltips, etc.
  Global: 1 if you want the accelerator to be translated even when MC doesn't have the focus
 
  Special key list: Insert, Delete, -, +, Right, Left, Up, Down,
    NumPad0, NumPad1, NumPad2 (etc.), F1, F2, F3 (etc.), Backspace, Enter, Escape,
    Apps, Page Up, Page Down, Home, End, Space, Print Screen, Tab

  Remember that order is relevant when the same shortcut appears multiple times.
 
  Variable list is here: https://wiki.jriver.com/index.php/Media_Center_Core_Commands#List
-->

  <ACCELERATORS>


<Entry key="Alt;P" command="26031" param="0" /> <!-- play selected -->
<Entry key="Alt;A" command="26031" param="5" /> <!-- play selected album -->
<Entry key="Alt;W" command="26031" param="2" /> <!-- play shuffled (artist or album) -->

<Entry key="Alt;V" command="26031" param="8" /> <!-- play but preserve enqueued tracks in playing now -->
<Entry key="Alt;N" command="26031" param="7" /> <!-- play next -->

<Entry key="Alt;Q" command="26031" param="6" /> <!-- add to playing now -->
<Entry key="Alt;U" command="26031" param="9" /> <!-- add selected to playing now shuffled -->
<Entry key="Alt;G" command="26031" param="15" /> <!-- add artist or album to playing now (strait order) -->
<Entry key="Alt;X" command="26031" param="17" /> <!-- remove from playing now -->
<Entry key="Alt;B" command="26031" param="12" /> <!-- add to the beginning of playing now -->

<Entry key="Alt;R" command="10041" param="0" /> <!-- shuffle remaining -->
<Entry key="Alt;D" command="10040" param="0" /> <!-- remove duplicates from playing now -->
<Entry key="Alt;C" command="10049" param="1" /> <!-- clear playing now (except for the playing track) -->
<Entry key="Alt;E" command="21024" param="0" /> <!-- edit playing now -->

<Entry key="Alt;S" command="10036" param="-1" /> <!-- stop after current file (toggling) -->

<Entry key="Alt;I" command="23020" param="0" /> <!-- run auto import -->

  </ACCELERATORS>

</MJRS>
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Custom Resource.xml not working on first program start
« Reply #1 on: June 20, 2019, 02:11:53 am »

You have left the original resource.xml file in place, I assume, in;

C:\Program Files\J River\Media Center 24\Data\Default Resources\Resource.xml

Because you should have.

The Custom Resource file adds to the Default Resource file. If you deleted the original resource.xml file maybe MC doesn't try to load the custom version until it is "refreshed" by an edit, and a MC restart?

Although where did you find the list of parameters for the 26031 MCC command? I think the question was asked when the command was created, but I can't find the list quickly now...
Ah, here it is, but the parameter isn't a number. I'm not sure how to use that information. https://yabb.jriver.com/interact/index.php/topic,118174.msg817635.html#msg817635
Perhaps the parameter needs to be those words, such as "SENDTO_PLAYING_NOW_TYPE_PLAY_SHUFFLED", although why the first entry has an " = 1" suffix I can't guess. Maybe that sets the start of a parameter count to 1, and each following line is incremented by 1?

Also, command 26031 isn't defined in the standard resource.xml file. That may not be an issue, but it could be.


Otherwise, your file looks okay, although cut down to the basics. I can't see anything dramatically wrong, except possibly your choice of a couple of keystrokes, which may clash with standard Windows Shortcuts. See my post here and the links in it: https://yabb.jriver.com/interact/index.php/topic,118862.msg822223.html#msg822223


Oh, also...

I just noticed that even though you mention you have bought MC, and you only joined the forum today so I would expect you to be using MC25, the path you mention above points to MC24.

Which version are you using and trying to modify, MC24 or MC25? Because if MC25, you may be putting your modified resource.xml file in the wrong location. Did you trial MC24 previously and leave a copy of it on your PC, or was that the version you bought?
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

G-Light

  • Member
  • *
  • Posts: 2
Re: Custom Resource.xml not working on first program start
« Reply #2 on: June 20, 2019, 02:36:16 pm »

You have left the original resource.xml file in place, I assume, in;

C:\Program Files\J River\Media Center 24\Data\Default Resources\Resource.xml

Right. I didn't edit it. Well, maybe I tried but then reverted all the changes, because it made no difference which file to edit. The final result was always the same, - as I described. Now the default file rests where it should be: at the path you indicated.

Quote
Although where did you find the list of parameters for the 26031 MCC command?

I didn't.  :) So I guessed the whole group by trial and error. I set the param and watched the player's behaviour after editing Resource.xml.

Quote
Maybe that sets the start of a parameter count to 1, and each following line is incremented by 1?

I'm not sure. As far as I remember there were numbers that seemed to do nothing (maybe there were some hidden actions?)

Quote
Also, command 26031 isn't defined in the standard resource.xml file. That may not be an issue, but it could be.

Right, it isn't in the standard xml file, but it is definitely on the command list here: https://wiki.jriver.com/index.php/Media_Center_Core_Commands. To make sure I did several more tests with system restarts. I ended up with custom Resource.xml like this:

Code: [Select]
<MJRS version="1.0">

<!--
ACCELERATORS:

  Key: semi-colon delimited list of key strokes to be pressed (see list below for special keys)
    note that the only valid combinations are: [Key], [Key];Ctrl, [Key];Ctrl;Shift, [Key];Alt
  Type: the type of command (defaults to MCC)
    MCC: the command is an MC command
    Program: the command is a program to run
  Command: the MCC command index / name of program
  Param: the parameter for the MCC command / program arguments
  TranslateFlags: flags that determine when and how an accelerator is translated (binary or'd together)
    1: don't translate in edits, comboboxes, and other data entry controls
    2: don't translate in fullscreen mode or theater view
    4: don't translate in any type of popup window
    8: only translate in fullscreen
    16: don't translate in IE, VB controls, or other unknown rich controls
    32: targets playback engine / display (DVD, image playback, etc.)
    64: only translate when Action Window is focused
  NoShowAsShortcut: 1 if you don't want MC to show this shortcut in menus, tooltips, etc.
  Global: 1 if you want the accelerator to be translated even when MC doesn't have the focus
 
  Special key list: Insert, Delete, -, +, Right, Left, Up, Down,
    NumPad0, NumPad1, NumPad2 (etc.), F1, F2, F3 (etc.), Backspace, Enter, Escape,
    Apps, Page Up, Page Down, Home, End, Space, Print Screen, Tab

  Remember that order is relevant when the same shortcut appears multiple times.
 
  Variable list is here: .jriver.com/index.phhttps://wikip/Media_Center_Core_Commands#List
-->

  <ACCELERATORS>

<Entry Key="Space" Command="10018" Param="1" />
<Entry Key="Ctrl;P" Command="10018" Param="1" />
<Entry Key="Alt;Q" Command="10018" Param="1" />


  </ACCELERATORS>

</MJRS>

I think this one adds some understanding to the issue. I saved it and restarted Windows. On startup I opened MC and checked which hotkeys worked. 10018 is a command to turn up the volume (the volume bar should move up) from the default xml file, I copied it right from there and changed only key combinations. As a result I got only Space working (the volume bar moved), the other two combinations did nothing, although Ctrl;P was also indicated in the default file (it should play/pause), and I should have overwritten it. But I overwrote only Space (which does the same by default). As far as I understand, the problem is in the key combinations and maybe some Windows restrictions, but still I have no clue how to solve it.

Quote
I can't see anything dramatically wrong, except possibly your choice of a couple of keystrokes, which may clash with standard Windows Shortcuts.

I considered this possible clash, that's why I chose Ctrl;P from default Resource.xml as a test combination. If it was in the default file, it should have worked, right? But it didn't. So even if there is a clash, why is this combination in the default xml? I don't quite get it so far.

Quote
I just noticed that even though you mention you have bought MC, and you only joined the forum today so I would expect you to be using MC25, the path you mention above points to MC24.

Which version are you using and trying to modify, MC24 or MC25? Because if MC25, you may be putting your modified resource.xml file in the wrong location. Did you trial MC24 previously and leave a copy of it on your PC, or was that the version you bought?

No, I indicated the right path and the right version. I bought MC24, although it was some time ago.

Thanks for the command list here: https://yabb.jriver.com/interact/index.php/topic,118174.msg817635.html#msg817635. But as I understand from the tests above, this is not the problem, because the command wasn't in the test - I excluded it intentionally. But thanks anyway.


Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Custom Resource.xml not working on first program start
« Reply #3 on: June 20, 2019, 05:29:00 pm »

Okay, this might need a comment from the JRiver team.

I've played with and used keyboard shortcuts some, but I'm not using them at the moment. I'm just relying on my remote control. I think I still have an active Custom Resource file on my HTPC though. I'll have a look later and see if it still works.
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
Pages: [1]   Go Up