Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adjust PC Volume
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00998440
Message ID:
00998666
Vues:
31
Wayne,

For reading/adjusting the sound vlume, you can use Multimedia API calls waveOutOpen, waveOutGetVolume, waveOutSetVolume and others.
PROCEDURE GetVolume
	LOCAL nVolume
	nVolume = 0
	IF THIS.hDevice <> 0
		= waveOutGetVolume(THIS.hDevice, @nVolume)
	ENDIF
	nVolume = Int(BitAnd(0x0000ffff, nVolume)/0xffff) * 10
	nVolume = Min(10, Max(1, nVolume))
	THIS.cmbVolume.ListIndex = nVolume

PROCEDURE SetVolume(nVolume)
	LOCAL nLeft, nRight
	nVolume = MIN(MAX(nVolume, 1), 10)
	nLeft = Int(nVolume * 0xffff / 10)
	nRight = BitLShift(nLeft, 16)
	nVolume = nLeft + nRight
	= waveOutSetVolume(THIS.hDevice, nLeft + nRight)
Complete code (members area):
WAV file player
http://www.news2news.com/vfp/?example=417
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform