public void InitScheduleAndPlay() { //displayController List<Schedule> schedules = new List<Schedule>(); Schedule schedule = new Schedule(); schedule.PlayItems.Add(new PlayItem("1","C:\\contents\\Custom_02_2012_64x128_1.avi", 0)); schedule.PlayItems.Add(new PlayItem("2","C:\\contents\\Lotus.JPG", 1)); schedules.Add(schedule); schedule = new Schedule(); schedule.PlayItems.Add(new PlayItem("3","C:\\contents\\Catching.JPG", 1)); schedule.PlayItems.Add(new PlayItem("4","C:\\contents\\Fairyland.JPG", 1)); schedules.Add(schedule); String schepath = Path.Combine(ScheduleDir, "Schedule.xml"); displayController = new DisplayController(); displayController.ReadFromXML(schepath); Status = PlayerStatus.Finished; }
private void timerSchedule_Tick(object sender, EventArgs e) { if (Status == PlayerStatus.Playing || Status == PlayerStatus.Init) { return; } if (newScheUpdated) { displayController = new DisplayController(); String schepath = Path.Combine(ScheduleDir, "Schedule.xml"); displayController.ReadFromXML(schepath); newScheUpdated = false; } PlayItem item = displayController.GetNextFileFromSchedule(); if (item != null && File.Exists(item.Path)) Play(item); }