ListOneCurOldIndex = ListOneCurIndex;
ListOneCurIndex++;//当前播放的文件索引 if(ListOneCurIndex >= ListInfo_One.GetSize())
{
for(i=0;i<ListInfo_One.GetSize();i++)
{
strPath = ListInfo_One.GetStringtAt(i);//从播放列表的链表中取文件路径
if(pThis->IsFileExist(strPath))//判断该路径是否存在
{
ListOneCurIndex = i;
break;
}
}
if(i==ListInfo_One.GetSize())//如果遍历整个文件链表,列表中存在的文件都不存在
{
pThis->m_Edit_FlieName_One.SetWindowText("无文件发送");//显示播放参数
pThis->m_Edit_FileSize_One.SetWindowText("");
pThis->m_Edit_Rate_One.SetWindowText("");
pThis->m_Edit_Time_One.SetWindowText("");
KillTimer(pThis->m_hWnd,1);
pThis->m_Progress_One.SetPos(0);
break;
}
else
{//否则找到一个,开始设置一些参数,准备发送文件了
if(fp[0]!=NULL)
fclose(fp[0]);
fp[0] = fopen(strPath,"rb"); //打开新文件 FileLength[0] = ListInfo_One.GetLenAt(ListOneCurIndex);
rate = ListInfo_One.GetRateAt(ListOneCurIndex);
time = ListInfo_One.GetTimerAt(ListOneCurIndex);
miro_set_rate(rate,Channel_Num,DeviceNum);//设置速率 pThis->m_Edit_FlieName_One.SetWindowText(strPath);//显示播放参数
str.Format("%dKB",FileLength[0]/1024);
pThis->m_Edit_FileSize_One.SetWindowText(str);
str.Format("%fMbps",rate);
pThis->m_Edit_Rate_One.SetWindowText(str);
str.Format("%ds",time);
pThis->m_Edit_Time_One.SetWindowText(str); KillTimer(pThis->m_hWnd,1);
pThis->m_Progress_One.SetRange(0,FileLength[0]);
pThis->m_Progress_One.SetPos(0);
if(time>=60)
SetTimer(pThis->m_hWnd,1,1000,NULL);
else
SetTimer(pThis->m_hWnd,1,500,NULL);
}
}
else
{
for(i=ListOneCurIndex;i<ListInfo_One.GetSize();i++)
{
strPath = ListInfo_One.GetStringtAt(i);
if(pThis->IsFileExist(strPath))
{
ListOneCurIndex = i;
break;
}
}
if(i == ListInfo_One.GetSize())
{
for(j=0;j<ListOneCurIndex;j++)
{
strPath = ListInfo_One.GetStringtAt(j);
if(pThis->IsFileExist(strPath))
{
ListOneCurIndex = j;
break;
}
}
if(j==ListOneCurIndex)
{
pThis->m_Edit_FlieName_One.SetWindowText("无文件发送");//显示播放参数
pThis->m_Edit_FileSize_One.SetWindowText("");
pThis->m_Edit_Rate_One.SetWindowText("");
pThis->m_Edit_Time_One.SetWindowText("");
KillTimer(pThis->m_hWnd,1);
pThis->m_Progress_One.SetPos(0);
break;
}
}
if(fp[0]!=NULL)
fclose(fp[0]);
fp[0] = fopen(strPath,"rb");
FileLength[0] = ListInfo_One.GetLenAt(ListOneCurIndex);
rate = ListInfo_One.GetRateAt(ListOneCurIndex);
time = ListInfo_One.GetTimerAt(ListOneCurIndex); miro_set_rate(rate,Channel_Num,DeviceNum); pThis->m_Edit_FlieName_One.SetWindowText(strPath);
str.Format("%dKB",FileLength[0]/1024);
pThis->m_Edit_FileSize_One.SetWindowText(str);
str.Format("%fMbps",rate);
pThis->m_Edit_Rate_One.SetWindowText(str);
str.Format("%ds",time);
pThis->m_Edit_Time_One.SetWindowText(str);
KillTimer(pThis->m_hWnd,1);
pThis->m_Progress_One.SetRange(0,FileLength[0]);
pThis->m_Progress_One.SetPos(0);
if(time>=60)
SetTimer(pThis->m_hWnd,1,1000,NULL);
else
SetTimer(pThis->m_hWnd,1,500,NULL);
}我是这样处理的,这样处理很笨,大家有更好的吗,建议下:
我是本版版主
此帖已多日无人关注
请您及时结帖
如您认为问题没有解决可按无满意结帖处理
另外本版设置了疑难问题汇总帖
并已在版面置顶
相关规定其帖子中有说明
您可以根据规定提交您帖子的链接
如您目前不想结帖只需回帖说明
我们会删除此结帖通知见此回复三日内无回应
我们将强制结帖
相关规定详见界面界面版关于版主结帖工作的具体办法