📄 o_fta_program.c
字号:
*
* Desc : MSO_FTA_PROGRAM user operation function.
****************************************************************************************/
#ifndef D_CUSTOM__FtaProgramOperation
STATIC MS_OP _FtaProgramOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_INIT:
{
MSO_OBJECT __NEAR* pObject;
if( bIsChannelProg )
{
pObject = MS_FindDescendant(pThis, &oVidPidEditDescriptor);
}
else
{
#ifdef FTA_SATELLITE
pObject = MS_FindDescendant(pThis, &oLNBEditDescriptor);
#endif //FTA_SATELLITE
#ifdef FTA_TERRESTRIAL
pObject = MS_FindDescendant(pThis, &oProgExitButtonDescriptor);
#endif
}
MS_ScreenSetFocusObject(pObject);
}
break;
case MS_OP_OPEN:
{
MSO_FTA_PROGRAM __NEAR* pFtaProgramObject = (MSO_FTA_PROGRAM __NEAR*)pThis;
CHANNEL_INFO channelInfo;
TRANSPORT_INFO transportInfo;
bIsChannelProg = (UINT16)(lParam >> 16 );
if( (lParam & 0xffff ) != (UINT16)-1 )
{
if( bIsChannelProg )
{
memcpy( wFtaProgTitle, L"Edit Press clear for re-edit", MAX_FTA_PROG_TITLE_CHARS);
CoreAPI_FtaGetChannelInfo((UINT16)(lParam & 0xffff ), &channelInfo);
pFtaProgramObject->moParam.mwChIndex = (UINT16)(lParam & 0xffff );
pFtaProgramObject->moParam.ciChannelInfo.uiVideoPID = channelInfo.uiVideoPID;
pFtaProgramObject->moParam.ciChannelInfo.uiAudioPID = channelInfo.uiAudioPID;
pFtaProgramObject->moParam.ciChannelInfo.uiPcrPID = channelInfo.uiPcrPID;
pFtaProgramObject->moParam.ciChannelInfo.mwAttr = channelInfo.mwAttr;
// Still keep this for when just Edit And Re edit.
pFtaProgramObject->moParam.ciChannelInfo.uiTransportIdx = channelInfo.uiTransportIdx;
memcpy( pFtaProgramObject->moParam.ciChannelInfo.szChannelName, channelInfo.szChannelName, CHANNEL_NAME_MAX_LENGTH);
}
else
{
memcpy( wFtaProgTitle, L"Edit Press clear for re-edit", MAX_FTA_PROG_TITLE_CHARS);
CoreAPI_FtaGetTransportInfo( (UINT16)(lParam & 0xffff ), &transportInfo );
pFtaProgramObject->moParam.tiTransportInfo.info.ulFrequency = transportInfo.info.ulFrequency/1000;
#ifdef FTA_SATELLITE
pFtaProgramObject->moParam.tiTransportInfo.info.ulLnbSwitchFreq = transportInfo.info.ulLnbSwitchFreq/1000;
pFtaProgramObject->moParam.tiTransportInfo.info.ulSymbolRate = transportInfo.info.ulSymbolRate/1000;
pFtaProgramObject->moParam.tiTransportInfo.info.uiWEPolModFec = transportInfo.info.uiWEPolModFec >> 9 ;
#endif
}
}
else
{
if( bIsChannelProg )
{
memcpy( wFtaProgTitle, L"Add New Channel", MAX_FTA_PROG_TITLE_CHARS);
// pFtaProgramObject->moParam.mwChIndex = INVALID_VALUE; // This index will be assigned by core
pFtaProgramObject->moParam.ciChannelInfo.uiVideoPID = INVALID_VALUE;
pFtaProgramObject->moParam.ciChannelInfo.uiAudioPID = INVALID_VALUE;
pFtaProgramObject->moParam.ciChannelInfo.uiPcrPID = INVALID_VALUE;
pFtaProgramObject->moParam.ciChannelInfo.mwAttr |= FTA_CHANNEL_VIDEO_ATTR;
}
else
{
memcpy( wFtaProgTitle, L"Add New Transport", MAX_FTA_PROG_TITLE_CHARS);
pFtaProgramObject->moParam.tiTransportInfo.info.ulFrequency = INVALID_VALUE;
#ifdef FTA_SATELLITE
pFtaProgramObject->moParam.tiTransportInfo.info.ulLnbSwitchFreq = INVALID_VALUE;
pFtaProgramObject->moParam.tiTransportInfo.info.ulSymbolRate = INVALID_VALUE;
pFtaProgramObject->moParam.tiTransportInfo.info.uiWEPolModFec = 0;
#endif
}
}
}
break;
case MS_OP_TICK:
break;
case MS_OP_CORE_MEDIA_CHANGED: // Fall through !!!
//rinat !!!!!!case MS_OP_FTA_PROGRAM:
// MsOp = MS_OP_CLOSE_PARENT;
break;
case MS_OP_EJECT: // Fall through !!!
case MS_OP_SKIPF: // Fall through !!!
case MS_OP_SKIPB: // Fall through !!!
case MS_OP_LR: // Fall through !!!
case MS_OP_KARAOKE: // Fall through !!!
case MS_OP_STOP: // Fall through !!!
case MS_OP_SLOWF: // Fall through !!!
case MS_OP_SLOWB: // Fall through !!!
case MS_OP_FASTF: // Fall through !!!
case MS_OP_FASTB: // Fall through !!!
case MS_OP_PAUSE: // Fall through !!!
case MS_OP_MARKAB: // Fall through !!!
case MS_OP_PLAY_MODE: // Fall through !!!
case MS_OP_MENU: // Fall through !!!
case MS_OP_PBC:
MS_SendOperation(pThis, MS_OP_CLOSE_PARENT, 0);
break;
case MS_OP_PLAY:
MsOp = MS_OP_ENTER;
break;
default:
break;
}
return MS_ComponentBasicOperation(pThis, MsOp, lParam);
}
#endif // D_CUSTOM
/***************************************************************************************
* Function : _FtaProgramKitOperation
*
* In :
*
* Out :
*
* Desc : The Fta program kit operation function.
****************************************************************************************/
#ifndef D_CUSTOM__FtaProgramKitOperation
#pragma argsused
STATIC MS_OP _FtaProgramKitOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
//Pre-processing
// TODO : if any
MsOp = VScrollListOperation(pThis, MsOp, lParam);
// Post-processing
switch(MsOp)
{
case MS_OP_REFRESH:
{
MSO_VLIST __NEAR* pList = (MSO_VLIST __NEAR*)MS_GetObjectListPtr(pThis);
MS_ASSERT(NULL != pList);
if(pList->moParam.mwTotalItems > pList->moParam.mcNumVisibleItems)
{
// Remove all items.
MS_SendOperation((MSO_OBJECT __NEAR*)pList, MS_OP_EMPTY, 0);
_AddItemsToFtaProgramKit(pList);
MS_DisplayAddObject(pThis);
// Set focus to the appropriate list item.
if(MS_IsFocused(pList))
{
MSO_OBJECT __NEAR* pObject = MS_GetObjectListPtr(pList);
if(!MS_IS_FOCUS_ON_LASTITEM(pList))
MS_ScreenSetFocusObject(pObject);
else
{
// Make sure we do not set focus on the Value VScroll list.
while(NULL != pObject->mpNext)
pObject = pObject->mpNext;
MS_ScreenSetFocusObject(pObject);
}
}
}
}
return MS_OP_NONE;
default:
break;
}
return MsOp;
}
#endif // D_CUSTOM
/***************************************************************************************
* Function : _FtaProgramkitVlistOperation
*
* In :
*
* Out :
*
* Desc : The FTA program kit VLIST operation function.
****************************************************************************************/
#pragma argsused
#ifndef D_CUSTOM__FtaProgramkitVlistOperation
STATIC MS_OP _FtaProgramkitVlistOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_INIT:
return MS_OP_NONE;
case MS_OP_OPEN:
_AddItemsToFtaProgramKit((MSO_VLIST __NEAR*)pThis);
break;
default:
break;
}
return VListOperation(pThis, MsOp, lParam);
}
#endif // D_CUSTOM
/***************************************************************************************
* Function : _VidPidOperation
*
* In :
*
* Out :
*
* Desc : The Title/Track operation function.
****************************************************************************************/
#pragma argsused
#ifndef D_CUSTOM__VidPidOperation
STATIC MS_OP _VidPidOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MSO_FTA_PROGRAM __NEAR* pFtaPid = (MSO_FTA_PROGRAM __NEAR*)MS_FindAncestor(pThis, &oFtaProgramDescriptor);
return _EditOperation( (MSO_OBJECT __NEAR*)pThis, MsOp, lParam, (UINT16*)&(pFtaPid->moParam.ciChannelInfo.uiVideoPID) );
}
#endif // D_CUSTOM
/***************************************************************************************
* Function : _AudPidOperation
*
* In :
*
* Out :
*
* Desc : The Chapter operation function.
****************************************************************************************/
#pragma argsused
#ifndef D_CUSTOM__AudPidOperation
STATIC MS_OP _AudPidOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MSO_FTA_PROGRAM __NEAR* pFtaPid = (MSO_FTA_PROGRAM __NEAR*)MS_FindAncestor(pThis, &oFtaProgramDescriptor);
return _EditOperation( (MSO_OBJECT __NEAR*)pThis, MsOp, lParam, (UINT16*)&(pFtaPid->moParam.ciChannelInfo.uiAudioPID) );
}
#endif // D_CUSTOM
/***************************************************************************************
* Function : _PcrPidOperation
*
* In :
*
* Out :
*
* Desc : The Chapter operation function.
****************************************************************************************/
#pragma argsused
#ifndef D_CUSTOM__PcrOperation
STATIC MS_OP _PcrPidOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MSO_FTA_PROGRAM __NEAR* pFtaPid = (MSO_FTA_PROGRAM __NEAR*)MS_FindAncestor(pThis, &oFtaProgramDescriptor);
return _EditOperation( (MSO_OBJECT __NEAR*)pThis, MsOp, lParam, (UINT16*)&(pFtaPid->moParam.ciChannelInfo.uiPcrPID) );
}
#endif // D_CUSTOM
/***************************************************************************************
* Function : _ChnlIndexOperation
*
* In :
*
* Out :
*
* Desc : The Chapter operation function.
****************************************************************************************/
#if 0
#pragma argsused
#ifndef D_CUSTOM__ChnlIndexOperation
STATIC MS_OP _ChnlIndexOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MSO_FTA_PROGRAM __NEAR* pFtaPid = (MSO_FTA_PROGRAM __NEAR*)MS_FindAncestor(pThis, &oFtaProgramDescriptor);
return _EditOperation( (MSO_OBJECT __NEAR*)pThis, MsOp, lParam, (UINT16*)&(pFtaPid->moParam.mwChIndex) );
}
#endif // D_CUSTOM
#endif
/***************************************************************************************
* Function : _LNBOperation
*
* In :
*
* Out :
*
* Desc : The Chapter operation function.
****************************************************************************************/
#pragma argsused
#ifdef FTA_SATELLITE
#ifndef D_CUSTOM__LNBOperation
STATIC MS_OP _LNBOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MSO_FTA_PROGRAM __NEAR* pFtaPid = (MSO_FTA_PROGRAM __NEAR*)MS_FindAncestor(pThis, &oFtaProgramDescriptor);
return _EditOperation( (MSO_OBJECT __NEAR*)pThis, MsOp, lParam, (UINT16*)&(pFtaPid->moParam.tiTransportInfo.info.ulLnbSwitchFreq) );
}
#endif // D_CUSTOM
#endif
/***************************************************************************************
* Function : _TransFreqOperation
*
* In :
*
* Out :
*
* Desc : The Chapter operation function.
****************************************************************************************/
#pragma argsused
#ifndef D_CUSTOM__TransFreqOperation
STATIC MS_OP _TransFreqOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MSO_FTA_PROGRAM __NEAR* pFtaPid = (MSO_FTA_PROGRAM __NEAR*)MS_FindAncestor(pThis, &oFtaProgramDescriptor);
return _EditOperation( (MSO_OBJECT __NEAR*)pThis, MsOp, lParam, (UINT16*)&(pFtaPid->moParam.tiTransportInfo.info.ulFrequency) );
}
#endif // D_CUSTOM
/***************************************************************************************
* Function : _SymbolOperation
*
* In :
*
* Out :
*
* Desc : The Chapter operation function.
****************************************************************************************/
#pragma argsused
#ifdef FTA_SATELLITE
#ifndef D_CUSTOM__TransFreqOperation
STATIC MS_OP _SymbolOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
MSO_FTA_PROGRAM __NEAR* pFtaPid = (MSO_FTA_PROGRAM __NEAR*)MS_FindAncestor(pThis, &oFtaProgramDescriptor);
return _EditOperation( (MSO_OBJECT __NEAR*)pThis, MsOp, lParam, (UINT16*)&(pFtaPid->moParam.tiTransportInfo.info.ulSymbolRate) );
}
#endif // D_CUSTOM
#endif
/***************************************************************************************
* Function : _ProgExitOperation
*
* In :
*
* Out :
*
* Desc : The Chapter operation function.
****************************************************************************************/
#pragma argsused
#ifndef D_CUSTOM__ProgExitOperation
STATIC MS_OP _ProgExitOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
switch(MsOp)
{
case MS_OP_FOCUS_CHANGE:
MS_DisplayAddObject(pThis);
break;
case MS_OP_ENTER:
{
MSO_FTA_PROGRAM __NEAR* pFtaPid = (MSO_FTA_PROGRAM __NEAR*)MS_FindAncestor(pThis, &oFtaProgramDescriptor);
if( bIsChannelProg )
{
MSO_OBJECT __NEAR* pChannelTab = MS_FindAncestor(pThis, &oDescriptorFTAProgramTab);
if( INVALID_VALUE == pFtaPid->moParam.mwChIndex ||
INVALID_VALUE == pFtaPid->moParam.ciChannelInfo.uiVideoPID ||
INVALID_VALUE == pFtaPid->moParam.ciChannelInfo.uiAudioPID ||
INVALID_VALUE == pFtaPid->moParam.ciChannelInfo.uiPcrPID )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -