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

📄 o_fta_channel_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_channel_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_Channel_Tab\o_FTA_Channel_Tab.h"
// Include configuration header file: named constants, macros and typedefs.
#include "Components\FTA_Channel_Tab\o_FTA_Channel_Tab_config.h"
// Include custom header file: customer specific definitions, over-writing common ones.
#include "Components\Custom\FTA_Channel_Tab\o_FTA_Channel_Tab_custom.h"

#define  FTA_MAX_CHANNEL_NAME_LEN           CHANNEL_NAME_MAX_LENGTH+1
/****************************************************************************************
* 			public functions
*****************************************************************************************/
MSO_OBJECT __NEAR* OpenFTAProgramTable(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 _RemoveChnlConfirmOperation(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_Channel_Tab\o_FTA_Channel_Tab_custom.c"
// Include configuration file: constants.
#include "Components\FTA_Channel_Tab\o_FTA_Channel_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;
		
		pList->moParam.mwTotalItems = CoreAPI_FtaGetNumberOfChannels();
	   	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 channel.
		wRestFiles = wTotalFiles -wIndex;

		if(wNumVisibleItems > 0)
		{
            CHANNEL_INFO channelInfo;            
			UINT16 wNextFileIndex = 0;
			UINT16 wszName[FTA_MAX_CHANNEL_NAME_LEN];
            memset( wszName, '\0', sizeof(UINT16)*FTA_MAX_CHANNEL_NAME_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( CoreAPI_FtaGetCurrChannel() == wNextFileIndex  )
                {
                    MS_SetSelected(pItem);
                }
                CoreAPI_FtaGetChannelInfo(wNextFileIndex, &channelInfo);
                memcpy((WCHAR*)wszName, channelInfo.szChannelName, FTA_MAX_CHANNEL_NAME_LEN);
                
                // get channle index
                OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszName);
                pItem->moParam.mwData[FTA_TAB_CH_INDEX_COLOMN] = OSDR_MallocScFormUniStr();
                OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwData[FTA_TAB_CH_INDEX_COLOMN]);

                // get channel name
                memset( wszName, '\0', sizeof(UINT16)*FTA_MAX_CHANNEL_NAME_LEN);
                STR_GenerateNumericValue(wNextFileIndex, wszName, 0, 8);
                OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszName);
                pItem->moParam.mwData[FTA_TAB_CH_NAME_COLOMN] = OSDR_MallocScFormUniStr();
                OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwData[FTA_TAB_CH_NAME_COLOMN]);

                // get channel Transport Index
                memset( wszName, '\0', sizeof(UINT16)*FTA_MAX_CHANNEL_NAME_LEN);                                                
                STR_GenerateNumericValue(channelInfo.uiTransportIdx, wszName, 0, 8);
                OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszName);
                pItem->moParam.mwData[FTA_TAB_CH_TP_COLOMN] = OSDR_MallocScFormUniStr();
                OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwData[FTA_TAB_CH_TP_COLOMN]);

                // get channel Video PID
                memset( wszName, '\0', sizeof(UINT16)*FTA_MAX_CHANNEL_NAME_LEN);                                                
                STR_GenerateNumericValue(channelInfo.uiVideoPID, wszName, 0, 8);
                OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszName);
                pItem->moParam.mwData[FTA_TAB_CH_VPID_COLOMN] = OSDR_MallocScFormUniStr();
                OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwData[FTA_TAB_CH_VPID_COLOMN]);

                // get channel Audio PID
                memset( wszName, '\0', sizeof(UINT16)*FTA_MAX_CHANNEL_NAME_LEN);                                                
                STR_GenerateNumericValue(channelInfo.uiAudioPID, wszName, 0, 8);
                OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszName);
                pItem->moParam.mwData[FTA_TAB_CH_APID_COLOMN] = OSDR_MallocScFormUniStr();
                OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwData[FTA_TAB_CH_APID_COLOMN]);

                // get channel PCR PID
                memset( wszName, '\0', sizeof(UINT16)*FTA_MAX_CHANNEL_NAME_LEN);
                STR_GenerateNumericValue(channelInfo.uiPcrPID, wszName, 0, 8);
                OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszName);
                pItem->moParam.mwData[FTA_TAB_CH_PPID_COLOMN] = OSDR_MallocScFormUniStr();
                OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwData[FTA_TAB_CH_PPID_COLOMN]);

                // get channel type
                if( CoreAPI_FtaIsVideoChannel( wNextFileIndex ))
                {                                       
                    memcpy((WCHAR*)wszName, L"V" , 4);
                }
                else
                {
                    memcpy((WCHAR*)wszName, L"A" , 4);
                }
                OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszName);
                pItem->moParam.mwData[FTA_TAB_CH_TYPE_COLOMN] = OSDR_MallocScFormUniStr();
                OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwData[FTA_TAB_CH_TYPE_COLOMN]);
			}
		}
	}

	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;


	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_FtaGetNumberOfChannels();
    if( CoreAPI_FtaIsChnlPlaying() )
    {
        pList->moParam.mwFirstDisplayItem = CoreAPI_FtaGetCurrChannel();
    }
   	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_NUM_OF_COLUMNS; iIndex++)
        {
            if(NULL_HANDLE != ((MSO_LISTITEM __NEAR*)pThis)->moParam.mwData[iIndex])
		    {
			    OSDR_FreeScFormUniStr(((MSO_LISTITEM __NEAR*)pThis)->moParam.mwData[iIndex]);
			    ((MSO_LISTITEM __NEAR*)pThis)->moParam.mwData[iIndex] = NULL_HANDLE;
		    }
        }        
		break;

	case MS_OP_FOCUS_CHANGE:
		MS_DisplayAddObject(pThis);
		break;

	case MS_OP_PLAY:
	case MS_OP_ENTER:   // edit item 
        {		                               
            MSO_LISTITEM __NEAR* pSubtItem = (MSO_LISTITEM __NEAR*)pThis;	 
            MSO_OBJECT __NEAR* pFtaProgramEdit = MS_CreateAndAddObject((MS_DESCRIPTOR*)&oFtaProgramDescriptor, (MSO_CONTAINER __NEAR*)(pThis->mpParent));
            MS_SendOperation(pFtaProgramEdit, MS_OP_OPEN, (UINT32)(PROGRAM_CHANNEL_LIST | pSubtItem->moParam.mwIndex) );

⌨️ 快捷键说明

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