From 2d70cc490b1cb7049f16b7f15c29d7d2b384f090 Mon Sep 17 00:00:00 2001
From: Mark Harmstone <mark@harmstone.com>
Date: Sun, 5 Apr 2015 14:16:11 +0100
Subject: winecfg: Add checkbox to enable/disable EAX support.

---
 programs/winecfg/resource.h |  1 +
 programs/winecfg/staging.c  | 21 +++++++++++++++++++++
 programs/winecfg/winecfg.rc |  1 +
 3 files changed, 23 insertions(+)

diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h
index 7b6ac54..044fc06 100644
--- a/programs/winecfg/resource.h
+++ b/programs/winecfg/resource.h
@@ -215,6 +215,7 @@
 /* Staging tab */
 #define IDC_ENABLE_CSMT                 9001
 #define IDC_ENABLE_VAAPI                9002
+#define IDC_ENABLE_EAX                  9003
 
 /* About tab */
 #define IDC_ABT_OWNER                8432
diff --git a/programs/winecfg/staging.c b/programs/winecfg/staging.c
index a2b6dce..614fabd 100644
--- a/programs/winecfg/staging.c
+++ b/programs/winecfg/staging.c
@@ -67,10 +67,27 @@ static void vaapi_set(BOOL status)
 #endif
 }
 
+/*
+ * EAX
+ */
+static BOOL eax_get(void)
+{
+    BOOL ret;
+    char *value = get_reg_key(config_key, keypath("DirectSound"), "EAXEnabled", "N");
+    ret = IS_OPTION_TRUE(*value);
+    HeapFree(GetProcessHeap(), 0, value);
+    return ret;
+}
+static void eax_set(BOOL status)
+{
+    set_reg_key(config_key, keypath("DirectSound"), "EAXEnabled", status ? "Y" : "N");
+}
+
 static void load_staging_settings(HWND dialog)
 {
     CheckDlgButton(dialog, IDC_ENABLE_CSMT, csmt_get() ? BST_CHECKED : BST_UNCHECKED);
     CheckDlgButton(dialog, IDC_ENABLE_VAAPI, vaapi_get() ? BST_CHECKED : BST_UNCHECKED);
+    CheckDlgButton(dialog, IDC_ENABLE_EAX, eax_get() ? BST_CHECKED : BST_UNCHECKED);
 
 #ifndef HAVE_VAAPI
     disable(IDC_ENABLE_VAAPI);
@@ -108,6 +125,10 @@ INT_PTR CALLBACK StagingDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
             vaapi_set(IsDlgButtonChecked(hDlg, IDC_ENABLE_VAAPI) == BST_CHECKED);
             SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
             return TRUE;
+        case IDC_ENABLE_EAX:
+            eax_set(IsDlgButtonChecked(hDlg, IDC_ENABLE_EAX) == BST_CHECKED);
+            SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
+            return TRUE;
         }
         break;
     }
diff --git a/programs/winecfg/winecfg.rc b/programs/winecfg/winecfg.rc
index 59fb0a9..8226c4b 100644
--- a/programs/winecfg/winecfg.rc
+++ b/programs/winecfg/winecfg.rc
@@ -317,6 +317,7 @@ BEGIN
     LTEXT       "The following settings are experimental and may break stuff!\nMake sure to reset them again in case of a problem.",IDC_STATIC,16,16,230,16
     CONTROL     "Enable &CSMT for better graphic performance (deprecated)",IDC_ENABLE_CSMT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,40,230,8
     CONTROL     "Enable &VAAPI as backend for DXVA2 GPU decoding",IDC_ENABLE_VAAPI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,55,230,8
+    CONTROL     "Enable Environmental Audio E&xtensions (EAX)",IDC_ENABLE_EAX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,70,230,8
 END
 
 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-- 
2.7.4

