// demoEnableFeatureDlg.cpp : 实现文件
//

#include "stdafx.h"
#include "demoEnableFeatureDlg.h"
#include "afxdialogex.h"
#include "HwmSdkAgent.h"

// demoEnableFeatureDlg 对话框

IMPLEMENT_DYNAMIC(demoEnableFeatureDlg, CDialogEx)

demoEnableFeatureDlg::demoEnableFeatureDlg(CWnd* pParent /*=NULL*/)
    : CDialogEx(demoEnableFeatureDlg::IDD, pParent)
{

}

demoEnableFeatureDlg::~demoEnableFeatureDlg()
{
}

void demoEnableFeatureDlg::DoDataExchange(CDataExchange* pDX)
{
    CDialogEx::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_RADIO_OPEN, m_radioOpen);
}


BEGIN_MESSAGE_MAP(demoEnableFeatureDlg, CDialogEx)
    ON_BN_CLICKED(IDC_BUTTON_MULTI_MONITOR, &demoEnableFeatureDlg::OnBnClickedButtonMultiMonitor)
    ON_BN_CLICKED(IDC_BUTTON_SHOW_HANGUP_ATTENDEE, &demoEnableFeatureDlg::OnBnClickedButtonShowHangupAttendee)
    ON_BN_CLICKED(IDC_BUTTON_HOWLING_DETECTION, &demoEnableFeatureDlg::OnBnClickedButtonHowlingDetection)
    ON_BN_CLICKED(IDC_BUTTON_1080P_CHANGE, &demoEnableFeatureDlg::OnBnClickedButton1080pChange)
    ON_BN_CLICKED(IDC_BUTTON_MIC_SWITCH, &demoEnableFeatureDlg::OnBnClickedButtonMicSwitch)
    ON_BN_CLICKED(IDC_BUTTON_CAM_SWITCH, &demoEnableFeatureDlg::OnBnClickedButtonCamSwitch)
    ON_BN_CLICKED(IDC_BUTTON_HIDE_EXTERNAL_LABEL, &demoEnableFeatureDlg::OnBnClickedButtonHideExternalLabel)
    ON_BN_CLICKED(IDC_AUTO_MIC_VOLUME_SWITCH, &demoEnableFeatureDlg::OnBnClickedAutoMicVolumeSwitch)
    ON_BN_CLICKED(IDC_BREAKOUT_CONF_SWITCH, &demoEnableFeatureDlg::OnBnClickedBreakoutConfSwitch)
    ON_BN_CLICKED(IDC_BUTTON_RECORDING_CONFIRMATION, &demoEnableFeatureDlg::OnBnClickedButtonRecordingConfirmation)
    ON_BN_CLICKED(IDC_PNR_SWITCH, &demoEnableFeatureDlg::OnBnClickedPNRSwitch)
    ON_BN_CLICKED(IDC_DEFAULT_SHARE_AUDIO, &demoEnableFeatureDlg::OnBnClickedDefaultShareAudio)
    ON_BN_CLICKED(IDC_SUPPORT_DISCONNECT_AUDIO, &demoEnableFeatureDlg::OnBnClickedSupportDisconnectAudio)
    ON_BN_CLICKED(IDC_DISCONNECT_AUDIO_TO_JOIN_CONF, &demoEnableFeatureDlg::OnBnClickedDisconnectAudioToJoinConf)
    ON_BN_CLICKED(IDC_CPU_REDUCTION_DETECT, &demoEnableFeatureDlg::OnBnClickedCpuReductionDetect)
    ON_BN_CLICKED(IDC_CPU_WITHOUT_MAIN_FRAME, &demoEnableFeatureDlg::OnBnClickedWithoutMainFrame)
    ON_BN_CLICKED(IDC_GUEST_INVITE, &demoEnableFeatureDlg::OnBnClickedGuestInvite)
    ON_BN_CLICKED(IDC_HIDE_INVITE_RESULT_TOAST, &demoEnableFeatureDlg::OnBnClickedHideInviteResultToast)
    ON_BN_CLICKED(IDC_SUPPORT_AUTO_ACCEPT_REMOTE_CONTROL, &demoEnableFeatureDlg::OnBnClickedSupportAutoAcceptRemoteControl)
    ON_BN_CLICKED(IDC_HIDE_OFFLINE_LIST, &demoEnableFeatureDlg::OnBnClickedHideOfflineList)
    ON_BN_CLICKED(IDC_HIDE_VB_RISK_TIP, &demoEnableFeatureDlg::OnBnClickedHideVbRiskTip)
    ON_BN_CLICKED(IDC_CONF_END_SHOW_TIPS, &demoEnableFeatureDlg::OnBnClickedConfEndShowTips)
END_MESSAGE_MAP()

BOOL demoEnableFeatureDlg::OnInitDialog()
{
    CDialog::OnInitDialog();

    m_radioOpen.SetCheck(1);

    return TRUE;
}
// demoEnableFeatureDlg 消息处理程序

void demoEnableFeatureDlg::OnBnClickedButtonMultiMonitor()
{
    bool isCheck = m_radioOpen.GetCheck() == 1 ? true : false;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_TYPE_MULTI_MONITOR, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable multi monitor failed"));
    }
}


void demoEnableFeatureDlg::OnBnClickedButtonShowHangupAttendee()
{
    bool isCheck = m_radioOpen.GetCheck() == 1 ? true : false;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_TYPE_SHOW_HANGUP_ATTENDEE, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable multi monitor failed"));
    }
}


void demoEnableFeatureDlg::OnBnClickedButtonHowlingDetection()
{
    bool isCheck = m_radioOpen.GetCheck() == 1 ? true : false;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_TYPE_HOWLING_DETECTION, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable howling detection failed"));
    }
}


void demoEnableFeatureDlg::OnBnClickedButton1080pChange()
{
    bool isCheck = m_radioOpen.GetCheck() == 1 ? true : false;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_TYPE_HIGH_RESOLUTION, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable 1080P failed"));
    }
}

void demoEnableFeatureDlg::OnBnClickedButtonMicSwitch()
{
    bool isCheck = m_radioOpen.GetCheck() == 1 ? true : false;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_TYPE_MIC_SWITCH, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable Mic failed"));
    }
}

void demoEnableFeatureDlg::OnBnClickedButtonCamSwitch()
{
    bool isCheck = m_radioOpen.GetCheck() == 1 ? true : false;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_TYPE_CAM_SWITCH, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable Cam failed"));
    }
}

void demoEnableFeatureDlg::OnBnClickedButtonHideExternalLabel()
{
    bool isCheck = m_radioOpen.GetCheck() == 1 ? true : false;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_TYPE_HIDE_EXTERNAL_LABEL, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable Hide external label failed"));
    }
}


void demoEnableFeatureDlg::OnBnClickedAutoMicVolumeSwitch()
{
    bool isCheck = m_radioOpen.GetCheck() == 1 ? true : false;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_AUTO_MIC_VOLUME, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable Auto Mic Volume failed"));
    }
}

void demoEnableFeatureDlg::OnBnClickedBreakoutConfSwitch()
{
    bool isCheck = m_radioOpen.GetCheck() == 1 ? true : false;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_BREAKOUT_CONF, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable Breakout Conf failed"));
    }
}


void demoEnableFeatureDlg::OnBnClickedButtonRecordingConfirmation()
{
    bool isCheck = m_radioOpen.GetCheck() == 1;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_CONFIRM_RECORD, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable Recording Confirmation failed"));
    }
}

void demoEnableFeatureDlg::OnBnClickedPNRSwitch()
{
    bool isCheck = m_radioOpen.GetCheck() == 1 ? true : false;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_VOICEPRINT_NOISE_REDUCE, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable Voiceprint Noise Reduction failed"));
    }
}

void demoEnableFeatureDlg::OnBnClickedDefaultShareAudio()
{
    bool isCheck = m_radioOpen.GetCheck() == 1 ? true : false;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_DEFAULT_SHARE_AUDIO, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Set Default Value For Share Audio Result failed"));
    }
}

void demoEnableFeatureDlg::OnBnClickedSupportDisconnectAudio()
{
    bool isCheck = m_radioOpen.GetCheck() == 1 ? true : false;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_SUPPORT_DISCONNECT_AUDIO, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable Support Disconnect audio failed"));
    }
}

void demoEnableFeatureDlg::OnBnClickedDisconnectAudioToJoinConf()
{
    bool isCheck = m_radioOpen.GetCheck() == 1 ? true : false;
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_DISCONNECT_AUDIO_TO_JOIN_CONF, isCheck);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable Disconnect audio to join conf failed"));
    }
}


void demoEnableFeatureDlg::OnBnClickedCpuReductionDetect()
{
    bool isChecked = static_cast<bool>(m_radioOpen.GetCheck());
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_CPU_REDUCTION_DETECT, isChecked);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable CPU reduction detect failed"));
    }
}


void demoEnableFeatureDlg::OnBnClickedWithoutMainFrame()
{
    bool isChecked = static_cast<bool>(m_radioOpen.GetCheck());
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_WITHOUT_MAIN_FRAME, isChecked);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable Without Main Frame failed"));
    }
}

void demoEnableFeatureDlg::OnBnClickedGuestInvite()
{
    bool isChecked = static_cast<bool>(m_radioOpen.GetCheck());
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_SUPPORT_GUEST_INVITE, isChecked);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Enable Guest Invite failed"));
    }
}


void demoEnableFeatureDlg::OnBnClickedHideInviteResultToast()
{
    bool isChecked = static_cast<bool>(m_radioOpen.GetCheck());
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_HIDE_INVITE_RESULT_TOAST, isChecked);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Hide Invite Result Toast failed"));
    }
}

void demoEnableFeatureDlg::OnBnClickedSupportAutoAcceptRemoteControl()
{
    bool isChecked = static_cast<bool>(m_radioOpen.GetCheck());
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_SUPPORT_AUTO_ACCEPT_REMOTE_CONTROL, isChecked);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Support Auto Accept Remote Control failed"));
    }
}


void demoEnableFeatureDlg::OnBnClickedHideOfflineList()
{
    bool isChecked = static_cast<bool>(m_radioOpen.GetCheck());
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_HIDE_OFFLINE_PARTICIPANT_LIST, isChecked);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Support Hide Offline Participant List failed"));
    }
}


void demoEnableFeatureDlg::OnBnClickedHideVbRiskTip()
{
    bool isChecked = static_cast<bool>(m_radioOpen.GetCheck());
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_HIDE_VB_RISK_TIP, isChecked);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Hide Virtual Background Risk Tip failed"));
    }
}

void demoEnableFeatureDlg::OnBnClickedConfEndShowTips()
{
    bool isChecked = static_cast<bool>(m_radioOpen.GetCheck());
    int ret = hwmsdkagent::EnableFeature(hwmsdkagent::HWM_ENABLE_FEATURE_CONF_END_SHOW_TIPS, isChecked);
    if (hwmsdk::HWM_COMMON_SUCCESS != ret)
    {
        AfxMessageBox(_T("Conf End Show Tips failed"));
    }
}
