Solved

Mixer Master Volume

Posted on 1997-05-12
2
896 Views
Last Modified: 2013-12-04
I need to control the WIN95 Mixer's  Master Volume.
Using the mixer, I can control the Volumes and Balances of  the CD Player, WAV, MIDI, MIC and PC Speaker lines. I do this by using mixerGetLineInfo(), mixerGetLineControls(), mixerGetControlDetails() and mixerSetControlDetails().  This Works !!!!!       However, How is the Master Volume Controlled?
0
Comment
Question by:jowen051297
2 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1397284
The following code is to get the control ID of the Master Volume.
        // get dwLineID
      MIXERLINE mxl;
      mxl.cbStruct = sizeof(MIXERLINE);
      mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
      if (::mixerGetLineInfo((HMIXEROBJ)m_hMixer,
                               &mxl,
                                     MIXER_OBJECTF_HMIXER |
                                     MIXER_GETLINEINFOF_COMPONENTTYPE)
            != MMSYSERR_NOERROR)
            return FALSE;

      // get dwControlID
      MIXERCONTROL mxc;
      MIXERLINECONTROLS mxlc;
      mxlc.cbStruct = sizeof(MIXERLINECONTROLS);
      mxlc.dwLineID = mxl.dwLineID;
      mxlc.dwControlType = MIXERCONTROL_CONTROLTYPE_VOLUME;
      mxlc.cControls = 1;
      mxlc.cbmxctrl = sizeof(MIXERCONTROL);
      mxlc.pamxctrl = &mxc;
      if (::mixerGetLineControls((HMIXEROBJ)m_hMixer,
                                   &mxlc,
                                           MIXER_OBJECTF_HMIXER |
                                           MIXER_GETLINECONTROLSF_ONEBYTYPE)
          != MMSYSERR_NOERROR)
            return FALSE;

Then you can call mixerGetControlDetails() and mixerSetControlDetails() with the control ID.

0
 

Author Comment

by:jowen051297
ID: 1397285
Excellent answer from chensu.  It was clear, concise and worked beautifully. Thanks.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question