Old 15th September 2004, 06:07   #1
shaneh
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.
Attached Files
File Type: zip atfext.zip (18.4 KB, 1229 views)
shaneh is offline   Reply With Quote
Old 15th September 2004, 06:32   #2
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
screenie

screenie
Attached Images
File Type: jpg screen.jpg (87.7 KB, 2081 views)
shaneh is offline   Reply With Quote
Old 15th September 2004, 07:08   #3
electricmime
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
electricmime is offline   Reply With Quote
Old 15th September 2004, 07:14   #4
shaneh
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)
shaneh is offline   Reply With Quote
Old 15th September 2004, 09:09   #5
shaneh
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.
Attached Files
File Type: zip atfext.zip (1.7 KB, 574 views)

Last edited by shaneh; 15th September 2004 at 09:30.
shaneh is offline   Reply With Quote
Old 15th September 2004, 12:03   #6
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
Suggestions and questions

code:

typedef struct
{
char *filename;
char *title; // 2048 bytes
int length;
int force_useformatting;
/* can set this to 1 if you want to force a
url to use title formatting shit */
} waHookTitleStruct;
// return TRUE if you hook this
#define IPC_HOOK_TITLES 850

LRESULT CALLBACK WinampSubclass(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{

LRESULT lres = (LRESULT)CallWindowProc((WNDPROC)lpOldWinampWndProc,
hwnd,message,wParam,lParam);


if (message==WM_WA_IPC && lParam==IPC_HOOK_TITLES) {
waHookTitleStruct *ht = (waHookTitleStruct *) wParam;
// Doing ATF stuff with ht->title, whatever...
}
return lres;
}



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:

#define IPC_GET_BASIC_FILE_INFO 291
//pass a pointer to the following struct in wParam
typedef struct {
char *filename;

int quickCheck; /*
set to 0 to always get,
1 for quick, 2 for default
(if 2, quickCheck will be set to 0 if
quick wasnot used) */

// filled in by winamp
int length;
char *title;
int titlelen;
} basicFileInfoStruct;

basicFileInfoStruct bfi;

bfi.quickCheck = 0;
bfi.filename = (char*)SendMessage(hwndWinamp, WM_WA_IPC, any_index, IPC_GETPLAYLISTFILE);
bfi.title = GlobalAlloc(GPTR, 1024);
SendMessage(hwndWinamp, WM_WA_IPC, (WPARAM)&bfi, IPC_GET_BASIC_FILE_INFO);
// Do whatever you want with bfi.title and bfi.length now...
GlobalFree((HGLOBAL)bfi.title);


saivert is offline   Reply With Quote
Old 15th September 2004, 12:15   #7
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
In what package is msvcr71.dll included?
saivert is offline   Reply With Quote
Old 15th September 2004, 12:17   #8
shaneh
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.
shaneh is offline   Reply With Quote
Old 15th September 2004, 13:17   #9
saivert
Banned
 
saivert's Avatar
 
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:

winampSetExtendedFileInfo used by IPC_SET_EXTENDED_FILE_INFO
winampWriteExtendedFileInfo used by IPC_WRITE_EXTENDED_FILE_INFO



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...
Attached Files
File Type: zip infotool_for_winamp.zip (39.7 KB, 644 views)
saivert is offline   Reply With Quote
Old 15th September 2004, 13:22   #10
shaneh
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:
#include <windows.h>
#include "ml.h"
#include "wa_ipc.h"

int PluginMessageProc(int message_typeint param1int param2int param3);
char rateStars[] = "*****";

int init()
{
    return 
0;
}

void quit()
{
}

winampMediaLibraryPlugin plugin =
{
    
MLHDR_VER,
        
"ATF Extender v0.2",
        
init,
        
quit,
        
PluginMessageProc,
};

void myTagFreeFunc(char tagvoid p)
{
    
GlobalFree((HGLOBALtag);
}

charmyTagFunc(char tagvoid p)
{
    
mlQueryStruct *mlQ = (mlQueryStruct *)p;
    
char retBuf[2096];
    
char *tmp;
    
retBuf[0] = '\0';
    
char numBuf[5];

    if (!
lstrcmpi(tag"artist"))
    {
        
lstrcpyn(retBufmlQ->results.Items[0].artistsizeof(retBuf));
    } else if (!
lstrcmpi(tag"title"))
    {
        
lstrcpyn(retBufmlQ->results.Items[0].titlesizeof(retBuf));
    } else if (!
lstrcmpi(tag"filename"))
    {
        
lstrcpyn(retBufmlQ->results.Items[0].filenamesizeof(retBuf));
    } else if (!
lstrcmpi(tag"album"))
    {
        
lstrcpyn(retBufmlQ->results.Items[0].albumsizeof(retBuf));
    } else if (!
lstrcmpi(tag"comment"))
    {
        
lstrcpyn(retBufmlQ->results.Items[0].commentsizeof(retBuf));
    }else if (!
lstrcmpi(tag"genre"))
    {
        
lstrcpyn(retBufmlQ->results.Items[0].genresizeof(retBuf));
    }else if (!
lstrcmpi(tag"trackno"))
    {
        
wsprintf(retBuf"%d"mlQ->results.Items[0].track);
    }else if (!
lstrcmpi(tag"year"))
    {
        
wsprintf(retBuf"%d"mlQ->results.Items[0].year);
    }else if (!
lstrcmpi(tag"tracknumber"))
    {
        
wsprintf(retBuf"%.2d"mlQ->results.Items[0].track);
    }else if (!
lstrcmpi(tag"trackno"))
    {
        
wsprintf(retBuf"%d"mlQ->results.Items[0].track);
    }else if (!
lstrcmpi(tag"ratingstar"))
    {
        
tmp getRecordExtendedItem(&mlQ->results.Items[0], "RATING");
        if (
tmp!= NULL)
        {
            
int rating tmp[0] - '0';
            
lstrcpyn(retBufrateStarsrating+1);
        } else
            return 
NULL;
    } else{
        
tmp getRecordExtendedItem(&mlQ->results.Items[0], tag);
        if (
tmp != NULL && lstrlen(tmp) != 0)
            
lstrcpyn(retBuftmpsizeof(retBuf));
        else
        {
            return 
NULL;
        }
    }

    if (
lstrlen(retBuf))
    {
        
char= (char*)GlobalAlloc(GPTRsizeof(retBuf));
        
lstrcpyn(sretBufsizeof(retBuf));
        return 
s;
    }

    return 
NULL;
}


char *GetFormattedTitleFromWinamp(voidp)
{
    
char *temp;
    
waFormatTitle fmt_title;
    
ZeroMemory(&fmt_titlesizeof(waFormatTitle));
    
temp = (char*)GlobalAlloc(GPTR2096);
    
fmt_title.spec NULL;
    
fmt_title.TAGFUNC myTagFunc;
    
fmt_title.TAGFREEFUNC myTagFreeFunc;
    
fmt_title.out temp;
    
fmt_title.out_len 2096;
    
fmt_title.p;
    
SendMessage(plugin.hwndWinampParentWM_WA_IPC, (WPARAM)&fmt_titleIPC_FORMAT_TITLE);
    return 
temp;
}


char *getRecordExtendedItem(itemRecord *itemchar *name)
{
    
int x=0;
    if (
item->extended_info) for (0item->extended_info[x]; x++)
    {
        if (!
lstrcmpi(item->extended_info[x],name))
            return 
item->extended_info[x]+lstrlen(name)+1;
    }
    return 
NULL;
}


int PluginMessageProc(int message_typeint param1int param2int param3)
{
    
// check for any global messages here
    
if (message_type == ML_IPC_HOOKTITLE)
    {
        
bool sucess false;
        
waHookTitleStruct *hts = (waHookTitleStruct *)param1;
        
mlQueryStruct mlQ;
        
mlQ.query=hts->filename;
        
mlQ.max_results=1;
        
mlQ.results.Alloc=0;
        
mlQ.results.Items=NULL;
        
mlQ.results.Size=0;

        if (
SendMessage(plugin.hwndLibraryParent,WM_ML_IPC,(WPARAM)&mlQ,ML_IPC_DB_RUNQUERY_FILENAME) == 1)
        {
            
char *tmp GetFormattedTitleFromWinamp(&mlQ);
            
lstrcpyn(hts->titletmp2096);
            
hts->length=mlQ.results.Items[0].length;
            
sucess true;
            
GlobalFree(tmp);
        }
        
SendMessage(plugin.hwndLibraryParentWM_ML_IPC, (WPARAM) &mlQML_IPC_DB_FREEQUERYRESULTS);
        return 
sucess;
    }

    return 
0;
}

extern "C" {
    
__declspecdllexport winampMediaLibraryPlugin winampGetMediaLibraryPlugin()
    {
        return &
plugin;
    }
}; 
shaneh is offline   Reply With Quote
Old 15th September 2004, 13:37   #11
saivert
Banned
 
saivert's Avatar
 
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!
saivert is offline   Reply With Quote
Old 15th September 2004, 13:43   #12
shaneh
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.
shaneh is offline   Reply With Quote
Old 15th September 2004, 15:11   #13
inthegray
Major Dude
 
inthegray's Avatar
 
Join Date: Sep 2003
Posts: 704
Send a message via AIM to inthegray
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.
inthegray is offline   Reply With Quote
Old 15th September 2004, 15:22   #14
shaneh
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.
shaneh is offline   Reply With Quote
Old 15th September 2004, 15:47   #15
inthegray
Major Dude
 
inthegray's Avatar
 
Join Date: Sep 2003
Posts: 704
Send a message via AIM to inthegray
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...
inthegray is offline   Reply With Quote
Old 15th September 2004, 15:59   #16
shaneh
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
shaneh is offline   Reply With Quote
Old 15th September 2004, 16:39   #17
shaneh
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.
Attached Files
File Type: zip atfext.zip (1.8 KB, 483 views)
shaneh is offline   Reply With Quote
Old 15th September 2004, 16:49   #18
inthegray
Major Dude
 
inthegray's Avatar
 
Join Date: Sep 2003
Posts: 704
Send a message via AIM to inthegray
inthegray is offline   Reply With Quote
Old 20th September 2004, 06:53   #19
saivert
Banned
 
saivert's Avatar
 
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.
saivert is offline   Reply With Quote
Old 20th September 2004, 07:07   #20
shaneh
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.
shaneh is offline   Reply With Quote
Old 20th September 2004, 09:14   #21
D&B
Banned
 
Join Date: Mar 2001
Posts: 1,027
Another very cool one Shaneh, thanks.
D&B is offline   Reply With Quote
Old 21st September 2004, 09:28   #22
D&B
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:
'['$fileext(%filename%)']'$pad(' '[%ratingstar%],6)[$caps(%artist%) - ][%year% - ][$caps(%album%)]$if(%album%,$if(%tracknumber%, - '['$num(%tracknumber%,2)']' , - ),)$if2($caps(%title%),$caps($filepart(%filename%)))' ('[%playcount%]')' 
Anyway, these are my two problems I'm having, neither really probably have to do with ATF Extender, but maybe you can help me

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:
'['$fileext(%filename%)']'[$caps(%artist%) - ][%year% - ][$caps(%album%)]$if(%album%,$if(%tracknumber%,- '['$num(%tracknumber%,2)']' , - ),)$if2($caps(%title%),$caps($filepart(%filename%))) 
Everything now works fine, exactly as it should! On tracks with an album and tracknumber tag, I am shown my track number. If they lack either of the two, I am shown my dash. No misplaced ML guessing, and I can pad the number without the mysterious 429467295 showing up.

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 . Anyway, I look forward to your next update, and will torture test it more for you. Do you have a site with all of your plugins? You have some real gems, and I forget them sometimes. You should at least put links to the threads in your sig.

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.
D&B is offline   Reply With Quote
Old 21st September 2004, 09:34   #23
shaneh
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.
shaneh is offline   Reply With Quote
Old 21st September 2004, 10:09   #24
shaneh
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%]
Attached Files
File Type: zip atfext.zip (1.9 KB, 898 views)

Last edited by shaneh; 21st September 2004 at 10:45.
shaneh is offline   Reply With Quote
Old 21st September 2004, 10:45   #25
saivert
Banned
 
saivert's Avatar
 
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...
saivert is offline   Reply With Quote
Old 21st September 2004, 10:55   #26
shaneh
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.
shaneh is offline   Reply With Quote
Old 21st September 2004, 18:56   #27
D&B
Banned
 
Join Date: Mar 2001
Posts: 1,027
Quote:
Originally posted by shaneh
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.
That would be awesome!

Don't have time to test new version, will this evening. Off to school.
D&B is offline   Reply With Quote
Old 21st September 2004, 20:57   #28
D&B
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?
D&B is offline   Reply With Quote
Old 22nd September 2004, 00:20   #29
shaneh
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.
shaneh is offline   Reply With Quote
Old 22nd September 2004, 01:30   #30
D&B
Banned
 
Join Date: Mar 2001
Posts: 1,027
Quote:
Originally posted by shaneh
I just did a quick check and it seems it would be possible to put the playlist index in there, so probably will.
Sweet.

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.
D&B is offline   Reply With Quote
Old 22nd September 2004, 06:13   #31
shaneh
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.
Attached Files
File Type: zip atfext.zip (2.1 KB, 603 views)
shaneh is offline   Reply With Quote
Old 22nd September 2004, 06:17   #32
shaneh
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.
Attached Images
File Type: jpg atfe.jpg (89.2 KB, 734 views)
shaneh is offline   Reply With Quote
Old 23rd September 2004, 09:49   #33
saivert
Banned
 
saivert's Avatar
 
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.
saivert is offline   Reply With Quote
Old 23rd September 2004, 09:52   #34
shaneh
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).
shaneh is offline   Reply With Quote
Old 23rd September 2004, 22:33   #35
D&B
Banned
 
Join Date: Mar 2001
Posts: 1,027
Quote:
Originally posted by shaneh
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).
So you give up on it? I understand the problems with it, so its cool. Maybe, someday in the future, something will work with it (Dr.O's PlEx?).

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!
D&B is offline   Reply With Quote
Old 24th September 2004, 01:29   #36
shaneh
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.
shaneh is offline   Reply With Quote
Old 28th April 2005, 02:28   #37
peaceofcake
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?
peaceofcake is offline   Reply With Quote
Old 29th April 2005, 10:45   #38
saivert
Banned
 
saivert's Avatar
 
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.
saivert is offline   Reply With Quote
Old 29th April 2005, 10:59   #39
shaneh
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.
shaneh is offline   Reply With Quote
Old 1st May 2005, 02:07   #40
billyvnilly
Forum King, M.D.
 
billyvnilly's Avatar
 
Join Date: Mar 2004
Location: Detroit burbs
Posts: 3,379
Send a message via ICQ to billyvnilly Send a message via AIM to billyvnilly
any chances for update? like %dir% and %parentdir% ? i.e. the rest of tags from your toaster list?
billyvnilly is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp 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