/// <summary> /// заполнение list данными из listView /// </summary> void CONVERT() { if (ViewModelMain.myLISTselect == null) { ViewModelMain.myLISTselect = new List <IPTVman.Model.ParamCanal>(); } ViewModelMain.myLISTselect.Clear(); int size = listView2.Items.Count; for (int i = 0; i < size; i++) { ListViewDragDropManager.Task p = (ListViewDragDropManager.Task)listView2.Items[i]; IPTVman.Model.ParamCanal canal = new IPTVman.Model.ParamCanal { name = p.Name, ExtFilter = "", group_title = "", logo = "", http = p.Http, tvg_name = "", ping = "", }; ViewModelMain.myLISTselect.Add(canal); } }
private void listView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { ListViewDragDropManager.Task p = (ListViewDragDropManager.Task)listView.SelectedItem; if (p == null) { return; } play.path = System.Reflection.Assembly.GetExecutingAssembly().Location + "Player/nvlcp.exe"; play.path = play.path.Replace(@"\", @"/"); play.path = play.path.Replace(@"IPTVmanager.exe", @""); if (File.Exists(play.path)) { taskRADIO = System.Threading.Tasks.Task.Run(() => { ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.CreateNoWindow = false; startInfo.UseShellExecute = false; startInfo.FileName = play.path; //startInfo.WindowStyle = ProcessWindowStyle.Hidden; startInfo.Arguments = p.Http + " " + p.Name + " --radio"; //startInfo.WindowStyle = ProcessWindowStyle.Maximized; play.playerV = Process.Start(startInfo); }); } else { IPTVman.ViewModel.dialog.Show("Не найден файл nVLC player по пути\n" + play.path); } }
/// <summary> /// Cтарт сканирования num - с какой позиции enabled_cyc - циклически /// </summary> /// <param name="num"></param> void cycscan(int num, bool enabled_cyc) { if (num_open_process() == 0) { init_scan_process(); } if (!enabled_cyc) { current = 1; } while (true) { if (need_stop_scan) { break; } byte max = 0; scanner.clear(); int j = 0; foreach (var item in listView.Items) { if (j < num) { j++; continue; } it = (ListViewDragDropManager.Task)item; if (key[j] < current) { key[j] += 1; scanner.add(it.Http); max++; if (max > 1) { break; } } j++; } if (max == 0) { if (!enabled_cyc) { break; } else { Thread.Sleep(3000); zap(); current++; } } //циклически waiting_result = true; scanner.getPLAYING(); while (waiting_result) { if (need_stop_scan) { break; } Thread.Sleep(100); } if (need_stop_scan) { break; } waiting_result = true; } waiting_result = false; need_stop_scan = false; }