Solved

Mixer Master Volume

Posted on 1997-05-12
2
894 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 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