Home
Tutorials
Code Snippets
Code Samples
Downloads
Links

The Blog
Our Projects
About
Contact

::Add RageStorm to Favorites!::

The Blog | Our Projects | Guest Book | About | Contact

 
Code Snippet - Aux Volume
Author:Arkon
Category:Win32API
File Size:668 Bytes
Uploaded at:27-Nov-02 08:35:58 pm
Description:
  Let your application adjust the master volume.
  
// The volume range is 0-0xffff.

 UINT MaxDevs = waveOutGetNumDevs();
 WAVEOUTCAPS woc;
 for (UINT DID = 0; DID < MaxDevs - 1; DID++)
 {
  MMRESULT res = waveOutGetDevCaps(DID, &woc, sizeof(AUXCAPS));
  if ((res == MMSYSERR_NOERROR) && (woc.dwSupport & WAVECAPS_LRVOLUME)) break;
 }
 if (DID == MaxDevs - 1) DID = AUX_MAPPER;

// MASTER VOLUME
#define MLEFTVOL  0x1000
#define MRIGHTVOL 0x1000
 auxSetVolume(DID, MAKELONG(MLEFTVOL, MRIGHTVOL));

// WAVE VOLUME
#define WLEFTVOL  0x8000
#define WRIGHTVOL 0x8000
 waveOutSetVolume((HWAVEOUT)DID, MAKELONG(WLEFTVOL, WRIGHTVOL));

//Updated on 13rd Sep 2001, now detects the waveOut volume device ID.
User Contributed Comments(None)
NOTE:
Comments that will hurt anyone in any way will be deleted.
Don't ask for features, advertise or curse.
If you want to leave a message to the author use the contacts,
if you have any question in relation to your comments please use the forum.
Comments which violate any of these requests will be deleted without further
notice. Use the comment system decently.

Post your comment:
Name:
email:
Comment:
::Top 5 Tutorials::
Embedded Python[116819]
2D Rotated Rectangles Collision Detection[88824]
Keyboard Hook[77119]
UDP[65783]
HTTP Proxy[41172]

::Top 5 Samples::
2D ColDet Rotated Rectangles[11551]
PS2 Mouse Driver[6948]
Wave Format Player[5782]
Reading FAT12[5609]
CodeGuru[5348]


All rights reserved to RageStorm © 2009