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

📄 o_bass_mgr.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
字号:
/* **************************************************************************************
*  Copyright (c) 2004 ZORAN Corporation, All Rights Reserved
*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
*  File: $Workfile: o_bass_mgr.c $
*
* Description:
* ============
* Project definition of the MSO_BASSMGR
*
****************************************************************************************/
#include "Config.h"		// Global Configuration - do not remove!

#ifdef D_SETUP_ADVANCED_TONE_SET

#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 <stdio.h>
#include <string.h>
#include "Kernel\eventdef.h"
#include "Playcore\Coremain\Coremain.h"
#include "Playcore\Coremain\CoreGDef.h"

#include "Library\String_generate.h"
#include "Library\Number.h"
#include "Library\Container_Misc.h"

#include "CoreAPI\CoreAPI.h"

#include "GUI\Menu_system\ms_object.h"
#include "gui\menu_system\osd_rendering.h"
#include "gui\menu_system\ms_display.h"
#include "GUI\Menu_system\ms_screen.h"
#include "GUI\Menu_system\ms_component.h"
#include "GUI\Menu_system\ms_send_op.h"

#include "GUI\Object_class\Hslider\mso_hslider.h"
#include "Components\Bass_manager\o_bass_mgr.h"
#include "GUI\Resource\Bitmap\bitmap.h"
#include "Menu\menu_operation_def.h"

#include "GUI\Object_class\Button\mso_button.h"
#include "GUI\Object_class\Page\mso_page.h"
#include "GUI\Object_class\Vlist\mso_vlist.h"

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

// Include configuration header file: named constants, macros and typedefs.
#include "Components\Bass_manager\o_bass_mgr_config.h"
// Include custom header file: customer specific definitions, over-writing common ones.
#include "Components\Custom\Bass_manager\o_bass_mgr_custom.h"

/**************************************************************************
* 	Utility functions
***************************************************************************/

/**************************************************************************
* 	Operation functions
***************************************************************************/
#ifdef D_BASS_ON_ITEM
static UINT16 _BassSliderAction(HSLIDER_ACTION eType, UINT16 wValue);
#endif
static UINT16 _BassToneSliderAction(HSLIDER_ACTION eType, UINT16 wValue);
static UINT16 _TrebleToneSliderAction(HSLIDER_ACTION eType, UINT16 wValue);
static MS_OP  _BassToneOKButtonOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);


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

// Include custom code file: customer specific code, over-writing common one.
#include "Components\Custom\Bass_manager\o_bass_mgr_custom.c"
// Include configuration file: constants.
#include "Components\Bass_manager\o_bass_mgr_config.c"


/**************************************************************************
* 	Utility functions
***************************************************************************/

/**************************************************************************
* 	Operation functions
***************************************************************************/

/**************************************************************************
*	Function 	: 	BassMgrOperation
*
*	In		:
*
*	Out		:
*
*	Desc 	:
 ***************************************************************************/
 #ifndef D_CUSTOM_BassMgrOperation
MS_OP BassMgrOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	// TODO : If neccessary handle operations here.

	return MS_ComponentBasicOperation(pThis, MsOp, lParam);
}
#endif // D_CUSTOM
/**************************************************************************
* 	Display functions
***************************************************************************/

/**************************************************************************
*	Function 	: 	BassMgrFillOSDSeg
*
*	In		:
*
*	Out		:
*
*	Desc 	:
 ***************************************************************************/
 #ifndef D_CUSTOM_BassMgrFillOSDSeg
BOOL BassMgrFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
	FORMATED_UNICODE_STRING oFormUniStr;
	MS_DESCRIPTOR_BASSMGR* pDescriptor = (MS_DESCRIPTOR_BASSMGR*)pThis->mpDescriptor;

	OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);

	oFormUniStr.mtFontIndex = FONT_0;
	// The page title
#ifdef D_BASS_ON_ITEM
	OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_BASS_MANAGE);
#else
	OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_TONE);
#endif

	OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
							pAbsArea,
							BSM_COL_1_X,
							BSM_LINE_2_Y,
							ALIGN_H_LEFT,
                            ALIGN_V_BOTTOM,
							pDescriptor->mwTextColor);
	// The first item label
#ifdef D_BASS_ON_ITEM
	OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_BASS);
#else
	OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_BASS_TONE);
#endif

	OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
							pAbsArea,
							BSM_COL_1_X,
							BSM_LINE_3_Y,
							ALIGN_H_LEFT,
							ALIGN_V_BOTTOM,
							pDescriptor->mwTextColor);

	// The second item label
#ifdef D_BASS_ON_ITEM
	OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_TONE);
#else
	OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_TREBLE_TONE);
#endif

	OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
							pAbsArea,
							BSM_COL_1_X,
                            BSM_LINE_4_Y,
							ALIGN_H_LEFT,
							ALIGN_V_BOTTOM,
							pDescriptor->mwTextColor);

#ifdef D_BASS_ON_ITEM
	// The third item label
	OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_BASS_TONE);

	OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
							pAbsArea,
							BSM_COL_1_X,
                            BSM_LINE_5_Y,
							ALIGN_H_LEFT,
							ALIGN_V_BOTTOM,
							pDescriptor->mwTextColor);

    // The fourth item label
	OSDR_GetFormUniStr_OsdMessage((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, S_TREBLE_TONE);

	OSDR_FillOsdSegUniString((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr,
							pAbsArea,
							BSM_COL_1_X,
                            BSM_LINE_6_Y,
							ALIGN_H_LEFT,
							ALIGN_V_BOTTOM,
							pDescriptor->mwTextColor);

#endif // D_BASS_ON_ITEM

	return FALSE;
}
#endif //D_CUSTOM
/**************************************************************************
*	Name	:	_BassSliderAction
*	In		:
*	Out 	:
*	Desc	:
***************************************************************************/
#ifdef D_BASS_ON_ITEM
#ifndef D_CUSTOM__BassSliderAction
static UINT16 _BassSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{
	if(eType == HS_ACTION_SET)
    {
        CoreAPI_UpdatePlayerSetting( PS_UPDATE_BASS_SET, wValue);
        CoreAPI_UpdatePlayerSetting( IE_CORE_AMPLIFIER_BASS_SCALE, wValue);
    }
    else
    {
		//wValue = gps->BassSet;
        wValue = 0;
    }

    return(wValue);
}
#endif //D_CUSTOM
#endif // D_BASS_ON_ITEM

/**************************************************************************
*	Name	:	_BassToneSliderAction
*	In		:
*	Out 	:
*	Desc	:
***************************************************************************/
#ifndef D_CUSTOM__BassToneSliderAction
static UINT16 _BassToneSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{
	if(eType == HS_ACTION_SET)
    {
        CoreAPI_UpdatePlayerSetting( PS_UPDATE_BASS_TONE, wValue);
        CoreAPI_UpdatePlayerSetting( IE_CORE_AMPLIFIER_BASS_TONE, wValue);
    }
    else
    {
#ifdef DIGITAL_AMPLIFIER_ENABLE
		wValue = CoreAPI_GetBassToneValue();
#else
		wValue = 0;
#endif
    }

    return(wValue);
}
#endif // D_CUSTOM

/**************************************************************************
*	Name	:	_TrebleToneSliderAction
*	In		:
*	Out 	:
*	Desc	:
***************************************************************************/
#ifndef D_CUSTOM__TrebleToneSliderAction
static UINT16 _TrebleToneSliderAction(HSLIDER_ACTION eType, UINT16 wValue)
{
	if(eType == HS_ACTION_SET)
    {
        CoreAPI_UpdatePlayerSetting( PS_UPDATE_TREBLE_TONE, wValue);
        CoreAPI_UpdatePlayerSetting( IE_CORE_AMPLIFIER_TREBLE_TONE, wValue);
    }
    else
    {
#ifdef DIGITAL_AMPLIFIER_ENABLE
		wValue = CoreAPI_GetTrebleToneValue();
#else
		wValue = 0;
#endif
    }

    return(wValue);
}
#endif // D_CUSTOM

/**************************************************************************
*	Function	:	_BassToneOKButtonOperation
*
*	In		:
*
*	Out 		:
*
*	Return	:
*
*	Desc	:
*
 ***************************************************************************/
 #ifndef D_CUSTOM__BassToneOKButtonOperation
static MS_OP  _BassToneOKButtonOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	switch(MsOp)
	{
		case MS_OP_ENTER:
			// The user wants to close this menu...
            // First, add it to the display list so that it will be re-displayed (removed)
			MS_DisplayAddObject((MSO_OBJECT __NEAR*)pThis->mpParent);
            // Set the focus to the prev-focus item in the parent container:
            MS_ScreenSetFocusObject(MS_GetPrevFocusInContainer(((MSO_CONTAINER __NEAR *)pThis->mpParent)->moObject.mpParent));
            // Send a message to the parent requesting removal of ourselves:
            MS_SEND_OP_OBJECT(((MSO_CONTAINER __NEAR *)pThis->mpParent)->moObject.mpParent, MS_OP_REMOVE, (UINT32)(pThis->mpParent));

			MsOp = MS_OP_NONE;
			break;
	}
	return(OBUTTON_Operation(pThis, MsOp, lParam));
}
#endif //D_CUSTOM
#endif //D_SETUP_ADVANCED_TONE_SET

⌨️ 快捷键说明

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