/**
 * @file hv_app_OsdMenu.c
 * @brief osd app menu c file.
 * @details This file provides the following functions: \n
 *          (1) Osd menu operation functions \n
 *          (2) Osd event operation functions \n
 *
 * @author HiView SoC Software Team
 * @version 1.0.0
 * @date 2022-09-01
 * @copyright Copyright(c),2022-8, Hiview Software. All rights reserved.
 * @par History:
 * <table>
 * <tr><th>Author       <th>Date            <th>Change Description
 * <tr><td>shanpeng     <td>2022-09-01      <td>create
 * </table>
 */

#include "hv_mw_OsdComm.h"
#include "hv_mw_OsdLog.h"
#include "hv_comm_DataBase.h"
#include "hv_mw_AppInterface.h"
#include "hv_mw_Channel_Manager.h"
#include "hv_res_OsdMenuOperation.h"
#include "hv_res_OsdMoeRes.h"
#include "hv_app_OsdDynamicUpdate.h"
#include "hv_mw_Factory.h"
#include "hv_app_OsdMenu.h"
#include "hv_app_Osd.h"
#include "hv_app_OsdDialog.h"
#include "hv_app_OsdFactory.h"
#include "hv_mw_OsdOperation.h"
#include "hv_mw_OsdDraw.h"
#ifdef CONFIG_USER_USB_OTA_ON
#include "hv_mw_UsbTask.h"
#endif

static BOOL s_bQuickEnter = HV_FALSE;
static INT32 s_iTimeTotal = 0;
static USHORT16 s_usKeyBackup;
static USHORT16 s_usItemBackup;
static BOOL s_bPowerTipsShowen = HV_FALSE;

VOID Hv_App_OsdInputMenuEnter(VOID)
{
    USHORT16 usItem = ITEM_HDMI1_SCENE_INPUT;

    Hv_App_OsdHideAll();

    Hv_Mw_OsdSceneInit(SCENE_INPUT);
    Hv_Mw_OsdSceneShow(SCENE_INPUT);

    Hv_Mw_OsdItemShowList(usItem);
    usItem = Hv_Mw_OsdItemFindSelected(usItem, HV_FALSE);
    Hv_Mw_OsdItemFocus(usItem);

    Hv_Mw_OsdSetKeyRepeatPeriod(OSD_DEFAULT_KEY_REPEAT_PERIOD_MS);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_UP, KEY_STATE_REPEATABLE, HV_TRUE);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_DOWN, KEY_STATE_REPEATABLE, HV_TRUE);
    OSD_LOG_INFO("Show input select quick menu");
}

VOID Hv_App_OsdInputMenuExit(VOID)
{
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_UP, KEY_STATE_REPEATABLE, HV_FALSE);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_DOWN, KEY_STATE_REPEATABLE, HV_FALSE);

    Hv_Mw_OsdItemFocusClear();
    Hv_Mw_OsdSceneHide(SCENE_INPUT);
    Hv_Mw_OsdSceneClear(SCENE_INPUT);
}

VOID Hv_App_OsdModeMenuEnter(VOID)
{
    /* Check disable before focus, if item disabled */
    if (Hv_App_Cb_ItemCheckDisable(ITEM_MODE_SCENE_MODE))
    {
        OSD_LOG_INFO("Display mode disabled!");
        return;
    }

    Hv_App_OsdHideAll();

    Hv_Mw_OsdSceneInit(SCENE_MODE);
    Hv_Mw_OsdSceneShow(SCENE_MODE);

    USHORT16 usItem = ITEM_MODE_SCENE_MODE;
    Hv_Mw_OsdItemShow(usItem);

    Hv_Mw_OsdItemFocus(usItem);

    Hv_Mw_OsdSetKeyRepeatPeriod(OSD_DEFAULT_KEY_REPEAT_PERIOD_MS);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_UP, KEY_STATE_REPEATABLE, HV_TRUE);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_DOWN, KEY_STATE_REPEATABLE, HV_TRUE);
    OSD_LOG_INFO("Show display mode select quick menu");
}

VOID Hv_App_OsdModeMenuExit(VOID)
{
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_UP, KEY_STATE_REPEATABLE, HV_FALSE);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_DOWN, KEY_STATE_REPEATABLE, HV_FALSE);

    Hv_Mw_OsdItemFocusClear();
    Hv_Mw_OsdSceneHide(SCENE_MODE);
    Hv_Mw_OsdSceneClear(SCENE_MODE);
}

VOID Hv_App_OsdCrosshairEnter(VOID)
{
    USHORT16 usStyle = Hv_App_GetOsdDataValue(E_USERDATA_CROSSHAIR);

    switch (usStyle)
    {
        case UD_CROSSHAIR_V_STYLE1:
        {
            Hv_Mw_OsdSceneInit(SCENE_CROSSHAIR);
            Hv_Mw_OsdSceneShow(SCENE_CROSSHAIR);
            Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_ICON, IMAGE_CROSSHAIR1_SCENE_CROSSHAIR_NORMAL));
            break;
        }
        case UD_CROSSHAIR_V_STYLE2:
        {
            Hv_Mw_OsdSceneInit(SCENE_CROSSHAIR);
            Hv_Mw_OsdSceneShow(SCENE_CROSSHAIR);
            Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_ICON, IMAGE_CROSSHAIR2_SCENE_CROSSHAIR_NORMAL));
            break;
        }
        case UD_CROSSHAIR_V_STYLE3:
        {
            Hv_Mw_OsdSceneInit(SCENE_CROSSHAIR);
            Hv_Mw_OsdSceneShow(SCENE_CROSSHAIR);
            Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_ICON, IMAGE_CROSSHAIR3_SCENE_CROSSHAIR_NORMAL));
            break;
        }
        default:
        {
            Hv_Mw_OsdSceneHide(SCENE_CROSSHAIR);
            Hv_Mw_OsdSceneClear(SCENE_CROSSHAIR);
            break;
        }
    }
    OSD_LOG_INFO("Show crosshair start");
}

VOID Hv_App_OsdCrosshairExit(VOID)
{
    Hv_Mw_OsdSceneHide(SCENE_CROSSHAIR);
    Hv_Mw_OsdSceneClear(SCENE_CROSSHAIR);
}

VOID Hv_App_OsdRefreshRateUpdate(VOID)
{
    if (!Hv_Mw_OsdSceneIsShowing(SCENE_REFRESH_RATE))
    {
        return;
    }

    Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_ASCII_STRING, CUSTOMSTRING_REFRESHRATE_SCENE_REFRESH_RATE_NORMAL));
    //Hv_Mw_OsdComponentUpdateByUserdata(COMPONENT(OSD_CP_TYPE_ASCII_STRING, CUSTOMSTRING_REFRESHRATE_SCENE_REFRESH_RATE_NORMAL), E_USERDATA_NONE);
    Hv_Mw_OsdStartAutoRefreshTimer(SCENE_REFRESH_RATE, 100);
}

VOID Hv_App_OsdRefreshRateEnter(VOID)
{
    Hv_Mw_OsdSceneInit(SCENE_REFRESH_RATE);
    Hv_Mw_OsdSceneShow(SCENE_REFRESH_RATE);
    Hv_App_OsdRefreshRateUpdate();
    //OSD_LOG_INFO("Show refresh rate start");
}

VOID Hv_App_OsdRefreshRateExit(VOID)
{
    Hv_Mw_OsdStopAutoRefreshTimer(SCENE_REFRESH_RATE);
    Hv_Mw_OsdSceneHide(SCENE_REFRESH_RATE);
    Hv_Mw_OsdSceneClear(SCENE_REFRESH_RATE);
}

VOID Hv_App_OsdTimeCounterSetTime(INT32 iTimeSecond)
{
    s_iTimeTotal = iTimeSecond;
}

VOID Hv_App_OsdTimeCounterUpdate(VOID)
{
    static BOOL bBlinkFlag = HV_FALSE;
    INT32 iTimeTotal = s_iTimeTotal;
    USHORT16 usMinus = iTimeTotal / 60;
    USHORT16 usSecond = iTimeTotal % 60;
    UCHAR8 aucStringTimer[16] = {0};
    USHORT16 usLen = 0;

    if (!Hv_Mw_OsdSceneIsShowing(SCENE_TIMER))
    {
        if (iTimeTotal >= 0)
        {
            OSD_LOG_DEBUG("TimerCount = %d", s_iTimeTotal);
            s_iTimeTotal--;
            Hv_Mw_OsdStartAutoRefreshTimer(SCENE_TIMER, 1000);
        }
        return;
    }

    if (iTimeTotal < 0)
    {
        if (bBlinkFlag)
        {
            Hv_Mw_OsdAsciiStringComponentShow(CUSTOMSTRING_TIMER_SCENE_TIMER_NORMAL, "00:00");
            bBlinkFlag = HV_FALSE;
        }
        else
        {
            Hv_Mw_OsdComponentHide(COMPONENT(OSD_CP_TYPE_ASCII_STRING, CUSTOMSTRING_TIMER_SCENE_TIMER_NORMAL));
            bBlinkFlag = HV_TRUE;
        }
    }
    else
    {
        Hv_Mw_OsdAsciiStringComponentShow(CUSTOMSTRING_TIMER_SCENE_TIMER_NORMAL, "%02d:%02d", usMinus, usSecond);
        OSD_LOG_DEBUG("TimerCount = %d", s_iTimeTotal);
        s_iTimeTotal--;
    }

    Hv_Mw_OsdStartAutoRefreshTimer(SCENE_TIMER, 1000);
}

VOID Hv_App_OsdTimeCounterEnter(VOID)
{
    Hv_Mw_OsdSceneInit(SCENE_TIMER);
    Hv_Mw_OsdSceneShow(SCENE_TIMER);
    Hv_App_OsdTimeCounterUpdate();
    OSD_LOG_INFO("Show timer start");
}

VOID Hv_App_OsdTimeCounterExit(VOID)
{
    if (s_iTimeTotal < 0)
    {
        Hv_Mw_OsdAdjustFunction(E_USERDATA_TIMER_COUNTER, ACT_SET, UD_TIMER_COUNTER_V_OFF, SET_ALL);
        Hv_Mw_OsdStopAutoRefreshTimer(SCENE_TIMER);
    }

    Hv_Mw_OsdSceneHide(SCENE_TIMER);
    Hv_Mw_OsdSceneClear(SCENE_TIMER);
}

VOID Hv_App_OsdLockEnter(VOID)
{
#if 0
    Hv_App_OsdHideAll();
    Hv_Mw_OsdSceneInit(SCENE_LOCK);
    Hv_Mw_OsdSceneShow(SCENE_LOCK);

    if (UD_OSD_LOCK_V_ON == Hv_App_GetOsdDataValue(E_USERDATA_OSD_LOCK))
    {
        Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_BMP, IMAGE_LOCK_SCENE_LOCK_NORMAL));
        Hv_Mw_OsdComponentHide(COMPONENT(OSD_CP_TYPE_BMP, IMAGE_UNLOCK_SCENE_LOCK_NORMAL));
        OSD_LOG_INFO("Show lock");
    }
    else
    {
        Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_BMP, IMAGE_UNLOCK_SCENE_LOCK_NORMAL));
        Hv_Mw_OsdComponentHide(COMPONENT(OSD_CP_TYPE_BMP, IMAGE_LOCK_SCENE_LOCK_NORMAL));
        OSD_LOG_INFO("Show unlock");
    }

    Hv_Mw_OsdStartAutoCloseTimer(SCENE_LOCK, 1);
#endif
}

VOID Hv_App_OsdLockExit(VOID)
{
#if 0
    Hv_Mw_OsdSceneHide(SCENE_LOCK);
    Hv_Mw_OsdSceneClear(SCENE_LOCK);
#endif
}

VOID Hv_App_OsdFuncitonTipsEnter(VOID)
{
    USHORT16 usItem = OSD_GET_FOCUSING();
    s_usKeyBackup = Hv_Mw_OsdGetKeyValue();
    s_usItemBackup = usItem;

    Hv_Mw_OsdSceneHide(ITEM_GET_SCENEID(usItem));

    Hv_Mw_OsdSceneInit(SCENE_FUNCTION_TIPS);
    Hv_Mw_OsdSceneShow(SCENE_FUNCTION_TIPS);

    Hv_Mw_OsdItemFocus(ITEM_NO_SCENE_FUNCTION_TIPS);
    Hv_Mw_OsdItemShowList(ITEM_NO_SCENE_FUNCTION_TIPS);

    switch (usItem)
    {
        case ITEM_FREESYNC_OFF_SCENE_MAIN:
        case ITEM_FREESYNC_ON_SCENE_MAIN:
        {
            if ((UD_VIDEO_SOURCE_V_DP1 == Hv_App_GetOsdDataValue(E_USERDATA_VIDEO_SOURCE)) ||
                (UD_VIDEO_SOURCE_V_DP2 == Hv_App_GetOsdDataValue(E_USERDATA_VIDEO_SOURCE)))
            {
                Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_ADJ_ADAPTIVESYNC_SCENE_FUNCTION_TIPS_NORMAL));
            }
            else
            {
                Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_ADJ_FREESYNC_SCENE_FUNCTION_TIPS_NORMAL));
            }
            Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_OFF_MPRT_SCENE_FUNCTION_TIPS_NORMAL));
            break;
        }
#if 0
        case ITEM_HDR_ADJUST_SCENE_MAIN:
        {
            Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_ADJ_HDR_SCENE_FUNCTION_TIPS_NORMAL));
            Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_OFF_MPRT_SCENE_FUNCTION_TIPS_NORMAL));
            break;
        }
#endif
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdFuncitonTipsExit(VOID)
{
    Hv_Mw_OsdSceneHide(SCENE_FUNCTION_TIPS);
    Hv_Mw_OsdSceneClear(SCENE_FUNCTION_TIPS);
    Hv_Mw_OsdSceneShow(ITEM_GET_SCENEID(s_usItemBackup));
    Hv_Mw_OsdItemFocus(s_usItemBackup);
}

VOID Hv_App_OsdPowerTipsEnter(VOID)
{
    USHORT16 usItem = OSD_GET_FOCUSING();
    s_usKeyBackup = Hv_Mw_OsdGetKeyValue();
    s_usItemBackup = usItem;

    Hv_Mw_OsdSceneHide(ITEM_GET_SCENEID(usItem));

    Hv_Mw_OsdSceneInit(SCENE_POWER_TIPS);
    Hv_Mw_OsdSceneShow(SCENE_POWER_TIPS);

    Hv_Mw_OsdItemFocus(ITEM_NO_SCENE_POWER_TIPS);
    Hv_Mw_OsdItemShowList(ITEM_NO_SCENE_POWER_TIPS);

    switch (usItem)
    {
        case ITEM_BRI_ADJ_SCENE_MAIN:
        case ITEM_BRIGHTNESS_SCENE_BRIGHTNESS:
        {
            Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_BRIGHTNESS_SCENE_POWER_TIPS_NORMAL));
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdPowerTipsExit(VOID)
{
    Hv_Mw_OsdSceneHide(SCENE_POWER_TIPS);
    Hv_Mw_OsdSceneClear(SCENE_POWER_TIPS);
    Hv_Mw_OsdSceneShow(ITEM_GET_SCENEID(s_usItemBackup));
    Hv_Mw_OsdItemFocus(s_usItemBackup);
}

VOID Hv_App_OsdBrightnessAdjustMenuEnter(VOID)
{
    /* Check disable before focus, if item disabled */
    if (Hv_App_Cb_ItemCheckDisable(ITEM_BRIGHTNESS_SCENE_BRIGHTNESS))
    {
        OSD_LOG_INFO("Brightness disabled!");
        return;
    }

    Hv_App_OsdHideAll();

    Hv_Mw_OsdSceneInit(SCENE_BRIGHTNESS);
    Hv_Mw_OsdSceneShow(SCENE_BRIGHTNESS);
    Hv_Mw_OsdItemFocus(ITEM_BRIGHTNESS_SCENE_BRIGHTNESS);
    Hv_Mw_OsdItemShowList(ITEM_BRIGHTNESS_SCENE_BRIGHTNESS);

    Hv_Mw_OsdSetKeyRepeatPeriod(OSD_ADJUST_KEY_REPEAT_PERIOD_MS);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_UP, KEY_STATE_REPEATABLE, HV_TRUE);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_DOWN, KEY_STATE_REPEATABLE, HV_TRUE);
    OSD_LOG_INFO("Show brightness adjust quick menu");
}

VOID Hv_App_OsdBrightnessAdjustMenuExit(VOID)
{
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_UP, KEY_STATE_REPEATABLE, HV_FALSE);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_DOWN, KEY_STATE_REPEATABLE, HV_FALSE);

    Hv_Mw_OsdItemFocusClear();
    Hv_Mw_OsdSceneHide(SCENE_BRIGHTNESS);
    Hv_Mw_OsdSceneClear(SCENE_BRIGHTNESS);
}

VOID Hv_App_OsdContrastAdjustMenuEnter(VOID)
{
    if (Hv_App_Cb_ItemCheckDisable(ITEM_CONTRAST_SCENE_CONTRAST))
    {
        OSD_LOG_INFO("Contrast disabled!");
        return;
    }
    Hv_App_OsdHideAll();

    Hv_Mw_OsdSceneInit(SCENE_CONTRAST);
    Hv_Mw_OsdSceneShow(SCENE_CONTRAST);
    Hv_Mw_OsdItemFocus(ITEM_CONTRAST_SCENE_CONTRAST);
    Hv_Mw_OsdItemShowList(ITEM_CONTRAST_SCENE_CONTRAST);

    Hv_Mw_OsdSetKeyRepeatPeriod(OSD_ADJUST_KEY_REPEAT_PERIOD_MS);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_UP, KEY_STATE_REPEATABLE, HV_TRUE);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_DOWN, KEY_STATE_REPEATABLE, HV_TRUE);
    OSD_LOG_INFO("Show contrast adjust quick menu");
}

VOID Hv_App_OsdContrastAdjustMenuExit(VOID)
{
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_UP, KEY_STATE_REPEATABLE, HV_FALSE);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_DOWN, KEY_STATE_REPEATABLE, HV_FALSE);

    Hv_Mw_OsdItemFocusClear();
    Hv_Mw_OsdSceneHide(SCENE_CONTRAST);
    Hv_Mw_OsdSceneClear(SCENE_CONTRAST);
}

VOID Hv_App_OsdVolumeAdjustMenuEnter(VOID)
{
    Hv_App_OsdHideAll();

    Hv_Mw_OsdSceneInit(SCENE_VOLUME);
    Hv_Mw_OsdSceneShow(SCENE_VOLUME);
    Hv_Mw_OsdItemFocus(ITEM_VOLUME_SCENE_VOLUME);
    Hv_Mw_OsdItemShowList(ITEM_VOLUME_SCENE_VOLUME);

    Hv_Mw_OsdSetKeyRepeatPeriod(OSD_ADJUST_KEY_REPEAT_PERIOD_MS);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_UP, KEY_STATE_REPEATABLE, HV_TRUE);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_DOWN, KEY_STATE_REPEATABLE, HV_TRUE);
    OSD_LOG_INFO("Show volume adjust quick menu");
}

VOID Hv_App_OsdVolumeAdjustMenuExit(VOID)
{
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_UP, KEY_STATE_REPEATABLE, HV_FALSE);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_DOWN, KEY_STATE_REPEATABLE, HV_FALSE);

    Hv_Mw_OsdItemFocusClear();
    Hv_Mw_OsdSceneHide(SCENE_VOLUME);
    Hv_Mw_OsdSceneClear(SCENE_VOLUME);
}

 VOID Hv_App_OsdOtaEnter(VOID)
 {
     Hv_App_OsdHideAll();
     Hv_Mw_OsdStopAutoCloseTimer(SCENE_MAIN);
     Hv_Mw_OsdSetAllKeyEnable(HV_FALSE);
 
     Hv_Mw_OsdSceneInit(SCENE_OTA);
     Hv_Mw_OsdSceneShow(SCENE_OTA);
 
     Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_PREPARE_SCENE_OTA_NORMAL));
     Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_PREPARE_POWER_SCENE_OTA_NORMAL));
 }
 
 VOID Hv_App_OsdOtaUpdate(USHORT16 usValue)
 {
#ifdef CONFIG_USER_USB_OTA_ON
     USHORT16 usUsbState = usValue & 0x00FF;
     OSD_LOG_INFO("OTA State = %d", usUsbState);
 
     Hv_App_OsdHideAll();
     Hv_Mw_OsdSceneInit(SCENE_OTA);
     Hv_Mw_OsdSceneShow(SCENE_OTA);
 
     switch (usUsbState)
     {
         case USB_STATE_NO_UDISK_IN:
         {
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_DISCONNECT_SCENE_OTA_NORMAL));
             Hv_Mw_OsdStartAutoCloseTimer(SCENE_OTA, 5);
             break;
         }
         case USB_STATE_NO_OTA_FILE:
         {
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_FIND_FILE_FAIL_SCENE_OTA_NORMAL));
             Hv_Mw_OsdStartAutoCloseTimer(SCENE_OTA, 5);
             break;
         }
         case USB_STATE_FOUND_OTA_FILE:
         {
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_PROCEED_SCENE_OTA_NORMAL));
             Hv_Mw_OsdItemFocus(ITEM_NO_SCENE_OTA);
             Hv_Mw_OsdItemShowList(ITEM_NO_SCENE_OTA);
             Hv_Mw_OsdSetAllKeyEnable(HV_TRUE);
             break;
         }
         case USB_STATE_OTA_IN_PROCESSING:
         {
             Hv_Mw_OsdSetAllKeyEnable(HV_FALSE);
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_UPDATING_SCENE_OTA_NORMAL));
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_ASCII_STRING, CUSTOMSTRING_OTA_SCENE_OTA_NORMAL));
             UCHAR8 ucPercent = (usValue & 0xFF00) >> 8;
             UCHAR8 aucString[8] = {0};
             USHORT16 usLen = HV_SNPRINTF(aucString, OSD_ASCII_STRING_LENGTH_MAX, "%d%%", ucPercent);
             Hv_Mw_OsdDynamicAsciiStringUpdate(CUSTOMSTRING_OTA_SCENE_OTA_NORMAL, aucString, usLen);
             break;
         }
         case USB_STATE_OTA_SUCCESS:
         {
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_DONE_SCENE_OTA_NORMAL));
             Hv_Mw_OsdStartAutoCloseTimer(SCENE_OTA, 5);
             break;
         }
         case USB_STATE_OTA_FAIL:
         {
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_FAIL_SCENE_OTA_NORMAL));
             Hv_Mw_OsdStartAutoCloseTimer(SCENE_OTA, 5);
             break;
         }
         default:
         {
             Hv_App_OsdOtaExit();
             break;
         }
     }
#endif
 }
 
 VOID Hv_App_OsdOtaExit(VOID)
 {
     Hv_Mw_OsdItemFocusClear();
     Hv_Mw_OsdSceneHide(SCENE_OTA);
     Hv_Mw_OsdSceneClear(SCENE_OTA);
     Hv_Mw_OsdSetAllKeyEnable(HV_TRUE);
 }

 VOID Hv_App_OsdMainMenuUpdate(VOID)
 {
     if (!Hv_Mw_OsdSceneIsShowing(SCENE_MAIN))
     {
         return;
     }
 
     Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_ASCII_STRING, CUSTOMSTRING_RESOLUTION1_SCENE_MAIN_NORMAL));
     Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_ASCII_STRING, CUSTOMSTRING_RESOLUTION2_SCENE_MAIN_NORMAL));
     OSD_LOG_INFO("Update timing info in main menu");
 
     Hv_Mw_OsdStartAutoRefreshTimer(SCENE_MAIN, HV_PROJECT_CONFIG_OSD_DEFAULT_REFRESH_PERIOD_MS);
 }
 
 VOID Hv_App_OsdMainMenu_InputPort(VOID)
 {
     UCHAR8 ucSource = Hv_App_GetOsdDataValue(E_USERDATA_VIDEO_SOURCE);
     switch (ucSource)
     {
         case UD_VIDEO_SOURCE_V_HDMI1:
         {
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_INPUTSOURCE1_HDMI1_SCENE_MAIN_NORMAL));
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_INPUTSOURCE2_HDMI1_SCENE_MAIN_NORMAL));
             break;
         }
         case UD_VIDEO_SOURCE_V_HDMI2:
         {
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_INPUTSOURCE1_HDMI2_SCENE_MAIN_NORMAL));
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_INPUTSOURCE2_HDMI2_SCENE_MAIN_NORMAL));
             break;
         }
         case UD_VIDEO_SOURCE_V_DP1:
         {
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_INPUTSOURCE1_DP1_SCENE_MAIN_NORMAL));
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_INPUTSOURCE2_DP1_SCENE_MAIN_NORMAL));
             break;
         }
         case UD_VIDEO_SOURCE_V_DP2:
         {
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_INPUTSOURCE1_DP2_SCENE_MAIN_NORMAL));
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_INPUTSOURCE2_DP2_SCENE_MAIN_NORMAL));
             break;
         }
         default:
         {
             Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_TEXT, TEXT_NOSIGNAL_HDMI1_SCENE_NOSIGNAL_NORMAL));
             break;
         }
     }

     Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_ASCII_STRING, CUSTOMSTRING_RESOLUTION1_SCENE_MAIN_NORMAL));
     Hv_Mw_OsdComponentShow(COMPONENT(OSD_CP_TYPE_ASCII_STRING, CUSTOMSTRING_RESOLUTION2_SCENE_MAIN_NORMAL));
 }

VOID Hv_App_OsdMainMenuEnter(VOID)
{
    USHORT16 usFirstItem = MAIN_INPUT_ITEM_SCENE_MAIN;
    USHORT16 usChild = ITEM_NONE_ID;
    USHORT16 usStringLength = 0;

    Hv_App_OsdHideAll();

    Hv_Mw_OsdSceneInit(SCENE_MAIN);
    Hv_Mw_OsdSceneShow(SCENE_MAIN);

#ifdef HV_SCALER_DEBUG_VERSION
    if (Hv_Mw_OsdIsMonkeyRunning())
    {
        usFirstItem = MAIN_BRI_ITEM_SCENE_MAIN;
    }
#endif
    Hv_Mw_OsdItemFocus(usFirstItem);
    Hv_Mw_OsdItemShowList(usFirstItem);
    
    usChild = CHILD_ITEM(usFirstItem);
    Hv_Mw_OsdItemShowListWithSingleValue(usChild);

    if (HV_COMMON_DATABASE_GET(SystemData, bFactoryMode))
    {
        Hv_Mw_OsdItemSetEnable(MAIN_F_ITEM_SCENE_MAIN, HV_TRUE);
        Hv_Mw_OsdItemShow(MAIN_F_ITEM_SCENE_MAIN);
    }
    else
    {
        Hv_Mw_OsdItemSetEnable(MAIN_F_ITEM_SCENE_MAIN, HV_FALSE);
    }

	Hv_App_OsdMainMenu_InputPort();

    Hv_Mw_OsdSetKeyRepeatPeriod(OSD_DEFAULT_KEY_REPEAT_PERIOD_MS);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_UP, KEY_STATE_REPEATABLE, HV_TRUE);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_DOWN, KEY_STATE_REPEATABLE, HV_TRUE);

    OSD_LOG_INFO("Show user menu");
}

VOID Hv_App_OsdMainMenuExit(VOID)
{
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_UP, KEY_STATE_REPEATABLE, HV_FALSE);
    Hv_Mw_OsdSetKeyState(OSDEVT_KEY_DOWN, KEY_STATE_REPEATABLE, HV_FALSE);

    Hv_Mw_OsdItemFocusClear();
    Hv_Mw_OsdSceneHide(SCENE_MAIN);
    Hv_Mw_OsdSceneClear(SCENE_MAIN);
}

static const VOID (*apfCustomKeyFunctionMap[])(VOID) =
{
    Hv_App_OsdInputMenuEnter,
    Hv_App_OsdModeMenuEnter,
    Hv_App_OsdBrightnessAdjustMenuEnter,
    Hv_App_OsdContrastAdjustMenuEnter,
    Hv_App_OsdVolumeAdjustMenuEnter,
};

static VOID Hv_App_OsdMenuNone(VOID)
{
    s_bQuickEnter = HV_FALSE;

    if (!CUR_TIMING_INFO(bSignalSync))
    {
        OSD_LOG_INFO("No signal, don't show user menu!");
        return;
    }

    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdMainMenuEnter();
            break;
        }
        case OSDEVT_KEY_DOWN:
        case OSDEVT_KEY_HOTKEY1:
        {
            USHORT16 usKey = Hv_App_GetOsdDataValue(E_USERDATA_CUSTOM_KEY1);
            HV_ASSERT_TRUE_VOID(usKey < ARRAY_SIZE(apfCustomKeyFunctionMap));
            s_bQuickEnter = HV_TRUE;
            apfCustomKeyFunctionMap[usKey]();
            break;
        }
        case OSDEVT_KEY_UP:
        case OSDEVT_KEY_HOTKEY2:
        {
            USHORT16 usKey = Hv_App_GetOsdDataValue(E_USERDATA_CUSTOM_KEY2);
            HV_ASSERT_TRUE_VOID(usKey < ARRAY_SIZE(apfCustomKeyFunctionMap));
            s_bQuickEnter = HV_TRUE;
            apfCustomKeyFunctionMap[usKey]();
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdMenuResetAutoCloseTimer(VOID)
{
    USHORT16 usTimeOut = Hv_App_OsdGetMenuTime();
    if (0 == usTimeOut)
    {
        Hv_Mw_OsdStopAutoCloseTimer(SCENE_MAIN);
    }
    else
    {
        Hv_Mw_OsdStartAutoCloseTimer(SCENE_MAIN, usTimeOut);
    }
}

VOID Hv_App_OsdMenuOperation(USHORT16 usValue)
{
    const OsdItemProp* pstItemProp = OSD_GET_ITEM_PROP(OSD_GET_FOCUSING());
#if 0
    if (UD_OSD_LOCK_V_ON == Hv_App_GetOsdDataValue(E_USERDATA_OSD_LOCK))
    {
        Hv_App_OsdLockEnter();
        return;
    }
#endif
    if (NULL == pstItemProp)
    {
        Hv_App_OsdMenuNone();
    }
    else if (pstItemProp->pfMenuOpsHandle)
    {
        OSD_LOG_DEBUG("Call MenuOperationFunction-%s", ITEM_NAME(pstItemProp->usItemId));
        OSD_LOG_DEBUG("KeyValue = %s", Hv_Mw_OsdGetKeyName(Hv_Mw_OsdGetKeyValue()));
        pstItemProp->pfMenuOpsHandle();
    }
    else
    {
        OSD_LOG_WARN("Item-%d has no MenuOperationHandle", pstItemProp->usItemId);
        return;
    }

    if (!CUR_TIMING_INFO(bSignalSync))
    {
        /* Notify ChannelManager to reset standby timer */
        Hv_Mw_Channel_SetOSDActive(HV_TRUE);
    }

    if (Hv_Mw_OsdSceneIsShowing(SCENE_FACTORY))
    {
        Hv_Mw_OsdStopAutoCloseTimer(SCENE_MAIN);
        return;
    }

    /* 开始实时更新VRR下的刷新率显示 */
    if (CUR_TIMING_INFO(bIsVrr))
    {
        Hv_Mw_OsdStartAutoRefreshTimer(SCENE_MAIN, HV_PROJECT_CONFIG_OSD_DEFAULT_REFRESH_PERIOD_MS);
    }

    Hv_App_OsdMenuResetAutoCloseTimer();
}

/* Common Menu Function Defination Begin */
static VOID Hv_App_OsdOpsLevel1FocusPrev(VOID)
{
    USHORT16 usItem = OSD_GET_FOCUSING();
    USHORT16 usChild = CHILD_ITEM(usItem);
    Hv_Mw_OsdItemHideListWithSingleValue(usChild);

    USHORT16 usNewFocusItem = Hv_Mw_OsdItemFocusPrev();
    usChild = CHILD_ITEM(usNewFocusItem);
    Hv_Mw_OsdItemShowListWithSingleValue(usChild);
}

static VOID Hv_App_OsdOpsLevel1FocusNext(VOID)
{
    USHORT16 usItem = OSD_GET_FOCUSING();
    USHORT16 usChild = CHILD_ITEM(usItem);
    Hv_Mw_OsdItemHideListWithSingleValue(usChild);

    USHORT16 usNewFocusItem = Hv_Mw_OsdItemFocusNext();
    usChild = CHILD_ITEM(usNewFocusItem);
    Hv_Mw_OsdItemShowListWithSingleValue(usChild);
}

static VOID Hv_App_OsdOpsLevel1FocusChild(VOID)
{
    Hv_Mw_OsdItemFocusChild();
}

static VOID Hv_App_OsdOpsLevel2FocusParent(VOID)
{
    Hv_Mw_OsdItemFocusParent();
}

static VOID Hv_App_OsdOpsLevel2FocusParentConfirm(VOID)
{
    USHORT16 usItem = OSD_GET_FOCUSING();
    Hv_Mw_OsdAdjustFunction(OSD_GET_USERDATA(usItem), ACT_SET,
                             OSD_GET_USERDATA_VALUE(usItem), SET_ALL);

    Hv_Mw_OsdItemFocusParent();
}

static VOID Hv_App_OsdOpsLevel2FocusPrev(VOID)
{
    Hv_Mw_OsdItemFocusPrev();
}

static VOID Hv_App_OsdOpsLevel2FocusNext(VOID)
{
    Hv_Mw_OsdItemFocusNext();
}

static VOID Hv_App_OsdOpsLevel2FocusAdjustValue(VOID)
{
    Hv_Mw_OsdItemHide(VALUE_ITEM(OSD_GET_FOCUSING()));
    Hv_Mw_OsdItemShow(CHILD_ITEM(OSD_GET_FOCUSING()));
    Hv_Mw_OsdItemFocusChild();
    Hv_Mw_OsdSetKeyRepeatPeriod(OSD_ADJUST_KEY_REPEAT_PERIOD_MS);
}

static VOID Hv_App_OsdOpsLevel2FocusListValue(VOID)
{
    Hv_Mw_OsdItemHideList(VALUE_ITEM(OSD_GET_FOCUSING()));
    Hv_Mw_OsdItemShowList(CHILD_ITEM(OSD_GET_FOCUSING()));
    Hv_Mw_OsdItemFocusChildSelect();
}

static VOID Hv_App_OsdOpsLevel3AdjustFocusParent(VOID)
{
    USHORT16 usItem = OSD_GET_FOCUSING();

    Hv_Mw_OsdItemHideList(usItem);
    Hv_Mw_OsdItemShowListWithSingleValue(PARENT_ITEM(usItem));
    Hv_Mw_OsdItemFocusParent();

    Hv_Mw_OsdSetKeyRepeatPeriod(OSD_DEFAULT_KEY_REPEAT_PERIOD_MS);
}

static VOID Hv_App_OsdOpsLevel3AdjustFocusParentConfirm(VOID)
{
    USHORT16 usItem = OSD_GET_FOCUSING();

    Hv_Mw_OsdItemHideList(usItem);
    Hv_Mw_OsdAdjustFunction(OSD_GET_USERDATA(usItem), ACT_SET,
                             OSD_GET_USERDATA_VALUE(usItem), SET_ALL);

    Hv_Mw_OsdItemShowListWithSingleValue(PARENT_ITEM(usItem));
    Hv_Mw_OsdItemFocusParent();

    Hv_Mw_OsdSetKeyRepeatPeriod(OSD_DEFAULT_KEY_REPEAT_PERIOD_MS);
}

static VOID Hv_App_OsdItemLevel3AdjustIncrease(VOID)
{
    USHORT16 usItem = OSD_GET_FOCUSING();
    /* 更新对应userdata */
    Hv_Mw_OsdAdjustFunction(OSD_GET_USERDATA(usItem), ACT_INCREASE, 1, SET_ALL);
    /* 更新显示当前聚焦item */
    Hv_Mw_OsdItemShow(usItem);
}

static VOID Hv_App_OsdItemLevel3AdjustDecrease(VOID)
{
    USHORT16 usItem = OSD_GET_FOCUSING();
    /* 更新对应userdata */
    Hv_Mw_OsdAdjustFunction(OSD_GET_USERDATA(usItem), ACT_DECREASE, 1, SET_ALL);
    /* 更新显示当前聚焦item */
    Hv_Mw_OsdItemShow(usItem);
}

static VOID Hv_App_OsdItemLevel3ListIncrease(VOID)
{
    USHORT16 usItem = Hv_Mw_OsdItemFocusNext();
    /* 更新对应userdata */
    Hv_Mw_OsdAdjustFunction(OSD_GET_USERDATA(usItem), ACT_SET, OSD_GET_USERDATA_VALUE(usItem), SET_ALL);
}

static VOID Hv_App_OsdItemLevel3ListDecrease(VOID)
{
    USHORT16 usItem = Hv_Mw_OsdItemFocusPrev();
    /* 更新对应userdata */
    Hv_Mw_OsdAdjustFunction(OSD_GET_USERDATA(usItem), ACT_SET, OSD_GET_USERDATA_VALUE(usItem), SET_ALL);
}

static VOID Hv_App_OsdOpsLevel1(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            Hv_App_OsdOpsLevel1FocusChild();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_App_OsdOpsLevel1FocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_App_OsdOpsLevel1FocusNext();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdMainMenuExit();
            break;
        }
        default:
        {
            break;
        }
    }
}

/* Level2 enter list items */
static VOID Hv_App_RB_OsdOpsMenu1_item(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            Hv_App_OsdOpsLevel2FocusListValue();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_App_OsdOpsLevel2FocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_App_OsdOpsLevel2FocusNext();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdOpsLevel2FocusParent();
            break;
        }
        default:
        {
            break;
        }
    }
}

/* Level2 current list items */
static VOID Hv_App_RB_OsdOpsMenu1_itemNeedConfirm(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            Hv_App_OsdOpsLevel2FocusParentConfirm();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_App_OsdOpsLevel2FocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_App_OsdOpsLevel2FocusNext();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdOpsLevel2FocusParent();
            break;
        }
        default:
        {
            break;
        }
    }
}

/* Level2 enter bar item */
static VOID Hv_App_RB_OsdOpsMenu1_Bar_item(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            Hv_App_OsdOpsLevel2FocusAdjustValue();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_App_OsdOpsLevel2FocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_App_OsdOpsLevel2FocusNext();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdOpsLevel2FocusParent();
            break;
        }
        default:
        {
            break;
        }
    }
}

static VOID Hv_App_OsdOpsLevel3Adjust(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            Hv_App_OsdOpsLevel3AdjustFocusParent();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_App_OsdItemLevel3ListDecrease();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_App_OsdItemLevel3ListIncrease();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdOpsLevel3AdjustFocusParent();
            break;
        }
        default:
        {
            break;
        }
    }
}

static VOID Hv_App_OsdOpsLevel3AdjustBar(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            Hv_App_OsdOpsLevel3AdjustFocusParent();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_App_OsdItemLevel3AdjustIncrease();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_App_OsdItemLevel3AdjustDecrease();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdOpsLevel3AdjustFocusParent();
            break;
        }
        default:
        {
            break;
        }
    }
}

static VOID Hv_App_OsdOpsLevel3AdjustNeedConfirm(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            Hv_App_OsdOpsLevel3AdjustFocusParentConfirm();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdItemFocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdItemFocusNext();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdOpsLevel3AdjustFocusParent();
            break;
        }
        default:
        {
            break;
        }
    }
}


VOID Hv_App_OsdItemBrightness_MenuBrightness_SceneBrightness(VOID)
{
    if (!s_bPowerTipsShowen)
    {
        if (OSDEVT_KEY_UP == Hv_Mw_OsdGetKeyValue())
        {
            if (80 == Hv_App_GetOsdDataValue(E_USERDATA_BRIGHTNESS))
            {
                /* show tips */
                Hv_App_OsdPowerTipsEnter();
                return;
            }
        }
    }

    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdBrightnessAdjustMenuExit();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdAdjustFunction(E_USERDATA_BRIGHTNESS, ACT_INCREASE,
                                       1, SET_ALL);
            Hv_Mw_OsdItemShow(OSD_GET_FOCUSING());
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdAdjustFunction(E_USERDATA_BRIGHTNESS, ACT_DECREASE,
                                       1, SET_ALL);
            Hv_Mw_OsdItemShow(OSD_GET_FOCUSING());
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemContrast_MenuContrast_SceneContrast(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdContrastAdjustMenuExit();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdAdjustFunction(E_USERDATA_CONTRAST, ACT_INCREASE,
                                       1, SET_ALL);
            Hv_Mw_OsdItemShow(OSD_GET_FOCUSING());
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdAdjustFunction(E_USERDATA_CONTRAST, ACT_DECREASE,
                                       1, SET_ALL);
            Hv_Mw_OsdItemShow(OSD_GET_FOCUSING());
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemYes_MenuFunctionTips_SceneFunctionTips(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            Hv_App_OsdFuncitonTipsExit();
            if (OSDEVT_KEY_UP == s_usKeyBackup)
            {
                Hv_App_OsdItemLevel3ListIncrease();
            }
            else if (OSDEVT_KEY_DOWN == s_usKeyBackup)
            {
                Hv_App_OsdItemLevel3ListDecrease();
            }
            else if ((OSDEVT_KEY_ENTER == s_usKeyBackup) || (OSDEVT_KEY_RIGHT == s_usKeyBackup))
            {
                //Hv_App_OsdOpsLevel3ListFocusParentConfirm();
            }
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdItemFocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdItemFocusNext();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdFuncitonTipsExit();
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemNo_MenuFunctionTips_SceneFunctionTips(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdFuncitonTipsExit();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdItemFocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdItemFocusNext();
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemHdmi1_MenuInputList_SceneInput(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            USHORT16 usItem = OSD_GET_FOCUSING();
            Hv_Mw_OsdAdjustFunction(OSD_GET_USERDATA(usItem), ACT_SET,
                                       OSD_GET_USERDATA_VALUE(usItem), SET_ALL);
            Hv_App_OsdInputMenuExit();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdItemFocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdItemFocusNext();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdInputMenuExit();
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemHdmi2_MenuInputList_SceneInput(VOID)
{
    Hv_App_OsdItemHdmi1_MenuInputList_SceneInput();
}
VOID Hv_App_OsdItemDp1_MenuInputList_SceneInput(VOID)
{
    Hv_App_OsdItemHdmi1_MenuInputList_SceneInput();
}
VOID Hv_App_OsdItemDp2_MenuInputList_SceneInput(VOID)
{
    Hv_App_OsdItemHdmi1_MenuInputList_SceneInput();
}
VOID Hv_App_OsdMainInputItem_MenuMain_SceneMain(VOID)
{
    if ((OSDEVT_KEY_ENTER == Hv_Mw_OsdGetKeyValue()) || (OSDEVT_KEY_RIGHT == Hv_Mw_OsdGetKeyValue()))
    {
        Hv_Mw_OsdItemFocusChildSelect();
    }
    else
    {
        Hv_App_OsdOpsLevel1();
    }
}
VOID Hv_App_OsdMainBriItem_MenuMain_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel1();
}
VOID Hv_App_OsdMainColItem_MenuMain_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel1();
}
VOID Hv_App_OsdMainPqItem_MenuMain_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel1();
}
VOID Hv_App_OsdMainDispItem_MenuMain_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel1();
}
VOID Hv_App_OsdMainAudItem_MenuMain_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel1();
}
VOID Hv_App_OsdMainMenuItem_MenuMain_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel1();
}
VOID Hv_App_OsdMainOtherItem_MenuMain_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel1();
}
VOID Hv_App_OsdMainFItem_MenuMain_SceneMain(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            Hv_App_OsdFactoryMenuEnter();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_App_OsdOpsLevel1FocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_App_OsdOpsLevel1FocusNext();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdMainMenuExit();
            break;
        }
        default:
        {
            break;
        }
    }

}
VOID Hv_App_OsdMenu1Hdmi1Item_Menu1InputItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_itemNeedConfirm();
}
VOID Hv_App_OsdMenu1Dp1Item_Menu1InputItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_itemNeedConfirm();
}
VOID Hv_App_OsdMenu1Hdmi2Item_Menu1InputItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_itemNeedConfirm();
}
VOID Hv_App_OsdMenu1Dp2Item_Menu1InputItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_itemNeedConfirm();
}
VOID Hv_App_OsdMenu1BriItem_Menu1BriConItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_Bar_item();
}
VOID Hv_App_OsdMenu1BklItem_Menu1BriConItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_Bar_item();
}
VOID Hv_App_OsdMenu1ConItem_Menu1BriConItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_Bar_item();
}
VOID Hv_App_OsdMenu1DcrItem_Menu1BriConItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1GammaItem_Menu1ColItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1EcoItem_Menu1ColItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1ColTpItem_Menu1ColItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1LblueItem_Menu1ColItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_Bar_item();
}
VOID Hv_App_OsdMenu1HueItem_Menu1ColItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_Bar_item();
}
VOID Hv_App_OsdMenu1SaturationItem_Menu1ColItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_Bar_item();
}
VOID Hv_App_OsdMenu1ColSpaceItem_Menu1ColItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1Hue_6axisItem_Menu1ColItem_SceneMain(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            USHORT16 usItem = Hv_Mw_OsdItemGetStartIdInPage(OSD_GET_FOCUSING());
            Hv_Mw_OsdItemHideList(VALUE_ITEM(usItem));
            Hv_Mw_OsdItemShowList(CHILD_ITEM(OSD_GET_FOCUSING()));
            Hv_Mw_OsdItemFocusChild();
            break;
        }
        default:
        {
            Hv_App_RB_OsdOpsMenu1_item();
            break;
        }
    }
}
VOID Hv_App_OsdMenu1Saturation_6axisItem_Menu1ColItem_SceneMain(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            USHORT16 usItem = Hv_Mw_OsdItemGetStartIdInPage(OSD_GET_FOCUSING());
            Hv_Mw_OsdItemHideList(VALUE_ITEM(usItem));
            Hv_Mw_OsdItemShowList(CHILD_ITEM(OSD_GET_FOCUSING()));
            Hv_Mw_OsdItemFocusChild();
            break;
        }
        default:
        {
            Hv_App_RB_OsdOpsMenu1_item();
            break;
        }
    }
}
VOID Hv_App_OsdMenu1SharpnessItem_Menu1PqItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_Bar_item();
}
VOID Hv_App_OsdMenu1OdItem_Menu1PqItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1MprtItem_Menu1PqItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1PicmodeItem_Menu1DispItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1MuteItem_Menu1AudItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1VolItem_Menu1AudItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_Bar_item();
}
VOID Hv_App_OsdMenu1LanguaItem_Menu1OsdItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1HPosItem_Menu1OsdItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_Bar_item();
}
VOID Hv_App_OsdMenu1VPosItem_Menu1OsdItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_Bar_item();
}
VOID Hv_App_OsdMenu1TranItem_Menu1OsdItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_Bar_item();
}
VOID Hv_App_OsdMenu1OsdtimeItem_Menu1OsdItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_Bar_item();
}
VOID Hv_App_OsdMenu1OsdrotItem_Menu1OsdItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1AdaptiveSyncItem_Menu1OtherItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1ResetItem_Menu1OtherItem_SceneMain(VOID)
{
    if ((OSDEVT_KEY_ENTER == Hv_Mw_OsdGetKeyValue()) || (OSDEVT_KEY_RIGHT == Hv_Mw_OsdGetKeyValue()))
    {
        Hv_Mw_OsdSceneHide(SCENE_MAIN);

        Hv_Mw_OsdSceneInit(SCENE_RESET_ALL);
        Hv_Mw_OsdSceneShow(SCENE_RESET_ALL);

        Hv_Mw_OsdItemFocus(ITEM_NO_SCENE_RESET_ALL);
        Hv_Mw_OsdItemShowList(ITEM_NO_SCENE_RESET_ALL);
    }
    else
    {
        Hv_App_RB_OsdOpsMenu1_item();
    }
}
VOID Hv_App_OsdMenu1CrosshairItem_Menu1OtherItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1RefreshRateItem_Menu1OtherItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1TimeCountItem_Menu1OtherItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1PowerIndicatorItem_Menu1OtherItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1Key1Item_Menu1OtherItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1Key2Item_Menu1OtherItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1Key3Item_Menu1OtherItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu1Ota_Menu1OtherItem_SceneMain(VOID)
{
    if ((OSDEVT_KEY_ENTER == Hv_Mw_OsdGetKeyValue()) || (OSDEVT_KEY_RIGHT == Hv_Mw_OsdGetKeyValue()))
    {
        Hv_App_OsdOtaEnter();
#ifdef CONFIG_USER_USB_OTA_ON
        OSD_LOG_INFO("OTA update begin");
        Hv_Mw_SendEvtToUsb(USB_EVENT_NORMAL_UPGRADE, 0);
#endif
    }
    else
    {
        Hv_App_RB_OsdOpsMenu1_item();
    }
}
VOID Hv_App_OsdItemNumberBri_Menu2BriConItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdItemNumberBkl_Menu2BriConItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdItemNumberCon_Menu2BriConItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdItemTextlistDcr_Menu2BriConItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2GammaItem_Menu2ColItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2EcoItem_Menu2ColItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2ColTpItem_Menu2ColItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2LblueItem_Menu2ColItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2HueItem_Menu2ColItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2SaturationItem_Menu2ColItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2ColSpaceItem_Menu2ColItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2SharpnessItem_Menu2PqItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2OdItem_Menu2PqItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2MprtItem_Menu2PqItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2PicmodeItem_Menu2DispItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2MuteItem_Menu2AudItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2VolItem_Menu2AudItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2LanguaItem_Menu2OsdItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2HPosItem_Menu2OsdItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2VPosItem_Menu2OsdItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2TranItem_Menu2OsdItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2OsdtimeItem_Menu2OsdItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2OsdrotItem_Menu2OsdItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2AdaptiveSyncItem_Menu2OtherItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2CrosshairItem_Menu2OtherItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2RefreshRateItem_Menu2OtherItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2TimeCountItem_Menu2OtherItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2PowerIndicatorItem_Menu2OtherItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2Key1Item_Menu2OtherItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2Key2Item_Menu2OtherItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdMenu2Key3Item_Menu2OtherItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdItemBriAdj_Adjust3BriItem_SceneMain(VOID)
{
    if (!s_bPowerTipsShowen)
    {
        if (OSDEVT_KEY_UP == Hv_Mw_OsdGetKeyValue())
        {
            if (80 == Hv_App_GetOsdDataValue(E_USERDATA_BRIGHTNESS))
            {
                /* show tips */
                Hv_App_OsdPowerTipsEnter();
                return;
            }
        }
    }

    Hv_App_OsdOpsLevel3AdjustBar();
}
VOID Hv_App_OsdItemAdjDcrOff_Adjust3DcrItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemAdjDcrOn_Adjust3DcrItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemBklAdj_Adjust3BklItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustBar();
}
VOID Hv_App_OsdItemConAdj_Adjust3ConItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustBar();
}
VOID Hv_App_OsdItemGamma_16_Adjust3GammaItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemGamma_18_Adjust3GammaItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemGamma_20_Adjust3GammaItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemGamma_22_Adjust3GammaItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemGamma_24_Adjust3GammaItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemGamma_26_Adjust3GammaItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemEcoNormal_Adjust3EcoItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemEcoPicture_Adjust3EcoItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemEcoMovie_Adjust3EcoItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemEcoGame_Adjust3EcoItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemEcoFps_Adjust3EcoItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemEcoRts_Adjust3EcoItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}

VOID Hv_App_OsdItemWarm_Adjust3ColtempItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3Adjust();
}
VOID Hv_App_OsdItemCool_Adjust3ColtempItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3Adjust();
}
VOID Hv_App_OsdItemColtempUser_Adjust3ColtempItem_SceneMain(VOID)
{
    if ((OSDEVT_KEY_ENTER == Hv_Mw_OsdGetKeyValue()) || (OSDEVT_KEY_RIGHT == Hv_Mw_OsdGetKeyValue()))
    {
        Hv_Mw_OsdItemHideList(OSD_GET_FOCUSING());
        Hv_Mw_OsdItemShowList(Hv_Mw_OsdItemFocusChild());
    }
    else
    {
        Hv_App_OsdOpsLevel3Adjust();
    }
}

VOID Hv_App_OsdItemLowblueAdj_Adjust3LowblueItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustBar();
}
VOID Hv_App_OsdItemHueAdj_Adjust3HueItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustBar();
}
VOID Hv_App_OsdItemSaturaAdj_Adjust3SaturaItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustBar();
}
VOID Hv_App_OsdItemSharpeAdj_Adjust3SharpeItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustBar();
}
VOID Hv_App_OsdItemOdOff_Adjust3OdItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemOdLow_Adjust3OdItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemOdMiddle_Adjust3OdItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemOdHigh_Adjust3OdItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemDisAuto_Adjust3DipItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemDis_169_Adjust3DipItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemDip_43_Adjust3DipItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemMuteOff_Adjust3MuteItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemMuteOn_Adjust3MuteItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemVolumeAdj_Adjust3VolItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustBar();
    if ((OSDEVT_KEY_UP == Hv_Mw_OsdGetKeyValue()) || (OSDEVT_KEY_DOWN == Hv_Mw_OsdGetKeyValue()))
    {
        Hv_Mw_OsdItemShow(MENU2_MUTE_ITEM_SCENE_MAIN);
    }
}
VOID Hv_App_OsdItemEnglish_Adjust3LanguItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemChinese_Adjust3LanguItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemOsdHAdj_Adjust3OsdHItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustBar();
}
VOID Hv_App_OsdItemOsdVAdj_Adjust3OsdVItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustBar();
}
VOID Hv_App_OsdItemOsdTranAdj_Adjust3OsdTranItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustBar();
}
VOID Hv_App_OsdItemTimeoutAdj_Adjust3TimeoutItem_SceneMain(VOID)
{
    USHORT16 usItem = OSD_GET_FOCUSING();

    if (OSDEVT_KEY_UP == Hv_Mw_OsdGetKeyValue())
    {
        Hv_Mw_OsdAdjustFunction(OSD_GET_USERDATA(usItem), ACT_INCREASE, 5, SET_ALL);
        Hv_Mw_OsdItemShow(usItem);
    }
    else if (OSDEVT_KEY_DOWN == Hv_Mw_OsdGetKeyValue())
    {
        Hv_Mw_OsdAdjustFunction(OSD_GET_USERDATA(usItem), ACT_DECREASE, 5, SET_ALL);
        Hv_Mw_OsdItemShow(usItem);
    }
    else
    {
        Hv_App_OsdOpsLevel3AdjustBar();
    }
}
VOID Hv_App_OsdItemRotNormal_Adjust3OsdrotItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemRot_90_Adjust3OsdrotItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemRot_180_Adjust3OsdrotItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemRot_270_Adjust3OsdrotItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemFreesyncOff_Adjust3FreesyncItem_SceneMain(VOID)
{
    if ((OSDEVT_KEY_UP == Hv_Mw_OsdGetKeyValue()) || (OSDEVT_KEY_DOWN == Hv_Mw_OsdGetKeyValue()))
    {
        if ((UD_MPRT_V_ON == Hv_App_GetOsdDataValue(E_USERDATA_MPRT)) &&
            (UD_FREESYNC_V_OFF == Hv_App_GetOsdDataValue(E_USERDATA_FREESYNC)))
        {
            /* show tips */
            Hv_App_OsdFuncitonTipsEnter();
            return;
        }
    }

    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemFreesyncOn_Adjust3FreesyncItem_SceneMain(VOID)
{
    if ((OSDEVT_KEY_UP == Hv_Mw_OsdGetKeyValue()) || (OSDEVT_KEY_DOWN == Hv_Mw_OsdGetKeyValue()))
    {
        if ((UD_MPRT_V_ON == Hv_App_GetOsdDataValue(E_USERDATA_MPRT)) &&
            (UD_FREESYNC_V_OFF == Hv_App_GetOsdDataValue(E_USERDATA_FREESYNC)))
        {
            /* show tips */
            Hv_App_OsdFuncitonTipsEnter();
            return;
        }
    }

    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}

static VOID Hv_App_OsdMainMenu_ColorTemp_UserRGB_Select(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            Hv_Mw_OsdItemHide(OSD_GET_FOCUSING());
            Hv_Mw_OsdItemShow(CHILD_ITEM(OSD_GET_FOCUSING()));
            Hv_Mw_OsdItemFocusChild();
            Hv_Mw_OsdSetKeyRepeatPeriod(OSD_ADJUST_KEY_REPEAT_PERIOD_MS);
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_App_OsdOpsLevel2FocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_App_OsdOpsLevel2FocusNext();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_Mw_OsdItemHideList(OSD_GET_FOCUSING());
            Hv_Mw_OsdItemShowList(PARENT_ITEM(OSD_GET_FOCUSING()));
            Hv_Mw_OsdItemFocusParent();
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemColUserR_Menu4ColUserItem_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_ColorTemp_UserRGB_Select();
}
VOID Hv_App_OsdItemColUserG_Menu4ColUserItem_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_ColorTemp_UserRGB_Select();
}
VOID Hv_App_OsdItemColUserB_Menu4ColUserItem_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_ColorTemp_UserRGB_Select();
}

static VOID Hv_App_OsdO_Colortemp_User_RGB_AdjustBar(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
			Hv_Mw_OsdItemHide(OSD_GET_FOCUSING());
			Hv_Mw_OsdItemShow(PARENT_ITEM(OSD_GET_FOCUSING()));
            Hv_Mw_OsdItemFocusParent();
            Hv_Mw_OsdSetKeyRepeatPeriod(OSD_DEFAULT_KEY_REPEAT_PERIOD_MS);
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_App_OsdItemLevel3AdjustIncrease();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_App_OsdItemLevel3AdjustDecrease();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
			Hv_Mw_OsdItemHide(OSD_GET_FOCUSING());
			Hv_Mw_OsdItemShow(PARENT_ITEM(OSD_GET_FOCUSING()));
            Hv_Mw_OsdItemFocusParent();
            Hv_Mw_OsdSetKeyRepeatPeriod(OSD_DEFAULT_KEY_REPEAT_PERIOD_MS);
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdAdjust4UserRItem_Adjust4ColUserR_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}
VOID Hv_App_OsdAdjust4UserGItem_Adjust4ColUserG_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}
VOID Hv_App_OsdAdjust4UserBItem_Adjust4ColUserB_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}
VOID Hv_App_OsdItemColspaceNative_Adjust3ColspaceItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemColspaceSrgb_Adjust3ColspaceItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemColspaceBt709_Adjust3ColspaceItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemColspaceDcip3_Adjust3ColspaceItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemColspaceAdobe_Adjust3ColspaceItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemCross0_Adjust3CrosshairItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemCross1_Adjust3CrosshairItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemCross2_Adjust3CrosshairItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemCross3_Adjust3CrosshairItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemRefreshRateOff_Adjust3RefreshRateItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemRefreshRateOn_Adjust3RefreshRateItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}

VOID Hv_App_OsdItemTimeCountAdjust_Adjust3TimeCount_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
    if ((OSDEVT_KEY_ENTER == Hv_Mw_OsdGetKeyValue()) || (OSDEVT_KEY_RIGHT == Hv_Mw_OsdGetKeyValue()))
    {
        Hv_Mw_OsdStopAutoRefreshTimer(SCENE_TIMER);

        USHORT16 usTimeMinus = 0;
        switch(Hv_App_GetOsdDataValue(E_USERDATA_TIMER_COUNTER))
        {
            case UD_TIMER_COUNTER_V_OFF:
            {
                Hv_App_OsdTimeCounterExit();
                return;
            }
            case UD_TIMER_COUNTER_V_5:
            {
                usTimeMinus = 5;
                break;
            }
            case UD_TIMER_COUNTER_V_10:
            {
                usTimeMinus = 10;
                break;
            }
            case UD_TIMER_COUNTER_V_20:
            {
                usTimeMinus = 20;
                break;
            }
            case UD_TIMER_COUNTER_V_40:
            {
                usTimeMinus = 40;
                break;
            }
            case UD_TIMER_COUNTER_V_60:
            {
                usTimeMinus = 60;
                break;
            }
            default:
            {
                break;
            }
        }
        Hv_App_OsdTimeCounterSetTime(usTimeMinus * 60);
    }
}

VOID Hv_App_OsdItemTimeCountOff_Adjust3TimeCountItem_SceneMain(VOID)
{
    Hv_App_OsdItemTimeCountAdjust_Adjust3TimeCount_SceneMain();
}
VOID Hv_App_OsdItemTimeCount_5_Adjust3TimeCountItem_SceneMain(VOID)
{
    Hv_App_OsdItemTimeCountAdjust_Adjust3TimeCount_SceneMain();
}
VOID Hv_App_OsdItemTimeCount_10_Adjust3TimeCountItem_SceneMain(VOID)
{
    Hv_App_OsdItemTimeCountAdjust_Adjust3TimeCount_SceneMain();
}
VOID Hv_App_OsdItemTimeCount_20_Adjust3TimeCountItem_SceneMain(VOID)
{
    Hv_App_OsdItemTimeCountAdjust_Adjust3TimeCount_SceneMain();
}
VOID Hv_App_OsdItemTimeCount_40_Adjust3TimeCountItem_SceneMain(VOID)
{
    Hv_App_OsdItemTimeCountAdjust_Adjust3TimeCount_SceneMain();
}
VOID Hv_App_OsdItemTimeCount_60_Adjust3TimeCountItem_SceneMain(VOID)
{
    Hv_App_OsdItemTimeCountAdjust_Adjust3TimeCount_SceneMain();
}
VOID Hv_App_OsdItemPowerIndicatorOff_Adjust3PowerIndicatorItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemPowerIndicatorOn_Adjust3PowerIndicatorItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey1Input_Adjust3Key1Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey1Picturemode_Adjust3Key1Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey1Brightness_Adjust3Key1Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey1Contrast_Adjust3Key1Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey1Volume_Adjust3Key1Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey2Input_Adjust3Key2Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey2Picturemode_Adjust3Key2Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey2Brightness_Adjust3Key2Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey2Contrast_Adjust3Key2Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey2Volume_Adjust3Key2Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey3Input_Adjust3Key3Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey3Picturemode_Adjust3Key3Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey3Brightness_Adjust3Key3Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey3Contrast_Adjust3Key3Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemKey3Volume_Adjust3Key3Item_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemMprtOff_Adjust3MprtItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemMprtOn_Adjust3MprtItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}
VOID Hv_App_OsdItemMprtVrr_Adjust3MprtItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3AdjustNeedConfirm();
}

VOID Hv_App_OsdMenu1LightmodeItem_Menu1OtherItem_SceneMain(VOID)
{
    Hv_App_RB_OsdOpsMenu1_item();
}
VOID Hv_App_OsdMenu2LightmodeItem_Menu2OtherItem_SceneMain(VOID)
{
}
VOID Hv_App_OsdItemLightmodeOff_Adjust3LightmodeItem_SceneMain(VOID)
{
    Hv_App_OsdOpsLevel3Adjust();
}
VOID Hv_App_OsdItemLightmodeSteady_Adjust3LightmodeItem_SceneMain(VOID)
{
    if ((OSDEVT_KEY_ENTER == Hv_Mw_OsdGetKeyValue()) || (OSDEVT_KEY_RIGHT == Hv_Mw_OsdGetKeyValue()))
    {
        Hv_Mw_OsdItemHideList(OSD_GET_FOCUSING());
        Hv_Mw_OsdItemShowList(CHILD_ITEM(OSD_GET_FOCUSING()));
        Hv_Mw_OsdItemFocusChildSelect();
    }
    else
    {
        Hv_App_OsdOpsLevel3Adjust();
    }
}
VOID Hv_App_OsdItemLightmodeBreathe_Adjust3LightmodeItem_SceneMain(VOID)
{
    if ((OSDEVT_KEY_ENTER == Hv_Mw_OsdGetKeyValue()) || (OSDEVT_KEY_RIGHT == Hv_Mw_OsdGetKeyValue()))
    {
        Hv_Mw_OsdItemHideList(OSD_GET_FOCUSING());
        Hv_Mw_OsdItemShowList(CHILD_ITEM(OSD_GET_FOCUSING()));
        Hv_Mw_OsdItemFocusChildSelect();
    }
    else
    {
        Hv_App_OsdOpsLevel3Adjust();
    }
}
VOID Hv_App_OsdItemLightmodeMarqueein_Adjust3LightmodeItem_SceneMain(VOID)
{
    if ((OSDEVT_KEY_ENTER == Hv_Mw_OsdGetKeyValue()) || (OSDEVT_KEY_RIGHT == Hv_Mw_OsdGetKeyValue()))
    {
        Hv_Mw_OsdItemHideList(OSD_GET_FOCUSING());
        Hv_Mw_OsdItemShowList(CHILD_ITEM(OSD_GET_FOCUSING()));
        Hv_Mw_OsdItemFocusChildSelect();
    }
    else
    {
        Hv_App_OsdOpsLevel3Adjust();
    }
}
VOID Hv_App_OsdItemLightmodeMarqueeout_Adjust3LightmodeItem_SceneMain(VOID)
{
    if ((OSDEVT_KEY_ENTER == Hv_Mw_OsdGetKeyValue()) || (OSDEVT_KEY_RIGHT == Hv_Mw_OsdGetKeyValue()))
    {
        Hv_Mw_OsdItemHideList(OSD_GET_FOCUSING());
        Hv_Mw_OsdItemShowList(CHILD_ITEM(OSD_GET_FOCUSING()));
        Hv_Mw_OsdItemFocusChildSelect();
    }
    else
    {
        Hv_App_OsdOpsLevel3Adjust();
    }
}

static VOID Hv_App_OsdMainMenu_LightMode_ColorSelect(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            USHORT16 usItem = OSD_GET_FOCUSING();
            Hv_Mw_OsdItemHideList(usItem);
            Hv_Mw_OsdItemShowList(PARENT_ITEM(usItem));
            Hv_Mw_OsdItemFocusParent();
            Hv_Mw_OsdAdjustFunction(OSD_GET_USERDATA(usItem), ACT_SET,
                                     OSD_GET_USERDATA_VALUE(usItem), SET_ALL);
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdItemFocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdItemFocusNext();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            USHORT16 usItem = OSD_GET_FOCUSING();
            Hv_Mw_OsdItemHideList(usItem);
            Hv_Mw_OsdItemShowList(PARENT_ITEM(usItem));
            Hv_Mw_OsdItemFocusParent();
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemSteadySpectrum_Adjust4SteadyColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdAdjust4SteadyRed_Adjust4SteadyColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdAdjust4SteadyGreen_Adjust4SteadyColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdAdjust4SteadyBlue_Adjust4SteadyColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdAdjust4SteadyCyan_Adjust4SteadyColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdAdjust4SteadyPurple_Adjust4SteadyColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdAdjust4SteadyYellow_Adjust4SteadyColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemBreatheSpectrum_Adjust4BreatheColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemBreatheRed_Adjust4BreatheColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemBreatheGreen_Adjust4BreatheColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemBreatheBlue_Adjust4BreatheColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemBreatheCyan_Adjust4BreatheColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemBreathePurple_Adjust4BreatheColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemBreatheYellow_Adjust4BreatheColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeinSpectrum1_Adjust4MarqueeinColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeinSpectrum2_Adjust4MarqueeinColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeinSpectrum3_Adjust4MarqueeinColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeinRed_Adjust4MarqueeinColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeinGreen_Adjust4MarqueeinColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeinBlue_Adjust4MarqueeinColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeinCyan_Adjust4MarqueeinColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeinPurple_Adjust4MarqueeinColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeinYellow_Adjust4MarqueeinColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeoutSpectrum1_Adjust4MarqueeoutColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeoutSpectrum2_Adjust4MarqueeoutColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeoutSpectrum3_Adjust4MarqueeoutColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeoutRed_Adjust4MarqueeoutColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeoutGreen_Adjust4MarqueeoutColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeoutBlue_Adjust4MarqueeoutColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeoutCyan_Adjust4MarqueeoutColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeoutPurple_Adjust4MarqueeoutColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}
VOID Hv_App_OsdItemMarqueeoutYellow_Adjust4MarqueeoutColor_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_LightMode_ColorSelect();
}

static VOID Hv_App_OsdMainMenu_Hue_Sat_EnterAdjust(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            USHORT16 usItem = Hv_Mw_OsdItemGetStartIdInPage(PARENT_ITEM(OSD_GET_FOCUSING()));
            Hv_Mw_OsdItemHideList(OSD_GET_FOCUSING());
            Hv_Mw_OsdItemShowList(VALUE_ITEM(usItem));
            Hv_Mw_OsdItemFocusParent();
            break;
        }
        default:
        {
            Hv_App_OsdMainMenu_ColorTemp_UserRGB_Select();
            break;
        }
    }
}

VOID Hv_App_OsdItemHueRed_Adjust3Hue_6axis_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_Hue_Sat_EnterAdjust();
}

VOID Hv_App_OsdItemHueGreen_Adjust3Hue_6axis_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_Hue_Sat_EnterAdjust();
}

VOID Hv_App_OsdItemHueBlue_Adjust3Hue_6axis_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_Hue_Sat_EnterAdjust();
}

VOID Hv_App_OsdItemHueYellow_Adjust3Hue_6axis_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_Hue_Sat_EnterAdjust();
}

VOID Hv_App_OsdItemHueMagenta_Adjust3Hue_6axis_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_Hue_Sat_EnterAdjust();
}

VOID Hv_App_OsdItemHueCyan_Adjust3Hue_6axis_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_Hue_Sat_EnterAdjust();
}

VOID Hv_App_OsdItemSaturationRed_Adjust3Saturation_6axis_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_Hue_Sat_EnterAdjust();
}

VOID Hv_App_OsdItemSaturationGreen_Adjust3Saturation_6axis_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_Hue_Sat_EnterAdjust();
}

VOID Hv_App_OsdItemSaturationBlue_Adjust3Saturation_6axis_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_Hue_Sat_EnterAdjust();
}

VOID Hv_App_OsdItemSaturationYellow_Adjust3Saturation_6axis_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_Hue_Sat_EnterAdjust();
}

VOID Hv_App_OsdItemSaturationMagenta_Adjust3Saturation_6axis_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_Hue_Sat_EnterAdjust();
}

VOID Hv_App_OsdItemSaturationCyan_Adjust3Saturation_6axis_SceneMain(VOID)
{
    Hv_App_OsdMainMenu_Hue_Sat_EnterAdjust();
}

VOID Hv_App_OsdAdjustHueRItem_Adjust4HueR_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}

VOID Hv_App_OsdAdjustHueGItem_Adjust4HueG_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}

VOID Hv_App_OsdAdjustHueBItem_Adjust4HueB_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}

VOID Hv_App_OsdAdjustHueYItem_Adjust4HueY_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}

VOID Hv_App_OsdAdjustHueMItem_Adjust4HueM_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}

VOID Hv_App_OsdAdjustHueCItem_Adjust4HueC_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}

VOID Hv_App_OsdAdjustSatRItem_Adjust4SaturationR_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}

VOID Hv_App_OsdAdjustSatGItem_Adjust4SaturationG_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}

VOID Hv_App_OsdAdjustSatBItem_Adjust4SaturationB_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}

VOID Hv_App_OsdAdjustSatYItem_Adjust4SaturationY_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}

VOID Hv_App_OsdAdjustSatMItem_Adjust4SaturationM_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}

VOID Hv_App_OsdAdjustSatCItem_Adjust4SaturationC_SceneMain(VOID)
{
    Hv_App_OsdO_Colortemp_User_RGB_AdjustBar();
}

VOID Hv_App_OsdItemMode_MenuMode_SceneMode(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdModeMenuExit();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdAdjustFunction(E_USERDATA_DISPLAY_MODE, ACT_INCREASE,
                                       1, SET_ALL);
            Hv_Mw_OsdItemShow(OSD_GET_FOCUSING());
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdAdjustFunction(E_USERDATA_DISPLAY_MODE, ACT_DECREASE,
                                       1, SET_ALL);
            Hv_Mw_OsdItemShow(OSD_GET_FOCUSING());
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemYes_MenuProceed_SceneOta(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
#ifdef CONFIG_USER_USB_OTA_ON
            Hv_Mw_SendEvtToUsb(USB_EVENT_UPGRADE_CONFIRM, 0);
            Hv_App_OsdOtaEnter();
#endif
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdItemFocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdItemFocusNext();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdOtaExit();
#ifdef CONFIG_USER_USB_OTA_ON
            Hv_Mw_SendEvtToUsb(USB_EVENT_UPGRADE_CANCEL, 0);
#endif
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemNo_MenuProceed_SceneOta(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdOtaExit();
#ifdef CONFIG_USER_USB_OTA_ON
            Hv_Mw_SendEvtToUsb(USB_EVENT_UPGRADE_CANCEL, 0);
#endif
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdItemFocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdItemFocusNext();
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemYes_MenuPowerTips_ScenePowerTips(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            s_bPowerTipsShowen = HV_TRUE;
            Hv_App_OsdPowerTipsExit();
            USHORT16 usItem = OSD_GET_FOCUSING();
            if (OSDEVT_KEY_UP == s_usKeyBackup)
            {
                Hv_Mw_OsdAdjustFunction(OSD_GET_USERDATA(usItem), ACT_INCREASE, 1, SET_ALL);
                Hv_Mw_OsdItemShow(usItem);
            }
            else
            {
                Hv_Mw_OsdAdjustFunction(OSD_GET_USERDATA(usItem), ACT_DECREASE, 1, SET_ALL);
                Hv_Mw_OsdItemShow(usItem);
            }
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdItemFocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdItemFocusNext();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdPowerTipsExit();
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemNo_MenuPowerTips_ScenePowerTips(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdPowerTipsExit();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdItemFocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdItemFocusNext();
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemYes_MenuReset_SceneResetAll(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        {
            Hv_Mw_OsdItemFocusClear();
            Hv_Mw_OsdSceneHide(SCENE_RESET_ALL);
            Hv_Mw_OsdSceneClear(SCENE_RESET_ALL);
            Hv_Mw_OsdSceneClear(SCENE_MAIN);
            s_bPowerTipsShowen = HV_FALSE;
            Hv_App_ResetToFactorySetting();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdItemFocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdItemFocusNext();
            break;
        }
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_Mw_OsdSceneHide(SCENE_RESET_ALL);
            Hv_Mw_OsdSceneClear(SCENE_RESET_ALL);
            Hv_Mw_OsdSceneShow(SCENE_MAIN);
            Hv_Mw_OsdItemFocus(MENU1_RESET_ITEM_SCENE_MAIN);
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemNo_MenuReset_SceneResetAll(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdItemFocusPrev();
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdItemFocusNext();
            break;
        }
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_Mw_OsdSceneHide(SCENE_RESET_ALL);
            Hv_Mw_OsdSceneClear(SCENE_RESET_ALL);
            Hv_Mw_OsdSceneShow(SCENE_MAIN);
            Hv_Mw_OsdItemFocus(MENU1_RESET_ITEM_SCENE_MAIN);
            break;
        }
        default:
        {
            break;
        }
    }
}

VOID Hv_App_OsdItemVolume_MenuVolume_SceneVolume(VOID)
{
    switch (Hv_Mw_OsdGetKeyValue())
    {
        case OSDEVT_KEY_ENTER:
        case OSDEVT_KEY_RIGHT:
        case OSDEVT_KEY_EXIT:
        case OSDEVT_KEY_LEFT:
        {
            Hv_App_OsdVolumeAdjustMenuExit();
            break;
        }
        case OSDEVT_KEY_UP:
        {
            Hv_Mw_OsdAdjustFunction(E_USERDATA_VOLUME, ACT_INCREASE,
                                       1, SET_ALL);
            Hv_Mw_OsdItemShow(OSD_GET_FOCUSING());
            break;
        }
        case OSDEVT_KEY_DOWN:
        {
            Hv_Mw_OsdAdjustFunction(E_USERDATA_VOLUME, ACT_DECREASE,
                                       1, SET_ALL);
            Hv_Mw_OsdItemShow(OSD_GET_FOCUSING());
            break;
        }
        default:
        {
            break;
        }
    }
}



