📄 emc_signal.c
字号:
/*******************************************************************************
File name : emc_signal.c
Description : no signal check & warning dialog display
Revision : 1.0
COPYRIGHT (C) EMC-HUST-JRC 2005.
Date Label Auther Comment
---- ---- ------ ---------------------
01-03-2006 Allen Wu Created
*********************************************************************************/
/* Includes --------------------------------------------------------------- */
#include "stvid.h"
#include "vid.h"
//#include "stosd.h"
//#include "hl_stosd.h"
#include "gui.h"
#include "osdwrap.h"
#include "sr_tuner.h"
//#include "OsdRegionInit.h"
#include "emc_font.h"
#include "emc_menustate.h"
#include "emc_signal.h"
#include "pics/data_bitmap_info.h"
#include "pics/data_struct_info.h"
/* Private Typedef ----------------------------------------------------------------*/
#define MIN_SIGNAL_STRENGTH 1
#define MIN_SIGNAL_QUALITY 1/*Modified from 20 to 1,by Allen,02-19-2006*/
//extern STVID_ViewPortHandle_t VID_ViewPortHandle;
extern dvb_state_e currMenuState;
BOOL bNoSignalLogoShow = FALSE;
static void drawNoSignalInfo(void)
{
int WIDTH = 210;
int HEIGHT = 60;
//sttbx_Print("\n----drawNoSignalInfo\n");
STVID_DisableOutputWindow(VID_ViewPortHandle); //FF05 the signal min strength seems a little high
if(currMenuState== DVB_DISPLAY)
{
EMC_HideAllRegions();
STOSD_FillRectangle(Handle_ProviewWindow, 0,0,ProviewWindowParams.Width,ProviewWindowParams.Height, backgroundColor);
STOSD_FillRectangle(Handle_ProviewWindow,
(ProviewWindowParams.Width-WIDTH)/2,(ProviewWindowParams.Height-HEIGHT)/2,
WIDTH,HEIGHT,
lightbluecolor);
STOSD_FillRectangle(Handle_ProviewWindow,
(ProviewWindowParams.Width-WIDTH)/2+2,(ProviewWindowParams.Height-HEIGHT)/2+2,
WIDTH-2*2,HEIGHT-2*2,
dialogcolor);
HL_STOSD_DrawBMP(Handle_ProviewWindow,
(ProviewWindowParams.Width-WIDTH)/2+2+8,
(ProviewWindowParams.Height-HEIGHT)/2+2+(HEIGHT-2*2-Bitmap_Struct_Info.Height)/2+1,
Bitmap_Struct_Info);
EMC_DrawTextRectangle(Handle_ProviewWindow,
(ProviewWindowParams.Width-WIDTH)/2+2+55, (ProviewWindowParams.Height-HEIGHT)/2+2+(HEIGHT-2*2-24)/2,120, 24,
"NO SIGNAL", JLEFT,FONT_MYENGFONT,FALSE,
whitecolor, dialogcolor, dialogcolor);
EMC_ShowRegion();
}
}
static void clearNoSignalInfo(void)
{
sttbx_Print("\n----clearNoSignalInfo\n");
#if 1/*modified by Allen,01-03-2005*/
STVID_EnableOutputWindow(VID_ViewPortHandle);
#endif
if(currMenuState == DVB_DISPLAY)
EMC_HideAllRegions();
}
void NoSignalCheck(void)
{
U32 SignalQuality,SignalStrength;
SRTNR_GetSignalInfo(TNR_DEFAULT_ID,&SignalQuality, &SignalStrength);
//sttbx_Print("---SignalQuality = %d,SignalStrength = %d\n",SignalQuality,SignalStrength);
//sttbx_Print("---bNoSignalLogoShow = %d\n",bNoSignalLogoShow?1:0);
#if 0/*commented by Allen,02-19-2006*/
//{{FF03 ,test for another time when found no signal
if(SignalStrength<=MIN_SIGNAL_STRENGTH || SignalQuality<=MIN_SIGNAL_QUALITY)
{
task_delay(ST_GetClocksPerSecond());
SRTNR_GetSignalInfo(TNR_DEFAULT_ID,&SignalQuality, &SignalStrength);
}
//}}FF03 end
SRTNR_GetSignalInfo(TNR_DEFAULT_ID,&SignalQuality, &SignalStrength);
#endif
if(/*SignalStrength<=MIN_SIGNAL_STRENGTH || */SignalQuality<=MIN_SIGNAL_QUALITY)
{
if(bNoSignalLogoShow == FALSE)
{ /*from signal to no_signal*/
if(currMenuState == DVB_DISPLAY)
{
/*draw NO_SINGAL Logo*/
drawNoSignalInfo();
bNoSignalLogoShow = TRUE;
}
else
{
drawNoSignalInfo(); /*FF03 comment out*/
}
}
}
else if(/*SignalStrength>MIN_SIGNAL_STRENGTH && */SignalQuality>MIN_SIGNAL_QUALITY)
{
if(bNoSignalLogoShow == TRUE)
{ /*from no_signal to signal*/
if(currMenuState == DVB_DISPLAY)
{
/*clear NO_SINGAL Logo*/
clearNoSignalInfo();
}
bNoSignalLogoShow = FALSE;
}
}
}
/*--------------------------------------EOF---------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -