// VoiceDialerDlg.h : header file
//

#pragma once
#include "SwiWwanCmApi.h"
#include "GobiConnectionMgmtAPI.h"
#include "GobiVoiceMgmtApi.h"
#include "afxwin.h"


//gobi apis
typedef struct
{
	arrCallInfo* inInfo;
	arrRemotePartyNum* 	remoteNumInfo;
	arrRemotePartyName* remoteName;
	arrAlertingType* 	alertType;
	arrSvcOption*		servieOpt;
	arrCallEndReason*   callEnd;
	arrAlphaIDInfo* alphaIDInfo;
	arrPeerNumInfo*  connectedPartyInfo;
	arrDiagInfo* diagInfo;
	arrPeerNumInfo* calledPartyInfo;
	arrPeerNumInfo* redirectInfo;
	arrAlertingPattern* alertPattern;
}TCallInfoCallback;

SWIIMPORT ULONG SWICMAPI SetCallInfoCallback( tFNCallInfo pCallback );
IMPORTGOBI ULONG GOBICMAPI	AnswerCall(
    // req params
	BYTE*		pInCallID,
	// resp params
	BYTE*		pOutCallID);

IMPORTGOBI ULONG GOBICMAPI	EndCall( 
	// req params
	BYTE*		pInCallID,
	// resp params
	BYTE*		pOutCallID
	);
IMPORTGOBI ULONG GOBICMAPI	DialCall( 
	// req params
	tDialReqParam* pDialReq,
	// resp params
	BYTE*			pCallID,
	alphaIDInfo*	pAlpha,
	BYTE*			pCCResult,
	ccSUPSType*		pServiceType
	);

#define MAX_PIFACE_TABLE_SIZE		9

typedef struct
{
    BYTE		PIFACEParamLen;
	BYTE		PIFACEParam[MAX_PIFACE_TABLE_SIZE];
} PIFACETable;

typedef struct
{
    BYTE  			AudioProfile;
    BYTE  			ACDBDevice;
    BYTE  			PIFACEID;
    PIFACETable 	PIFACETbl;
} AudioConfig;


typedef struct
{
    LONG		B0;
    LONG		B1;
    LONG		B2;
    LONG		A1;
    LONG		A2;
} PCMIIRFilter;

typedef struct
{
    BYTE	Profile;
	BYTE	Switch;
	BYTE	Stage;
} PCMIIRSetConfig;

typedef struct
{
    BYTE			Profile;
	BYTE			Stage;
	PCMIIRFilter	Coeff;
} PCMIIRSetCoeff;

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetProfile(
    // req params
    BYTE*		pGenerator,
    // resp params
    BYTE*       pProfile,
    BYTE*       pEarMute,
    BYTE*       pMicMute,
    BYTE*       pOutGenerator,
    BYTE*		pVolume,
    BYTE*       pCwtMute
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetProfile(
    // req params
    BYTE*  		pProfile,
    BYTE*  		pEarMute,
    BYTE*  		pMicMute,
    BYTE*  		pGenerator,
    BYTE*  		pVolume,
    BYTE*       pCwtMute
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetVolume(
    // req params
    BYTE*		pProfile,
    BYTE*  		pGenerator,
    // resp params
    BYTE*  		pVolume
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetVolume(
    // req params
    BYTE*		pProfile,
    BYTE*  		pGenerator,
    BYTE*  		pVolume
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetAVMute(
    // req params
    BYTE*  		pProfile,
    BYTE*  		pEarMute,
    BYTE*  		pMicMute,
    BYTE*  		pcwtMute//waiting tone mute
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetAVMute(
    // req params
    BYTE*  		pProfile,
    BYTE*  		pEarMute,
    BYTE*  		pMicMute,
    BYTE*  		pcwtMute//waiting tone mute
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetAVCFG(
    // req params
    BYTE*  		 pAudioProfile,
    BYTE*  		 pABCDDevice,
    BYTE*  		 pPIFACEID,
    PIFACETable* pPIFACETable
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetAVCFG(
    // req params
    // resp params
	AudioConfig*	pAudioConfig,
	BYTE*			pSize
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioNVDef(
    // req params
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetLPBK(
    // req params
    BYTE*	pEnable
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetSpeakerGain(
    // req params
    BYTE*		pProfile,
    // resp params
    USHORT*  	pSpkrGain
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetSpeakerGain(
    // req params
    BYTE*  		pProfile,
    USHORT*  	pSpkrGain
    // resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetSTG(
    // req params
    BYTE*		pProfile,
    // resp params
    WORD*  		pGainValue
);


IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetSTG(
    // req params
    BYTE*		pProfile,
    WORD*  		pGainValue
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetTxVolume(
    // req params
    BYTE*		pProfile,
    // resp params
    WORD*  		pTxVolume
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetTxVolume(
    // req params
    BYTE*		pProfile,
    WORD*  		pTxVolume
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetMicGain(
    // req params
    BYTE*		pProfile,
    // resp params
    WORD*  		pMicGain
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetMicGain(
    // req params
    BYTE*		pProfile,
    WORD*  		pMicGain
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetVolDB(
    // req params
    BYTE*		pProfile,
    BYTE*  		pGenerator,
    BYTE*  		pLevel,
    // resp params
	WORD*		pValue
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetVolDB(
    // req params
    BYTE*		pProfile,
    BYTE*  		pGenerator,
    BYTE*  		pLevel,
    WORD*		pValue
	// resp params
);

/*IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetTXPCMIIR(
    // req params
    BYTE*  			pProfile,
	BYTE*			pOpMode,
	// resp params
	BYTE*           pSwitch,
    BYTE*           pStage,
    PCMIIRFilter*   pFilterCoeff
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetTXPCMIIR(
    // req params
    PCMIIRSetConfig*  	pConfig,
	PCMIIRSetCoeff*		pCoeff
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetRXPCMIIR(
    // req params
    BYTE*  			pProfile,
	BYTE*			pOpMode,
	// resp params
	BYTE*           pSwitch,
    BYTE*           pStage,
    PCMIIRFilter*   pFilterCoeff
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetRXPCMIIR(
    // req params
    PCMIIRSetConfig*  	pConfig,
	PCMIIRSetCoeff*		pCoeff
	// resp params
);*/

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetAVTXG(
    // req params
    BYTE*		pProfile,
    // resp params
    WORD*  		pEncoderGain
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetAVTXG(
    // req params
    BYTE*		pProfile,
    WORD*  		pEncoderGain
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetAVRXG(
    // req params
    BYTE*		pProfile,
    // resp params
    WORD*  		pDecoderGain
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetAVRXG(
    // req params
    BYTE*		pProfile,
    WORD*  		pDecoderGain
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetAVEC(
    // req params
    BYTE*		pProfile,
    // resp params
    BYTE*  		pSwitch
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetAVEC(
    // req params
    BYTE*		pProfile,
    BYTE*  		pSwitch
	// resp params
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioGetAVNS(
    // req params
    BYTE*		pProfile,
    // resp params
    BYTE*  		pSwitch
);

IMPORTGOBI ULONG GOBICMAPI	SwiM2MAV_AudioSetAVNS(
    // req params
    BYTE*		pProfile,
    BYTE*  		pSwitch
	// resp params
);

// CVoiceDialerDlg dialog
class CVoiceDialerDlg : public CDialog
{
// Construction
public:
	CVoiceDialerDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_VOICEDIALER_DIALOG };


	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

// Implementation
protected:
	HICON m_hIcon;
	UINT_PTR m_DeviceSearchTimer;

 	// Search for available device
	BOOL DeviceSearch();

	// Generated message map functions
	virtual BOOL OnInitDialog();
#if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP)
	afx_msg void OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/);
#endif
	virtual void OnCancel();
	virtual void OnOK();
	DECLARE_MESSAGE_MAP();
public:
	CEdit m_editStatus;
	afx_msg void OnTimer(UINT_PTR nIDEvent);
	afx_msg LRESULT OnNotifDeviceRemoval(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnCallInfoCallback(WPARAM wParam, LPARAM lParam);
	afx_msg void OnBnClickedButton3();
	afx_msg void OnBnClickedButton4();
	CListBox lst_Log;
	arrCallInfo m_callinfo;
	CEdit phoneno;
	afx_msg void OnBnClickedBtnget();
	CComboBox m_combo_cmd;
	CEdit m_edit_profile;
	CEdit m_edit_earmute;
	CEdit m_edit_micmute;
	CEdit m_edit_generator;
	CEdit m_edit_volume;
	CEdit m_edit_cwt;
	afx_msg void OnBnClickedBtnset();
	afx_msg void OnBnClickedBtnclear();
	CEdit m_edit_error;
	CEdit m_edit_gain;
	CEdit m_edit_level;
	CEdit m_edit_loopback;
	CButton m_check_keep;
	CEdit m_edit_switch;
	CEdit m_edit_stage;
	CEdit m_edit_b0;
	CEdit m_edit_b1;
	CEdit m_edit_b2;
	CEdit m_edit_a1;
	CEdit m_edit_a2;
	CButton m_check_switch;
	CButton m_check_coeff;
	CEdit m_edit_device;
	CEdit m_edit_id;
	CEdit m_edit_param;
};
