コード例 #1
0
        public ucConvertVideoToAav(ConvertVideoToAavOperation operation, VideoController videoController)
            : this()
        {
            m_Operation       = operation;
            m_VideoController = videoController;

            m_RoiSelector = m_VideoController.CurrentImageTool as RoiSelector;

            nudFirstFrame.Minimum = videoController.VideoFirstFrame;
            nudFirstFrame.Maximum = videoController.VideoLastFrame - 1;
            nudFirstFrame.Value   = nudFirstFrame.Minimum;

            nudLastFrame.Minimum = videoController.VideoFirstFrame;
            nudLastFrame.Maximum = videoController.VideoLastFrame - 1;
            nudLastFrame.Value   = nudLastFrame.Maximum;

            nudStartingAtFrame.Minimum = videoController.VideoFirstFrame;
            nudStartingAtFrame.Maximum = videoController.VideoLastFrame - 1;
            nudStartingAtFrame.Value   = nudFirstFrame.Minimum;

            AutoDetectVTIOSDPosition();

            m_State = AavConfigState.ConfirmingVtiOsdPosition;
            UpdateControlState();
        }
コード例 #2
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            m_State = AavConfigState.FinishedConverting;
            UpdateControlState();

            m_Operation.EndConversion();
        }
コード例 #3
0
        internal void EndConversion()
        {
            m_State = AavConfigState.FinishedConverting;
            UpdateControlState();

            MessageBox.Show("AAV file convertion completed.", "Tangra", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
コード例 #4
0
        private void btnDetectIntegrationRate_Click(object sender, EventArgs e)
        {
            var frm = new frmIntegrationDetection(m_VideoController, (int)nudFirstFrame.Value);

            frm.StartPosition = FormStartPosition.CenterParent;
            DialogResult res = frm.ShowDialog(this);

            if (res == DialogResult.OK)
            {
                if (frm.IntegratedFrames != null)
                {
                    nudIntegratedFrames.SetNUDValue(frm.IntegratedFrames.Interval);
                    nudStartingAtFrame.SetNUDValue(frm.IntegratedFrames.StartingAtFrame);

                    m_State = AavConfigState.ReadyToConvert;
                    var reinterlacedStream = m_VideoController.FramePlayer.Video as ReInterlacingVideoStream;
                    if (reinterlacedStream != null && (reinterlacedStream.Mode == ReInterlaceMode.ShiftOneField || reinterlacedStream.Mode == ReInterlaceMode.SwapFields))
                    {
                        rbFirstFieldBottom.Checked = true;
                    }
                    UpdateControlState();
                    return;
                }
            }

            if (m_VideoController.ShowMessageBox(
                    "This must be an integrated video with consistent and known integration rate in order to convert it to AAV.\r\n\r\nTo enter manually the 'Starting At' frame and the 'Integration' rate press OK.\r\n\r\nPlease note that Tangra will not try to validate the values you entered.",
                    "Tangra", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.OK)
            {
                m_ManualIntegrationConfig = true;
                m_State = AavConfigState.ManualIntegrationRateEntry;
                UpdateControlState();
            }
        }
コード例 #5
0
        public ucConvertVideoToAav(ConvertVideoToAavOperation operation, VideoController videoController)
            : this()
        {
            m_Operation = operation;
            m_VideoController = videoController;

            nudFirstFrame.Minimum = videoController.VideoFirstFrame;
            nudFirstFrame.Maximum = videoController.VideoLastFrame - 1;
            nudFirstFrame.Value = nudFirstFrame.Minimum;

            nudLastFrame.Minimum = videoController.VideoFirstFrame;
            nudLastFrame.Maximum = videoController.VideoLastFrame - 1;
            nudLastFrame.Value = nudLastFrame.Maximum;

            nudStartingAtFrame.Minimum = videoController.VideoFirstFrame;
            nudStartingAtFrame.Maximum = videoController.VideoLastFrame - 1;
            nudStartingAtFrame.Value = nudFirstFrame.Minimum;

            UpdateVtiOsdPositions(TangraContext.Current.FrameHeight - 28, TangraContext.Current.FrameHeight);

            AutoDetectVTIOSDPosition();

            m_State = AavConfigState.ConfirmingVtiOsdPosition;
            UpdateControlState();
        }
コード例 #6
0
        private void btnUseIntegrationRate_Click(object sender, EventArgs e)
        {
            m_State = AavConfigState.ReadyToConvert;
            var reinterlacedStream = m_VideoController.FramePlayer.Video as ReInterlacingVideoStream;

            if (reinterlacedStream != null && (reinterlacedStream.Mode == ReInterlaceMode.ShiftOneField || reinterlacedStream.Mode == ReInterlaceMode.SwapFields))
            {
                rbFirstFieldBottom.Checked = true;
            }
            UpdateControlState();
        }
コード例 #7
0
        private void btnConvert_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(cbxCameraModel.Text))
            {
                m_VideoController.ShowMessageBox(
                    "Camera model must be specified. Use 'Unknown' if the camera model is not known.",
                    "Tangra",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);

                cbxCameraModel.Focus();
                return;
            }

            if (string.IsNullOrWhiteSpace(cbxSensorInfo.Text))
            {
                m_VideoController.ShowMessageBox(
                    "Sensor info must be specified. Use 'Unknown' if the camera sensor is not known.",
                    "Tangra",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);

                cbxSensorInfo.Focus();
                return;
            }

            saveFileDialog.FileName = Path.GetFileName(Path.ChangeExtension(m_VideoController.CurrentVideoFileName, ".aav"));

            if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                m_State = AavConfigState.Converting;
                UpdateControlState();

                m_VideoController.MoveToFrame((int)nudFirstFrame.Value);

                var vtiOsdPosition = m_RoiSelector.SelectedROI;

                m_Operation.StartConversion(
                    saveFileDialog.FileName,
                    vtiOsdPosition.Top,
                    vtiOsdPosition.Bottom,
                    vtiOsdPosition.Left,
                    vtiOsdPosition.Right,
                    (int)nudStartingAtFrame.Value,
                    (int)nudIntegratedFrames.Value,
                    (int)nudLastFrame.Value,
                    cbxCameraModel.Text,
                    cbxSensorInfo.Text,
                    rbFirstFieldBottom.Checked,
                    m_ManualIntegrationConfig);
            }
        }
コード例 #8
0
        private void btnConfirmPosition_Click(object sender, EventArgs e)
        {
            m_State = AavConfigState.DetectingIntegrationRate;
            nudFirstFrame.SetNUDValue(m_VideoController.CurrentFrameIndex);

            var vtiOsdPosition = m_RoiSelector.SelectedROI;

            TangraConfig.Settings.AAV.RegisterOsdPosition(
                m_VideoController.FramePlayer.Video.Width,
                m_VideoController.FramePlayer.Video.Height,
                vtiOsdPosition.Top,
                vtiOsdPosition.Bottom,
                vtiOsdPosition.Left,
                vtiOsdPosition.Right);

            TangraConfig.Settings.Save();

            UpdateControlState();
        }
コード例 #9
0
 internal void EndConversion()
 {
     m_State = AavConfigState.FinishedConverting;
     UpdateControlState();
 }
コード例 #10
0
        private void btnDetectIntegrationRate_Click(object sender, EventArgs e)
        {
            var frm = new frmIntegrationDetection(m_VideoController, (int)nudFirstFrame.Value);
            frm.StartPosition = FormStartPosition.CenterParent;
            DialogResult res = frm.ShowDialog(this);

            if (res == DialogResult.OK)
            {
                if (frm.IntegratedFrames != null)
                {
                    nudIntegratedFrames.SetNUDValue(frm.IntegratedFrames.Interval);
                    nudStartingAtFrame.SetNUDValue(frm.IntegratedFrames.StartingAtFrame);

                    m_State = AavConfigState.ReadyToConvert;
                    var reinterlacedStream = m_VideoController.FramePlayer.Video as ReInterlacingVideoStream;
                    if (reinterlacedStream != null && (reinterlacedStream.Mode == ReInterlaceMode.ShiftOneField || reinterlacedStream.Mode == ReInterlaceMode.SwapFields))
                        rbFirstFieldBottom.Checked = true;
                    UpdateControlState();
                }
            }
            else if (res == DialogResult.Cancel)
            {
                m_VideoController.ShowMessageBox("This must be an integrated video with consistent and known integration rate in order to convert it to AAV.", "Tangra", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #11
0
        private void btnConvert_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(cbxCameraModel.Text))
            {
                m_VideoController.ShowMessageBox(
                    "Camera model must be specified. Use 'Unknown' if the camera model is not known.",
                    "Tangra",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);

                cbxCameraModel.Focus();
                return;
            }

            if (string.IsNullOrWhiteSpace(cbxSensorInfo.Text))
            {
                m_VideoController.ShowMessageBox(
                    "Sensor info must be specified. Use 'Unknown' if the camera sensor is not known.",
                    "Tangra",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);

                cbxSensorInfo.Focus();
                return;
            }

            saveFileDialog.FileName = Path.GetFileName(Path.ChangeExtension(m_VideoController.CurrentVideoFileName, ".aav"));

            if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                m_State = AavConfigState.Converting;
                UpdateControlState();

                m_VideoController.MoveToFrame((int) nudFirstFrame.Value);
                m_Operation.StartConversion(
                    saveFileDialog.FileName,
                    (int)nudPreserveVTITopRow.Value,
                    (int)nudPreserveVTIBottomRow.Value,
                    (int)nudStartingAtFrame.Value,
                    (int)nudIntegratedFrames.Value,
                    cbxCameraModel.Text,
                    cbxSensorInfo.Text,
                    rbFirstFieldBottom.Checked);
            }
        }
コード例 #12
0
        private void btnConfirmPosition_Click(object sender, EventArgs e)
        {
            m_State = AavConfigState.DetectingIntegrationRate;
            nudFirstFrame.SetNUDValue(m_VideoController.CurrentFrameIndex);

            TangraConfig.Settings.AAV.RegisterOsdPosition(
                m_VideoController.FramePlayer.Video.Width,
                m_VideoController.FramePlayer.Video.Height,
                (int)nudPreserveVTITopRow.Value,
                (int)nudPreserveVTIBottomRow.Value);
            TangraConfig.Settings.Save();

            UpdateControlState();
        }
コード例 #13
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            m_State = AavConfigState.FinishedConverting;
            UpdateControlState();

            m_Operation.EndConversion();
        }