![]() |
#1 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
ATF Extender
Will let you use stuff like '%rating%' and %ratingstar%' and playcount etc in your ATF settings for your playlist
Its built to not hammer your drive to query the length of a song if it is in your media library, similar to how the ML does it. It uses a much more efficient method of doing the formatting of tags, which I will carry over to gen_tips and gen_toaster. gen_script1 already uses a similar method and wont need to be changed. I think theres a couple tags missing, let me know if theres anything missing from this that is available with the standard winamp ATF. I will modify it later to give prettier display for stuff like last played etc. |
![]() |
![]() |
![]() |
#2 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
screenie
screenie
|
![]() |
![]() |
![]() |
#3 |
Major Dude
Join Date: Mar 2004
Posts: 991
|
awesome(i had wanted ratings and playcounts in the playlist for a while now, lol)
now all we need is a plugin that lets us save multiple atf strings with easy access from context menu i know you can shorten things by a certain amount of numbers in atf, but would it be possible to make it 'short enough to make room' so its like 'only shorten if the next tag will be cut off' so you could have ratings at the end of songs without the fear of them being hidden with long song titles...maybe like %autosize(%title%)% or something(i suppose i could just count how many letters my playlist window holds and subtract by 5 though) also, could you include a list of the new commands? edit: sorry to be rude, but what are the two numbers(the one in front and then the one in parenthesis) in your atf string? There is no reset button on life... but the graphics kick ass |
![]() |
![]() |
![]() |
#4 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Basically the same things as gen_toaster, but without the cmp: and other extensions. Also doesnt have things like channels and whatever.
It works in exactly the same way as the ml title hooking, only it also looks at the extended info (ie all the other fields in the media library, lastupd, lastplay, rating, playcount, dbidx, bitrate, type, filesize, filetime) |
![]() |
![]() |
![]() |
#5 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
v0.2
Forgot the %filename% tag. Also using libctiny to reduce filesize. Fixed ATF formatting method a bit. Last edited by shaneh; 15th September 2004 at 09:30. |
![]() |
![]() |
![]() |
#6 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
Suggestions and questions
code: Are you using 1 or 2 in the following list in Toaster plugin? 1. #define IPC_GET_EXTENDED_FILE_INFO 290 //pass a pointer to the following struct in wParam 2. #define IPC_GET_EXTENDED_FILE_INFO_HOOKABLE 296 I guess IPC_GET_EXTENDED_FILE_INFO_HOOKABLE will give you more info normally not available, like giving you the foldername if album is not set as metadata. You need to use this when parsing %lengthf% in your ATF parser. It will let you get the length of any file. Using SendMessage(hwndWinamp, WM_WA_IPC, 1, IPC_GETOUTPUTTIME) only gives you length in seconds of currently playing song. code: |
![]() |
![]() |
![]() |
#7 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
In what package is msvcr71.dll included?
|
![]() |
![]() |
![]() |
#8 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
I dont understand what that first bit of code was pasted for? This plugin hooks things a little different to that, it uses the ML hook title technique. It basically does a quick ml lookup for the file, then does ATF formatting on that. It does no other lookups, it pulls everything from the inital lookup. If it can't find it in the ML, it doesnt hook the title.
Toaster is currently a little bit broken in the way it does ATF stuff, I will fix it soon. I dont use IPC_GET_EXTENDED_FILE_INFO because it causes winamp to read the ID3 stuff out of the file. The hookable version causes the ML to intercept and give the info, which is much faster. Done correctly, you dont need to use the GET_EXTENDED_INFO at all, this means you only need to do one ML lookup, and no file access. So I will be changing it to not do any GET_EXTENDED_INFO unless it cannot be found in the ML. I do not use IPC_GETOUTPUTTIME (or if I do, I will change it) at all because it causes winamp to scan the file for the length. EDIT: is msvcrt71.dll required for this? I thought I compiled it in a manner that it wouldnt be. EDIT: Yeah I do use GETOUTPUTTIME in Toaster at the moment, but asI said its a bit broken, and Im about to make quite a lot of changes to the ATF handling which will make it much better. Last edited by shaneh; 15th September 2004 at 12:36. |
![]() |
![]() |
![]() |
#9 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
Hmm...
I pasted the first bit cos' I thought you were using this to hook titles
and wanted a response on this. I have to read through the ml_ipc.h to follow the Media Library discussion. [b]Re: IPC_GET_EXTENDED_FILE_INFO[b] IPC_GET_EXTENDED_FILE_INFO resolves into a call to "winampGetExtendedFileInfo" located in the input plugin that handles the file extension of the file you query metadata for. The "winampGetExtendedFileInfo" function is responsible for returning the metadata to Winamp, when Winamp calls it. This is the reason why it it generates disk traffic. Other functions exported by input plugins used with metadata is: code: Hope this gives you a better understanding of it. I have attached a plugin that tries to use most of the IPC_* calls. Source will be available soon... |
![]() |
![]() |
![]() |
#10 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Yeah I know what it does, thats why I dont use it. I use the hookable version instead, as the media library intercepts it and does a db lookup which is cached in memory and much faster. It only resorts to disk reads if its not in the ml.
This is the code to this plugin, I will update it over time to 'pretty up' some of the other tags.: PHP Code:
|
![]() |
![]() |
![]() |
#11 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
ML_IPC_HOOKTITLE and IPC_HOOK_TITLES is two sides of the same thing basically. ML_IPC_HOOKTITLE is trapped in ML and IPC_HOOK_TITLES is trapped *by* Ml. I see.... gotto go. Be back tomorrow!
|
![]() |
![]() |
![]() |
#12 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
The advantage of doing within the ml is:
1. You know the ML is loaded and can query for meta data. 2. You get a chance to hook the titles before the ML does. Hooking IPC_HOOK_TITLES means you have to disable the option in the media library to hook titles, or get in first before the ML does. |
![]() |
![]() |
![]() |
#13 |
Major Dude
|
shaneh,
this seems like a great way to show ratings/playcounts/etc in the playlist. my only complaint is that the information for a track isn't showed until it's played. i'm sure, most people would prefer all the data being displayed immediately, if possible. the first thing i thought when i was playing around with it was that i wish there was a way to rate a song in the playlist and have the change show up. |
![]() |
![]() |
![]() |
#14 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
That is dependant on your settings in winamp. Set it to 'read metadata when played or viewed' under Titles in preferences. Im pretty sure it would behave the same for any custom ATF setting with or without this plugin.
As for having the rating change show up, you will need to do a 'read extended info on selection' after making a change. It is a limitation on the rating mechanism built into winamp that it does not re-read the title after a rating change. I may make it look for 'rating change' messages and manually do a re-read, as I suspect this to be a common issue. It would be nice if winamp supported this natively anyway, I have examined the code in the ML and it is almost identical, bar the 4 or 5 lines extra required to get the additional info. Makes you wonder. |
![]() |
![]() |
![]() |
#15 |
Major Dude
|
shaneh, my title preferences were already set like that, but I retried it again, with the same results. I'm running a clean install of 5.05, on XP Pro.
I'll go into Local Media in the ML, double click a random song to play it and load all the other songs in the view, into the playlist window. Ratings/Playcounts won't display next to the song until the track is played. Hope that helps... |
![]() |
![]() |
![]() |
#16 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Ah I see. The important bit there is your'e doing it through the ML. If you enqueue files from the open or add dialogs of winamp, you will not get that.
It would appear the ML is skipping the hook when enqueing stuff, because it 'thinks' it knows how to do it best (by enqueing stuff with the title already formatted). I suppose I can hook the enqueue and modify the title, that is the only real way to do it. I dont think there is a setting to stop the ML from doing that, or tell Winamp to ignore pre-formatted titles. Alternatively, you can enqueue stuff by writing a 'sendto_' script which enqueues it through winamp rather than internally through the ML. --sendto_enqueue and play.vbs--- x = GetSendToItems if ubound(x) > 0 Then plpos = playlist.count + 1 for each track in x track.enqueue next playlist.position = plpos play End If quit |
![]() |
![]() |
![]() |
#17 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Alternatively, this version nulls the meta data associated with the enqueueing so that winamp will re-read it.
It will affect all plugins etc that enqueue stuff with pre-formatted titles however. |
![]() |
![]() |
![]() |
#18 |
Major Dude
|
![]() |
![]() |
![]() |
![]() |
#19 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
It looks like we plugin developers constantly needs to hack Winamp into pieces to achieve what we want. Winamp should natively support more tags in the ATF string for the playlist, maybe give us an API for extending it. If Nullsoft would give us part of the source-code for the core, it would have helped a lot. Bu until this happens we must struggle with plugins competing over the control over Winamp (mainly subclassing issues). The last plugin to get in and subclass is the one that has the control. And the last ML plugin to be called has control over the formatting. And there is no way to tell ML in what order to call plugin's PluginMessageProc.
|
![]() |
![]() |
![]() |
#20 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Well only one plugin should be doing the formatting anyway. Having competing plugins that do the same thing installed is a bit silly. Unless they are configured to handle different types (ie one for .mp3 one for .avi etc). Plugins should have the option of being disabled, configured or uninstalled if a user wants to use a different plugin to do the task.
I agree that the ML should do some kind of lookup for undefined tags. ie. if it encounters %rating% and doesnt handle it internally it should do a IPC_GET_EXTENDED_INFO or something for that meta data. But all it really saves you is the implementation of doing the ATF stuff, which isnt too hard and gives you a lot more control of how you want to format the titles. With the implementation I have here, it is actually a lot more efficient than if the ML passed undefined tags around, as it requires only one ML lookup per file, doesnt do lots of SendMessage calls for each file etc. With this implementation, you can extend the ATF tags by simply adding fields to the ML for the items. This impl will look them up to see if they exist. I dont know why the original ML implementation doesnt do this, it requires barely any extra code. |
![]() |
![]() |
![]() |
#21 |
Banned
Join Date: Mar 2001
Posts: 1,027
|
Another very cool one Shaneh, thanks.
|
![]() |
![]() |
![]() |
#22 |
Banned
Join Date: Mar 2001
Posts: 1,027
|
Cool, this got me into using ATF, something I have never done before. This is my current setting:
PHP Code:
![]() 1. I tried setting up a %ratingstar% field like in shaneh's screenshot. I figure the rating goes up to 5 stars, so I would have the rating plus a single space padded to 6 - this way there was 0-5 stars (with a number of spaces equal to the number of stars NOT present) and then one space to set them apart. The thing is, as stars go in, they push that title *ever so slightly* to the right. I would guess this is from the width of a * being slightly more then the width of a space. You dont appear to be suffering this in your screenshot shaneh, how did you do it? 2. My second problem has to do with my track number string, and I have tried a million variations. Heres the lowdown. I have it set so that if there is an album, and if there is a track number, it will display it, if not, it wont. The problem arises when there is an album and no track number. What I want to happen (and have it set to) is that only a "- " would be displayed, but what is displayed is [429467295]. Im dead serious. I have a playlist full of it. What appears to be happening is that the ML is guessing at the tracknumber, even though I have the ML set to guess only if ALL metadata is missing, and im talking about songs that have an album tag but no track number. The odd thing is if I take off the $num pad around the track number, in the offending entries (the ones that have an album tag but no tracklist tag, that should show simply a dash) show the bastardized guess of the ML, which ends up usually being a [-01] (remeber the ML is set NOT TO GUESS in this case.) Can anyone make sense of this madness? [EDIT] I figured it out. Winamp and the ML are behaving fine, its a bug in ATF extender. Upon removing ATF extender, and removing the ATFe specific tags out of my code so it is just: PHP Code:
I probably would never use the ratings, but I would have liked to have the playcount...hopefully you can fix this weird shit, and if not you at least made me try ATF! [EDIT 2] You beat me to it, lol. Figured it out before I did ![]() Ah, change the font. I will, but first I must go to bed. I've literally been fucking with ATF for an hour and a half, trying to figure out what was going on! I keep bringing up my PL just to look at it - its gorgeous! [EDIT 3] Code -> PHP to fix forum breakage. While I'm obesessing over the perfection of my Pl, is there a way to get the PL's entry numbers to have leading zeros? Also, can you post/pm/email me your ATF string that you showed earlier, so I can nail down this rating view. Seriously though, bed now. Last edited by D&B; 21st September 2004 at 09:46. |
![]() |
![]() |
![]() |
#23 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
1. Monospaced font. (Courier etc). Edit pledit.txt.
2. Seems like a problem with ATF extender. It doesnt do much error checking, I will have to check if the fields exist before returning them. I think -1 is returned when the track isnt found. Will post an update soon which fixes that. |
![]() |
![]() |
![]() |
#24 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
v0.4
Fixes the problem with missing meta data showing up as -1 and other missing meta data.
[edit, that ATF string looked something like] $pad(%ratingstar%,5)$pad(%playcount%,2) $if2(%title%,$filepart(%filename%))[ - %artist%] Last edited by shaneh; 21st September 2004 at 10:45. |
![]() |
![]() |
![]() |
#25 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
What about creating a configuration dialog for your plugin where people can customize how ATFExtender extends the playlist title formatting. Maybe have a preset library so people can select a ATF string and it will appear in the Title page. I think you must write to winamp.ini to do this.
And give people a place to write huge ATF strings like in foobar2000. Just hopes and ideas... |
![]() |
![]() |
![]() |
#26 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
This plugin currently uses 'NULL' which means to use the one specified in Winamp prefs, but you can use anything you like, even have alternating ones if you really wanted to. You would need to write to winamp.ini to have it appear in the prefs, but you can just ignore it and use your own settings if you wanted. (except if the item isnt found in the ml, this plugin defaults to letting winamp handle it, which uses the default ATF spec from the prefs).
I wish ATF had some kind of $leftpad that padded from the left instead of the right to achieve right alignment. I may make some special tags which do right alignment, plus tags which return padding depending on the width of the playlist etc. |
![]() |
![]() |
![]() |
#27 | |
Banned
Join Date: Mar 2001
Posts: 1,027
|
Quote:
Don't have time to test new version, will this evening. Off to school. |
|
![]() |
![]() |
![]() |
#28 |
Banned
Join Date: Mar 2001
Posts: 1,027
|
Alright, your new version fixed all my problems! Awesome, thanks!
Special alignment tags and tags that consider the width of the placelist would be truly great if you could do them. How about a tag that produced the playlist item number? This would be useful because we could turn off the built in one then do any operations on it we wanted (such as padding) and place it whereever we wanted! Oh, playing around with ATF has given me renewed momentum to fix all my ID3 tags. What sofwtare do you guys use for intense (mass) tagging sessions? |
![]() |
![]() |
![]() |
#29 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
I just did a quick check and it seems it would be possible to put the playlist index in there, so probably will.
Tags that are dependent on the width of the playlist could be tricky, esp as the playlist can change width at anytime, you would have to re-read the info everytime you re-sized. But I guess thats to be expected. I will probably do something like %spaces30% which produces whitespace for 30% of the playlist width or something. And maybe %rpad:artist:30% or something. Dunno, will work it out as I go along. The trouble is, ATFE only intercepts formatting if the item is in the ml. If it doesn't, it lets winamp handle it. This is fine because it currently works the same way, with the only extensions being ML only extensions so if the item doesnt exist that extra info wouldnt be available anyway. If I wanted to handle extra stuff I would have to format tags of stuff not in the ML. This is fine, but makes it a fair bit more complicated, especially with regards to streams. I use musicbrainz.org for tagging. IMHO it is the best tagger around when you are missing ID3 info. Its kinda slow as it does lookups and analyses the actual music data rather than just filename and id3 info etc, but is very thorough. If you are mass tagging from filename->ID3 you may be better off with something else. |
![]() |
![]() |
![]() |
#30 | |
Banned
Join Date: Mar 2001
Posts: 1,027
|
Quote:
For the other stuff, if it is too tough/impossible then oh well. Its already very cool. As far as tagging, thanks for the link. With MusicBrainz and Mp3Tag I have all the help I'll need. |
|
![]() |
![]() |
![]() |
#31 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Ive added a plpos and renum tag. These work ok, but keep in mind that if you move items about these numbers will be wrong until you re-read the info. So its kinda dodge.
The renum tag is a bit tricky in that its not related to the playlist position but will just count up until it sees a X: filename (separator) then will get reset. See the following screenshot. I might improve this a bit to use a number one more than the previous entry, unless the previous entry is a separator. There is a subtle difference between these two approaches. Either way, because it doesnt really reflect the actual number in the playlist, it may be of limited use anyway. |
![]() |
![]() |
![]() |
#32 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
screen
The separators were added using the scripting plugin in-case anyone is wondering.
[EDIT] That renumbering and playlist number stuff is quite broken, probably best not to use it. Dont bother with bug reports about it. I dont think there is a practical way to implement it the way I want. oh well. |
![]() |
![]() |
![]() |
#33 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
Note: You must turn off playlist indexes in Winamp preferences for the plpos and renum tags to look all right.
|
![]() |
![]() |
![]() |
#34 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
plpos and renum are terribly broken anyway, playing a file will give you random numbers instead of the proper index. Fixing it would involve some ugly hacks, and IMHO not worth it. Your'e better off using the previously posted version (0.3).
|
![]() |
![]() |
![]() |
#35 | |
Banned
Join Date: Mar 2001
Posts: 1,027
|
Quote:
I also was gonna suggest (well, someone brought it up earlier), some sort of functionality where we could have multiple ATF strings that could be easily selectable, but then I thought of the same problem you are hitting here, the fact that the changes would show until each individual song was reloaded. So, I dont know. All I know is I am enjoying 0.3! |
|
![]() |
![]() |
![]() |
#36 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Actually v0.4 is the one to use, but it looks like I forgot to increase the version number. Basically for now just use the one from:
http://forums.winamp.com/showthread....08#post1476908 until I update it again. |
![]() |
![]() |
![]() |
#37 |
Senior Member
Join Date: Sep 2003
Posts: 333
|
I can only get it to work if I enque the files from a media library smartview, but not a playlist. Despite this, the tooltops still displays info, but the playlist titles are blank. Any ideas?
|
![]() |
![]() |
![]() |
#38 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
The Media Library adds the items with metadata (titles) so the PL does not request more info on them, thus leaving Shaneh's plugin out without a say.
EDIT: I ment with playlists from the ML. Last edited by saivert; 29th April 2005 at 11:33. |
![]() |
![]() |
![]() |
#39 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Actually, ATFE intercepts adding items with titles such as used to enqueue items from the ML, and resets them so that winamp requests them.
From a playlist however, the extended info (ie the playlist title) is saved with the playlist and used when populating the playlist - it doesnt seem to fire that message when adding each item. Just select all the items and click 'read extended info for items' and it will be re-read. You can then save your playlist with the new titles. Alternatively, you can edit your playlist files to not have the #EXT stuff so that winamp reads the titles from the files on load. |
![]() |
![]() |
![]() |
#40 |
Forum King, M.D.
|
any chances for update? like %dir% and %parentdir% ? i.e. the rest of tags from your toaster list?
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|