Winamp song time [ based on tetsuo's code]

社区服务
高级搜索
猴岛论坛CSGO反恐精英CS作弊器交流讨论Winamp song time [ based on tetsuo's code]
发帖 回复
倒序阅读 最近浏览的帖子最近浏览的版块
0个回复

Winamp song time [ based on tetsuo's code]

楼层直达
作弊辅导员_h

ZxID:1019634

等级: 元老
定做作弊器
举报 只看楼主 使用道具 楼主   发表于: 2007-07-05 0


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.html

its 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)
Attached Files
File Type: hwinampfrontend.h (13.0 KB, 28 views)
密码被盗,请联系cscheat取回
« 返回列表
发帖 回复