⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 o_fta_transport_tab.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
📖 第 1 页 / 共 2 页
字号:
/* **************************************************************************************
*  Copyright (c) 2005 ZORAN Corporation, All Rights Reserved
*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
*  File: $Workfile: o_FTA_transport_tab.c $
*
* Description:
* ============
*
****************************************************************************************/
#include "Config.h"		// Global Configuration - do not remove!

#ifdef FTA_SUPPORT

#include "Include\SysDefs.h"

#include "GUI\Menu_system\ms_menu.h"
#include "GUI\Object_class\Page\mso_page.h"
#include "Menu\menu_operation_def.h"
#include "GUI\Menu_system\ms_container.h"
#include "GUI\Menu_system\ms_component.h"
#include "CoreAPI\CoreAPI.h"
#include "Playcore\FTA\fta.h"
#include "Kernel\EventDef.h"
#include "GUI\Object_class\Vlist\mso_vlist.h"
#include "GUI\Menu_system\ms_display.h"
#include "GUI\Menu_system\ms_screen.h"
#include "GUI\Menu_system\ms_send_op.h"
#include "GUI\Resource\Bitmap\bitmap.h"
#include "GUI\Object_class\Confirm\mso_confirm.h"
#include "Library\String_generate.h"
#include "Components\FTA_Program\o_FTA_Program.h"

#include "Menu_config\menu_config_common.h"
#include "GUI\Object_class\Text\mso_text.h"

// Include the module header file
#include "Components\FTA_Transport_Tab\o_FTA_Transport_Tab.h"
// Include configuration header file: named constants, macros and typedefs.
#include "Components\FTA_Transport_Tab\o_FTA_Transport_Tab_config.h"
// Include custom header file: customer specific definitions, over-writing common ones.
#include "Components\Custom\FTA_Transport_Tab\o_FTA_Transport_Tab_custom.h"

#define  FTA_MAX_TRANSPORT_INFO_LEN           32
/****************************************************************************************
* 			public functions
*****************************************************************************************/
MSO_OBJECT __NEAR* OpenFTATransportTable(MSO_CONTAINER __NEAR* pContainer);

/****************************************************************************************
*	operation handlers
*****************************************************************************************/

/****************************************************************************************
*	operation functions
*****************************************************************************************/
static void _VScrollListInitOp(MSO_OBJECT __NEAR* pThis, UINT32 lParam);
static void _VScrollListRefreshOperation(MSO_OBJECT __NEAR* pThis, UINT32 lParam);
static MS_OP _VScrollListOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _ListItemOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _ComponentOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _RemoveTransportConfirmOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
/*****************************************************************************************
*	Display  functions
******************************************************************************************/
static BOOL _ListItemFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea);
static BOOL _ComponentFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea);


/***************************************************************************************
* 	Include customization file.
****************************************************************************************/

// Include custom code file: customer specific code, over-writing common one.
//#include "Components\Custom\FTA_Program_Tab\o_FTA_Program_Tab_custom.c"
// Include configuration file: constants.
#include "Components\FTA_Transport_Tab\o_FTA_Transport_Tab_config.c"

/***************************************************************************************
* 	Utility functions
****************************************************************************************/
/***************************************************************************************
*	Function	: 	_VScrollListRefreshOperation
*
*	In		: 	pThis	=	Pointer to the FTA channel scroll list  object.
*
*				lParam	=	Parameter associated with an MS_OP if any.
*
*	Out		: 	None.
*
*	Return	:	None
*
*	Desc 	:	This function handles MS_OP_REFRESH operation of the
*				MSO_VSCROLL_LIST object represented by the
*				oDescriptorVScrollList descriptor..
****************************************************************************************/
#ifndef D_CUSTOM__VScrollListRefreshOperation
static void _VScrollListRefreshOperation(MSO_OBJECT __NEAR* pThis, UINT32 lParam)
{
	MSO_LISTITEM __NEAR* 	    pItem;
	MSO_VLIST __NEAR* 			pList;
	MS_DESCRIPTOR_VLIST* 		pListDescriptor;

	FORMATED_UNICODE_STRING oFormUniStr;
	UINT16 wIndex, wCount, wNum;

	oFormUniStr.mtFontIndex = FONT_0;

	pListDescriptor = ((MS_DESCRIPTOR_VSCROLL_LIST*)(pThis->mpDescriptor))->mpDescriptorVList;
	pList = (MSO_VLIST __NEAR*)MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pThis, (MS_DESCRIPTOR *)pListDescriptor);

	// Remove all existing items in the browser list.
	MS_SendOperation((MSO_OBJECT __NEAR*)pList, MS_OP_EMPTY, 0);

	{
		UINT16  wRestFiles,  wNumVisibleItems;
		UINT16 wTotalFiles;
		UINT16 wCurrTransport;
		CHANNEL_INFO channelInfo;

		pList->moParam.mwTotalItems = CoreAPI_FtaGetNumberOfTransport();

		if(REFRESH_LIST_DISPLAY_FIRST_ITEM == lParam)
			pList->moParam.mwFirstDisplayItem = 0;

		// Set list parameters.
		wTotalFiles = pList->moParam.mwTotalItems;

		wNumVisibleItems 	= pList->moParam.mcNumVisibleItems;
		wIndex 			= pList->moParam.mwFirstDisplayItem;    //First Display Item number in folder

		// Display the transport.
		wRestFiles = wTotalFiles -wIndex;

		// check the current transport
		wCurrTransport = CoreAPI_FtaGetCurrChannel();
		CoreAPI_FtaGetChannelInfo(wCurrTransport, &channelInfo); 
		wCurrTransport = channelInfo.uiTransportIdx;

		if(wNumVisibleItems > 0)
		{
			TRANSPORT_INFO transportInfo;            

			UINT16 wNextFileIndex = 0;
			UINT16 wszName[FTA_MAX_TRANSPORT_INFO_LEN];
			memset( wszName, '\0', sizeof(UINT16)*FTA_MAX_TRANSPORT_INFO_LEN);
			wNum = MIN(wNumVisibleItems, wRestFiles);

			for(wCount = 0; wCount < wNum; wCount++)
			{
		                wNextFileIndex = wCount + wIndex;//-1;

		                pItem = (MSO_LISTITEM __NEAR*)OVLIST_CreatAndAddItem((MSO_OBJECT __NEAR*)pList,
																	                (MS_DESCRIPTOR *)&oDescriptorListItem,
																	                TRUE, FALSE);
		                pItem->moParam.mwIndex = wNextFileIndex;
		                
		                if( wNextFileIndex == wCurrTransport )
		                	MS_SetSelected(pItem);               

		                CoreAPI_FtaGetTransportInfo( wNextFileIndex, &transportInfo );

		                // get index
		                memset( wszName, '\0', sizeof(UINT16)*FTA_MAX_TRANSPORT_INFO_LEN);                                                
		                STR_GenerateNumericValue(wNextFileIndex , wszName, 0, 10);
		                OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszName);
		                pItem->moParam.mwData[FTA_TAB_TRANSPORT_INDEX_COLOMN] = OSDR_MallocScFormUniStr();
		                OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwData[FTA_TAB_TRANSPORT_INDEX_COLOMN]);
#ifdef FTA_SATELLITE
		                // get LNB
		                memset( wszName, '\0', sizeof(UINT16)*FTA_MAX_TRANSPORT_INFO_LEN);                                                
		                STR_GenerateNumericValue(transportInfo.info.ulLnbSwitchFreq/1000 , wszName, 0, 10);
		                OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszName);
		                pItem->moParam.mwData[FTA_TAB_TRANSPORT_LNB_COLOMN] = OSDR_MallocScFormUniStr();
		                OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwData[FTA_TAB_TRANSPORT_LNB_COLOMN]);

		                // get Transport ID
		                memset( wszName, '\0', sizeof(UINT16)*FTA_MAX_TRANSPORT_INFO_LEN);                                                
		                STR_GenerateNumericValue(transportInfo.info.ulFrequency/1000 , wszName, 0, 10);
		                OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszName);
		                pItem->moParam.mwData[FTA_TAB_TRANSPORT_REQ_COLOMN] = OSDR_MallocScFormUniStr();
		                OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwData[FTA_TAB_TRANSPORT_REQ_COLOMN]);

		                // get symboul rate
		                memset( wszName, '\0', sizeof(UINT16)*FTA_MAX_TRANSPORT_INFO_LEN);                                                
		                STR_GenerateNumericValue(transportInfo.info.ulSymbolRate/1000, wszName, 0, 10);
		                OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszName);
		                pItem->moParam.mwData[FTA_TAB_TRANSPORT_SYMBOL_COLOMN] = OSDR_MallocScFormUniStr();
		                OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwData[FTA_TAB_TRANSPORT_SYMBOL_COLOMN]);

		                // get polarty
		                memset( wszName, '\0', sizeof(UINT16)*FTA_MAX_TRANSPORT_INFO_LEN);

		                // POL = (uiWEPolModFec >> 9), 1 is vertical, 0 horizontal

		                if( ((transportInfo.info.uiWEPolModFec) >> 9 ) == 0 )
		                {                                       
		                    memcpy((WCHAR*)wszName, L"H" , 4);
		                }
		                else
		                {
		                    memcpy((WCHAR*)wszName, L"V" , 4);
		                }
		                OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszName);
		                pItem->moParam.mwData[FTA_TAB_TRANSPORT_POLAR_COLOMN] = OSDR_MallocScFormUniStr();
		                OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwData[FTA_TAB_TRANSPORT_POLAR_COLOMN]);
#endif // FTA_SATELLITE
			}
		}
	}

	MS_DisplayAddObject(pThis);

	// Set focus to the appropriate list item.
	if (!MS_IsFocused(pList))
		MS_ScreenSetFocusObject((MSO_OBJECT __NEAR*)pList);
	{
		if(!MS_IS_FOCUS_ON_LASTITEM(pList))
			MS_ScreenSetFocusObject(((MSO_CONTAINER __NEAR*)pList)->mpOlist);
		else
		{
			MSO_OBJECT __NEAR* pObject = ((MSO_CONTAINER __NEAR*)pList)->mpOlist;

			while(NULL != pObject->mpNext)
				pObject = pObject->mpNext;

			MS_ScreenSetFocusObject(pObject);
		}
	}    
}
#endif //D_CUSTOM

/***************************************************************************************
*	Function	: 	_VScrollListInitOp
*
*	In		: 	pThis	=	Pointer to the subtitle scroll list (MSO_VSCROLL_LIST) object.*
*
*				lParam	=	Parameter associated with an MS_OP if any.
*
*	Out		: 	None.
*
*	Return	:	None.
*
*	Desc 	:	This function handle MS_OP_INIT  of the subtitle scroll list
*				(MSO_VSCROLL_LIST) object represented by the
*				oDescriptorVScrollList descriptor.
****************************************************************************************/
#ifndef D_CUSTOM__VScrollListInitOp
static void _VScrollListInitOp(MSO_OBJECT __NEAR* pThis, UINT32 lParam)
{
	MSO_VLIST __NEAR* pList;
	MS_DESCRIPTOR_VLIST * pListDescriptor;
    CHANNEL_INFO channelInfo;
    UINT16 wCurrChnl;

	pListDescriptor = ((MS_DESCRIPTOR_VSCROLL_LIST*)(pThis->mpDescriptor))->mpDescriptorVList;
	pList = (MSO_VLIST __NEAR*)MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pThis,
														(MS_DESCRIPTOR *)pListDescriptor);
    pList->moParam.mwTotalItems = CoreAPI_FtaGetNumberOfTransport();
    
    // check the current transport
    if( CoreAPI_FtaIsChnlPlaying() )
    {
        wCurrChnl = CoreAPI_FtaGetCurrChannel();
        CoreAPI_FtaGetChannelInfo(wCurrChnl, &channelInfo); 
        pList->moParam.mwFirstDisplayItem = channelInfo.uiTransportIdx;
    }
   	MS_SendOperation(pThis, MS_OP_REFRESH, lParam);

}
#endif // D_CUSTOM

/***************************************************************************************
*	Function	: 	_VScrollListOperation
*
*	In		: 	pThis	=	Pointer to the subtitle scroll list (MSO_VSCROLL_LIST) 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 subtitle scroll list
*				(MSO_VSCROLL_LIST) object represented by the
*                                     oDescriptorVScrollList descriptor.
****************************************************************************************/
#ifndef D_CUSTOM__VScrollListOperation
static MS_OP _VScrollListOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	MsOp = VScrollListOperation(pThis, MsOp, lParam);

	// Post processing
	switch(MsOp)
	{
	case MS_OP_INIT:
		_VScrollListInitOp(pThis, lParam);
		break;

	case MS_OP_REFRESH:
		_VScrollListRefreshOperation(pThis, lParam);
		return MS_OP_NONE;

	default:
		break;
	}
	return MsOp;
}
#endif // D_CUSTOM

/***************************************************************************************
*	Function	: 	_ListItemOperation
*
*	In		: 	pThis	=	Pointer to the subtitle file list item (MSO_VSCROLL_LIST) 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 subtitle list item
*				(MSO_LISTITEM) object represented by the
*                                     oSubtListDescriptor descriptor.
****************************************************************************************/
#ifndef D_CUSTOM__ListItemOperation
#pragma argsused
static MS_OP _ListItemOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{    
    int iIndex;
	// Pre-processing
	switch(MsOp)
	{
	case MS_OP_EMPTY:

        for( iIndex = 0; iIndex < FTA_TAB_TRANSPORT_NUM_OF_COLUMNS; iIndex++)
        {
            if(NULL_HANDLE != ((MSO_LISTITEM __NEAR*)pThis)->moParam.mwData[iIndex])

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -