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

📄 o_chnl_scanning.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
📖 第 1 页 / 共 2 页
字号:
			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;
				pItem = (MSO_LISTITEM __NEAR*)OVLIST_CreatAndAddItem((MSO_OBJECT __NEAR*)pList,
														(MS_DESCRIPTOR *)&oDescriptorListItem,
														TRUE, FALSE);
				pItem->moParam.mwIndex = wNextFileIndex;
				CoreAPI_FtaGetChannelInfo(wNextFileIndex, &channelInfo);
				memcpy((WCHAR*)wszName, channelInfo.szChannelName, FTA_MAX_CHANNEL_NAME_LEN);
				
				if( CoreAPI_FtaIsVideoChannel( wNextFileIndex ))
				{
					pItem->moParam.eType = FTA_SEL_CHANNEL_TYPE_VIDEO;                    
				}
				else
				{
					pItem->moParam.eType = FTA_SEL_CHANNEL_TYPE_RADIO;
				}			
				OSDR_GetFormUniStr_Ram((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, (UINT32)wszName);
				pItem->moParam.mwData = OSDR_MallocScFormUniStr();
				OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwData);
			}
		}
	}

	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);
		}
	}
}


/***************************************************************************************
* 	Utility functions
****************************************************************************************/
/***************************************************************************************
*	Function	:	_GetFrequencyValueStr
*
*
*	Desc		: 
****************************************************************************************/
#pragma argsused
 static void _GetFrequencyValueStr(FORMATED_UNICODE_STRING __NEAR* pFormUniStr, UINT32 lParam)
{
}

/***************************************************************************************
* 	Display functions
****************************************************************************************/
/***************************************************************************************
*	Function	:	_AutoScanComponentFillOSDSeg
*
*
*	Desc		: 
****************************************************************************************/
#pragma argsused
static BOOL _AutoScanComponentFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
	MS_DESCRIPTOR_SCANNING* pDescriptor = (MS_DESCRIPTOR_SCANNING*)pThis->mpDescriptor;

	OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);

	return FALSE;
}

/***************************************************************************************
*	Function	:	OScanning_OpenAtPos
*
*	In		:	pParent		=	Pointer to the parent container.
*
*				wStartX		=	X position of the component. The default position (specified in the 
*								descriptor) is used in case this parameter is set to DEFAULT_POSITION.
*
*				wStartY		=	Y position of the component.The default position (specified in the 
*								descriptor) is used in case this parameter is set to DEFAULT_POSITION.
*
*	Out		:	None.
*
*	Return	:	Pointer to the Search component if opened successfully, otherwise NULL.
*
*	Desc		: 	Creates, and displays a Search component at a specified position.
****************************************************************************************/
extern MSO_OBJECT __NEAR* OScanning_OpenAtPos(MSO_CONTAINER __NEAR* pParent, UINT16 wStartX, UINT16 wStartY)
{
	if(NULL != pParent)
	{
		MSO_OBJECT __NEAR* pScanningWnd = NULL;	
		
		
		pScanningWnd = (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oScanningControl, pParent);

		if(NULL != pScanningWnd)
		{
			if((DEFAULT_POSITION != wStartX) || (DEFAULT_POSITION != wStartY))
			{
				wStartX = (DEFAULT_POSITION == wStartX) ? pScanningWnd->mpDescriptor->moArea.msX : wStartX;
				wStartY = (DEFAULT_POSITION == wStartY) ? pScanningWnd->mpDescriptor->moArea.msY : wStartY;
				MS_ObjectMove(pScanningWnd, wStartX, wStartY);
			}
			
			MS_DisplayAddObject(pScanningWnd);
		}

		return pScanningWnd;
	}
	return NULL;
}


#endif

/***************************************************************************************
*	Function 	: 	_ScanningKitOperation
*
*	In		:
*
*	Out		:
*
*	Desc 	:	The Scanning kit operation function.
****************************************************************************************/
#pragma argsused
static MS_OP _ScanningKitOperation(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);
			
			//NO need this sentence. Mode choice pList->moParam.mwTotalItems will change from 1 to 4, if mode is Scanning music
			if(pList->moParam.mwTotalItems > pList->moParam.mcNumVisibleItems)
			{
				// Remove all items.
				MS_SendOperation((MSO_OBJECT __NEAR*)pList, MS_OP_EMPTY, 0);

				_AddItemsToScanningKit(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;
}

/***************************************************************************************
*	Function 	: 	_ScanningkitVlistOperation
*
*	In		:
*
*	Out		:
*
*	Desc 	:	The Scanning kit VLIST operation function.
****************************************************************************************/
#pragma argsused
static MS_OP _ScanningkitVlistOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	switch(MsOp)
	{
	case MS_OP_INIT:
		return MS_OP_NONE;
		
	case MS_OP_OPEN:
		{
			_AddItemsToScanningKit((MSO_VLIST __NEAR*)pThis);
		}
		break;

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


/***************************************************************************************
*	Array 		: 	aScanningKit
*
*	Purpose	 	:	Contains an array of pointer to descriptors of the objects that would be 
*					added to the Scanningkit (oScanningKitDescriptor). 
 ****************************************************************************************/
static CONST MS_DESCRIPTOR* CONST aScanningKit[] = {
	(MS_DESCRIPTOR*)&oMainScanningSliderDescriptor,
	NULL // IMPORTANT : Last item must always be NULL.
};

/***************************************************************************************
* 	Utility functions
****************************************************************************************/
static BOOL _AddItemsToScanningKit(MSO_VLIST __NEAR* pList)
{
	if(NULL != pList)
	{
		UINT8 cIndex;
		UINT8 cNumItems;
		UINT8 cTotalItemsInToolkit = 0;
		MSO_OBJECT __NEAR* pObject;

		// Get the total number of tools in the toolkit

		while(NULL != aScanningKit[cTotalItemsInToolkit])
			cTotalItemsInToolkit++;
		pList->moParam.mwTotalItems = cTotalItemsInToolkit;
		
		cNumItems = MIN(pList->moParam.mcNumVisibleItems, (pList->moParam.mwTotalItems - pList->moParam.mwFirstDisplayItem));

		
		for(cIndex = 0; cIndex < cNumItems; cIndex++)
		{			
			pObject = OVLIST_CreateAndAppendItem(pList, aScanningKit[pList->moParam.mwFirstDisplayItem + cIndex]);
			MS_SendOperation(pObject, MS_OP_OPEN, 0);
			MS_SendOperation(pObject, MS_OP_INIT, 0);		
		}	
		return TRUE;
	}	
	return FALSE;
}


/***************************************************************************************
*	Function	:	_MainScanningSliderAction
*
*	In		:	eType	=	Getting or Setting the value
*				wValue	=	0 if value to get, or value to be set
*
*	Out 		:	None
*
*	Return	: 	None
*
*	Desc		: 	The main volumn slider action function.
****************************************************************************************/
STATIC UINT16 _MainScanningSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{
		
	if(eType == HS_ACTION_SET)
	{
        // it is not set by user ( by now )
	}
	else
	{
       wValue = 0; // todo
	}
	return(wValue);
}


/***************************************************************************************
* 	Display functions
****************************************************************************************/
#pragma argsused
static BOOL _ScanningFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
	MS_DESCRIPTOR_SCANNING* pDescriptor = (MS_DESCRIPTOR_SCANNING*)pThis->mpDescriptor;

	OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);

	return FALSE;
}


/***************************************************************************************
*	Function	:	OScanning_OpenAtPos
*
*	In		:	pParent		=	Pointer to the parent container.
*
*				wStartX		=	X position of the component. The default position (specified in the 
*								descriptor) is used in case this parameter is set to DEFAULT_POSITION.
*
*				wStartY		=	Y position of the component.The default position (specified in the 
*								descriptor) is used in case this parameter is set to DEFAULT_POSITION.
*
*	Out		:	None.
*
*	Return	:	Pointer to the Search component if opened successfully, otherwise NULL.
*
*	Desc		: 	Creates, and displays a Search component at a specified position.
****************************************************************************************/
extern MSO_OBJECT __NEAR* OScanning_OpenAtPos(MSO_CONTAINER __NEAR* pParent, UINT16 wStartX, UINT16 wStartY)
{
	if(NULL != pParent)
	{
		MSO_OBJECT __NEAR* pScanningWnd = NULL;	
		
		
		pScanningWnd = (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oScanningControl, pParent);

		if(NULL != pScanningWnd)
		{
			if((DEFAULT_POSITION != wStartX) || (DEFAULT_POSITION != wStartY))
			{
				wStartX = (DEFAULT_POSITION == wStartX) ? pScanningWnd->mpDescriptor->moArea.msX : wStartX;
				wStartY = (DEFAULT_POSITION == wStartY) ? pScanningWnd->mpDescriptor->moArea.msY : wStartY;
				MS_ObjectMove(pScanningWnd, wStartX, wStartY);
			}
			
			MS_DisplayAddObject(pScanningWnd);
		}

		return pScanningWnd;
	}
	return NULL;
}

#endif // FTA_SUPPORT

⌨️ 快捷键说明

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