View Issue Details

IDProjectCategoryView StatusLast Update
0002889MMW v4Now Playingpublic2010-10-25 19:08
Reporterrusty Assigned To 
PriorityurgentSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Fixed in Version3.0 
Summary0002889: Integration of Auto-DJ type scripts with Auto-DJ
DescriptionThis feature would would allow a script developer to interface Auto-DJ to a recommendation engine so that rather than just using an AutoPlaylist, MM could use a recommendation engine as the source for tracks played via the auto-dj. That would make it much easier for auto-dj type script developers since they could use the Auto-DJ framework to enable/configure the feature, and would give end users a better experience.

Comments from psyxonova:
I have already coded SDj to add more than one track at a time in Now Playing list. How can we achieve the same thing using AutoDJ?? Perhaps AutoDJ could take tracks from a playlist that is maintained by a script. In such scenario AutoDJ could expose a playlist to the script, and the script should submit any new songs to this playlist.


Here's a potential idea for implementing this:
--------------------------

[ ] Enable Auto-DJ
    Add tracks from: ______________________^ (Entire Library, Playlist, xxxx DJ plug-in,...)

    -------this-section-is-customized-depending-on-the-above-selection-------

e.g. Entire library -- nothing appears

     Playlist -- Playlist: __________________________ [Choose]

     Scrobbler DJ -- Seed: ___________________^ (Now Playing Tracks, Playlist)
                         Playlist: _____________ [Choose]
                       Minimal Match: __%
                       Limit same artist: __m
                       Show lookup status: __ s
                       Timeout after: __ s

     Music IP -- Seed: ___________________^ (Now Playing Tracks, Playlist)
                         Playlist: _____________ [Choose]
                       
     Album --
     --------------------------------------------------------------------------
     
     Maintain at least __^ ____________^ (tracks, Albums)
     Limit tracks to Rating >= ______________^
     
TagsNo tags attached.
Fixed in build1031

Activities

jiri

2007-04-19 15:32

administrator   ~0009056

I agree with the proposed solution. Whenever user changes selected AutoDJ engine, there would be another panel shown below. Since we don't have unlimited space and some plug-ins might need a lot of configuration, I'd leave there a space for a single configuration line only (as currently our Playlist handling needs) and in case a script needs more, it can add something like 'Configure' button and open its own dialog with details.

Technically, things needed to do:
1. This special type of script will be designated as type 4 and loaded by Scripts.pas (managed in customScripts variable).
2. When user selects a script to be used for Auto-DJ, it will be loaded into memory and will stay there while AutoDJ (and this script) is active. See FormAutoTag.pas for details, a similar code there is:

  // Initialize script for searching
  RunningScript := TScriptExec.Create( ConcatPaths( ScriptDir, RunningScriptName), '');

3. When a new track(s) is needed, the current script will be called (its GenerateNewTrack function), again using mechanism from FormAutoTag.pas:

  // Really start the search
  v := VarArrayCreate([0, 3], varVariant);
  v[0] := backpanelCOM as IDispatch;
  v[1] := CBSearch.Text;
  v[2] := suggartist;
  v[3] := suggalbum;
  RunningScript.SC.Run( 'StartSearch', PSafeArray(TVarData(v).VArray));

4. Scripts shouldn't be called from a thread (just a warning...)

5. Configuration of scripts will be as follows: When Auto-DJ sheet of Options dialog is openned, the list of existing Auto-DJ scripts (i.e. type 4) is added to 'Add tracks from:' dropdown.

6. When another script is selected in 'Add tracks from:' dropdown, it will be loaded (warning: if it's also the currently used script, it is already loaded, so this loaded instance will be used!!!) into memory and called InitConfigSheet() procedure with argument Panel - which will be TSDBUITranspPanel variable - just as in FormAutoTag.pas.

6. When another script is selected there, or Options dialog is closed, CloseConfigSheet() procedure of script is called (with proper parameter specifying whether user already pressed OK button or not).

That should be it, a sample script is commited to SVN to Scripts\AutoDJSample.vbs, it can be used as a template for testing and could be also slightly expanded in functionality.

Ludek

2007-05-02 10:11

developer   ~0009092

All completed at revision 2806

rusty

2007-05-02 14:21

administrator   ~0009096

Jiri, before we close this, can you update the wiki with documentation about the feature and a sample script?

jiri

2007-05-02 15:00

administrator   ~0009097

Completed, it is in Wiki and announced in forum.