volume_setting.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:7k
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * volume_setting.h
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * Acoustic volume setting header
- *
- * Author:
- * -------
- * Andy Ueng (mtk00490)
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * $Revision$
- * $Modtime$
- * $Log$
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- //---------------------------------------------------------------------------
- #ifndef _VOLUME_SETTING_H_
- #define _VOLUME_SETTING_H_
- #include <Classes.hpp>
- #include <Controls.hpp>
- #include <StdCtrls.hpp>
- #include <Forms.hpp>
- #include <ComCtrls.hpp>
- #include <Dialogs.hpp>
- #include <ExtCtrls.hpp>
- #include <Buttons.hpp>
- #ifndef META_DLL_H
- #include "meta.h"
- #endif
- #ifndef _METAAPP_COMMON_H_
- #include "metaapp_common.h"
- #endif
- #ifndef _MAN_HANDLE_H_
- #include "man_handle.h"
- #endif
- #ifndef _AUDIO_COMMON_H_
- #include "Audio_common.h"
- #endif
- #define CUST_VOL_LEVEL_NUM 7
- //---------------------------------------------------------------------------
- typedef enum
- {
- NORMAL_MODE = 0,
- HEADSET_MODE,
- HANDSFREE_MODE,
- TVOUT_MODE
- }E_CUST_VOL_MODE;
- typedef enum
- {
- CALL_TONE_TYPE,
- KEYPAD_TONE_TYPE,
- MICROPHONE_TYPE,
- GMI_TONE_TYPE,
- SPEECH_TONE_TYPE,
- SIDE_TONE_TYPE,
- MELODY_TYPE
- }E_CUST_VOL_TONE_TYPE;
- typedef struct
- { bool b_ToneSupport[TOTAL_TONE_NUM];
- }S_TONE_SUPPORT;
- //---------------------------------------------------------------------------
- class CVOLSET
- {
- private:
- CMETAHANDLE m_META_HANDLE_Obj;
- bool m_bCustVolExSupport;
- bool m_bRuntimeSupport;
- E_METAAPP_RESULT_T m_eConfirmState;
- CustAcousticVol_T m_sCustVol;
- CustAcousticVol16lvl_T m_sCustVolEx;
- char *m_pcVolSetBuf;
- int m_iVolSetBufSize;
- protected:
- void Confirm(E_METAAPP_RESULT_T confirm_state);
- void ComposeCustAcousticVol(CustAcousticVol_T s_cust_vol, Audio_Get_Profile_Settings_By_Mode_Cnf_T& s_runtime);
- void DeComposeCustAcousticVol(Audio_Get_Profile_Settings_By_Mode_Cnf_T s_runtime, CustAcousticVol_T& s_cust_vol);
- void ComposeCustAcousticVol16Lvl(CustAcousticVol16lvl_T s_cust_vol, Audio_Set_Profile_Settings_By_Mode_Req_T& s_runtime);
- void DeComposeCustAcousticVol16Lvl(Audio_Get_Profile_Settings_By_Mode_Cnf_T s_runtime, CustAcousticVol16lvl_T& s_cust_vol);
- public:
- CVOLSET(void);
- ~CVOLSET();
- // runtime
- void REQ_Get_Runtime_CustVol(void);
- void REQ_Set_Runtime_CustVol(void);
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- // Public interface
- void Init(void);
- void ReleaseDynMemory(void);
- void (*ConfirmCallback)(void);
- void REQ_Stop(void);
- void REQ_Read_From_NVRAM(bool CustVolExSupport);
- bool REQ_Write_To_File(char *filename, bool hideEnable, bool CustVolExSupport);
- void CNF_ReadFromNVRAM(void);
- void REQ_Write_To_NVRAM(bool CustVolExSupport, bool b_runtime_support);
- void CNF_WriteToNVRAM(void);
- bool REQ_Read_From_File(char *filename, bool CustVolExSupport);
- bool Decompose_CustAcousticVol(void);
- bool Compose_CustAcousticVol(void);
- bool REQ_Write_To_nvram_default_audio(char *filename, S_TONE_SUPPORT tone_support, bool CustVolExSupport);
- // runtime setting
- void REQ_Get_Runtime_CustVol_Start(void);
- void REQ_Set_Runtime_CustVol_Start(void);
- // Query
- bool Query_CustVolExSupport_Start(void);
- bool Query_CustVolRuntime_Support_Start(void);
- // export information
- E_METAAPP_RESULT_T Get_ConfirmState(void);
- CustAcousticVol_T* Get_CustVol(void);
- void Set_CustVol(CustAcousticVol_T cust_vol);
- CustAcousticVol16lvl_T* Get_CustVol16(void);
- void Set_CustVol16(CustAcousticVol16lvl_T cust_vol);
- unsigned char Get_CustVol(int cate, int type, bool CustVolExSupport);
- void Set_CustVol(int cate, int type, unsigned char vol, bool CustVolExSupport);
- unsigned char Get_CustVolGain(int cate, int type, int level, bool CustVolExSupport);
- void Set_CustVolGain(int cate, int type, int level, unsigned char vol, bool CustVolExSupport);
- unsigned char Get_MaxMelodyVolGain(int cate);
- void Set_MaxMelodyVolGain(int cate, unsigned char vol_gain);
- unsigned char Get_MelodyVolGainStep(int cate);
- void Set_MelodyVolGainStep(int cate, unsigned char gain_step);
- unsigned char Get_TvOutVolGain(int level);
- void Set_TvOutVolGain(int level, unsigned char vol_gain);
- };
- #endif