Article View: borland.public.cppbuilder.multimedia
Article #920Re: Master Volume Control
From: Michael Warner
Date: Thu, 20 Jun 2002 08:24
Date: Thu, 20 Jun 2002 08:24
32 lines
2086 bytes
2086 bytes
On Thu, 20 Jun 2002 09:27:06 +0200, Davide Puccioni
<davide.puccioni@audiodevices.com> wrote:
>Hi, everybody!
>I've taken full control of wave volume, but how can I take control over
>Master Volume Control?
You need the dreaded audio mixer - see the multimedia help. There's
no substitute for understanding how it works, but here's some code
which locates the master volume control:
// master volume details
ml.cbStruct = sizeof(ml);
ml.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
if
(mixerGetLineInfo(MixerHandle,&ml,MIXER_GETLINEINFOF_COMPONENTTYPE)) {
mixerClose(MixerHandle); return false; // no wave out line
}
// mlc.cbStruct = sizeof(mlc);
mlc.dwLineID = ml.dwLineID;
// mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME;
// mlc.cControls = 1;
// mlc.cbmxctrl = sizeof(mc);
// mlc.pamxctrl = &mc;
if
(mixerGetLineControls(MixerHandle,&mlc,MIXER_GETLINECONTROLSF_ONEBYTYPE))
{
mixerClose(MixerHandle); return false; // no wave out line
}
MasterID = mc.dwControlID;
mmax = mc.Bounds.dwReserved[1]; // compiler doesn't like
dxMaximum!
Technical Details
Message-ID:
<q843hugjifci1udpu8u8qjng2lepcr26ne@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!yellow.newsread.com!bad-news.newsread.com!netaxs.com!newsread.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<3D1183CA.6040709@audiodevices.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d0fc,8f4d59250bac3499 X-Google-Attributes: gid10d0fc,public X-Google-ArrivalTime: 2002-06-20 01:30:42 PST From: Michael Warner <mvw@ozemail.com.au> Newsgroups: borland.public.cppbuilder.multimedia Subject: Re: Master Volume Control Date: Thu, 20 Jun 2002 17:54:39 +0930 Organization: Warner Solutions Reply-To: mvw@ozemail.com.au Message-ID: <q843hugjifci1udpu8u8qjng2lepcr26ne@4ax.com> References: <3D1183CA.6040709@audiodevices.com> X-Newsreader: Forte Agent 1.91/32.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 203.12.165.248 X-Trace: dnews 1024561430 203.12.165.248 (20 Jun 2002 01:23:50 -0700) Lines: 33 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!yellow.newsread.com!bad-news.newsread.com!netaxs.com!newsread.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews