📄 captiondemodlg.cpp
字号:
m_Scroll_Saturation.SetScrollRange(0,255);
m_Scroll_Saturation.SetScrollPos(64);
m_text_saturation.Format(TEXT("%d"), 64);
pICg2k->spv_vo_saturation(64);
//初始化色度Gain
maxgain =0;
m_Scroll_Gain.SetScrollRange(0, maxgain);
m_Scroll_Gain.SetScrollPos(0);
m_text_gain.Format(TEXT("%d"), 0);
pICg2k->spv_vo_gain(0);
}
}
UpdateData(FALSE);
}
void CCaptionDemoDlg::OnRadioSdi()
{
m_InputVideoType =SDI;
pICg2k->spv_switch_decoder_source(m_InputVideoType);// set input video source for sdi
}
void CCaptionDemoDlg::OnVideoBusWideselect()
{
if( m_button_videowideselect.GetCheck())
{
m_VideoDataWide=BIT10;
pICg2k->spv_videobuswide(m_VideoDataWide);
}
else
{
m_VideoDataWide=BIT8;
pICg2k->spv_videobuswide(m_VideoDataWide);
}
}
// input video type select//////////////////////////////////////////////
void CCaptionDemoDlg::OnVideotypePal()
{
m_VideoType = PAL;
pICg2k->spv_video_format( m_VideoType );
}
void CCaptionDemoDlg::OnVideotypeNtsc()
{
m_VideoType = NTSC;
pICg2k->spv_video_format( m_VideoType );
}
// Lock Mode select///////////////////////////////////////////////////
void CCaptionDemoDlg::OnSynExternal()
{
USLONG m_isbbntsc = 0;
//+++added for card_yuv 20041105
if((m_BoardType == MAGICG_LE)||(m_BoardType == MAGICG_YUV))
//---added for card_yuv 20041105
{//MAGICG_LE
m_LockToExternal = TRUE;
pICg2k->spv_genlock(TRUE);
m_button_syn_external.SetCheck(1);
m_button_syn_internal.SetCheck(0);
}
else
{//MAGICG_BOX
pICg2k->spv_isbb_ntsc(&m_isbbntsc);
if(m_VideoType == NTSC)
{
if (m_isbbntsc == TRUE)
{
m_LockToExternal = TRUE;
pICg2k->spv_genlock(TRUE);
m_button_syn_external.SetCheck(1);
m_button_syn_internal.SetCheck(0);
}
else
{
AfxMessageBox("Software is NTSC format, but BB input is PAL format or no input");
m_button_syn_external.SetCheck(0);
m_button_syn_internal.SetCheck(1);
}
}
if(m_VideoType == PAL)
{
if (m_isbbntsc == TRUE)
{
AfxMessageBox("Software is PAL format, but BB input is NTSC format");
m_button_syn_external.SetCheck(0);
m_button_syn_internal.SetCheck(1);
}
else
{
m_LockToExternal = TRUE;
pICg2k->spv_genlock(TRUE);
m_button_syn_external.SetCheck(1);
m_button_syn_internal.SetCheck(0);
}
}
}
}
void CCaptionDemoDlg::OnSynInternal()
{
m_LockToExternal = FALSE;
pICg2k->spv_genlock(FALSE);
m_mixstate=FRAMEBYPASS;
pICg2k->spv_key_state(m_mixstate); //frame bypass
//内同步时只有输出图文输出有效
m_button_overlaymode_alphamix.SetCheck(FALSE);
m_button_overlaymode_frambypass.SetCheck(TRUE);
m_button_overlaymode_backpass.SetCheck(FALSE);
}
void CCaptionDemoDlg::OnOverlaymodeAlphamix()
{
m_mixstate=VIDEOMIXFRAME;
pICg2k->spv_key_state(m_mixstate); //cg mix with back video
//更新显示BUTTON的状态
m_button_overlaymode_alphamix.SetCheck(TRUE);
m_button_overlaymode_frambypass.SetCheck(FALSE);
m_button_overlaymode_backpass.SetCheck(FALSE);
//内同步MIX时,设置背景活动视频为单色图像,例如黑场
if(m_LockToExternal == FALSE)
{
pICg2k->spv_key_black(TRUE,0,0,0);
}
}
void CCaptionDemoDlg::OnOverlaymodeFramebypass()
{
m_mixstate=FRAMEBYPASS;
pICg2k->spv_key_state(m_mixstate); //frame bypass
//更新显示BUTTON的状态
m_button_overlaymode_alphamix.SetCheck(FALSE);
m_button_overlaymode_frambypass.SetCheck(TRUE);
m_button_overlaymode_backpass.SetCheck(FALSE);
}
void CCaptionDemoDlg::OnOverlaymodeBackpass()
{
m_mixstate=VIDOEBYPASS;
pICg2k->spv_key_state(m_mixstate); //video bypass
//更新显示BUTTON的状态
m_button_overlaymode_alphamix.SetCheck(FALSE);
m_button_overlaymode_frambypass.SetCheck(FALSE);
m_button_overlaymode_backpass.SetCheck(TRUE);
}
void CCaptionDemoDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
int temppos = 0;
int minpos = 0 , maxpos = 0;
int tmpstartx=0, tmpstarty=0;
// char chaTmp[256];
pScrollBar->GetScrollRange(&minpos, &maxpos);
maxpos = pScrollBar->GetScrollLimit();
switch(pScrollBar->GetDlgCtrlID())
{
//for color adjust///////////////////////////////////////////////////////////////
//brightnese 调整
case IDC_SCROLLBAR_BRIGHT:
temppos=m_Scroll_Bright.GetScrollPos();
switch(nSBCode)
{
case SB_LINELEFT:
temppos=max(0,temppos-1);
m_Scroll_Bright.SetScrollPos(temppos);
m_text_bright.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_bright(temppos);
break;
case SB_LINERIGHT:
temppos=min(255,temppos+1);
m_Scroll_Bright.SetScrollPos(temppos);
m_text_bright.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_bright(temppos);
break;
case SB_PAGELEFT:
temppos=max(0,temppos-8);
m_Scroll_Bright.SetScrollPos(temppos);
m_text_bright.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_bright(temppos);
break;
case SB_PAGERIGHT:
temppos=min(255,temppos+8);
m_Scroll_Bright.SetScrollPos(temppos);
m_text_bright.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_bright(temppos);
break;
case SB_THUMBPOSITION:// Scroll to absolute position. nPos is the position
temppos=nPos; // of the scroll box at the end of the drag operation.
m_Scroll_Bright.SetScrollPos(temppos);
m_text_bright.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_bright(temppos);
break;
case SB_THUMBTRACK:// Drag scroll box to specified position. nPos is the
temppos=nPos; // position that the scroll box has been dragged to.
m_Scroll_Bright.SetScrollPos(temppos);
m_text_bright.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_bright(temppos);
//sprintf(chaTmp, "TB_THUMBTRACK %d\n", temppos);
//OutputDebugString(chaTmp);
break;
default:
break;
}
break;
//contrast 调整
case IDC_SCROLLBAR_CONTRAST:
temppos=m_Scroll_Contrast.GetScrollPos();
switch(nSBCode)
{
case SB_LINELEFT:
temppos=max(0,temppos-1);
m_Scroll_Contrast.SetScrollPos(temppos);
m_text_contrast.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_contrast(temppos);
break;
case SB_LINERIGHT:
temppos=min(255,temppos+1);
m_Scroll_Contrast.SetScrollPos(temppos);
m_text_contrast.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_contrast(temppos);
break;
case SB_PAGELEFT:
m_Scroll_Contrast.SetScrollPos(temppos);
m_text_contrast.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_contrast(temppos);
temppos=max(0,temppos-8);
break;
case SB_PAGERIGHT:
temppos=min(255,temppos+8);
m_Scroll_Contrast.SetScrollPos(temppos);
m_text_contrast.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_contrast(temppos);
break;
case SB_THUMBPOSITION:// Scroll to absolute position. nPos is the position
temppos=nPos; // of the scroll box at the end of the drag operation.
m_Scroll_Contrast.SetScrollPos(temppos);
m_text_contrast.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_contrast(temppos);
break;
case SB_THUMBTRACK:// Drag scroll box to specified position. nPos is the
temppos=nPos; // position that the scroll box has been dragged to.
m_Scroll_Contrast.SetScrollPos(temppos);
m_text_contrast.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_contrast(temppos);
break;
default:
break;
}
break;
//Hue 调整
case IDC_SCROLLBAR_HUE:
temppos=m_Scroll_Hue.GetScrollPos();
switch(nSBCode)
{
case SB_LINELEFT:
temppos=max(0,temppos-1);
m_Scroll_Hue.SetScrollPos(temppos);
m_text_hue.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_hue(temppos);
break;
case SB_LINERIGHT:
temppos=min(255,temppos+1);
m_Scroll_Hue.SetScrollPos(temppos);
m_text_hue.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_hue(temppos);
break;
case SB_PAGELEFT:
temppos=max(0,temppos-8);
m_Scroll_Hue.SetScrollPos(temppos);
m_text_hue.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_hue(temppos);
break;
case SB_PAGERIGHT:
temppos=min(255,temppos+8);
m_Scroll_Hue.SetScrollPos(temppos);
m_text_hue.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_hue(temppos);
break;
case SB_THUMBPOSITION:// Scroll to absolute position. nPos is the position
temppos=nPos; // of the scroll box at the end of the drag operation.
m_Scroll_Hue.SetScrollPos(temppos);
m_text_hue.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_hue(temppos);
break;
case SB_THUMBTRACK:// Drag scroll box to specified position. nPos is the
temppos=nPos; // position that the scroll box has been dragged to.
m_Scroll_Hue.SetScrollPos(temppos);
m_text_hue.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_hue(temppos);
break;
default:
break;
}
break;
//Saturation 调整
case IDC_SCROLLBAR_SATURATION:
temppos=m_Scroll_Saturation.GetScrollPos();
switch(nSBCode)
{
case SB_LINELEFT:
temppos=max(0,temppos-1);
m_Scroll_Saturation.SetScrollPos(temppos);
m_text_saturation.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_saturation(temppos);
break;
case SB_LINERIGHT:
temppos=min(255,temppos+1);
m_Scroll_Saturation.SetScrollPos(temppos);
m_text_saturation.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_saturation(temppos);
break;
case SB_PAGELEFT:
temppos=max(0,temppos-8);
m_Scroll_Saturation.SetScrollPos(temppos);
m_text_saturation.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_saturation(temppos);
break;
case SB_PAGERIGHT:
temppos=min(255,temppos+8);
m_Scroll_Saturation.SetScrollPos(temppos);
m_text_saturation.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_saturation(temppos);
break;
case SB_THUMBPOSITION://Scroll to absolute position. nPos is the position
temppos=nPos; //of the scroll box at the end of the drag operation.
m_Scroll_Saturation.SetScrollPos(temppos);
m_text_saturation.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_saturation(temppos);
break;
case SB_THUMBTRACK://Drag scroll box to specified position. nPos is the
temppos=nPos; //position that the scroll box has been dragged to.
m_Scroll_Saturation.SetScrollPos(temppos);
m_text_saturation.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_saturation(temppos);
break;
default:
break;
}
break;
//色度GAIN 调整
case IDC_SCROLLBAR_GAIN:
temppos=m_Scroll_Gain.GetScrollPos();
switch(nSBCode)
{
case SB_LINELEFT:
temppos=max(0,temppos-1);
m_Scroll_Gain.SetScrollPos(temppos);
m_text_gain.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_gain(temppos);
break;
case SB_LINERIGHT:
temppos=min((int)maxgain,temppos+1);
m_Scroll_Gain.SetScrollPos(temppos);
m_text_gain.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_gain(temppos);
break;
case SB_PAGELEFT:
temppos=max(0,temppos-8);
m_Scroll_Gain.SetScrollPos(temppos);
m_text_gain.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_gain(temppos);
break;
case SB_PAGERIGHT:
temppos=min((int)maxgain,temppos+8);
m_Scroll_Gain.SetScrollPos(temppos);
m_text_gain.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_gain(temppos);
break;
case SB_THUMBPOSITION:// Scroll to absolute position. nPos is the position
temppos=nPos; // of the scroll box at the end of the drag operation.
m_Scroll_Gain.SetScrollPos(temppos);
m_text_gain.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_gain(temppos);
break;
case SB_THUMBTRACK:// Drag scroll box to specified position. nPos is the
temppos=nPos; // position that the scroll box has been dragged to.
m_Scroll_Gain.SetScrollPos(temppos);
m_text_gain.Format(TEXT("%d"), temppos);
pICg2k->spv_vo_gain(temppos);
break;
default:
break;
}
break;
//for pahse adjust///////////////////////////////////////////////////////////////
//行相位调整
case IDC_SCROLLBAR_HPHASE:
temppos=m_Scroll_Hphase.GetScrollPos();
switch(nSBCode)
{
case SB_LINELEFT:
temppos=max(1,temppos-1);
m_Scroll_Hphase.SetScrollPos(temppos);
m_text_hphase.Fo
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -