音乐播放器制作概要.ppt
文本预览下载声明
在文件最后依次添加如下函数 void CTao_MusicDlg::Show(int cnt) { CClientDC dc(this); CString mtime; TCHAR temp[19]; DWORD cdf,cdfrom; int showstrlen=18,i; int tposx,tposy,sposx,sposy; tposx=12,tposy=128; sposx=12,sposy=81; switch(cnt){ case 0: hour=0;minute=0;second=0; dc.SetBkColor(RGB(124,252,0));//设置放置计数器区域的外观 dc.SetTextColor(RGB(255,255,203));//设置数字显示的颜色 mtime.Format(%02d:%02d:%02d,hour,minute,second);//显示时间进度 dc.TextOut(tposx,tposy,mtime); for(i=0;ishowstrlen;i++){ temp[i]=cursong[(i+showstr)%cursong.GetLength()]; }temp[i]=\0; showstr=(showstr+1)%cursong.GetLength(); mtime.Format(---------------------------- );//覆盖上次显示 dc.TextOut(sposx,sposy,mtime); dc.TextOut(sposx,sposy,temp); break; case 1: dc.TextOut(sposx,sposy,); KillTimer(0); KillTimer(1); KillTimer(2); hour=0;minute=0;second=0;//歌曲时间置0 break; case 2: KillTimer(0);//取消计数器的显示 KillTimer(1); KillTimer(2); hour=0;minute=0;second=0; dc.SetBkColor(RGB(124,252,0));//设置放置计数器区域的外观 dc.SetTextColor(RGB(255,255,203));//设置数字显示的颜色 mtime.Format(%02d:%02d:%02d,hour,minute,second);//显示时间进度 dc.TextOut(tposx,tposy,mtime); for(i=0;ishowstrlen;i++){ temp[i]=cursong[(i+showstr)%cursong.GetLength()]; }temp[i]=\0; showstr=(showstr+1)%cursong.GetLength(); mtime.Format(---------------------------- );//覆盖上次显示 dc.TextOut(sposx,sposy,mtime); dc.TextOut(sposx,sposy,temp); break; case 3: second++; dc.SetBkColor(RGB(124,252,0));//设置放置计数器区域的外观 dc.SetTextColor(RGB(255,255,203));//设置数字显示的颜色 if(second==60){//设置钟表的显示 minute++;second=0; }if(minute==60){ hour++;minute=0; } //mtime.Format(%02d:%02d:%02d,hour,minute,second);//显示时间进度 //dc.TextOut(280,128,mtime); cdf=Mp3.getinformation(MCI_STATUS_LENGTH);//获得当前毫秒值MCI_STATUS_POSITION if(cdf=Mp3.getinformation(MCI_STATUS_POSITION)){//如果停止就进行换歌 CString strtemp; GetDlgItemText(IDC_exit,strtemp);//获取按钮状态 if (strtemp.Compare(单曲)==0){ Mp3.Setvolumn(1000-m_slider.GetPos());//声音设为滑块指示的地方
显示全部