Page 1 of 1

Auto-DJ scripts

Posted: Wed May 02, 2007 9:59 am
by jiri
Starting from MediaMonkey 3.0 alpha 4 there will be support for custom Auto-DJ scripts, i.e. developers will be able to create their own engine for track selection. You can read more about it in http://www.mediamonkey.com/wiki/index.p ... DJ_scripts

Jiri

Posted: Wed May 02, 2007 10:44 am
by Teknojnky
Wow, nice suprise.

Look forward to seeing alpha4!

Posted: Tue May 08, 2007 3:23 am
by trixmoto
This looks like it could be useful, but more so if "GenerateTrack" actually returned a list of tracks to be added. Is this possible?

Posted: Tue May 08, 2007 3:49 am
by jiri
The idea is that the function would always return one track and in case in has more results to return, it would 'cache' them (i.e. store in some variable internally) and return when its called the next time. Is it ok?

Jiri

Posted: Tue May 08, 2007 3:51 am
by trixmoto
Oh yeah, that would work! :)

Posted: Tue May 08, 2007 5:19 am
by psyXonova
So, let me get this straight....

Suppose I have set-up my MM3 to automatically maintain 10 following tracks in the now playing list and I choose to play the last song...
Will GenerateTrack be called sequentially 10 times???

Another question, is there a way for the script to know how many tracks will be maintained it the now playing list?

Finally, a question I should have asked a long time ago; is there a way to know whether a volume is online (e.g. a USB disk is plugged and activated)? Is it possible to add an event that will inform of such changes (when a volume goes online or offline??)

Posted: Tue May 08, 2007 7:51 am
by RedX
jiri wrote:The idea is that the function would always return one track and in case in has more results to return, it would 'cache' them (i.e. store in some variable internally) and return when its called the next time. Is it ok?

Jiri
I personally would fint it a bit a waste of time since ive got all the next X songs i need. Why not enqueue them at one?

Is it to complicate to use internally a SDB playlist?

Regards,
Red

Posted: Tue May 08, 2007 8:15 am
by trixmoto
I'd have thought SDBSongList would be better than a playlist. I'd like to turn my AutoAlbumDJ script into a script of this type, but can't if it will only add one track at a time.

Posted: Wed May 09, 2007 6:38 am
by jiri
My point was, that if user configures MM to always maintain the next 3 tracks in NP window, then MM should handle this somehow. If MM asks a script to return tracks in a list, it can easily return different number, like 10 and it isn't clear what MM should do then - forget about the next 7 tracks? remember them and use the next time?

I still don't see the problem with the current implementation - the script can very easily remember unused tracks and return them the next time. It's about some 2 lines of code while giving the script maximum flexibility, don't you agree?

Jiri

Posted: Wed May 09, 2007 8:26 am
by RedX
ok now i see your point, it means that if 5 songs are to stay enqueued and the user is on the last track then the script will call enqueuetracks 5 times.

Yes this would work aswell :)

Posted: Wed May 09, 2007 9:30 am
by trixmoto
Yeah, this makes sense! :)

Posted: Wed May 09, 2007 2:13 pm
by psyXonova
So, is there a way for the script to know how many tracks will be maintained it the now playing list?
I think this is important...

Posted: Wed May 09, 2007 5:41 pm
by jiri
What I meant was that MM will call that method enough times to get as many tracks as necessary. In case the script has >1 track to be returned, it can easily store it in a list a return these tracks later.

Jiri

Posted: Wed May 09, 2007 5:59 pm
by RedX
i have some ideas i'd like to present for the future version of MM3, should i PM it to you or rather post it somewhere?

Thx,
Red

Posted: Thu May 10, 2007 4:19 am
by jiri
E-mail it to me.

Jiri