// m_CFile.ReadSetInfo(m_SetInfo); SYSTEMTIME sysTime; GetLocalTime(&sysTime); m_CFile.ReadDayInfo(sysTime.wDayOfWeek,m_Info); m_CFile.Close(); int hour = GetHour(m_Info.sSStarttime); int minute = GetMinute(m_Info.sSStarttime); if(sysTime.wHour == hour && sysTime.wMinute == minute)//开始播放上午音乐 { ReadCatalogMusic(m_Info.sSMusic);//读取配置文件中指定的上午播放音乐目录 m_nPlay = 0; Play(0); KillTimer(1); //终止1号定时器 int duration = atoi(m_Info.sSDuration);//读取播放时间段 SetTimer(3,duration*60*1000,NULL);//启动三号定时器 m_nFlag = 1; return; } hour = GetHour(m_Info.sMStarttime); minute = GetMinute(m_Info.sMStarttime); if(sysTime.wHour == hour && sysTime.wMinute == minute)//开始播放中午音乐 { ReadCatalogMusic(m_Info.sMMusic); m_nPlay = 0; Play(0); KillTimer(1); int duration = atoi(m_Info.sMDuration); SetTimer(3,duration*60*1000,NULL); m_nFlag = 2; |