https://git.reactos.org/?p=reactos.git;a=commitdiff;h=28309096df136f9c15fe53d4225fe87dd0331dd4

commit 28309096df136f9c15fe53d4225fe87dd0331dd4
Author:     Eric Kohl <eric.k...@reactos.org>
AuthorDate: Fri Mar 1 22:01:14 2019 +0100
Commit:     Eric Kohl <eric.k...@reactos.org>
CommitDate: Fri Mar 1 22:01:14 2019 +0100

    [SNDVOL32] In record mode, rename the 'Mute' autocheckbox to 'Select', turn 
it into a checkbox and make it behave like a radiobutton.
---
 base/applications/sndvol32/dialog.c   | 17 ++++++++++++++++-
 base/applications/sndvol32/sndvol32.c | 28 ++++++++++++++++++++--------
 2 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/base/applications/sndvol32/dialog.c 
b/base/applications/sndvol32/dialog.c
index 781a59ea44..5a52272ed8 100644
--- a/base/applications/sndvol32/dialog.c
+++ b/base/applications/sndvol32/dialog.c
@@ -674,6 +674,7 @@ VOID
 LoadDialogCtrls(
     PPREFERENCES_CONTEXT PrefContext)
 {
+    WCHAR szBuffer[64];
     HWND hDlgCtrl;
     RECT statusRect;
     UINT i;
@@ -720,9 +721,23 @@ LoadDialogCtrls(
                      SWP_NOZORDER);
     }
 
-    /* Resize the vertical line separators */
+    if (PrefContext->MixerWindow->MixerId == RECORD_MIXER)
+        LoadStringW(hAppInstance, IDS_SELECT, szBuffer, ARRAYSIZE(szBuffer));
+
     for (i = 0; i < PrefContext->MixerWindow->DialogCount; i++)
     {
+        if (PrefContext->MixerWindow->MixerId == RECORD_MIXER)
+        {
+            hDlgCtrl = GetDlgItem(PrefContext->MixerWindow->hWnd, (i + 1) * 
IDC_LINE_SWITCH);
+
+            /* Turn the autocheckbox into a checkbox */
+            SetWindowLongPtr(hDlgCtrl, GWL_STYLE, (GetWindowLongPtr(hDlgCtrl, 
GWL_STYLE) & ~BS_AUTOCHECKBOX) | BS_CHECKBOX);
+
+            /* Change text from 'Mute' to 'Select' */
+            SetWindowTextW(hDlgCtrl, szBuffer);
+        }
+
+        /* Resize the vertical line separator */
         hDlgCtrl = GetDlgItem(PrefContext->MixerWindow->hWnd, (i + 1) * 
IDC_LINE_SEP);
         if (hDlgCtrl != NULL)
         {
diff --git a/base/applications/sndvol32/sndvol32.c 
b/base/applications/sndvol32/sndvol32.c
index 9a5578dc96..64ce3ac556 100644
--- a/base/applications/sndvol32/sndvol32.c
+++ b/base/applications/sndvol32/sndvol32.c
@@ -1000,16 +1000,28 @@ MainWindowProc(HWND hwnd,
                             /* compute window id of line name static control */
                             CtrlID = LineOffset * IDC_LINE_NAME;
 
-                            /* get line name */
-                            if (GetDlgItemTextW(hwnd, CtrlID, 
Context.LineName, MIXER_LONG_NAME_CHARS) != 0)
+                            if (Preferences.MixerWindow->Mixer->MixerId == 
PLAY_MIXER)
+                            {
+                                /* get line name */
+                                if (GetDlgItemTextW(hwnd, CtrlID, 
Context.LineName, MIXER_LONG_NAME_CHARS) != 0)
+                                {
+                                    /* setup context */
+                                    Context.SliderPos = 
SendMessage((HWND)lParam, BM_GETCHECK, 0, 0);
+                                    Context.bVertical = FALSE;
+                                    Context.bSwitch = TRUE;
+
+                                    /* set volume */
+                                    
SndMixerEnumConnections(Preferences.MixerWindow->Mixer, 
Preferences.SelectedLine, SetVolumeCallback, (LPVOID)&Context);
+                                }
+                            }
+                            else if (Preferences.MixerWindow->Mixer->MixerId 
== RECORD_MIXER)
                             {
-                                /* setup context */
-                                Context.SliderPos = SendMessage((HWND)lParam, 
BM_GETCHECK, 0, 0);
-                                Context.bVertical = FALSE;
-                                Context.bSwitch = TRUE;
+                                UINT i;
 
-                                /* set volume */
-                                
SndMixerEnumConnections(Preferences.MixerWindow->Mixer, 
Preferences.SelectedLine, SetVolumeCallback, (LPVOID)&Context);
+                                for (i = 0; i < 
Preferences.MixerWindow->DialogCount; i++)
+                                {
+                                    SendDlgItemMessageW(hwnd, (i + 1) * 
IDC_LINE_SWITCH, BM_SETCHECK, (WPARAM)((i + 1) == LineOffset), 0);
+                                }
                             }
                         }
                         else if (CtrlID % IDC_LINE_ADVANCED == 0)

Reply via email to