INTERACT FORUM

Please login or register.

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

Author Topic: MCWS  (Read 3135 times)

bblue

  • Galactic Citizen
  • ****
  • Posts: 307
MCWS
« on: December 30, 2015, 04:29:52 pm »

What I would really like to see is a set of documentation that thoroughly explains all the MCWS commands and command line functions.  How they compare to their MC analog, and what steps or sequences are best to use to control MC more in a macro manner, without having to figure out by trial and error all the various steps and how to sequence them to produce the desired result.

As it stands now MC's MCWS control is largely a black box, though with a lot of experimentation much can be derived.  The goal for this documentation would be to explain how things work and what series of MCWS commands can simulate a main MC function, including timing requirements, zone control.  Everything necessary to help a programmer type to interface any remote control system (Crestron, AMX or any other) to MC.

I have written a few with Python scripts as a control language to do specific things, another to pass through commands from another control device (Crestron), acting much as an interpreter.  Also, a two simultaneous zone 'internet radio station' streamer control, Icecast streaming manager, and song titler which can be viewed remotely during the remote playback over the net.  In these and I presume others I haven't even thought of yet, it would be great to know more about how MC works, specifically what the MCWS commands do and don't do, how they interact or have states set up for another following command.  Web site php (or similar) could also be a control method, interactively, but it is largely limited to a handful of web programmers right now.

Yes, there's the (incomplete and terse wiki) and numerous articles on the forum you can fish through for clues, but really?

Please give this some thought.  I think it would help a lot of folks take advantage of a great Media Player/System with remote control devices without little frustration.

--Bill
Logged

bblue

  • Galactic Citizen
  • ****
  • Posts: 307
Re: MCWS
« Reply #1 on: December 31, 2015, 01:09:25 am »

The preceding was my post which was split from the "Parallel Universe" topic regarding home automation.

I don't really see why, since one of the things that would prevent some folks from even trying to automate MC would be the remote control commands in MCWS... not the commands themselves but the lack of documentation about them, along with usage examples and how to relate to them when you are deciding just how to accomplish your automation goal.  Obviously some are obvious, but not all.

Why the separation, Jim?

--Bill
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71439
  • Where did I put my teeth?
Re: MCWS
« Reply #2 on: December 31, 2015, 04:00:10 am »

Different topic.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71439
  • Where did I put my teeth?
Re: MCWS
« Reply #3 on: December 31, 2015, 04:09:35 am »

It's self documenting.  On your server, in a browser, try this link:
http://localhost:52199/MCWS/v1/

Meda Server or Media Center need to be running on the server.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3966
Re: MCWS
« Reply #4 on: December 31, 2015, 04:56:27 am »

The API reference is documented with respect to the list of commands & parameters but actually using the api itself requires a fair bit of trial and error to see what happens when you prod it. The API is also quite dense, for example the range of activity that is possible using 1 command can be pretty large.

To take an example, this is described as "gets the files of a playlist" but it does this in 2 different formats (one of which is not obvious what it means) and also allows you to play the files, save the files & change the playlist contents.

Code: [Select]
Playlist

      Files
         Gets the files of a playlist.
         Parameters:
            Playlist: The playlist the command is targetted for. (default: )
            PlaylistType: The type of value provided in 'Playlist' (ID: playlist id; Path: playlist path). (default: ID)
            Action: The action to perform with the files (MPL: return MPL playlist; Play: plays files; Save: saves the files (as a playlist in the library, etc.); Serialize: return serialized file array (basically a list of file keys)). (default: mpl)
            Shuffle: Set to 1 to shuffle the files. (default: )
            ActiveFile: A file key to set as active (used as the file that playback starts with, etc.). (default: -1)
            ActiveFileOnly: Set to 1 to trim the returned files to only contain the active file. (default: )
            PlayMode: Play mode flags delimited by commas (Add: adds to end of playlist; NextToPlay: adds files in the next to play position). (default: )
            Fields: The fields to include in an MPL (use empty to include all fields). (default: )
            NoLocalFilenames: Set to 1 to filter out local filenames from MPL output (since they might be meaningless to a server). (default: )
            PlayDoctor: Set to 1 to change the files to a Play Doctor generated playlist using these files as a seed. (default: )
            SaveMode: Playlist: playlist (overwrites existing; returns ID) (default: )
            SaveName: A backslash delimited path used with the action 'Save'. (default: )
            NoUI: Set to one to put the player in no UI mode. (default: )
            Zone: The zone the command is targetted for. (default: -1)
            ZoneType: The type of value provided in 'Zone' (ID: zone id; Index: zone index; Name: zone name). (default: ID)
         Response:
         Examples:
            Click here

Some coded examples for a range of use cases would probably be a useful addition, hosting it on github would probably be a good idea as that would allow people to submit examples easily.
Logged
Pages: [1]   Go Up