INTERACT FORUM

Please login or register.

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

Author Topic: Excellent additions to Automation SDK  (Read 2349 times)

Soundman

  • Regular Member
  • World Citizen
  • ***
  • Posts: 155
  • Go Music!
Excellent additions to Automation SDK
« on: June 24, 2003, 08:00:47 pm »

Hello, JRiver!

Quote
Matt Wrote, on June 14: We'll add a IMJFieldsAutomation object when the UI redo slows down. (remind us then if you would)


I'll take that as a cue to share my big Automation Wishlist. I am doing an HTPC menu system that strongly depends on many of these new requests. I realize the new GUI stuff is still hot, but I want to get this list out there so that you already have it when the GUI work slows.

1. New property: CMJCurPlaylist.PreventDupes
This new read/write property takes three values:
0 - Duplicates OK (this is like PN always behaves today)
1 - Duplicates not allowed. If a duplicate item is being added to PN, it will replace the existing instance of it (effectively moving it to a new position).
2 - Duplicates not allowed. If a duplicate item is being added to PN, it will be ignored. The existing instance will not be moved.

2. Add parameter values to CMJFilesAutomation.Play() and CMJViewItemAutomation.DoCommand()
This method already requires a parameter, but it currently has no effect.  Please make this parameter distinguish between the variations of Play, such as Add (to beginning), Add (as next to play), Replace (shuffled), etc.

3. New variations of Play needed
Some new variations of Play (that currently don't exist in the GUI), are strongly needed as well:
* Add (No dupes) - Adds the files, skipping any that are already in PN list
* Add (Shuffled, no dupes) - Same as above, but shuffles new files going in.
* Remove - Removes any instances of these files from the Playing Now list.
It would be great if these choices also exist in the GUI.  The Remove option is especially important!!  If you do #1 (the PreventDupes property), then I could live without the two new flavors of Add, but still need Remove.

4. Smartlist control
As requested before, I need to be able to read and write smartlist definitions (query strings). If the smartlist being modified is the current basis of A View Filter (i.e. View menu/View Filter/Show Only or Hide), then changing the smartlist query string via Automation should affect the files returned by CMJSchemeAutomation.GetFiles() and CMJViewItemAutomation.GetFiles().

5. Add new method CMJFilesAutomation.SaveToDisk(filename)
Write all the files in this collection to the given filename (as when saving a playlist via the menu command File / Export playlist.  NOTE: I prefer to add this to CMJFilesAutomation instead of CMJPlaylistAutomation, so that you can do CMJAutomation.Search(), then call Sort(), then SaveToDisk(), to get a list based on arbitrary filter criteria, and without having to iterate through it myself, which is very slow (I am doing out-of-process calls via MCIO plugin).

6. Parameterize CMJFilesAutomation.Sort()
This method should take an array of field names to sort upon, or a string containing delimited field names to sort upon.

7. Ability to set the current View Filter
I suggest making a new CMJViewFilterAutomation object, with read/write properties that define the playlist filter for show and hide, as well as the boolean properties under this menu.  I would like show and hide to accept arbitrary filter strings, but could work around it by setting it to a smartlist, then programmatically changing the smartlist filter (#4)

8. Add new method CMJCurPlaylistAutomation.Clear(n)
This method clears the Playing now list. The parameter can be 0: all files, 1: leave playing file.

9. Add new method CMJCurPlaylistAutomation.GetFiles()
This returns a CMJFilesAutomation collection containing the current contents of Playing Now.  This, would be useful to allow one to do playingNow.GetFiles().Sort().Play(replace) sequence to re-sort the PN list using any sort criteria.

10. Need property to distinguish Playlist from Playlist Group
When iterating through the tree of Playlists, it is currently not directly possible to tell if a given CMJPlaylistAutomation object has children. This one is low priority for me, personally.

11. New method: CMJPlaylistAutomation.AddFiles(CMJFilesAutomation)
Adds all the files in the given collection to the given static playlist, all at once.

12. New method: CMJPlaylistAutomation.Clear()
Removes all files from the given static playlist.

13. New method CMJAutomation.SendKeys(string or integer)
Sends the key keycode (integer) or string of characters to the application as if you had typed it. This is like the MCC_KEYSTROKE command.  Basically, I think that anything you can do via MCC commands should also be possible via Automation (and visa versa, as much as feasible). SendKeys() strikes me as potentially very useful.

14. Hairstyle
For now, I've implemented my own Hairstyle-like thing in JavaScript + DHTML, because Hairstyle is not flexible enough.  To make Hairstyle great, it needs Automation support. Examples include: Jump directly to a node in Hairstyle tree, given a path. Control over which kind of Play (or DoCommand?) occurs when you select a node. Ability to add my own nodes to the tree which call a function in my code when selected, etc.

15. Misc
Automation SDK should provide a way to create and manage Scheduled events, TV tuner and recorder, line-in recording, multi-zone support, etc.  I haven't thought about these as much, yet.

16. Allow out-of-process access to Automation SDK
I use JHC's "Media Center Inside-Out" plugin for this, but is very slow at iterating through large collections (about 160/second on a 2.5GHz box).

Conclusion
I realize this is quite a list, and I thank you for giving attention to this. I listed them roughly in order of my priority.  I would say that #1-4 are critical for my current project, and #5-7 are "very important". I think many of these suggestions will be useful to others using the SDK, as well.

Thanks a million,
Howard
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42323
  • Shoes gone again!
Re: Excellent additions to Automation SDK
« Reply #1 on: June 25, 2003, 01:08:14 pm »

Thanks... all good ideas.

One comment is that you can do a lot of what you want already -- you'll just have to write a bit more code.

For example, you can plug through the CPLDB file-by-file and add / remove / track duplicates.

Also, if you want more control than DoCommand(...), you can GetFiles(...) and then do whatever you want with them.

Anyway, thanks for the ideas.  We'll see what we can do.
Logged
Matt Ashland, JRiver Media Center

Soundman

  • Regular Member
  • World Citizen
  • ***
  • Posts: 155
  • Go Music!
Re: Excellent additions to Automation SDK
« Reply #2 on: June 25, 2003, 06:10:30 pm »

Matt,

Thanks.  You're right that much of this can be done "manually", and I am fully prepared to do that. The main problem is performance.  I am using JHC's Inside-out plugin to gain out-of-process access to the Automation SDK.  But iterating through collections is terribly slow (at best, maybe 160 items per second).  To get around this, I will have to write my own plugin and communicate with interpocess communication.  I can do that, but not easily.

Also, while all of these requests pertain to the SDK, some of them should really be in the GUI anyway.  For example, when browsing my music library, if I pick a playlist, and say "play all these," and later decide I don't want any music having bagpipes, I want to navigate to the bagpipes playlist, right click on it, and say "remove these from PN".  Right now, this is next to impossible to do, but I find myself wanting to do it frequently.  Another example is that I would prefer to put the PN list in a "no dupes allowed" mode, then add stuff willy-nilly to it without regard to whether some of the selected tracks are already there.

Then of course, there are those things that can't be done using the SDK now. Those would naturally be the more important.

Anyway, thanks for considering suggestions.  I hope you all get the time to do some of them.

My highest Regards,
Howard
Logged

Soundman

  • Regular Member
  • World Citizen
  • ***
  • Posts: 155
  • Go Music!
Re: Excellent additions to Automation SDK
« Reply #3 on: July 31, 2003, 07:40:56 pm »

Bump!

I read on the forum that you are finishing up MC9.1.  Please don't forget the Automation SDK enhancements. Of my long list, I *really* need Numbers 2, 1, 8, 7 (in that order or priority).

For #1, you could just do "RemoveDupes()" to execute the command that you already have on Playing Now's right-click menu.

I just hope that you haven't decided to put all this off to v. 10.

Thanks!
Logged
Pages: [1]   Go Up