Inheritance: AForge.Video.VFW.AVIReader, IFileClass
Ejemplo n.º 1
0
        private void FillRow(AVIClass v, int pos)
        {
            this.FillRowMark(v, pos);
            if (v.Owner == null)
            {
                this.gridList[pos, 1] = new SourceGrid.Cells.Cell(Translator.Instance.T("**未知摄像头**"));
            }
            else
            {
                this.gridList[pos, 1] = new SourceGrid.Cells.Cell(v.Owner.FullName);
            }
            this.gridList[pos, 2] = new SourceGrid.Cells.Cell(v.TimeStamp);
            this.gridList[pos, 3] = new SourceGrid.Cells.Cell(v.Length);
            this.gridList[pos, 4] = new SourceGrid.Cells.Cell(v.FileSize);

            string codec = mCC.GetValue(v.Codec, string.Format(Translator.Instance.T("录像格式 ({0})"), v.Codec));
            this.gridList[pos, 5] = new SourceGrid.Cells.Cell(codec);
            this.gridList.Rows[pos].Tag = v;
        }
Ejemplo n.º 2
0
        private void InsertGrid(AVIClass v)
        {
            lock (this.gridList)
            {
                this.gridList.Rows.Insert(1);

                this.FillRow(v, 1);

                this.Count = this.gridList.RowsCount - 1;
                this.gridList.AutoSizeCells();
            }
        }
Ejemplo n.º 3
0
        private void FillGrid(AVIClass v)
        {
            lock (this.gridList)
            {
                int pos = this.gridList.RowsCount;
                this.gridList.RowsCount++;

                this.FillRow(v, pos);

                this.Count = this.gridList.RowsCount - 1;
            }
        }
Ejemplo n.º 4
0
 private void fileSystemWatcher_Renamed(object sender, RenamedEventArgs e)
 {
     IFileClass f = null;
     switch (this.Style)
     {
         case CameraBoardStyle.AVI:
             AVIClass v = new AVIClass(e.FullPath, null);
             f = v as IFileClass;
             break;
         case CameraBoardStyle.PIC:
             PICClass p = new PICClass(e.FullPath, null);
             f = p as IFileClass;
             break;
     }
     if (f != null && f.IsValid() && f.Owner != null)
     {
         SourceGrid.Grid.GridRow row = this.Find(e.OldFullPath);
         if (row == null)
         {
             row = this.Find(e.FullPath);
             if (row == null)
             {
                 switch (this.Style)
                 {
                     case CameraBoardStyle.AVI:
                         this.InsertGrid(f as AVIClass);
                         break;
                     case CameraBoardStyle.PIC:
                         this.InsertGrid(f as PICClass);
                         break;
                 }
                 return;
             }
         }
         IFileClass c = row.Tag as IFileClass;
         c.FileName = f.FileName;
         this.FillRowMark(c, row.Index);
         this.gridList.InvalidateCell(this.gridList[row.Index, 0]);
     }
 }
Ejemplo n.º 5
0
        private void StopCapture()
        {
            mMutexCapture.WaitOne();
            mCaptureElapse = 0;
            this.mIntervalsToSave = 0;
            if (mAVIWriter != null)
            {
                try
                {
                    FileInfo fi = new FileInfo(mAVIWriter.FileName);
                    mAVIWriter.Dispose();
                    mAVIWriter = null;

                    this.CaptureCount++;

                    DateTime n = DateTime.Now;
                    string s = "" + n.Hour + ":" + n.Minute + ":" + n.Second;
                    this.toolStripStatusLabelCapture.Text = string.Format(Translator.Instance.T("录像结束({0})"), s);

                    this.CameraClass.Capturing = false;

                    AVIClass avi = new AVIClass(fi.FullName, this.CameraClass);
                    avi.Mark = RecordMark.UNREAD;

                    this.OnCameraViewRecordFinished(new CameraViewCaptureEventArgs(this));
                }
                catch (Exception)
                {
                }
            }
            mMutexCapture.ReleaseMutex();
        }
Ejemplo n.º 6
0
 public bool Remove(AVIClass c)
 {
     foreach (Control t in this.CameraPanel.Controls)
     {
         AVIView v = t as AVIView;
         if (v != null && v.AVIClass.FileName.Equals(c.FileName))
         {
             v.Stop();
             this.CameraPanel.Controls.Remove(v.Me);
             this.ShortcutRemove(v);
             break;
         }
     }
     return true;
 }
Ejemplo n.º 7
0
        public IVideoView Add(AVIClass c)
        {
            IVideoView v;

            if (c == null)
            {
                return null;
            }
            v = this.Find(c.Camera);
            if (v == null)
            {
                AVIView x = new AVIView();
                x.AVIClass = c;
                x.VisibleChanged += new EventHandler(this.IView_VisibleChanged);
                this.CameraPanel.Controls.Add(x);
                x.ViewRatio = this.ViewRatio;

                CameraBoardAddNewEventArgs e = new CameraBoardAddNewEventArgs(x);
                this.OnCameraBoardAddNewEvent(e);
                e = null;
                v = x;
                this.ShortcutAdd(v);
            }
            else
            {
                v.ViewRatio = this.ViewRatio;
                v.Me.Visible = true;
            }
            return v;
        }