mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[SNDVOL32] Play the default sound when the volume or balance trackbar of the master line has been changed by the user.
This commit is contained in:
parent
64d48843d7
commit
dda77704dd
1 changed files with 62 additions and 20 deletions
|
@ -924,33 +924,75 @@ MainWindowProc(HWND hwnd,
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_VSCROLL:
|
case WM_VSCROLL:
|
||||||
{
|
switch (LOWORD(wParam))
|
||||||
if (LOWORD(wParam) == TB_THUMBTRACK)
|
|
||||||
{
|
{
|
||||||
/* get dialog item ctrl */
|
case TB_THUMBTRACK:
|
||||||
CtrlID = GetDlgCtrlID((HWND)lParam);
|
/* get dialog item ctrl */
|
||||||
|
CtrlID = GetDlgCtrlID((HWND)lParam);
|
||||||
|
|
||||||
/* get line index */
|
/* get line index */
|
||||||
LineOffset = CtrlID / IDC_LINE_SLIDER_VERT;
|
LineOffset = CtrlID / IDC_LINE_SLIDER_VERT;
|
||||||
|
|
||||||
/* compute window id of line name static control */
|
/* compute window id of line name static control */
|
||||||
CtrlID = LineOffset * IDC_LINE_NAME;
|
CtrlID = LineOffset * IDC_LINE_NAME;
|
||||||
|
|
||||||
/* get line name */
|
/* get line name */
|
||||||
if (GetDlgItemTextW(hwnd, CtrlID, Context.LineName, MIXER_LONG_NAME_CHARS) != 0)
|
if (GetDlgItemTextW(hwnd, CtrlID, Context.LineName, MIXER_LONG_NAME_CHARS) != 0)
|
||||||
{
|
{
|
||||||
/* setup context */
|
/* setup context */
|
||||||
Context.SliderPos = HIWORD(wParam);
|
Context.SliderPos = HIWORD(wParam);
|
||||||
Context.bVertical = TRUE;
|
Context.bVertical = TRUE;
|
||||||
Context.bSwitch = FALSE;
|
Context.bSwitch = FALSE;
|
||||||
|
|
||||||
/* set volume */
|
/* set volume */
|
||||||
SndMixerEnumConnections(Preferences.MixerWindow->Mixer, Preferences.SelectedLine, SetVolumeCallback, (LPVOID)&Context);
|
SndMixerEnumConnections(Preferences.MixerWindow->Mixer, Preferences.SelectedLine, SetVolumeCallback, (LPVOID)&Context);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TB_ENDTRACK:
|
||||||
|
MixerWindow = GetWindowData(hwnd,
|
||||||
|
MIXER_WINDOW);
|
||||||
|
|
||||||
|
/* get dialog item ctrl */
|
||||||
|
CtrlID = GetDlgCtrlID((HWND)lParam);
|
||||||
|
|
||||||
|
/* get line index */
|
||||||
|
LineOffset = CtrlID / IDC_LINE_SLIDER_VERT;
|
||||||
|
|
||||||
|
if (LineOffset == 1 && MixerWindow->Mixer->MixerId == 0)
|
||||||
|
PlaySound((LPCTSTR)SND_ALIAS_SYSTEMDEFAULT, NULL, SND_ASYNC | SND_ALIAS_ID);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_HSCROLL:
|
||||||
|
switch (LOWORD(wParam))
|
||||||
|
{
|
||||||
|
case TB_THUMBTRACK:
|
||||||
|
/* FIXME */
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TB_ENDTRACK:
|
||||||
|
MixerWindow = GetWindowData(hwnd,
|
||||||
|
MIXER_WINDOW);
|
||||||
|
|
||||||
|
/* get dialog item ctrl */
|
||||||
|
CtrlID = GetDlgCtrlID((HWND)lParam);
|
||||||
|
|
||||||
|
/* get line index */
|
||||||
|
LineOffset = CtrlID / IDC_LINE_SLIDER_HORZ;
|
||||||
|
|
||||||
|
if (LineOffset == 1 && MixerWindow->Mixer->MixerId == 0)
|
||||||
|
PlaySound((LPCTSTR)SND_ALIAS_SYSTEMDEFAULT, NULL, SND_ASYNC | SND_ALIAS_ID);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
|
|
Loading…
Reference in a new issue