📄 o_fta_channel_tab.c
字号:
MS_SendOperation(pFtaProgramEdit, MS_OP_INIT, (UINT32)0);
MS_DisplayAddObject(pFtaProgramEdit);
}
return MS_OP_NONE;
case MS_OP_LEFT: // delete item
{
MSO_LISTITEM __NEAR* pSubtItem = (MSO_LISTITEM __NEAR*)pThis;
MSO_OBJECT __NEAR* pFtaProgramEdit = MS_CreateAndAddObject((MS_DESCRIPTOR*)&oConfirmRemoveChnlDescriptor, (MSO_CONTAINER __NEAR*)(pThis->mpParent));
MS_SendOperation(pFtaProgramEdit, MS_OP_OPEN, TRUE);
MS_SendOperation(pFtaProgramEdit, MS_OP_INIT, (UINT32)pSubtItem->moParam.mwIndex);
MS_DisplayAddObject(pFtaProgramEdit);
}
break;
case MS_OP_RIGHT: // add item
{
MSO_OBJECT __NEAR* pFtaProgramEdit = MS_CreateAndAddObject((MS_DESCRIPTOR*)&oFtaProgramDescriptor, (MSO_CONTAINER __NEAR*)(pThis->mpParent));
MS_SendOperation(pFtaProgramEdit, MS_OP_OPEN, (UINT32)(PROGRAM_CHANNEL_LIST | (UINT16)-1) );
MS_SendOperation(pFtaProgramEdit, MS_OP_INIT, (UINT32)0);
MS_DisplayAddObject(pFtaProgramEdit);
}
return MS_OP_NONE;
default:
break;;
}
return MsOp;
}
#endif
/***************************************************************************************
* Function : _ListItemFillOSDSeg
*
* In : pThis = Pointer to subtitle file list item objects.
* pAbsArea = Absolute area of pThis object.
*
* Out : None.
*
* Return : None.
*
* Desc : draw external subtitle file list item objects represented by
* oSubtListDescriptor descriptor.
****************************************************************************************/
#ifndef D_CUSTOM__ListItemFillOSDSeg
static BOOL _ListItemFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
MSO_LISTITEM __NEAR* pItem = (MSO_LISTITEM __NEAR*)pThis;
FORMATED_UNICODE_STRING oFormUniStr;
UINT8* pBmp;
MS_AREA pAbsArea1 = *pAbsArea ;
//UINT16 wColor = CIDX_2;
UINT16 wColor = MS_IsSelected(pThis) ? /*pDescriptor->mwTextColor*/CIDX_4 : CIDX_2;
pAbsArea1.mwW = FTA_TAB_RECT_NUMERIC_WIDTH;
OSDR_FillOsdSegRectangleFitArea(CIDX_1, &pAbsArea1);
pAbsArea1.mwW = FTA_TAB_RECT_STRING_WIDTH;
pAbsArea1.msX = pAbsArea1.msX + FTA_TAB_RECT_NUMERIC_WIDTH-6;
OSDR_FillOsdSegRectangleFitArea(CIDX_7, &pAbsArea1);
pAbsArea1.mwW = FTA_TAB_RECT_NUMERIC_WIDTH;
pAbsArea1.msX = pAbsArea1.msX + FTA_TAB_RECT_STRING_WIDTH -6;
OSDR_FillOsdSegRectangleFitArea(CIDX_1, &pAbsArea1);
pAbsArea1.msX = pAbsArea1.msX + FTA_TAB_RECT_NUMERIC_WIDTH -6;
OSDR_FillOsdSegRectangleFitArea(CIDX_7, &pAbsArea1);
pAbsArea1.msX = pAbsArea1.msX + FTA_TAB_RECT_NUMERIC_WIDTH -6;
OSDR_FillOsdSegRectangleFitArea(CIDX_1, &pAbsArea1);
pAbsArea1.msX = pAbsArea1.msX + FTA_TAB_RECT_NUMERIC_WIDTH -6;
OSDR_FillOsdSegRectangleFitArea(CIDX_7, &pAbsArea1);
pAbsArea1.mwW = 32;
pAbsArea1.msX = pAbsArea1.msX + FTA_TAB_RECT_NUMERIC_WIDTH -6;
OSDR_FillOsdSegRectangleFitArea(CIDX_1, &pAbsArea1);
// display channel index
OSDR_GetFormUniStr_ScFormatted((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)pItem->moParam.mwData[FTA_TAB_CH_NAME_COLOMN]);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pAbsArea,
FTA_TAB_DISPLAY_CHNL_INDEX,
(pAbsArea->mwH >> 1) + 2,
ALIGN_H_LEFT,
ALIGN_V_CENTER,
wColor);
// display channel name
OSDR_GetFormUniStr_ScFormatted((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)pItem->moParam.mwData[FTA_TAB_CH_INDEX_COLOMN]);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pAbsArea,
FTA_TAB_DISPLAY_CHNL_NAME,
(pAbsArea->mwH >> 1) + 2,
ALIGN_H_LEFT,
ALIGN_V_CENTER,
wColor);
// display TP
OSDR_GetFormUniStr_ScFormatted((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)pItem->moParam.mwData[FTA_TAB_CH_TP_COLOMN]);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pAbsArea,
FTA_TAB_DISPLAY_CHNL_TPID,
(pAbsArea->mwH >> 1) + 2,
ALIGN_H_LEFT,
ALIGN_V_CENTER,
wColor);
// display Video Pid
OSDR_GetFormUniStr_ScFormatted((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)pItem->moParam.mwData[FTA_TAB_CH_VPID_COLOMN]);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pAbsArea,
FTA_TAB_DISPLAY_CHNL_VPID,
(pAbsArea->mwH >> 1) + 2,
ALIGN_H_LEFT,
ALIGN_V_CENTER,
wColor);
// display Audio Pid
OSDR_GetFormUniStr_ScFormatted((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)pItem->moParam.mwData[FTA_TAB_CH_APID_COLOMN]);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pAbsArea,
FTA_TAB_DISPLAY_CHNL_APID,
(pAbsArea->mwH >> 1) + 2,
ALIGN_H_LEFT,
ALIGN_V_CENTER,
wColor);
// display PCR Pid
OSDR_GetFormUniStr_ScFormatted((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)pItem->moParam.mwData[FTA_TAB_CH_PPID_COLOMN]);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pAbsArea,
FTA_TAB_DISPLAY_CHNL_PPID,
(pAbsArea->mwH >> 1) + 2,
ALIGN_H_LEFT,
ALIGN_V_CENTER,
wColor);
// display channle type V/A
OSDR_GetFormUniStr_ScFormatted((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)pItem->moParam.mwData[FTA_TAB_CH_TYPE_COLOMN]);
OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pAbsArea,
FTA_TAB_DISPLAY_CHNL_TYPE,
(pAbsArea->mwH >> 1) + 2,
ALIGN_H_LEFT,
ALIGN_V_CENTER,
wColor);
if (MS_IsFocused(pThis))
OSDR_FillOsdSegBitmapFitArea(BMP_FG_FOCUS, pAbsArea);
return FALSE;
}
#endif // D_CUSTOM
/***************************************************************************************
* Function : OpenFTAProgramTable
*
* In :
*
* Out : None.
*
* Return : None.
*
* Desc :
****************************************************************************************/
#ifndef D_CUSTOM_OpenFTAProgramTable
MSO_OBJECT __NEAR* OpenFTAProgramTable(MSO_CONTAINER __NEAR* pContainer)
{
MSO_FTA_CHANNEL_TAB __NEAR* pFTAProgTab;
UINT16 wTotalNumFile;
if((NULL != pContainer) && CoreAPI_IsFtaMenuAllowed())
{
pFTAProgTab = (MSO_FTA_CHANNEL_TAB __NEAR*)MS_CreateAndAddObject((MS_DESCRIPTOR*)&oDescriptorFTAProgramTab,
pContainer);
wTotalNumFile = CoreAPI_FtaGetNumberOfChannels();
if (0==wTotalNumFile)
{
MS_SEND_OP_OBJECT(pFTAProgTab, MS_OP_CLOSE, 0);
return NULL;
}
MS_SEND_OP_OBJECT(pFTAProgTab, MS_OP_OPEN, 0);
MS_SEND_OP_OBJECT(pFTAProgTab, MS_OP_INIT, 0);
return (MSO_OBJECT __NEAR*)pFTAProgTab;
}
return NULL;
}
#endif //D_CUSTOM
/***************************************************************************************
* Function : _SubtSelectWindInitOp
*
* In : pThis = point to subtitle selection window object.
*
* lParam = Parameter associated with an MS_OP if any.
*
* Out : None.
*
* Return : None.
*
* Desc : handle MS_OP_INIT operation of subtitle selection window
* object represented by oDescriptorVScrollList descriptor.
****************************************************************************************/
#ifndef D_CUSTOM__SubtSelectWindInitOp
static void _SubtSelectWindInitOp(MSO_OBJECT __NEAR* pThis, UINT32 lParam)
{
MSO_OBJECT __NEAR* pObject = MS_CreateAndAddObject((MS_DESCRIPTOR *)&oDescriptorVScrollList, (MSO_CONTAINER __NEAR*)pThis);
MS_SendOperation(pObject, MS_OP_OPEN, lParam);
#ifdef D_FTA_PROGRAM_TAB_TIMEOUT
((MSO_FTA_CHANNEL_TAB __NEAR*)pThis)->moParam.mwTimeOut = 1200; // 120 seconds
#endif // D_FTA_PROGRAM_TAB_TIMEOUT
}
#endif // D_CUSTOM
/***************************************************************************************
* Function : _ComponentOperation
*
* In : pThis = Pointer to the subtitle select window (MSO_FTA_CHANNEL_TAB) object.
*
* MsOp = Operation ID.
*
* lParam = Parameter associated with an MS_OP if any.
*
* Out : None.
*
* Return : ID of the operation that is to be propagated once processing is done,
* otherwise MS_OP_NONE.
*
* Desc : This function processes all operations/events of the fta table window
* (MSO_FTA_CHANNEL_TAB) object represented by the
* oFtaWindowDescriptor descriptor.
****************************************************************************************/
#ifndef D_CUSTOM__ComponentOperation
static MS_OP _ComponentOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
// reset timer each time user made operation on the channels list
#ifdef D_FTA_PROGRAM_TAB_TIMEOUT
if( MsOp != MS_OP_TICK )
{
((MSO_FTA_CHANNEL_TAB __NEAR*)pThis)->moParam.mwTimeOut = 400;
}
#endif // D_FTA_PROGRAM_TAB_TIMEOUT
switch (MsOp)
{
case MS_OP_INIT:
_SubtSelectWindInitOp(pThis, lParam);
MS_DisplayAddObject(pThis);
break;//return MS_OP_NONE;
#ifdef D_FTA_PROGRAM_TAB_TIMEOUT
case MS_OP_TICK:
{
UINT16 *wTimeOut = &((MSO_FTA_CHANNEL_TAB __NEAR*)pThis)->moParam.mwTimeOut;
if (*wTimeOut)
{
if (--(*wTimeOut) == 0)
{
//close subtitle select window and not select any subtitle
//MsOp = MS_SendOperation(pThis, MS_OP_CLEAR, 0);
//MS_SEND_OP(MsOp, 0);
MsOp = MS_OP_CLOSE_PARENT;
}
}
}
break;
#endif // D_FTA_PROGRAM_TAB_TIMEOUT
case MS_OP_CLOSE: // Fall Thru
case MS_OP_FTA_TAB_EXIT: // Fall Thru
case MS_OP_EJECT:
MS_SendOperation(pThis, MS_OP_CLOSE_PARENT, 0);
//MsOp = MS_OP_CLOSE_PARENT;
break;
case MS_OP_EMPTY:
break;
default:
break;
}
MsOp = MS_ComponentBasicOperation(pThis, MsOp, lParam);
if (MS_OP_FTA_SELECTION_FINISHED == MsOp)
{
MS_SEND_OP_OBJECT(pThis, MS_OP_CLOSE_PARENT, lParam);
}
// Prohibit user operation (such as MS_OP_SEARCH)
else if (MS_IS_USER_OP(MsOp) && (MsOp != MS_OP_POWER) && (MsOp != MS_OP_EJECT) )
{
PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
return MS_OP_NONE;
}
return MsOp;
}
#endif //D_CUSTOM
/***************************************************************************************
* Function : _ComponentFillOSDSeg
*
* In : pThis = Pointer to subtitle file list item objects.
* pAbsArea = Absolute area of pThis object.
*
* Out : None.
*
* Return : None.
*
* Desc : draw subtitle selection window objects represented by
* oSubSelectWindowDescriptor descriptor.
****************************************************************************************/
#ifndef D_CUSTOM__ComponentFillOSDSeg
#pragma argsused
static BOOL _ComponentFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
OSDR_FillOsdSegBitmapFitArea(BMP_BG_2, pAbsArea);
return FALSE;
}
#endif //D_CUSTOM__ComponentFillOSDSeg
/**************************************************************************
* Function : _RemoveChnlConfirmOperation
*
* In :
*
* Out :
*
* Desc :
***************************************************************************/
#ifndef D_CUSTOM__RemoveChnlConfirmOperation
static MS_OP _RemoveChnlConfirmOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MSO_REMOVE_CHNL_CONFIRM __NEAR* pObject = (MSO_REMOVE_CHNL_CONFIRM __NEAR*)pThis;
MsOp = OCONFIRM_Operation(pThis, MsOp, lParam);
switch (MsOp)
{
case MS_OP_INIT:
pObject->moParamIndex = (UINT16)lParam;
break;
case MS_OP_BUTTON_YES:
{
MSO_OBJECT __NEAR* pChannelTab = MS_FindAncestor(pThis, &oDescriptorFTAProgramTab);
CoreAPI_FtaRemoveChannelFromList( pObject->moParamIndex );
// doto: after delete need to refresh the list of channels
MS_SendOperation((MSO_CONTAINER __NEAR *)pChannelTab, MS_OP_REFRESH, 0);
}
break;
default:
break;
}
return MsOp;
}
#endif // D_CUSTOM
#endif // FTA_SUPPORT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -