3

Under Windows (7,8) I can mute / adjust volume as per application and per output device.

Sound Control

I wonder how I can set / query these values from my C++ Qt application. Basically I need to figure out / accomplish (use cases):

  1. Is the global mute set (per device)? Set global mute from my application.
  2. Is the application's mixer mute set? Set mixer mute.
  3. Set mixer volume, set global volume.
  4. Query mixer volume, set mixer volume?

Wherever possible I am looking for the Qt-ish way to accomplish things, keeping code as platform independent as possible. I can imagine to query the global mute via an OS-independent API, but using a Windows only class for the mixer.

From the C# question Get Master Sound Volume in c# I understand IAudioMeterInformation, IMMDeviceCollection, IMMDevice are the MSDN documentation entry points for Windows specific handling.

How do I tell if the master volume is muted? shows how commands can be send via WM_APPCOMMAND . Again, windows specific, also not allowing to query values but only to set them.

Is there something for Qt encapsulating these things? Is it Phonon I need to use? Checking Phonon briefly I did not see any methods for what I need, but I might have missed it.

2
  • 2
    I'm not aware of any such API, as applications usually don't mess with the system volume/mixer settings, unless they are a system volume/mixer application, and that's a good thing. Jan 1, 2014 at 15:16
  • 2
    Understood, but there are some shortcomings I want to solve. Example, when the mixer settings are set to mute, I want to show it in my application. Users frequently wonder why a communication cannot be established, and overlook a global mute. There are more such details, and I'd like to learn what is possible in order to find the best way for me to implement things. Jan 1, 2014 at 22:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.