From: Eric Kohl Date: Mon, 11 Feb 2019 20:16:32 +0000 (+0100) Subject: [SNDVOL32] Disable the balance trackbar for mono channels. X-Git-Tag: 0.4.13-dev~410 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=45f0d7413c1eec69fe6728fcd26acc561d93f46f [SNDVOL32] Disable the balance trackbar for mono channels. CORE-15743 --- diff --git a/base/applications/sndvol32/dialog.c b/base/applications/sndvol32/dialog.c index 8ff9a490b41..a93a6380347 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); + } } } }