Solved

Mixer Master Volume

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now