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

📄 mapp_uimenudraw.c

📁 mstar 776 开发的车载dvd
💻 C
字号:
#define MAPP_UI_MENU_DRAW_C
/******************************************************************************
 Copyright (c) 2006 MStar Semiconductor, Inc.
 All rights reserved.

 [Module Name]: MApp_uiMenuDraw.c
 [Date]:        2006/09/04
 [Comment]:
   OSD draw components relative subroutine..
 [Reversion History]:
*******************************************************************************/
#include "MApp_GlobalVar.h"
#include "MApp_GlobalFunction.h"
#include "MApp_Font.h"

#include "MApp_UiMenuDef.h"

#include "MApp_UiMenu.h"
#include "MApp_UiMenuTbl.h"

#include "MApp_UiMenuDraw1.h"
#include "MApp_UiMenuDraw2.h"

#include "MApp_UiMenuDraw.h"
#include "MApp_UiMenuFunc.h"
#include "DrvISR.h"

#define OSDDBG(x) //x

extern S16 s16LongFileNameIndex;

//============================================================================
void MApp_UiMenu_DrawComponents(DrawComponentType *ComponentList, COMPONENT_STATE_TYPE  ComponentState)
{
    U8 u8ListIndex = 0;
    BOOLEAN bDoDrawFlag = TRUE;
    DrawComponentType* Component;

    while(bDoDrawFlag)
    {

        Component = ComponentList+u8ListIndex;
        if((Component->u8ComponentType) == NULL)
            bDoDrawFlag = FALSE;

        switch(Component->u8ComponentType)
        {

            case EN_CP_LINE_2:
                MApp_UiMenu_DrawLine_2(Component->u8ComponentIndex);
                break;

            case EN_CP_BLOCK_2:
                MApp_UiMenu_DrawBlock_2(Component->u8ComponentIndex);
                break;

            case EN_CP_3DCONVEXBLOCK_2:
                MApp_UiMenu_Draw3DConvexBlock_2(Component->u8ComponentIndex);
                break;

            case EN_CP_3DCONCAVEBLOCK_2:
                MApp_UiMenu_Draw3DConcaveBlock_2(Component->u8ComponentIndex);
                break;

            case EN_CP_BMP_2:
                MApp_UiMenu_DrawBitmap_2(Component->u8ComponentIndex, ComponentState);
                break;

            case EN_CP_MENUSTRING0_2:
                MApp_UiMenu_DrawMenuString0_2(Component->u8ComponentIndex, ComponentState);
                break;

            case EN_CP_MENUSTRING1_2:
                MApp_UiMenu_DrawMenuString1_2(Component->u8ComponentIndex, ComponentState);
                break;

            case EN_CP_MENUSTRING2_2:
                MApp_UiMenu_DrawMenuString2_2(Component->u8ComponentIndex, ComponentState);
                break;

            case EN_CP_IDLESTRING0_2:
                MApp_UiMenu_DrawIdleString0_2(Component->u8ComponentIndex, ComponentState);
                break;

            //case EN_CP_IDLESTRING1_2:
                //MApp_UiMenu_DrawIdleString1(Component->u8ComponentIndex, ComponentState);
                //break;

            case EN_CP_NUMBER_2:
                MApp_UiMenu_DrawNumber_2(Component->u8ComponentIndex, ComponentState);
                break;

            case EN_CP_BMP_PROGRESS_BAR_2:
                MApp_UiMenu_DrawBmpProgBar_2(Component->u8ComponentIndex, ComponentState);
                break;

            case EN_CP_BMP_BALANCE_BAR_2:
                MApp_UiMenu_DrawBmpBalanceBar_2(Component->u8ComponentIndex, ComponentState);
                break;

            case EN_CP_BMP_SIGNAL_BAR_2:
                MApp_UiMenu_DrawBmpSignalBar_2(Component->u8ComponentIndex, ComponentState);
                break;

            case EN_CP_NOPREFIX_SIGN_NUMBER_2:
                MApp_UiMenu_DrawNoPrefixSignNumber_2(Component->u8ComponentIndex, ComponentState);
                break;

            case EN_CP_AQUABMP_PROGRESS_BAR_2:
                MApp_UiMenu_DrawAquaBitmapProgressBar_2(Component->u8ComponentIndex);
                break;

            case EN_CP_PLUSMINUSNUMBER_2:
		        MApp_UiMenu_DrawPlusMinusNumber_2(Component->u8ComponentIndex,ComponentState);
		        break;

             case EN_CP_UNCOLORKEY_BMP_2:
		        MApp_UiMenu_DrawUnColorKeyBitmap_2(Component->u8ComponentIndex, ComponentState);
                break;

            default:
                bDoDrawFlag = FALSE;
                break;

        }
        u8ListIndex++;
    }
}

void MApp_UiMenu_DrawSpectrumBar(DrawComponentType *ComponentList, U8 u8BarDisplayType ,U8 u8BarDisplayMode)
{
	U8 u8ListIndex = 0;
	S8 u8BarOrientFlag = 0;
	U8 u8TempPreValue,u8TempCurrentValue = 0;
	BOOLEAN bDoDrawFlag = TRUE;
	DrawComponentType* Component;

	while(bDoDrawFlag)
	{
		Component = ComponentList+u8ListIndex;
		if((Component->u8ComponentType) == NULL)
			return;

		if(u8SpectrumCurrentValue[u8ListIndex] == u8SpectrumProvValue[u8ListIndex])
		{	u8BarOrientFlag = 0;
		}
		else if(u8SpectrumCurrentValue[u8ListIndex] > u8SpectrumProvValue[u8ListIndex])
		{	u8BarOrientFlag = 1;
		}
		else
		{	u8BarOrientFlag = -1;
		}

		if(u8BarOrientFlag==1)
		{
			if( u8SpectrumProvValue[u8ListIndex]<31)
			{
			       u8TempPreValue = u8SpectrumProvValue[u8ListIndex]*4 ;
				u8SpectrumProvValue[u8ListIndex] +=1;
				u8TempCurrentValue = u8SpectrumProvValue[u8ListIndex]*4 ;

                            if(u8BarDisplayType==SPECTRUM_TYPE_BAR)
				{   MApp_UiMenu_SpretrumBar_DrawBlock_2(Component->u8ComponentIndex,u8TempCurrentValue,u8BarOrientFlag,u8BarDisplayMode);
                            }
                            else
                            {   MApp_UiMenu_SpretrumBar_DrawBitmap_2(Component->u8ComponentIndex,u8TempPreValue,u8TempCurrentValue,u8BarDisplayMode);
                            }
			}
		}
		else if(u8BarOrientFlag == -1)
		{
			u8SpectrumCounter[u8ListIndex]+=1;
			if(u8SpectrumCounter[u8ListIndex]>3)
			{
				if(u8SpectrumProvValue[u8ListIndex]>0)
				{
				       u8TempPreValue = u8SpectrumProvValue[u8ListIndex]*4 ;
					u8SpectrumProvValue[u8ListIndex] -= 1;
					u8TempCurrentValue = u8SpectrumProvValue[u8ListIndex]*4 ;
                                   if(u8BarDisplayType==SPECTRUM_TYPE_BAR)
					{   MApp_UiMenu_SpretrumBar_DrawBlock_2(Component->u8ComponentIndex,u8TempCurrentValue,u8BarOrientFlag,u8BarDisplayMode);
                                   }
                                   else
                                   {  MApp_UiMenu_SpretrumBar_DrawBitmap_2(Component->u8ComponentIndex,u8TempPreValue,u8TempCurrentValue,u8BarDisplayMode);
                                   }
				}
				u8SpectrumCounter[u8ListIndex]=0;
			}
		}

		u8ListIndex++;
	}
}


#undef MAPP_UI_MENU_DRAW_C

⌨️ 快捷键说明

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