https://git.reactos.org/?p=reactos.git;a=commitdiff;h=45f0d7413c1eec69fe672…
commit 45f0d7413c1eec69fe6728fcd26acc561d93f46f
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Mon Feb 11 21:16:32 2019 +0100
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Mon Feb 11 21:16:32 2019 +0100
[SNDVOL32] Disable the balance trackbar for mono channels.
CORE-15743
---
base/applications/sndvol32/dialog.c | 37 ++++++++++++++++++++++++++-----------
1 file changed, 26 insertions(+), 11 deletions(-)
diff --git a/base/applications/sndvol32/dialog.c b/base/applications/sndvol32/dialog.c
index 8ff9a490b4..a93a638034 100644
--- a/base/applications/sndvol32/dialog.c
+++ b/base/applications/sndvol32/dialog.c
@@ -562,21 +562,36 @@ EnumConnectionsCallback(
}
}
- /* Set the balance trackbar */
- wID = (PrefContext->Count + 1) * IDC_LINE_SLIDER_HORZ;
-
- /* get dialog control */
- hDlgCtrl = GetDlgItem(PrefContext->MixerWindow->hWnd,
wID);
+ if (Line->cChannels == 1)
+ {
+ /* Disable the balance trackbar for mono channels */
+ wID = (PrefContext->Count + 1) *
IDC_LINE_SLIDER_HORZ;
- if (hDlgCtrl != NULL)
+ /* get dialog control */
+ hDlgCtrl =
GetDlgItem(PrefContext->MixerWindow->hWnd, wID);
+ if (hDlgCtrl != NULL)
+ {
+ EnableWindow(hDlgCtrl, FALSE);
+ }
+ }
+ else if (Line->cChannels == 2)
{
- /* check state */
- LRESULT OldPosition = SendMessageW(hDlgCtrl,
TBM_GETPOS, 0, 0);
+ /* Set the balance trackbar */
+ wID = (PrefContext->Count + 1) *
IDC_LINE_SLIDER_HORZ;
+
+ /* get dialog control */
+ hDlgCtrl =
GetDlgItem(PrefContext->MixerWindow->hWnd, wID);
- if (OldPosition != balancePosition)
+ if (hDlgCtrl != NULL)
{
- /* update control state */
- SendMessageW(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE,
balancePosition);
+ /* check state */
+ LRESULT OldPosition = SendMessageW(hDlgCtrl,
TBM_GETPOS, 0, 0);
+
+ if (OldPosition != balancePosition)
+ {
+ /* update control state */
+ SendMessageW(hDlgCtrl, TBM_SETPOS,
(WPARAM)TRUE, balancePosition);
+ }
}
}
}