📄 wndw_ds_src.c
字号:
{
U8 _wt1_, _ofst_;
U8 _t1_;
if(_osd_pos_y == WNDW_DS_SR_NUM_WN_Y){
if(wndw_pop_crnt_ch > 0) wndw_pop_crnt_ch--;
else wndw_pop_crnt_ch = cmn_max_ch-1;
SetCrntDvcCh(wndw_pop_crnt_ch,&wndw_crnt_dvc,&wndw_crnt_ch);
//// if(GetAsicFlgType(wndw_crnt_dvc,DVC_PG0,0x38,BIT0<<wndw_crnt_ch) == OFF) b_ch_src = CH_SRC_LV;
// if(GetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),BIT2) == OFF) b_ch_src = CH_SRC_LV;
// else b_ch_src = CH_SRC_PB;
SetWndwDsSrOSDWn(_pth);
SetWndwDsSrOSDLv(_pth);
SetWndwDsSrOSDPb(_pth);
SetWndwDsSrOSDEnhChk(_pth);
}
else if(_osd_pos_y == WNDW_DS_SR_NUM_LV_Y){
// if(b_ch_src == CH_SRC_LV){
if(!(GetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),BIT2))){ //... PB_PATH_EN=0
SetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),0x30,0x10); //... FUNC_MODE=1
WaitChStrbDoneX(BIT0<<wndw_crnt_ch);
// _t1_ = GetWndwDsSrLv();
_t1_ = GetAsicVar8Type(wndw_crnt_dvc,DVC_PG0,0x80+0x10*wndw_crnt_ch,0x62);
if(_t1_ > 0) _t1_--;
else _t1_ = 3;
// SetWndwDsSrLv(_t1_);
SetAsicVar8Type(wndw_crnt_dvc,DVC_PG0,0x80+0x10*wndw_crnt_ch,0x62,_t1_);
SetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),0x30,0x00); //... FUNC_MODE=0
SetWndwDsSrOSDLv(_pth);
}
}
else if(_osd_pos_y == WNDW_DS_SR_NUM_PB_Y){
if(GetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),BIT2)){ //... PB_PATH_EN=1
#if defined(__4CH__)
_wt1_ = 3;
_ofst_ = 0;
#elif defined(__16CH__)
_wt1_ = ((cmn_max_ch>>cmn_rc_md)-1);
_ofst_ = GetWndwDsSrPbOfst();
#endif
// _t1_ = GetWndwDsSrPb();
_t1_ = GetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x16+(wndw_crnt_ch<<3),0x0f);
if(_t1_ > _ofst_) _t1_--;
else _t1_ = (_ofst_+_wt1_);
// SetWndwDsSrPb(_t1_);
SetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x16+(wndw_crnt_ch<<3),0x0f,_t1_);
SetWndwDsSrOSDPb(_pth);
}
}
// if(b_ch_src == CH_SRC_LV){
// if(_osd_pos_y == WNDW_DS_SR_NUM_LV_Y){
// _t1_ = GetWndwDsSrLv();
// if(_t1_ > 0) _t1_--;
// else _t1_ = 3;
// SetWndwDsSrLv(_t1_);
// SetWndwDsSrOSDLv(_pth);
// }
// }
// else{
// if(_osd_pos_y == WNDW_DS_SR_NUM_PB_Y){
//#if defined(__4CH__)
// _wt1_ = 3;
// _ofst_ = 0;
//#elif defined(__16CH__)
// _wt1_ = ((cmn_max_ch>>cmn_rc_md)-1);
// _ofst_ = GetWndwDsSrPbOfst();
//#endif
// _t1_ = GetWndwDsSrPb();
// if(_t1_ > _ofst_) _t1_--;
// else _t1_ = (_ofst_+_wt1_);
// SetWndwDsSrPb(_t1_);
// SetWndwDsSrOSDPb(_pth);
// }
// }
// }
}
//==================================================================================
void RunWndwDsSrInc(U8 _pth, U8 _osd_pos_y)
{
U8 _t1_;//, _t2_;
U8 _wt1_, _ofst_;
if(_osd_pos_y == WNDW_DS_SR_NUM_WN_Y){
if(wndw_pop_crnt_ch < (cmn_max_ch-1)) wndw_pop_crnt_ch++;
else wndw_pop_crnt_ch = 0;
SetCrntDvcCh(wndw_pop_crnt_ch,&wndw_crnt_dvc,&wndw_crnt_ch);
//// if(GetAsicFlgType(wndw_crnt_dvc,DVC_PG0,0x38,BIT0<<wndw_crnt_ch) == OFF) b_ch_src = CH_SRC_LV;
// if(GetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),BIT2) == OFF) b_ch_src = CH_SRC_LV;
// else b_ch_src = CH_SRC_PB;
SetWndwDsSrOSDWn(_pth);
SetWndwDsSrOSDLv(_pth);
SetWndwDsSrOSDPb(_pth);
SetWndwDsSrOSDEnhChk(_pth);
}
// else{
// if(b_ch_src == CH_SRC_LV){
// if(_osd_pos_y == WNDW_DS_SR_NUM_LV_Y){
// _t1_ = GetWndwDsSrLv();
// if(_t1_ < 3) _t1_++;
// else _t1_ = 0;
// SetWndwDsSrLv(_t1_);
// SetWndwDsSrOSDLv(_pth);
// }
// }
// else{
// if(_osd_pos_y == WNDW_DS_SR_NUM_PB_Y){
//#if defined(__4CH__)
// _wt1_ = 3;
// _ofst_ = 0;
//#elif defined(__16CH__)
// _wt1_ = ((cmn_max_ch>>cmn_rc_md)-1);
// _ofst_ = GetWndwDsSrPbOfst();
//#endif
// _t1_ = GetWndwDsSrPb();
// if(_t1_ < (_ofst_+_wt1_)) _t1_++;
// else _t1_ = _ofst_;
// SetWndwDsSrPb(_t1_);
// SetWndwDsSrOSDPb(_pth);
// }
// }
// }
else if(_osd_pos_y == WNDW_DS_SR_NUM_LV_Y){
// if(b_ch_src == CH_SRC_LV){
if(!(GetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),BIT2))){ //... PB_PATH_EN=0
SetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),0x30,0x10); //... FUNC_MODE=1
WaitChStrbDoneX(BIT0<<wndw_crnt_ch);
// _t1_ = GetWndwDsSrLv();
_t1_ = GetAsicVar8Type(wndw_crnt_dvc,DVC_PG0,0x80+0x10*wndw_crnt_ch,0x62);
if(_t1_ < 3) _t1_++;
else _t1_ = 0;
// SetWndwDsSrLv(_t1_);
SetAsicVar8Type(wndw_crnt_dvc,DVC_PG0,0x80+0x10*wndw_crnt_ch,0x62,_t1_);
SetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),0x30,0x00); //... FUNC_MODE=0
SetWndwDsSrOSDLv(_pth);
}
}
else if(_osd_pos_y == WNDW_DS_SR_NUM_PB_Y){
if(GetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),BIT2)){ //... PB_PATH_EN=1
#if defined(__4CH__)
_wt1_ = 3;
_ofst_ = 0;
#elif defined(__16CH__)
_wt1_ = ((cmn_max_ch>>cmn_rc_md)-1);
_ofst_ = GetWndwDsSrPbOfst();
#endif
// _t1_ = GetWndwDsSrPb();
_t1_ = GetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x16+(wndw_crnt_ch<<3),0x0f);
if(_t1_ < (_ofst_+_wt1_)) _t1_++;
else _t1_ = _ofst_;
// SetWndwDsSrPb(_t1_);
SetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x16+(wndw_crnt_ch<<3),0x0f,_t1_);
SetWndwDsSrOSDPb(_pth);
}
}
}
//==================================================================================
void RunWndwDsSr(U8 _pth)
{
U8 _t1_;
U8 _osd_pos_x_, _osd_pos_y_;
_osd_pos_x_ = GetMseOSDX(reg_crsr_pos_x);
_osd_pos_y_ = GetMseOSDY(reg_crsr_pos_y);
if(wndw_ds_sc_fmt != SC_FMT_8CH){
RunWndwDsSrOSDArwWn(_pth,_osd_pos_x_,_osd_pos_y_);
// if(b_ch_src == CH_SRC_LV)
if(!(GetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),BIT2))) //... PB_PATH_EN=0
RunWndwDsSrOSDArwLv(_pth,_osd_pos_x_,_osd_pos_y_);
else RunWndwDsSrOSDArwPb(_pth,_osd_pos_x_,_osd_pos_y_);
}
if(b_mse_btn_dwn_lb == 1){
b_mse_btn_dwn_lb = 0;
if((_osd_pos_x_ == WNDW_DS_SR_CLOS_X)&&(_osd_pos_y_ == WNDW_DS_SR_CLOS_Y)){
// SetBoxBtnStrPush(BOX_WNDW_QUIT);
}
}
if(b_mse_btn_dwn_rb == 1) b_mse_btn_dwn_rb = 0;
if(b_mse_clk_lb == 1){
b_mse_clk_lb = 0;
if((_osd_pos_x_ == WNDW_DS_SR_CLOS_X)&&(_osd_pos_y_ == WNDW_DS_SR_CLOS_Y)){
// SetBoxBtnStrPull(BOX_WNDW_QUIT);
WriteOSDClr(_pth,MASTER,WNDW_DS_SR_POS_X,WNDW_DS_SR_POS_Y,WNDW_DS_SR_L,WNDW_DS_SR_H);
WriteOSDClrX(MASTER,WNDW_DS_SR_POS_X-1,WNDW_DS_SR_POS_Y-1,WNDW_DS_SR_L+2,WNDW_DS_SR_H+2);
// DisableBox(_pth,BOX_WNDW_QUIT,BOX_WNDW_FRM); // decoration wndwdow, main wndwdow
SetOSDNoMn();
// b_status_wndw = OFF;
b_cmn_wndw_mn = OFF;
wndw_mn_pos_crnt = 30;
}
else if(_osd_pos_x_ == WNDW_DS_SR_RDO_X){
if((_osd_pos_y_ == WNDW_DS_SR_RDO_LV_Y)||(_osd_pos_y_ == WNDW_DS_SR_RDO_PB_Y)){
//#if defined(__4CH__)
// if(GLBL_PB_MD != PB_MD_FLTNG){
//#endif
// if(_osd_pos_y_ == WNDW_DS_SR_RDO_LV_Y) b_ch_src = CH_SRC_LV;
// else{
// if(wndw_ds_in_type != IN_TYPE_DGTL) b_ch_src = CH_SRC_PB;
// }
if(wndw_ds_sc_fmt == SC_FMT_8CH){
if(_osd_pos_y_ == WNDW_DS_SR_RDO_LV_Y) _t1_ = CH_SRC_LV;
else _t1_ = CH_SRC_PB;
if(_t1_ != b_ch_src){
b_ch_src = _t1_;
// SetWndwDsSrOSDLv(_pth);
// SetWndwDsSrOSDPb(_pth);
//
// if(b_ch_src == CH_SRC_PB){
// SetAsicFlgType(MASTER,DVC_PG1,0x01,0x03,0x02); //... any field
//// SetAsicFlgType(MASTER,DVC_PG0,0x38,0x0f,0x0f); //... enable pb
// SetAsicFlgType(MASTER,DVC_PG1,0x10+(wndw_crnt_ch<<3),BIT2,BIT2); //... enable pb
// }
// else{
// SetAsicFlgType(MASTER,DVC_PG1,0x01,0x03,0x00); //... odd field
//// SetAsicFlgType(MASTER,DVC_PG0,0x38,0x0f,0x00); //... disable pb
// SetAsicFlgType(MASTER,DVC_PG1,0x10+(wndw_crnt_ch<<3),BIT2,0x00); //... disable pb
// }
//
// for(_t1_=0;_t1_<4;_t1_++){
// if((b_ch_src == CH_SRC_PB)&&(b_rc_fm_type == FM_TYPE_CIF))
// SetSclRto(_pth,MASTER,_t1_,0x23,0x23);
// else SetSclRto(_pth,MASTER,_t1_,0x13,0x23);
//
//// SetAsicFlgType(MASTER,DVC_PG1,REG_FIELD_OP_X,BIT4<<_t1_,BIT4<<_t1_);
// SetAsicFlgType(MASTER,DVC_PG1,0x12+(_t1_<<3),BIT5,BIT5);
//// SetAsicFlgType(MASTER,DVC_PG0,0x15+0x40*_t1_,BIT5,BIT5); // set 2 for V_ALIAS_X(page0) when FIELD_OP(page1) == 1.
// }
// SelWndwDsSrSrc();//_pth);
if(b_ch_src == CH_SRC_PB){
SetAsicFlgType(MASTER,DVC_PG1,0x01,0x03,0x02); //... STRB_FLD=2
SetAsicFlgType(MASTER,DVC_PG1,0x16,BIT7,BIT7); //... PB_AUTO_EN=1
}
else{
SetAsicFlgType(MASTER,DVC_PG1,0x01,0x03,0x00); //... STRB_FLD=0
// SetAsicFlgType(MASTER,DVC_PG1,0x16,BIT7,0x00); //... PB_AUTO_EN=0
}
SetWndwDsScFmtPsd8Ch();
SetWndwDsSrOSDLv(_pth);
SetWndwDsSrOSDPb(_pth);
}
}
else{
if(_osd_pos_y_ == WNDW_DS_SR_RDO_LV_Y) _t1_ = 0x00;
else _t1_ = BIT2;
if(_t1_ != GetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),BIT2)){
if(_t1_){ //... PB_PATH_EN=1
// SetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x01,0x03,0x02); //... STRB_FLD=2
if(wndw_rc_fm_type == CIF_TYPE_FR)
SetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x01,0x03,0x03); //... STRB_FLD=3 (because AUTO_ENHANCE=1)
else
SetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x01,0x03,0x02); //... STRB_FLD=2
SetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x16,BIT7,BIT7); //... PB_AUTO_EN=1
SetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),0x30|BIT2,0x10|BIT2); //... FUNC_MODE=1,PB_PATH_EN=1
}
else{
// WaitChStrbDoneX(BIT0<<wndw_crnt_ch);
SetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x10+(wndw_crnt_ch<<3),0x30|BIT2,0x00); //... FUNC_MODE=0,PB_PATH_EN=0
}
// SelWndwDsSrSrc();//_pth);
InitChScaleAdapt(wndw_crnt_dvc,wndw_crnt_ch);
SetWndwDsSrOSDLv(_pth);
SetWndwDsSrOSDPb(_pth);
mse_flg_on_osd = MSE_ON_OSD_DS_SR_LV|MSE_ON_OSD_DS_SR_PB;
RunWndwDsSrOSDArwLv(_pth,_osd_pos_x_,_osd_pos_y_);
RunWndwDsSrOSDArwPb(_pth,_osd_pos_x_,_osd_pos_y_);
}
}
//#if defined(__4CH__)
// }
//#endif
}
}
else if(wndw_ds_sc_fmt != SC_FMT_8CH){
if(_osd_pos_x_ == WNDW_DS_SR_CHK_X){
if(_osd_pos_y_ == WNDW_DS_SR_CHK_Y){
// _t1_ = GetWndwDsSrEnh();
_t1_ = GetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x11+(wndw_crnt_ch<<3),BIT3)^BIT3;
// if(_t1_ == OFF) _t1_ = ON;
// else _t1_ = OFF;
// SetWndwDsSrEnh(_t1_);
SetAsicFlgType(wndw_crnt_dvc,DVC_PG1,0x11+(wndw_crnt_ch<<3),BIT3,_t1_);
SetWndwDsSrOSDEnhChk(_pth);
}
}
else if((_osd_pos_x_ == WNDW_DS_SR_DEC_WN_X)||(_osd_pos_x_ == WNDW_DS_SR_INC_WN_X)){
if(_osd_pos_y_ == WNDW_DS_SR_NUM_WN_Y){
if(_osd_pos_x_ == WNDW_DS_SR_DEC_WN_X) RunWndwDsSrDec(_pth,_osd_pos_y_);
else RunWndwDsSrInc(_pth,_osd_pos_y_);
}
}
else if((_osd_pos_x_ == WNDW_DS_SR_DEC_LV_X)||(_osd_pos_x_ == WNDW_DS_SR_INC_LV_X)){
if((_osd_pos_y_ == WNDW_DS_SR_NUM_LV_Y)||(_osd_pos_y_ == WNDW_DS_SR_NUM_PB_Y)){
if(_osd_pos_x_ == WNDW_DS_SR_DEC_LV_X) RunWndwDsSrDec(_pth,_osd_pos_y_);
else RunWndwDsSrInc(_pth,_osd_pos_y_);
}
}
}
}
if(b_mse_clk_rb == 1) b_mse_clk_rb = 0;
if(b_mse_pshng_clk_lb == 1){
b_mse_pshng_clk_lb = 0;
if(wndw_ds_sc_fmt != SC_FMT_8CH){
if((_osd_pos_x_ == WNDW_DS_SR_DEC_WN_X)||(_osd_pos_x_ == WNDW_DS_SR_INC_WN_X)){
if(_osd_pos_y_ == WNDW_DS_SR_NUM_WN_Y){
if(_osd_pos_x_ == WNDW_DS_SR_DEC_WN_X) RunWndwDsSrDec(_pth,_osd_pos_y_);
else RunWndwDsSrInc(_pth,_osd_pos_y_);
}
}
else if((_osd_pos_x_ == WNDW_DS_SR_DEC_LV_X)||(_osd_pos_x_ == WNDW_DS_SR_INC_LV_X)){
if((_osd_pos_y_ == WNDW_DS_SR_NUM_LV_Y)||(_osd_pos_y_ == WNDW_DS_SR_NUM_PB_Y)){
if(_osd_pos_x_ == WNDW_DS_SR_DEC_LV_X) RunWndwDsSrDec(_pth,_osd_pos_y_);
else RunWndwDsSrInc(_pth,_osd_pos_y_);
}
}
}
}
if(b_mse_pshng_clk_rb == 1) b_mse_pshng_clk_rb = 0;
}
//==================================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -