INTERACT FORUM

Please login or register.

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

Author Topic: New 'Selected' command line switch - How to use it ?  (Read 938 times)

rolf_eigenheer

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 303
  • nothing more to say...
New 'Selected' command line switch - How to use it ?
« on: December 24, 2020, 04:54:30 am »

Since Build 045 there is a new command line switch 'Selected'. I was told, that this should fix the problem that MCC_LIST_SEND_TO_PLAYING_NOW does not work in Theater Mode.
How can a hotkey be assigned to the 'Selected' command line switch ? For MCC commands there are examples using the resource.xml. What is the reason to use a new command line switch instead of MCC command ? MCC commands can be used from command line as well.

Objective: I would like to add the marked item (album, artist, track, photo or video) to Playing Now in the TheaterView with a single keystroke.
At the moment it takes at least 19 keystrokes to insert an album as 'Next to play'. And another 22 keystrokes in the track view to add the whole album to the end of Playing Now
Logged

rolf_eigenheer

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 303
  • nothing more to say...
Re: New 'Selected' command line switch - How to use it ?
« Reply #1 on: December 28, 2020, 05:11:25 am »

Anyone out there who knows how to use this ? https://wiki.jriver.com/index.php/The_Command_Line does not list this new switch 'selected'.

It is great to get this command which should help me to add selected files to playing now even in theater mode. But I can't use it without some assistance.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: New 'Selected' command line switch - How to use it ?
« Reply #2 on: December 28, 2020, 08:48:54 am »

Selected, along with Shuffle, is now a valid <PlayItem> and follows the rules documented there for playitems:
Quote
Some options in the table below accept a parameter <playitems>, which is a list of one or more items, each item separated by a | (vertical bar, or pipe). Through the text, each item in <playitems> can be any of the following:
        A filename: Example: C:\song1.mp3
        A URL: Example: http:\\www.somewebsite.com\station.pls
        A location within the Organization Tree: Example: TREEPATH=Playlists\Playlist1
        Note: The TREEPATH=<location>\<item> specification is case-sensitive for <location> and <item> and the hierarchy separator is \ (backslash).
        A device under CD & DVD and Handhelds: Example: DEVICE=G:

Therefore, you can do:

mc27.exe /Play selected - Plays any files current selected in the currently active View, appending them to the current list if it already contains items.
mc27.exe /PlayNext "selected|shuffle" - Adds as next to play any files selected in the currently active View, shuffling the new items first.
mc27.exe /PlayReplace "c:\some\path\to\song1.mp3|TREEPATH=Playlists\Playlist1|selected|shuffle" - Will clear Playing Now and replace the contents with the shuffled results of the currently selected files, the contents of the Playlist at Playlists\Playlist1, and the file c:\some\path\to\song1.mp3

Note: If any of the PlayItems contain spaces, or if you use the pipe character to separate multiple items, you have to wrap the playitems in double-quotes or the command interpreter will get confused and try to actually pipe the output (or consider them multiple parameters at the space).
Logged
"Some cultures are defined by their relationship to cheese."

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

rolf_eigenheer

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 303
  • nothing more to say...
Re: New 'Selected' command line switch - How to use it ?
« Reply #3 on: December 29, 2020, 07:59:08 am »

This is really powerful. To play a smartlist at a single keypress is a nice add on which I'll ad to my remote.

How to assign hotkeys to calls to MC27.EXE ?  What syntax is needed within Resource.XML ?
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: New 'Selected' command line switch - How to use it ?
« Reply #4 on: December 29, 2020, 11:57:29 am »

How to assign hotkeys to calls to MC27.EXE ?  What syntax is needed within Resource.XML ?

That I don't know, as I use separate scripting utilities for my systems that work with more applications than just MC.
Logged
"Some cultures are defined by their relationship to cheese."

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

rolf_eigenheer

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 303
  • nothing more to say...
Re: New 'Selected' command line switch - How to use it ?
« Reply #5 on: December 31, 2020, 05:46:40 am »

That I don't know, as I use separate scripting utilities for my systems that work with more applications than just MC.
Glynor, Thank you for your assistance! 

Is there someone from JRiver Staff which could give an advice ? I'd like to program some hotkeys as shortcuts for adding selected items to Playing now. Actually it takes up to 20 keystrokes each.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: New 'Selected' command line switch - How to use it ?
« Reply #6 on: December 31, 2020, 02:27:28 pm »

I looked it up. I will note: It took me about 5 minutes to google search it, and the answer was right in the Wiki article for the Resource.xml file:

Quote
You can also run any program using Type="Program" for the command. In this case, the command is the executable and the param is the arguments to pass the executable.
https://wiki.jriver.com/index.php/User_Defined_Global_Keyboard_Shortcuts

There's even an example that does /Command Pause (though it points to MC13's Command Line launcher) in the example Resource.xml file posted there. So, in the future, looking a little would probably save you (and me) some time.  ;) ;D

So, there you go:
Code: [Select]
<Entry Key="Ctrl;Shift;N" Type="Program" Command="mc27.exe" Param="/PlayNext selected" Global="1" />
Logged
"Some cultures are defined by their relationship to cheese."

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

rolf_eigenheer

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 303
  • nothing more to say...
Re: New 'Selected' command line switch - How to use it ?
« Reply #7 on: January 01, 2021, 07:16:02 am »

Thanks Glynor! Finally I'm able to bind hotkeys to these commands.
    <Entry Key="Ctrl;Shift;R" Type="Program" Command="mc27.exe" Param="/PlayReplace selected" Global="1" />
    <Entry Key="Ctrl;Shift;T" Type="Program" Command="mc27.exe" Param="/Append selected" Global="1" />
    <Entry Key="Ctrl;Shift;H" Type="Program" Command="mc27.exe" Param="/PlayNext selected" Global="1" />


But it shows now, that it fails to select a single track. Always the whole abum is added to PlayingNow.
On photos or videos the three hotkeys do nothing at all.

Once it will be fixed and correctly plays the selected single track, a next problem might pop up. In an Artist\Album View clicking on an artist having only one album, ThaterView directly shows the tracks instead of the album.  How to play the single track and how to play the full album ?
There might be a need to differentiate between the listed(filtered) items and the focussed item.

The feedback is also inconsistent. When adding a track via the context menu, the overlay 'Add' appears as confirmation. There is no response when using the hotkeys. If you press again in case of doubt, you will add the selection several times.
Logged
Pages: [1]   Go Up