private void button1_Click(object sender, EventArgs e) { try { if (!int.TryParse(textBox_interval.Text.Trim(), out int step)) { return; } string folder = textBox_folder.Text.Trim(); string note = textBox_note.Text.Trim(); int top = comboBox_top.SelectedIndex; List <int> ids = new List <int>() { video.Id }; bool win = GetDatas.SolutionData.SolutionOfTheFrame(new Solution(folder, note, ids, step, top)); if (!win) { MessageBox.Show("添加失败"); return; } VideoPlay play = Methods.GetNewImages(video.Id); OnRefresh(play); this.Close(); } catch (Exception) { MessageBox.Show("输入格式不正确"); return; } }
/// <summary> /// 改变对应条件行颜色 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) { if (e.RowHandle < 0 || e.RowHandle > videoplays.Count() - 1) { return; } VideoPlay video = (VideoPlay)gridView1.GetRow(e.RowHandle); if (video.ImageId.Count != 0 && !string.IsNullOrEmpty(video.Label)) { e.Appearance.BackColor = Color.LightGreen; } else if (video.ImageId.Count != 0 && string.IsNullOrEmpty(video.Label)) { e.Appearance.BackColor = Color.Khaki; } else if (video.ImageId.Count == 0 & !string.IsNullOrEmpty(video.Label)) { e.Appearance.BackColor = Color.LightPink; } if (e.RowHandle == gridView1.FocusedRowHandle) { e.Appearance.BackColor = Color.SkyBlue; } }
public void Handle(VideoPlay message) { if (CheckFile(message, null, FileTypes.Video, message.FileName)) { this.main.Handle(message); } }
public void PlayVideo(string name, Action callback) { GetViewChild("VideoPlay").SetActive(true); VideoPlay videoPlay = GetViewChild("VideoPlay").GetComponent <VideoPlay> (); videoPlay.SetCallback(callback); videoPlay.Play(name); }
public void PlayVideo(string fileName, Action action) { video.SetActive(true); VideoPlay play = video.GetComponent <VideoPlay> (); play.SetCallback(action); play.Play(fileName); }
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { switch (keyData) { case Keys.Up: gridView1.FocusedRowHandle = gridView1.FocusedRowHandle == 0 ? 0 : gridView1.FocusedRowHandle - 1; if (gridView1.FocusedRowHandle < 0) { return(true); } transmissionvideo = (VideoPlay)gridView1.GetRow(gridView1.FocusedRowHandle); GetIntToString(); return(true); case Keys.Down: gridView1.FocusedRowHandle = gridView1.FocusedRowHandle == gridView1.RowCount - 1 ? gridView1.RowCount - 1 : gridView1.FocusedRowHandle + 1; if (gridView1.FocusedRowHandle < 0) { return(true); } transmissionvideo = (VideoPlay)gridView1.GetRow(gridView1.FocusedRowHandle); GetIntToString(); return(true); case Keys.D: DELToolStripMenuItem.PerformClick(); return(true); case Keys.Escape: this.WindowState = FormWindowState.Minimized; return(true); case Keys.F2: Methods.OpenFolderAndSelectFile(AppSettings.ReturnStringUrl(Methods.ConversionString(transmissionvideo.Uri))); return(true); case Keys.Space: if (gridView1.FocusedRowHandle < 0) { return(true); } transmissionvideo = (VideoPlay)gridView1.GetRow(gridView1.FocusedRowHandle); if (hInfo.InRowCell) { OpenVideoPaly(); } return(true); //case Keys.Q: // ShowStaticLabels(); // return true; default: break; } return(base.ProcessCmdKey(ref msg, keyData)); }
/// <summary> /// 展示静态标签 /// </summary> private void ShowStaticLabels() { int index = gridView1.FocusedRowHandle; int row = gridView1.GetDataRowHandleByGroupRowHandle(index); VideoPlay dr = (VideoPlay)gridView1.GetRow(row); int id = dr.EquipmentID; ShowStaticLabel show = new ShowStaticLabel(id); show.Show(); }
public VideoRecording(VideoPlay videopath, List <VideoPlay> videoPlays) { videoplay = videopath; videos = videoPlays; InitializeComponent(); videoPlayers1.MyEvent += new Aplayer.VideoPlayers.MyDelegate(ImageAdd); videoPlayers1.path = AppSettings.ImageSavePath; dropDownButton1.DropDownControl = CreateDXPopupMenu(); SetAllListNodes(videoPlays); }
private void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e) { if (treeList1.FocusedNode.Level == 0) { return; } videoplay = VideoData.GetIndexVideoInfo(int.Parse(treeList1.FocusedNode.GetValue(0).ToString())); SetFocusInfo(); SetLabel(int.Parse(treeList1.FocusedNode.Tag.ToString())); PlayVideo(); }
/// <summary> /// 双击打开 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridView1_DoubleClick(object sender, EventArgs e) { if (gridView1.FocusedRowHandle < 0) { return; } transmissionvideo = (VideoPlay)gridView1.GetRow(gridView1.FocusedRowHandle); if (hInfo.InRowCell) { OpenVideoPaly(); } }
IEnumerator InitGame(float waitTime) { yield return new WaitForSeconds(waitTime); Debug.Log("InitGame"+waitTime); UIManager.Instance.Close(UIType.BlackUI); IsInit = true; Destroy(gameObject); instance = null; FinishCallBack(); }
private void PlayVideo(bool isnew = true) { ReturnRepetition re = (ReturnRepetition)gridView1.GetRow(gridView1.FocusedRowHandle); VideoPlay play = new VideoPlay(); List <VideoPlay> plays = new List <VideoPlay>(); if (isnew) { play = VideoData.GetIndexVideoInfo(re.ID); plays.Add(play); } else { if (re.DuplicateId == 0) { return; } play = VideoData.GetIndexVideoInfo(re.DuplicateId); foreach (var item in re.Duplicates) { VideoPlay video = VideoData.GetIndexVideoInfo(item.Id); plays.Add(video); } } if (play == null) { MessageBox.Show("不存在该视频或者已经被删除"); return; } VideoRecording recording = new VideoRecording(play, plays); if (play == null || play.Uri == null) { return; } if (File.Exists(AppSettings.ReturnStringUrl(Methods.ConversionString(play.Uri)))) { recording.Show(); Program.log.Error($"打开{AppSettings.ReturnStringUrl(Methods.ConversionString(play.Uri))}", new Exception("打开成功")); } else { DialogResult MsgBoxResult = MessageBox.Show("指定目录没有找到该视频,是否继续标注", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2); if (MsgBoxResult != DialogResult.Yes) { return; } recording.Show(); Program.log.Error($"打开{AppSettings.ReturnStringUrl(Methods.ConversionString(play.Uri))}", new Exception("没有找到视频")); } }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); VideoPlay.VideoPlayListControl(); AdvertiseTaskSchedule.Start(); LiveControl.ControlLive(); }
/// <summary> /// 焦点改变 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { int rowIndex = gridView1.FocusedRowHandle; if (rowIndex < 0) { rowIndex = gridView1.GetDataRowHandleByGroupRowHandle(rowIndex); } transmissionvideo = (VideoPlay)gridView1.GetRow(rowIndex); RefreshImage(); GetIntToString(); DeleteFolder(AppSettings.ImageSavePath); }
/// <summary> /// 所有勾选项 /// </summary> /// <returns></returns> private List <VideoPlay> GetCheckList() { gridView1.CloseEditor(); List <VideoPlay> plays = new List <VideoPlay>(); int[] rownumber = gridView1.GetSelectedRows(); for (int i = 0; i < rownumber.Count(); i++) { VideoPlay video = (VideoPlay)gridView1.GetRow(rownumber[i]); plays.Add(video); } return(plays); }
/// <summary> /// 刷新焦点行图片集合 /// </summary> public void RefreshImage() { if (transmissionvideo == null) { return; } foreach (var item in videoplays) { if (transmissionvideo.Id == item.Id) { transmissionvideo = item; break; } } }
/// <summary> /// 刷新标签 /// </summary> /// <param name="play"></param> public void RefreshData(VideoPlay play) { VideoPlay video = videoplays.FirstOrDefault(t => t.Id == play.Id); video.Labels = play.Labels; video.ImageId = play.ImageId; video.StartTime = play.StartTime; video.EndTime = play.EndTime; video.CreateTime = play.CreateTime; video.RecordTime = play.RecordTime; video.Recorded = play.Recorded; bindingSource1.DataSource = videoplays; gridView1.RefreshData(); Program.log.Info($"保存并刷新{video.Id}"); }
private void gridView1_Click(object sender, EventArgs e) { int i = gridView1.FocusedRowHandle; if (i < 0) { return; } int index = gridView1.GetDataRowHandleByGroupRowHandle(i); transmissionvideo = (VideoPlay)gridView1.GetRow(index); RefreshImage(); GetIntToString(); DeleteFolder(AppSettings.ImageSavePath); }
public static VideoPlay GetNewImages(int index) { string url = AppSettings.Urlpath + $"/videos?id={index}"; JObject obj = WebClinetHepler.GetJObject(url); VideoPlay videoplay = new VideoPlay(); for (int i = 0; i < obj["result"].Count(); i++) { Projects project = JsonHelper.DeserializeDataContractJson <Projects>(obj["result"][0]["project"].ToString()); EquipmentInfo info = JsonHelper.DeserializeDataContractJson <EquipmentInfo>(obj["result"][0]["equipments"][0]["equipment_info"].ToString()); videoplay = JsonHelper.DeserializeDataContractJson <VideoPlay>(obj["result"][0]["equipments"][0]["videos"][0].ToString()); videoplay.Project = project; videoplay.Rquipment = info; } return(videoplay); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AdsLabelToolStripMenuItem_Click(object sender, EventArgs e) { int index = gridView1.FocusedRowHandle; int row = gridView1.GetDataRowHandleByGroupRowHandle(index); VideoPlay dr = (VideoPlay)gridView1.GetRow(row); int id = dr.EquipmentID; if (id == 0) { return; } SelectLabel select = new SelectLabel(RefreshType.StaticLabel, mydic[id].LabelStr); select.MyRefreshEvent += new SelectLabel.MyDelegate(SetLabelsToEquipment); select.ShowDialog(); }
public void GroupIndex() { for (int i = -1; gridView1.IsGroupRow(i); i--) { int row = gridView1.GetDataRowHandleByGroupRowHandle(i); VideoPlay dr = (VideoPlay)gridView1.GetRow(row); if (dr == null) { return; } if (dr.EquipmentID == 0) { gridView1.SetRowExpanded(i, true); } } }
/// <summary> /// 读取并加载信息 /// </summary> public void PostVideos() { GettListVideo(); if (isFirst) { transmissionvideo = videoplays.Count == 0 ? null : videoplays.First(); isFirst = false; } mydic = equipments.ToDictionary(t => t.Id, s => s); total = Sum(comple); recorded = Sum(comple, false); SetText(); RefreshImage(); bindingSource1.DataSource = videoplays; gridView1.FindFilterText = string.Empty; gridView1.CollapseAllGroups(); GroupIndex(); }
//YeuThich yeuthich; public MainWindow() { InitializeComponent(); foreach (var x in vmd.List) { st.Children.Add(new TextBlock() { Text = x.TheLoai, FontSize = 30, Foreground = new SolidColorBrush(Colors.White), Margin = new Thickness(30) }); st.Children.Add(new VideoAppearance(this) { List = x.Videos }); } Sender = new send(GetVieo); videoplay = new VideoPlay(); filminfo = new FilmInfo(); SenderYT = new sendYT(GetYT); }
private List <VideoPlay> GetSelectRow() { int[] rownumber = gridView1.GetSelectedRows(); if (rownumber.Count() == 0) { return(null); } List <VideoPlay> videos = new List <VideoPlay>(); foreach (var it in rownumber) { if (it < 0) { continue; } VideoPlay video = (VideoPlay)gridView1.GetRow(it); videos.Add(video); } return(videos); }
/// <summary> /// 删除视频 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show($"是否删除编号{transmissionvideo.Id}的视频,删除视频前请确认解帧图片一并删除?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } if (!VideoData.DeleteVideo(transmissionvideo.Id)) { MessageBox.Show("删除失败"); Program.log.Error($"删除{transmissionvideo.Id}失败", new Exception($"{transmissionvideo.Id}")); } videoplays.Remove(transmissionvideo); bindingSource1.DataSource = videoplays; transmissionvideo = (VideoPlay)gridView1.GetRow(gridView1.FocusedRowHandle); gridView1.ExpandAllGroups(); unfold = true; gridView1.RefreshData(); OnSave(); //Program.log.Error($"删除{transmissionvideo.Id}", new Exception($"{url}")); }
/// <summary> /// 通道添加标签 /// </summary> /// <param name="labels"></param> public void SetLabelsToEquipment(List <string> labels) { int index = gridView1.FocusedRowHandle; int row = gridView1.GetDataRowHandleByGroupRowHandle(index); VideoPlay dr = (VideoPlay)gridView1.GetRow(row); int id = dr.EquipmentID; if (id == 0) { return; } List <int> ids = MyLabel.GetSelectIds(labels); if (!LabelData.AddLabelToEquipment(id, ids)) { MessageBox.Show("添加标签到通道失败"); Program.log.Error($"通道ID:{id},添加标签:{string.Join(",",labels)}--失败"); return; } Program.log.Error($"通道ID:{id},添加标签:{string.Join(",", labels)}"); PostVideos(); }
public void Handle(VideoPlay message) { this.log.Information("Play video track {0}", message.FileName); PlayVideo(message.FileName); }
public void OnRefresh(VideoPlay play) { MyRefreshEvent.Invoke(play); }
public SolutionFrame(VideoPlay videoPlay) { InitializeComponent(); video = videoPlay; }
/// <summary> /// 点击加载图片 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridControl1_Click(object sender, EventArgs e) { transmissionvideo = (VideoPlay)gridView1.GetRow(gridView1.FocusedRowHandle); }