?
Solved

Mixer Master Volume

Posted on 1997-05-12
2
Medium Priority
?
898 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 100 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

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…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and 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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

770 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