扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:智慧的鱼 来源:天极网 2007年10月17日
关键字:
BOOL CMixer::SetMute(DWORD dwSrcType, BOOL bValue) { MIXERLINE mxl; if (! GetLineInfo(&mxl, MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, dwSrcType)) return FALSE; MIXERCONTROL mxc; if (! GetLineControl(&mxc, &mxl, MIXERCONTROL_CONTROLTYPE_MUTE)) return FALSE; MIXERCONTROLDETAILS mxcd; MIXERCONTROLDETAILS_BOOLEAN mxcd_f; mxcd.cbStruct = sizeof(mxcd); mxcd.dwControlID = mxc.dwControlID; mxcd.cChannels = 1; mxcd.cMultipleItems = 0; mxcd.cbDetails = sizeof(mxcd_f); mxcd.paDetails = &mxcd_f; mxcd_f.fValue = bValue; if (! SetControlDetails(&mxcd, MIXER_OBJECTF_MIXER)) return FALSE; return TRUE; } BOOL CMixer::GetMute(DWORD dwSrcType, BOOL* pbValue) { MIXERLINE mxl; if (! GetLineInfo(&mxl, MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, dwSrcType)) return FALSE; MIXERCONTROL mxc; if (! GetLineControl(&mxc, &mxl, MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT )) return FALSE; MIXERCONTROLDETAILS mxcd; MIXERCONTROLDETAILS_BOOLEAN mxcd_f; mxcd.cbStruct = sizeof(mxcd); mxcd.dwControlID = mxc.dwControlID; mxcd.cChannels = 1; mxcd.cMultipleItems = 0; mxcd.cbDetails = sizeof(mxcd_f); mxcd.paDetails = &mxcd_f; if (! GetControlDetails(&mxcd, MIXER_GETCONTROLDETAILSF_VALUE)) return FALSE; *pbValue = mxcd_f.fValue; return TRUE; } |
BOOL bValue = TRUE; SetMute(MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, bValue); GetMute(MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, &bValue); |
afx_msg void OnMLChange(WPARAM wParam, LPARAM lParam); afx_msg void OnMCChange(WPARAM wParam, LPARAM lParam); ON_MESSAGE(MM_MIXM_LINE_CHANGE, OnMLChange) ON_MESSAGE(MM_MIXM_CONTROL_CHANGE, OnMCChange) |
wParam = (WPARAM) hMixer lParam = (LPARAM) dwControlID |
wParam = (WPARAM) hMixer lParam = (LPARAM) dwLineID |
void CMixerControlDlg::OnMCChange(WPARAM wParam, LPARAM lParam) { DWORD dwLValue; DWORD dwRValue; GetVolume(MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, &dwLValue,&dwRValue); //GetVolume函数的定义见下面,然后根据返回的值调整滑动条的位置 m_SliderVolR.SetPos(MAX_VOL_VALUE - dwLValue); m_SliderVolL.SetPos(MAX_VOL_VALUE - dwRValue); //你也可以在这里调用GetMute查看Volume是否被静音, } |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者