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

📄 o_chnl_scanning.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_volumn_control.c$
*
* Description:
* ========
*
****************************************************************************************/
#include "Config.h"   	// Global Configuration - do not remove!
#ifdef FTA_SUPPORT
#ifdef DEBUG_UI_TRACE
#undef IFTRACE
#define IFTRACE if (gTraceUI)
#include "Debug\DbgMain.h"
#endif //DEBUG_UI_TRACE


#include "include\sysdefs.h"
/***************************************************************************************
* Include files
****************************************************************************************/
#include "include\math-macro.h"
#include "Playcore\ps\ps.h"

#include "GUI\Menu_system\ms_screen.h"
#include "GUI\Menu_system\ms_container.h"
#include "GUI\Menu_system\ms_display.h"
#include "GUI\Menu_system\ms_component.h"

#include "CoreAPI\CoreAPI.h"
#include "Strings\Strings.h"

#include "Library\String_generate.h"

#include "GUI\Object_class\Text\mso_text.h"
#include "GUI\Object_class\Hslider\mso_hslider.h"
#include "GUI\Object_class\Vlist\mso_vlist.h"
#include "Components\Message\o_message_handler.h"


#include "GUI\Resource\Bitmap\bitmap.h"
#include "Menu\menu_operation_def.h"
#include "Menu_config\menu_config_common.h"


#ifdef D_GINGER_I86
#include "decoder\osdlayou.h"
#endif //D_GINGER_I86
#ifdef D_GINGER_I96
#include "Osdlayou.h"
#endif //D_GINGER_I96
#ifdef I64_STEP_B_PROGRESSIVE
#include "decoder\decoder.h"
#endif

#include "Components\Chnl_Scanning\o_chnl_scanning.h"
#include "Components\Chnl_Scanning\o_chnl_scanning_config.h"
#include "Components\Custom\Chnl_Scanning\o_chnl_scanning_custom.h"


#ifndef DEBUG_UI_TRACE
#undef dbg_printf(sMsg)
#define dbg_printf(sMsg)
#undef	dbgm_printf(sMsg, mode)
#define dbgm_printf(sMsg, mode)
#endif


/***************************************************************************************
* 	Operation functions
****************************************************************************************/
static MS_OP _ScanningPromptOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _ScanningKitOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _ScanningkitVlistOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);


/***************************************************************************************
* 	Utility functions
****************************************************************************************/
static BOOL _AddItemsToScanningKit(MSO_VLIST __NEAR* pList);
/***************************************************************************************
* 	Action functions
****************************************************************************************/
static UINT16 _MainScanningSliderAction(HSLIDER_ACTION eType, UINT16 wValue);

/***************************************************************************************
* 	Display functions
****************************************************************************************/
static BOOL _ScanningFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea);
#if 0
/***************************************************************************************
* 	Operation functions
****************************************************************************************/
static MS_OP _AutoScanComPonentOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _ValueOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
// TODO: Vscroll +vlist to List
static MS_OP _ChannelVscrollListOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _ChannelVListOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static void _ChannelListRefreshOperation(MSO_OBJECT __NEAR* pThis, UINT32 lParam);

/***************************************************************************************
* 	Utility functions
****************************************************************************************/
static void _GetChannelNoValueStr(FORMATED_UNICODE_STRING __NEAR* pFormUniStr, UINT32 lParam);
static void _GetFrequencyValueStr(FORMATED_UNICODE_STRING __NEAR* pFormUniStr, UINT32 lParam);

 
/***************************************************************************************
* 	Action functions
****************************************************************************************/

/***************************************************************************************
* 	Display functions
****************************************************************************************/
static BOOL _AutoScanComponentFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea);
#endif


#include "Components\Custom\Chnl_Scanning\o_chnl_scanning_custom.c"
#include "Components\Chnl_Scanning\o_chnl_scanning_config.c"


/***************************************************************************************
*	Function 	: 	_ScanningPromptOperation
*
*	In		:
*
*	Out		:
*
*	Desc 	:	The Scanning Prompt component operation function.
****************************************************************************************/

static MS_OP _ScanningPromptOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	static UINT uiLastProg;
	UINT uiCurrProg;

	switch(MsOp)
	{
	case MS_OP_INIT:
		uiLastProg = 0;
		MS_ComponentInitFocus((MSO_COMPONENT __NEAR*)pThis);
		break;

	// TODO: When close the volumn object is more reasonalbe
	case MS_OP_UP:
	//Fall Thru
	case MS_OP_DOWN: // Fall Thru
	case MS_OP_CORE_MEDIA_CHANGED:  //Fall Thru
		MS_SendOperation(pThis, MS_OP_CLOSE_PARENT,  0);
		return MS_OP_NONE;
	case MS_OP_EJECT: //Fall Thru
		MS_SendOperation(pThis, MS_OP_CLOSE_PARENT,  0);
		break;
	case MS_OP_CHNL_SCANNING:
		MS_SendOperation(pThis, MS_OP_CLOSE_PARENT,  0);
		return MS_OP_NONE;
	case MS_OP_CLOSE_PARENT:
		CoreAPI_FtaChnlScanAbort();
		break;		
	case MS_OP_TICK:
		uiCurrProg = CoreAPI_GetChnlScanProgress();
		if( uiCurrProg > uiLastProg )
		{
			uiLastProg++;
			//MsOp = MS_OP_RIGHT;
		}
        // TODO: - update according to channle information 
        // MS_SendOperation(pThis, MS_OP_RIGHT,  0);
        // MS_SendOperation(pThis, MS_OP_LEFT,  0);
		break;

	case MS_OP_LEFT:
	case MS_OP_RIGHT:
		return MS_OP_NONE;
	 //	MS_SendOperation(pThis, MS_OP_RIGHT,  0);
	// return MS_OP_NONE; // not allowed change slider menulay

	default :
		break;
	}
	return MS_ComponentBasicOperation(pThis, MsOp, lParam);
}


#if 0
/***************************************************************************************
*	Function 	: 	_AutoScanComPonentOperation
*
*	In		:
*
*	Out		:
*
*	Desc 	:	The Scanning Prompt component operation function.
****************************************************************************************/
#ifndef D_CUSTOM__AutoScanComPonentOperation
static MS_OP _AutoScanComPonentOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	switch(MsOp)
	{
	case MS_OP_CLOSE_PARENT:
		CoreAPI_FtaChnlScanAbort();
		break;

	case MS_OP_FTA_TAB_EXIT:
		MS_SendOperation(pThis, MS_OP_CLOSE_PARENT,  0);
		return MS_OP_NONE;
		
	case MS_OP_EJECT:
		MS_SendOperation(pThis, MS_OP_CLOSE_PARENT,  0);
		break;
		
	default:
		break;
	}
		
	return MS_ComponentBasicOperation(pThis, MsOp, lParam);
}
#endif

/***************************************************************************************
*	Function	: 	_ValueOperation
*
*	In		:			
*	Out 	:
*	Return	:
*	Desc	: 	This funtion handle message of Singal  component
****************************************************************************************/
#ifndef D_CUSTOM__ValueTickOperation
static MS_OP _ValueOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
 {
 	switch(MsOp)
 	{
 	case MS_OP_TICK:
			MS_SendOperation(pThis, MS_OP_BUILD_TEXT_STRING, 0);
			MS_SendOperation(pThis, MS_OP_REFRESH, 0);
		break;
 	}
 	// Now call the generic preproctext op handler:
 	return(OTEXT_Operation(pThis, MsOp, lParam));
 }
 #endif
 
/***************************************************************************************
*	Function	: 	_ChannelVscrollListOperation
*
*	In		:			
*	Out 	:
*	Return	:
*	Desc	: 	This funtion handle message of List component
****************************************************************************************/
 static MS_OP _ChannelVscrollListOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{


	MsOp = VScrollListOperation(pThis, MsOp, lParam);

	// Post processing
	switch(MsOp)
	{
	case MS_OP_INIT:		
	case MS_OP_REFRESH:
		_ChannelListRefreshOperation(pThis, lParam);
		return MsOp;

	default:
		break;
	}
	return MsOp;
}

/***************************************************************************************
*	Function	: 	_ChannelListOperation
*
*	In		:			
*	Out 	:
*	Return	:
*	Desc	: 	This funtion handle message of List component
****************************************************************************************/
static MS_OP _ChannelVListOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	switch (MsOp)
	{
		case MS_OP_TICK:
		{
			// TODO:
			if current channels number is not equal to List total number. 
			{
				send to MS_OP_REFRESH to PARENT;
			}
		}
		break;
		
		default:
			break;
	}
	return MS_BasicContainerOperation(pThis, MsOp, lParam);
}

/***************************************************************************************
*	Function	: 	_ChannelListRefreshOperation
*
*	In		:			
*	Out 	:
*	Return	:
*	Desc	: 	This funtion handle Vscroll list component refresh
****************************************************************************************/
static void _ChannelListRefreshOperation(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);
	pList->moParam.mwTotalItems = CoreAPI_FtaGetNumberOfChannels();

	{
		UINT16  	wRestFiles;
		UINT16	wNumVisibleItems;
		UINT16 	wTotalFiles;

		// TODO: chane mwFirstDisplayItem will make this list go to work. 
		if(REFRESH_LIST_DISPLAY_FIRST_ITEM == lParam)
			pList->moParam.mwFirstDisplayItem = 0; 
		/*else
		{
			if( FTA_GetStatus() == FTA_STATUS_PLAYING )
			{
				pList->moParam.mwFirstDisplayItem = FTA_GetCurrChannel();
			}
		}*/
		// 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)
		{

⌨️ 快捷键说明

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