/*
 * @file hv_mw_Audio.h
 * @brief Header file of audio module.
 *
 * @verbatim
 * ==============================================================================
 *                        ##### How to use #####
 * ==============================================================================
 * (+) Use Hv_Mw_Audio_Init() to initial audio module, for system module.
 * (+) Use Hv_Mw_Audio_SelectSound(1/4) to select one input from HDMI1/HDMI2/DP1/DP2, for channel manager and setting APP module.
 * (+) Use Hv_Mw_Audio_GetVolume() to get volume value from datebase, for setting APP module.
 * (+) Use Hv_Mw_Audio_SetVolume(0-100) to set 0-100 value to DAC, for setting APP module.
 * (+) Use Hv_Mw_Audio_ChannelMute() to mute audio, for channel manager and setting APP module.
 * (+) Use Hv_Mw_Audio_ChannelUnMute() to unmute audio, for channel manager and setting APP module.
 * (+) Use Hv_Mw_Audio_SetEQMode(xxx mode) to set xxx mode to HW-EQ, for setting APP module.
 * (+) Use Hv_Mw_Audio_DelaySound(xx ms) to delay the sound by xx ms over the video, for setting APP module.
 *
 * @endverbatim
 * @author HiView SoC Software Team
 * @version 1.0.0
 * @date 2022-08-18
 */

#ifndef __SDK_MIDDLEWARE_AUDIO_H__
#define __SDK_MIDDLEWARE_AUDIO_H__

#include "hv_comm_DataType.h"
#include "hv_comm_Define.h"

/**
 * @brief initialize audio module, for system module.
 * @param[in] VOID.
 * @return SUCCESS.
 */
Status Hv_Mw_Audio_Init(VOID);

/**
 * @brief select one input from HDMI1/HDMI2/DP1/DP2, for channel manager and setting APP module.
 * @param[in] uiSoundChannelIndex: HDMI1/HDMI2/DP1/DP2.
 * @return Status, 0-SUCCESS, 1-FAILUER.
 */
Status Hv_Mw_Audio_SelectSound(LinkPortIndex uiSoundChannelIndex, ChannelType enChannelType);

/**
 * @brief get volume value from datebase, for setting APP module.
 * @param[in] VOID.
 * @return 0-100 value.
 */
UINT32 Hv_Mw_Audio_GetVolume(VOID);

/**
 * @brief set 0-100 value to DAC, for setting APP module.
 * @param[in] uiSoundVolumeValue: 0-100.
 * @return Status, 0-SUCCESS, 1-HV_FAILURE.
 */
Status Hv_Mw_Audio_SetVolume(UINT32 uiSoundVolumeValue);

/**
 * @brief mute audio, for setting APP module.
 * @return Status, 0-SUCCESS, 1-HV_FAILURE.
 */
Status Hv_Mw_Audio_UIMute(VOID);

/**
 * @brief unmute audio, for setting APP module.
 * @return Status, 0-SUCCESS, 1-HV_FAILURE.
 */
Status Hv_Mw_Audio_UIUnMute(VOID);

/**
 * @brief mute audio, for channel manager.
 * @return Status, 0-SUCCESS, 1-FAILUER.
 */
Status Hv_Mw_Audio_ChannelMute(UINT32 uiBitMsk);

/**
 * @brief unmute audio, for channel manager.
 * @return Status, 0-SUCCESS, 1-FAILUER.
 */
Status Hv_Mw_Audio_ChannelUnMute(UINT32 uiBitMsk);

/**
 * @brief get eq mode, for setting APP module.
 * @param[in] void.
 * @return uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
 */
UINT32 Hv_Mw_Audio_GetEQMode(VOID);

/**
 * @brief set eq mode to HW-EQ, for setting APP module.
 * @param[in] uiEQMode: Rock/Pop/Live/Dance/Club/Powerful MODE.
 * @return Status, 0-SUCCESS, 1-FAILUER.
 */
Status Hv_Mw_Audio_SetEQMode(UINT32 uiEQMode);

/**
 * @brief get delay time value from datebase, for setting APP module.
 * @param[in] VOID.
 * @return 0-500 value.
 */
UINT32 Hv_Mw_Audio_GetDelayTime(VOID);

/**
 * @brief delay the sound by xx ms over the video, for setting APP module.
 * @param[in] uiSoundDelayTime: 50-500 ms. 50 ms per-step.
 * @return Status, 0-SUCCESS, 1-HV_FAILURE.
 */
Status Hv_Mw_Audio_SetDelayTime(UINT32 uiSoundDelayTime);

/**
 * @brief Start Sound DelayTimer.
 */
VOID Hv_Mw_Audio_StartSoundDelayTimer(VOID);

/**
 * @brief audio spdif out, for channel manager and setting APP module.
 * @param[in] bAudioSpdifOut: ENABLE or DISABLE.
 */
VOID Hv_Mw_Audio_SpdifOut(BOOL bAudioSpdifOut);

/**
 * @brief Set Pll ManualConfig Fbdiv, for channel manager and setting APP module.
 */
VOID Hv_Mw_Audio_SetPllManualConfig(VOID);

/**
 * @brief Set Pll AutoConfig Fbdiv, for channel manager and setting APP module.
 */
VOID Hv_Mw_Audio_SetPllAutoConfig(VOID);

/**
 * @brief Lock PLL, for channel manager and setting APP module.
 */
VOID Hv_Mw_Audio_ClockLock(VOID);

/**
 * @brief TurnOnAmbientLight, for setting AmbientLight module.
 */
VOID Hv_Mw_Audio_TurnOnAmbientLight(VOID);

/**
 * @brief TurnOffAmbientLight, for setting AmbientLight module.
 */
VOID Hv_Mw_Audio_TurnOffAmbientLight(VOID);

#endif

