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

📄 o_smartpic_slider.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
📖 第 1 页 / 共 2 页
字号:
			{
				PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
				return MS_OP_NONE;
			}
		}
		break;

	default:
		break;
	}
	
	MsOp = HSliderOperationOnVList(pThis, MsOp, lParam);

	// Post-processing
	switch(MsOp)
	{
	case MS_OP_INIT:
		{
				MS_CLEAR_CHOICE_DISABLE(pThis);
		}
		break;

	case MS_OP_ENTER:
		return MS_OP_NONE;

	default:
		break;
	}

	return MsOp;
}
/***************************************************************************************
*	Function 	: 	_SmartPicSliderOperation
*
*	In		:
*
*	Out		:
*
*	Desc 	:	MSO_KARAOKE user operation function.
****************************************************************************************/
#pragma argsused
static MS_OP _SmartPicSliderOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	// Pre-processing
	switch(MsOp)
	{
	case MS_OP_INIT:
		{
			MS_ComponentInitFocus((MSO_COMPONENT __NEAR*)pThis);
		}
		break;

	case MS_OP_ENTER:
		{
			MSO_OBJECT __NEAR *pObject;
			//find previously focused object in pThis->mpParent and set focus to it
			pObject = MS_ContainerGetPrevFocusObject((MSO_CONTAINER __NEAR*)pThis->mpParent);
			if (pObject != NULL)
			{
				MS_ScreenSetFocusObject(pObject);
				MS_SEND_OP_OBJECT(pObject, MS_OP_CLOSE_CHOICE, 0);
			}
			MS_SetToBeRemoved(pThis);
			MS_DisplayAddObject(pThis);
			MsOp = MS_OP_NONE;
		}
		break;

	default:
		break;
	}	
	return MS_ComponentBasicOperation(pThis, MsOp, lParam);
}
/***************************************************************************************
*	Function 	: 	_SmartPicSliderFillOSDSeg
*
*	In		:
*
*	Out		:
*
*	Desc 	:	MSO_KARAOKE display function.
****************************************************************************************/
#pragma argsused
static BOOL _SmartPicSliderFillOSDSeg(MSO_OBJECT __NEAR * pThis, MS_AREA __NEAR * pAbsArea)
{
	MS_DESCRIPTOR_SMARTPIC* pDescriptor = (MS_DESCRIPTOR_SMARTPIC*)pThis->mpDescriptor;

	OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);

   	return FALSE;
}
/***************************************************************************************
* 	Choice item action functions
****************************************************************************************/

/***************************************************************************************
*	Function	:	_BrightnessSliderAction
*
*	In		:	eType	=	Getting or Setting the value
*				wValue	=	0 if value to get, or value to be set
*
*	Out 		:	None
*
*	Return	: 	None
*
*	Desc		: 	The brightness choice action function.
****************************************************************************************/

#pragma argsused
STATIC UINT16 _BrightnessSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{
	UINT16 wBrightnessValue;
	if(HS_ACTION_GET == eType)
	{
		wBrightnessValue = CoreAPI_GetPsBrightness();

		// Check slider value range before return.
		if(BRIGHTNESS_SLIDER_MAX_VALUE  < wBrightnessValue)
			wBrightnessValue = (BRIGHTNESS_SLIDER_MAX_VALUE - BRIGHTNESS_SLIDER_MIN_VALUE)/2;
		else
			wBrightnessValue = (UINT16)(wBrightnessValue - ((BRIGHTNESS_SLIDER_MAX_VALUE - BRIGHTNESS_SLIDER_MIN_VALUE)/2));
		return wBrightnessValue;
	}
	else
	{
		// Check value range before return to slider.
		if(((BRIGHTNESS_SLIDER_MAX_VALUE - BRIGHTNESS_SLIDER_MIN_VALUE)/2) < (INT16)wValue)
			wBrightnessValue = BRIGHTNESS_SLIDER_MAX_VALUE;
		else if (((BRIGHTNESS_SLIDER_MIN_VALUE -BRIGHTNESS_SLIDER_MAX_VALUE)/2) > (INT16)wValue)
		{
			wBrightnessValue = BRIGHTNESS_SLIDER_MIN_VALUE;
		}
		else
			wBrightnessValue = (INT16)wValue + (BRIGHTNESS_SLIDER_MAX_VALUE/2);

		CoreAPI_UpdatePlayerSetting(PS_UPDATE_DYNAMIC_BRIGHTNESS, wBrightnessValue);
		return wBrightnessValue;
	}
	
}

/***************************************************************************************
*	Function	:	_ContrastSliderAction
*
*	In		:	eType	=	Getting or Setting the value
*				wValue	=	0 if value to get, or value to be set
*
*	Out 		:	None
*
*	Return	: 	None
*
*	Desc		: 	The contrast choice action function.
****************************************************************************************/

#pragma argsused
STATIC UINT16 _ContrastSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{	
	UINT16 wContrastValue;
	if(HS_ACTION_GET == eType)
	{
		wContrastValue = CoreAPI_GetPsContrast();

		// Check slider value range before return.
		if(CONTRAST_SLIDER_MAX_VALUE  < wContrastValue)
			wContrastValue = CONTRAST_SLIDER_MAX_VALUE/2;
		else
			wContrastValue = (UINT16)(wContrastValue - (CONTRAST_SLIDER_MAX_VALUE/2));
		return wContrastValue;
	}
	else
	{
		// Check value range before return to slider.
		if((CONTRAST_SLIDER_MAX_VALUE/2) < (INT16)wValue)
			wContrastValue = CONTRAST_SLIDER_MAX_VALUE;
		else if ((0 -CONTRAST_SLIDER_MAX_VALUE/2) > (INT16)wValue)
		{
			wContrastValue = CONTRAST_SLIDER_MIN_VALUE;
		}
		else
			wContrastValue = (INT16)wValue + (CONTRAST_SLIDER_MAX_VALUE/2);
		

		CoreAPI_UpdatePlayerSetting(PS_UPDATE_DYNAMIC_CONTRAST, wContrastValue);
		return wContrastValue;
	}
}

/***************************************************************************************
*	Function	:	_TintSliderAction
*
*	In		:	eType	=	Getting or Setting the value
*				wValue	=	0 if value to get, or value to be set
*
*	Out 		:	None
*
*	Return	: 	None
*
*	Desc		: 	The tint choice action function.
****************************************************************************************/

#pragma argsused
STATIC UINT16 _TintSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{	
	UINT16 wTintValue;
	if(HS_ACTION_GET == eType)
	{
		wTintValue = CoreAPI_GetPsTint();

		// Check slider value range before return.
		if(TINT_SLIDER_MAX_VALUE  < wTintValue)
			wTintValue = TINT_SLIDER_MAX_VALUE/2;
		else
			wTintValue = (UINT16)(wTintValue - (TINT_SLIDER_MAX_VALUE/2));
		return wTintValue;
	}
	else
	{
		// Check value range before return to slider.
		if((TINT_SLIDER_MAX_VALUE/2) < (INT16)wValue)
			wTintValue = TINT_SLIDER_MAX_VALUE;
		else if ((0 -TINT_SLIDER_MAX_VALUE/2) > (INT16)wValue)
		{
			wTintValue = TINT_SLIDER_MIN_VALUE;
		}
		else
			wTintValue = (INT16)wValue + (TINT_SLIDER_MAX_VALUE/2);
		
		CoreAPI_UpdatePlayerSetting(PS_UPDATE_DYNAMIC_TINT, wTintValue);
		return wTintValue;
	}
}

/***************************************************************************************
*	Function	:	_ColorSliderAction
*
*	In		:	eType	=	Getting or Setting the value
*				wValue	=	0 if value to get, or value to be set
*
*	Out 		:	None
*
*	Return	: 	None
*
*	Desc		: 	The Color choice action function.
****************************************************************************************/

#pragma argsused
STATIC UINT16 _ColorSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{	
	UINT16 wColorValue;
	if(HS_ACTION_GET == eType)
	{
		wColorValue = CoreAPI_GetPsColor();

		// Check slider value range before return.
		if(COLOR_SLIDER_MAX_VALUE  < wColorValue)
			wColorValue = COLOR_SLIDER_MAX_VALUE/2;
		else
			wColorValue = (UINT16)(wColorValue - (COLOR_SLIDER_MAX_VALUE/2));
		return wColorValue;
	}
	else
	{
		// Check value range before return to slider.
		if((COLOR_SLIDER_MAX_VALUE/2) < (INT16)wValue)
			wColorValue = CONTRAST_SLIDER_MAX_VALUE;
		else if ((0 -COLOR_SLIDER_MAX_VALUE/2) > (INT16)wValue)
		{
			wColorValue = COLOR_SLIDER_MIN_VALUE;
		}
		else
			wColorValue = (INT16)wValue + (COLOR_SLIDER_MAX_VALUE/2);

		CoreAPI_UpdatePlayerSetting(PS_UPDATE_DYNAMIC_COLOR, wColorValue);
		return wColorValue;
	}
}
/***************************************************************************************
* 	Public functions
****************************************************************************************/

/***************************************************************************************
*	Function	:	OSmartPic_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 Smart Pic componet if opened successfully, otherwise NULL.
*
*	Desc		: 	Creates, and displays a smart pic component.
****************************************************************************************/
MSO_OBJECT __NEAR* OSmartPic_OpenAtPos(MSO_CONTAINER __NEAR* pParent, UINT16 wStartX, UINT16 wStartY)
{
	if(NULL != pParent)
	{
		MSO_OBJECT __NEAR* pSmartPicWnd = NULL;	

		pSmartPicWnd = (MSO_OBJECT __NEAR*)MS_ComponentOpen((MS_DESCRIPTOR_COMPONENT*)&oSmartPicControlDescriptor , pParent);

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

⌨️ 快捷键说明

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