Evil_Has_Survived Posted April 9, 2006 Posted April 9, 2006 (edited) how do I set volume to this slider #include <GUIConstants.au3> GUICreate("My Music Player",400,400, -1,-1) GUISetBkColor (0x313594); will change background color $slider1 = GUICtrlCreateSlider (10,10,200,20) GUICtrlSetLimit(-1,200,0); change min/max value $button = GUICtrlCreateButton ("Value?",75,70,70,20) GUISetState() GUICtrlSetData($slider1,45); set cursor $start=TimerInit() Do $n = GUIGetMsg () If $n = $button Then MsgBox(0,"slider1",GUICtrlRead($slider1),2) $start=TimerInit() EndIf Until $n = $GUI_EVENT_CLOSE SoundSetWaveVolume(50) or send("{VOLUME_DOWN}") send("{VOLUME_UP}") Edited April 9, 2006 by Evil_Has_Survived Thanks in advance
Valuater Posted April 9, 2006 Posted April 9, 2006 expandcollapse popup#include <GUIConstants.au3> GUICreate("My Music Player",400,400, -1,-1) GUISetBkColor (0x313594); will change background color $slider1 = GUICtrlCreateSlider (10,10,200,20) GUICtrlSetLimit(-1,200,0); change min/max value $button = GUICtrlCreateButton ("Value?",75,70,70,20) GUISetState() $WVol = _SoundGetWaveVolume() GUICtrlSetData($slider1,$WVol); set cursor $start=TimerInit() Do $n = GUIGetMsg () If $n = $button Then MsgBox(0,"slider1",GUICtrlRead($slider1),2) $start=TimerInit() EndIf Until $n = $GUI_EVENT_CLOSE Func _SoundGetWaveVolume() Local $WaveVol = -1, $p, $ret Const $MMSYSERR_NOERROR = 0 $p = DllStructCreate ("dword") If @error Then SetError(2) Return -2 EndIf $ret = DllCall("winmm.dll", "long", "waveOutGetVolume", "long", -1, "long", DllStructGetPtr ($p)) If ($ret[0] == $MMSYSERR_NOERROR) Then $WaveVol = Round(Dec(StringRight(Hex(DllStructGetData ($p, 1), 8), 4)) / 0xFFFF * 100) Else SetError(1) EndIf $Struct=0 Return $WaveVol EndFunc;==>_SoundGetWaveVolume 8)
Evil_Has_Survived Posted April 9, 2006 Author Posted April 9, 2006 (edited) expandcollapse popup#include <GUIConstants.au3> GUICreate("My Music Player",400,400, -1,-1) GUISetBkColor (0x313594); will change background color $slider1 = GUICtrlCreateSlider (10,10,200,20) GUICtrlSetLimit(-1,200,0); change min/max value $button = GUICtrlCreateButton ("Value?",75,70,70,20) GUISetState() $WVol = _SoundGetWaveVolume() GUICtrlSetData($slider1,$WVol); set cursor $start=TimerInit() Do $n = GUIGetMsg () If $n = $button Then MsgBox(0,"slider1",GUICtrlRead($slider1),2) $start=TimerInit() EndIf Until $n = $GUI_EVENT_CLOSE Func _SoundGetWaveVolume() Local $WaveVol = -1, $p, $ret Const $MMSYSERR_NOERROR = 0 $p = DllStructCreate ("dword") If @error Then SetError(2) Return -2 EndIf $ret = DllCall("winmm.dll", "long", "waveOutGetVolume", "long", -1, "long", DllStructGetPtr ($p)) If ($ret[0] == $MMSYSERR_NOERROR) Then $WaveVol = Round(Dec(StringRight(Hex(DllStructGetData ($p, 1), 8), 4)) / 0xFFFF * 100) Else SetError(1) EndIf $Struct=0 Return $WaveVol EndFunc;==>_SoundGetWaveVolume 8) how do I use it lol I turn on my music, and then open the script then iturned down and then up nothing, and good work, but I think I need the volume up and down instead, because I want to set hot keys to sorry, Edited April 9, 2006 by Evil_Has_Survived Thanks in advance
Valuater Posted April 9, 2006 Posted April 9, 2006 expandcollapse popup#include <GUIConstants.au3> $main = GUICreate("My Music Player", 400, 400, -1, -1) GUISetBkColor(0x313594); will change background color $slider1 = GUICtrlCreateSlider(10, 10, 200, 20) GUICtrlSetLimit(-1, 100, 0); change min/max value $button = GUICtrlCreateButton("Value?", 75, 70, 70, 20) GUISetState() $WVol = _SoundGetWaveVolume() GUICtrlSetData($slider1, $WVol); set cursor $start = TimerInit() Do $n = GUIGetMsg() If $n = $button Then MsgBox(0, "slider1", GUICtrlRead($slider1), 2) $start = TimerInit() EndIf If $WVol <> GUICtrlRead($slider1) Then $WVol = GUICtrlRead($slider1) ToolTip($WVol) SoundSetWaveVolume($WVol) Sleep(150) ToolTip("") EndIf Until $n = $GUI_EVENT_CLOSE Func _SoundGetWaveVolume() Local $WaveVol = -1, $p, $ret Const $MMSYSERR_NOERROR = 0 $p = DllStructCreate("dword") If @error Then SetError(2) Return -2 EndIf $ret = DllCall("winmm.dll", "long", "waveOutGetVolume", "long", -1, "long", DllStructGetPtr($p)) If ($ret[0] == $MMSYSERR_NOERROR) Then $WaveVol = Round(Dec(StringRight(Hex(DllStructGetData($p, 1), 8), 4)) / 0xFFFF * 100) Else SetError(1) EndIf $Struct = 0 Return $WaveVol EndFunc ;==>_SoundGetWaveVolume 8)
Evil_Has_Survived Posted April 9, 2006 Author Posted April 9, 2006 nice you always pull threw for me same with a few othe rpeople Thanks in advance
Evil_Has_Survived Posted April 9, 2006 Author Posted April 9, 2006 Welcome 8) it was working, then I went to edit it and get this error Error $p = DllStructCreate("dword") Thanks in advance
nfwu Posted April 9, 2006 Posted April 9, 2006 DLLStructCreate requires beta. #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode()
Evil_Has_Survived Posted April 9, 2006 Author Posted April 9, 2006 it was working, then I went to edit it and get this error Error $p = DllStructCreate("dword") never mind I fixed it Thanks in advance
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now