Old 19th February 2002, 21:26   #1
OReubens
Junior Member
 
Join Date: Feb 2002
Location: Belgium
Posts: 44
Playlist plugin (was on WA3 Discussion)

---
This question is also on WA3 Discussion (by mistake). Not trying to deliberately crosspost :-(
Mea culpa, mea culpa, mea maxima culpa.
---
Is it at all possible to write a playlist plugin ? I didn't see playlist listed in the possible plugin types...


Feature A, randomising with "favourites")

Basically, I'd like to make a system with "better" randomisation. Allowing for "favourite" songs which will get played more often than others.
The idea is that any song you add to the playlist will have a default "preference" of say 10. If you have 5 songs rated 10, then each one is just as likely to get played. If you have 5 songs at 10, and 1 at 50, basically, that one song will get played half of the time.
I've already have the code for this randomising scheme worked out, I know it works :-)

This of course would require:
1) Access to the playlist randomiser
2) Storage of preferences (I'm assuming the XML database can handle this)
3) Display of preference value in the playlist. (extra column)
4) Extra buttons (or something) allowing to to increase/decrease preference. Preferably in a way that won't require special purpose skins, and won't prevent users from using any skin they like.
5) An additional config panel/dialog where the user can specify some additional playlist settings (like default preference value, whether or not to allow a song to be played twice in a row ...)

It would allow people from jukeboxing their entire music collection non-stop, and still have fav songs played more often.


Feature B, linking songs)
Two songs on a CD are sometimes "linked" together, one song flowing into the other. The randomiser should have an ability to link songs so that song 2 will always follow song 1, (and any other followups).


Feature C, Album randomising)
Play all songs of an album in sequence, then jump to another album.


I Can think of some more playlist issues. But I'll stop for now ;-)

OReubens
OReubens is offline  
Old 19th February 2002, 22:11   #2
soundsys
Senior Member
 
Join Date: Oct 2001
Location: Rennes (France)
Posts: 156
Send a message via ICQ to soundsys
Talking Possible

It's possible.

---
You can take control of a core. This is the raw bad solution.
Register a corecallback to the core
Each time the core need next file it'll ask you
You'll tell it : this is the next file.
---

But, team nullsoft have a better solution for you:
ItemSequencerI and
ListSequencer (I think you should derive from this one)

Please have a look at sequence.h and sequence.cpp for more info.

Once you' ve done this use the api: //api.h
int core_registerSequencer(CoreToken core, ItemSequencer *seq);
int core_deregisterSequencer(CoreToken core, ItemSequencer *seq);

core=0 is the main core (CoreToken is an integer)

For all the UI stuff:
a contwnd (or a StylePosWnd) wich include:
a listwnd.
as many buttonwnd as you want.
// see associated *.h and *.cpp


Hope this help

Soundsys
soundsys is offline  
Old 20th February 2002, 21:45   #3
OReubens
Junior Member
 
Join Date: Feb 2002
Location: Belgium
Posts: 44
Not working ? or ?

I've got a few questions about this core_registerSequencer().

I've created a WAC that calls:
api->core_registerSequencer(0, &ListSeq);

ListSeq is a static object derived from ListSequencer
At current, it just shows a debug message and calls the default ListSequencer functions.

3 problems...

1) Nothing seems to happen. My functions in ListSeq never get called.
2) At winamp exit, it crashes with an access violation it is related to core_registerSequencer. If I don't call this, the crash doesn't occur.
3) If I look at what WA's ListSequencer does... I'm not getting the impression it's patching into the play-order of the normal playlist... I'm not sure what I'm supposed to think of it.
OReubens is offline  
Old 21st February 2002, 16:55   #4
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
Re: Not working ? or ?

Quote:
Originally posted by OReubens
2) At winamp exit, it crashes with an access violation it is related to core_registerSequencer. If I don't call this, the crash doesn't occur.
[/B]
Are you calling core_deregisterSequencer() before the destructor for the base class (the one derived from WAComponentClient) is called? I have a feeling this needs doing (it can't be done in the destructor - WAComponentClient::onDestroy() is your best bet)

For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave.
|Musicbrainz|Audioscrobbler|last.fm|

Last edited by Russ; 21st February 2002 at 17:51.
Russ is offline  
Old 21st February 2002, 18:25   #5
OReubens
Junior Member
 
Join Date: Feb 2002
Location: Belgium
Posts: 44
Is the core_registerSequencer then an exception that doesn't get destroyed automatically as all other seem to be ?
Any particular reeason as to why ?
OReubens is offline  
Old 21st February 2002, 18:30   #6
OReubens
Junior Member
 
Join Date: Feb 2002
Location: Belgium
Posts: 44
Solved but.

Ok...

Degregistring in onDestroy makes the crash go away... Points to you there...

But I still don't see anything happening... What is this ListSequencer supposed to do (As far as I can tell, it's not tapping into the playlist). None of the functions in my registered listsequencer get called...
Or is this part not functional in Beta 3 ?
OReubens is offline  
Old 21st February 2002, 18:32   #7
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
I don't know, but I was working on a hunch, as the coreCallback registrations need to be destroyed before your wac is unloaded, and I've been playing with callbacks quite a lot recently. Anyhow, deregistering it before destruction isn't going to hurt.

For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave.
|Musicbrainz|Audioscrobbler|last.fm|
Russ is offline  
Old 21st February 2002, 18:33   #8
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
Sheesh... near-realtime discussion here . I haven't played with the listsequencer stuff, I'd have to ask someone who knows more about this .

For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave.
|Musicbrainz|Audioscrobbler|last.fm|
Russ is offline  
Old 21st February 2002, 18:43   #9
schweitn
Winamp3 Component Guuuru
Beta Team
 
schweitn's Avatar
 
Join Date: Dec 2000
Location: Milwaukee, WI
Posts: 1,068
Send a message via AIM to schweitn Send a message via Yahoo to schweitn
OK - Here is MY understanding of ListSequencer...

It is more or less for coming up with you're own playlist completely SEPERATE from the std. playlist editor... to really see how ListSequencer works you should take a look at ExampleDelta - it basically creates a playlist of songs on a website via XML. Very cool and should show you its intended use.

Now then, can you do what you're talking about with ListSeq? I don't know. I haven't touched that stuff too much. You might instead want to look at the svc_playlistReader and svc_playlistWriter templates. You might be able to hook in there - not sure. I think those service templates are if you are planning on creating you're own playlist editor to replace the one provided - which you may end up needing to do in order to do what you want.

Hope this gives you some fresh starting points.

Enjoy.

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
- Albert Einstein

Winamp 3 Projects | Winamp 2x Plugin Manager | Explorer Playlist | FileSystem Object | Shoutcast List | Sashimi
schweitn is offline  
Old 21st February 2002, 18:43   #10
OReubens
Junior Member
 
Join Date: Feb 2002
Location: Belgium
Posts: 44
Real Time

Hmm that real time thing. makes me wonder...
is there a dedicated IRC room for WinAmp developers ?
OReubens is offline  
Old 21st February 2002, 18:50   #11
Russ
Mostly Harmless
(Alumni)
 
Join Date: Jan 2001
Location: UK
Posts: 2,319
Well, if there isn't, then I can always set one up - I happen to run a small IRC net, and it's always nice to have some new users .

irc.phasenet.co.uk #wa3 if you're interested.

For long you live and high you fly, but only if you ride the tide, and balanced on the biggest wave you race towards an early grave.
|Musicbrainz|Audioscrobbler|last.fm|
Russ is offline  
Old 21st February 2002, 18:50   #12
schweitn
Winamp3 Component Guuuru
Beta Team
 
schweitn's Avatar
 
Join Date: Dec 2000
Location: Milwaukee, WI
Posts: 1,068
Send a message via AIM to schweitn Send a message via Yahoo to schweitn
There are... but none that I can get on right now... pesky corporate firewalls and all... besides - we'd like this visible for others to be helped by - don't we?

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
- Albert Einstein

Winamp 3 Projects | Winamp 2x Plugin Manager | Explorer Playlist | FileSystem Object | Shoutcast List | Sashimi
schweitn is offline  
Old 21st February 2002, 18:57   #13
OReubens
Junior Member
 
Join Date: Feb 2002
Location: Belgium
Posts: 44
OOh !

Bah, WASABI makes things too easy sometimes... ;-)

In just under 30min I can have svc_playlistWriter/Reader save/load a playlist into/from an SQL database.. Still can't make the songs play in any order other then the normal one though <sigh>
OReubens is offline  
Old 21st February 2002, 19:19   #14
OReubens
Junior Member
 
Join Date: Feb 2002
Location: Belgium
Posts: 44
Digging deeper, but not one step further.

I've now put debugmessages in each of the ListSequencer overrides...

getNextPlayItem, rewind, forward, onRegister, onDeregister, onNextFile, onTitleChange, onStarted, onStopped, onPaused, onUnpaused, onRewind, onForward, getNumEntries, enumItem, getCurrent, setCurrent, loop

Only onRegister and onDeregister ever get called.
OReubens is offline  
Old 22nd February 2002, 01:09   #15
LENZ.NET
Senior Member
 
Join Date: Oct 2001
Location: Australia
Posts: 291
Send a message via ICQ to LENZ.NET
Personally I find the stuff you guys are doing damn exciting. Good work.

(Sorry this serves no other purpose than throw out some mad props to people )

"Some dance to remember, Some dance to forget."
Spacer | Previewer |
LENZ.NET is offline  
Old 22nd February 2002, 07:46   #16
Aus
French Canadian
(Alumni)
 
Aus's Avatar
 
Join Date: Dec 2001
Location: A shiny Igloo.
Posts: 333
Send a message via AIM to Aus
actually, calling all your cleanup and closing code onDestroy is GOOD, because you might not exist after that. I think you get dropped from the ptr list which stores sequencers (and that ptrlist might not even exist anymore. ouch.) at that time. so yeah. kaboom.

Aus -- NoisePort.Org, chronicles of the french canadian alien (Temporarly down during the move).
Aus is offline  
Old 23rd February 2002, 08:11   #17
knole_z
Senior Member
 
Join Date: Oct 2001
Posts: 146
ive been having this problem since beta 2, except i derived from ItemSequenceI rather than ListSequence. only onRegister and onDeregister ever get called, and i cant change the normal order of playing.
id really rather not have to redo the playlist editor, all i want is to replce the shuffle algorithim with a more complicated (and probability based) one. i havent touched my project since beta 2 though, because i think i was told ItemSequence wouldnt be ready until beta 3. but i havent tried playing with it either yet...
anyway, if anyone gets anywhere with this stuff, let us know
knole_z is offline  
Old 23rd February 2002, 09:11   #18
OReubens
Junior Member
 
Join Date: Feb 2002
Location: Belgium
Posts: 44
Same here... Maybe they couldn't get it ready for beta3 and it'll be there in Beta4.

However I'm getting a strong impression that the ListSequencer doesn't tap into the regular playlist, but requires you to maintain your own list (not sure if it'll display in the regular playlist window though).
The getNumEntries, enumItem, getCurrent & setCurrent member functions are strong indications in that direction.
It also doesn't seem to have functions to know when the user added/removed songs to/from the list.
OReubens is offline  
Old 26th May 2003, 01:42   #19
gakkai
Junior Member
 
Join Date: May 2003
Posts: 3
Has anything more been done on this topic? I was planning to write a randomization tool like this, but I've been running into some problems -- has there been any success?
gakkai is offline  
Old 26th May 2003, 06:23   #20
knole_z
Senior Member
 
Join Date: Oct 2001
Posts: 146
i finished my project in the end and released it as queue sidecar. i ended up using the playlist queue rather than a listsequencer which worked really well. if you still want to write your own randomization routines you can actually write wacs that extend queue sidecar so that queue sidecar will ask you what songs to enqueue. if you're interested in that let me know.

Andy
knole_z is offline  
Old 26th May 2003, 07:33   #21
gakkai
Junior Member
 
Join Date: May 2003
Posts: 3
Wow, this is awesome. I checked out your example too. I think it might be cool to have a fully customizable module -- if you don't mind, I think I'll try to write some routines that expose the relevant parts (like xxSelector::select(), getNumPlaylistEntries, and the file name) so that users can write their own algorithms. I'll have to see what's in my capabilities. I'm new to wac programming, so I don't know how much I can handle.

By the way, is there a way to override Winamp's default behavior of double-clicking in the playlist playing the next enqueued song (as opposed to the song that was clicked)? Some kind of "play immediately" override would be cool.
gakkai is offline  
Old 26th May 2003, 07:59   #22
knole_z
Senior Member
 
Join Date: Oct 2001
Posts: 146
I don't really know what you mean by exposing functionality to users... the functionality already is exposed. You override select() to implement your own algorithim... well, provided the 'users' can code wacs in C++ . If you mean to make it scriptable or something, that would be cool too.

Unfortunatly, there is no way to fix that annoying bug in Winamp3. It has been reported as a bug, but I don't think anything has been done about it yet. The best thing to do is hold down [Ctrl]+[Alt] when clicking the track to insert it at the front of the queue, then hit next.
knole_z is offline  
Old 27th May 2003, 00:38   #23
gakkai
Junior Member
 
Join Date: May 2003
Posts: 3
I'm playing with ExampleSelector, and I'm having a problem -- whenever I'm running in the debugger, it crashes on exit with
HEAP[Studio.exe]: Invalid Address specified to RtlFreeHeap( 00850000, 012E1990 )
This happens even when auto-selection isn't enabled, and SimpleSelector isn't the selection method chosen. I can be debugging another wac file, but it still crashes so long as ExampleSelector.wac is in the wacs directory. Any suggestions? Thanks.
gakkai is offline  
Old 27th May 2003, 12:02   #24
knole_z
Senior Member
 
Join Date: Oct 2001
Posts: 146
I didn't know about that one, but I think I know whats causing it - I think the ExampleSelector component is getting destoyed before the QueueSidecar component, so when queue sidecar tries to delete the SimpleSelector* passed to it from example selector (it claims responsibility for deleting all the selectors) it is throwing an error. I just assumed that each wac's OnDestroy would be called before it was actually unloaded/destoyed, which seems reasonable to me. But then, I assumed each wac's constructor would be called before the first OnCreate() is called, and I was wrong there too.

Anyway, at least it isn't an issue with Queue sidecar unless people also have other selectors installed. I'll do some more digging soon and fix the problem. Thanks for pointing it out.
knole_z is offline  
Old 28th May 2003, 19:03   #25
Brennan
Monkey Hump Master
 
Brennan's Avatar
 
Join Date: Apr 2000
Posts: 782
Quote:
Originally posted by gakkai
By the way, is there a way to override Winamp's default behavior of double-clicking in the playlist playing the next enqueued song (as opposed to the song that was clicked)? Some kind of "play immediately" override would be cool.
Next version will have this as default behavior.


--Brennan
Brennan is offline  
 
Go Back   Winamp & Shoutcast Forums > Winamp3 > Wasabi Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump