-
关注Ta
-
- 注册时间 2004-07-09
- 最后登录 2008-01-25
-
- 发帖1257
- 在线1135小时
- 精华8
- DB29513
- 威望2067
- 保证金0
- 桃子0
- 鲜花0
- 鸡蛋0
-
访问TA的空间加好友用道具
|
look for IPC_GETOUTPUTTIME in wa_ipc.h and the usage is in the comments set the mode to 0, that is the easy part The hard part is converting miliseconds to minutes:seconds format what we are normally used too in reading song time this is not my code i for it from some site http://datalib.library.ualberta.ca/...ples/timec.htmlits kinda hidden in there so ill paste what you need PHP Code:
int minutes = (timeo / 1000 / 60) % 60 ; int seconds = (timeo / 1000) % 60 ;
then PHP Code:
DrawHudString(50,500,0,0,250,"%s %02i:%02i", fag,minutes,seconds );
[edit] fag is the song title just so it dont confuse you [/edit] Thanks tetsuo winamp http://datalib.library.ualberta.c ( who ever you are ) __________________ echo j | format c: Here's what I use Code: HWND hwWinamp = FindWindow("Winamp v1.x",NULL); if ( hwWinamp && bWinampDisplay ) { int curpos= ( ::SendMessage(hwWinamp,WM_WA_IPC,0,IPC_GETOUTPUTTIME) ) / 1000; int songlen= ( ::SendMessage(hwWinamp,WM_WA_IPC,1,IPC_GETOUTPUTTIME) ); int playstatus = ( ::SendMessage(hwWinamp,WM_WA_IPC,0,IPC_ISPLAYING) );
char status[10]; if(playstatus == 0) sprintf( status,"%s", "stopped" ); else if ( playstatus == 1) sprintf( status,"%s", "playing" ); else if( playstatus == 3) sprintf( status, "%s", "paused" ); else sprintf( status, "%s", "unknown" );
int iWinampY = m_scrinfo.iHeight*0.68; int iWinampX = 16;
fHud.Print ( iWinampX, iWinampY, Color.x, Color.y, Color.z, FL_NONE, "[%s]", GetWinampTrack(hwWinamp)); iWinampY += fHud.GetTypeHeight() + 1;
fHud.Print ( iWinampX, iWinampY, Color.x, Color.y, Color.z, FL_NONE, "[%s - %i:%.2i/%i:%.2i]", status, (curpos / 60), (curpos % 60), (songlen / 60), (songlen % 60) ); } //====================================================================== ================== // Returns the current Winamp track, removing the song number //====================================================================== ================== char *CWinamp::GetWinampTrack ( HWND hwWinamp ) { char WinampTitle[2048]; int iRetVal = GetWindowText(hwWinamp, WinampTitle, sizeof(WinampTitle)); if (iRetVal) { char *p; p = WinampTitle+strlen(WinampTitle)-9; while (p >= WinampTitle) { if (!strnicmp(p," - Winamp",9)) break; p--; } if (p >= WinampTitle) p--; while (p >= WinampTitle && *p == ' ') p--; *++p=0;
p = WinampTitle; while (p >= WinampTitle) { if (*p == '.') { p += 2; break; } p++; }
return p; } return NULL; } Just uses the winampfrontend.h (attached) Seems to be compatible with Winamp 2 through 5 (3 requires a plugin)
|