Soundsetwavevolume und Sound.au3

  • [autoit]

    SoundSetWaveVolume(GUICtrlRead($idsliderVol))

    [/autoit]

    übernimmt von einem Slider die Prozentangabe. Den Slider musst du mit

    [autoit]

    GUICtrlSetLimit(-1, 100, 0) ;maximal 100 minimal 0

    [/autoit]

    auf die gewünschten Werte limitieren. Es gibt auch zumindest unter XP Prof SP3 keine Unverträglichkeiten mit der Sound.Au3.

    mfg (Auto)Bert

  • Ich benutz auch Vista.
    Hier mal eins von meinen alten (eig wie von AutoBert):

    [autoit]

    Func _volume()
    $slider1 = GUICtrlRead($volume)
    SoundSetWaveVolume($slider1)
    EndFunc

    [/autoit]


    Sound.au3 muss unter include stehen.
    Problem is, dass es die Höhe der Lautstärke zu Begin auf 100 setzt. Man kann also prinzipiell nur die Lautstärke verringern.

  • naja hab für doodle jump so ne kleine gdi+ slider udf gemacht :D

    Spoiler anzeigen
    [autoit]

    Func _GDIPlus_CreateSlider($hGraphics, $x, $y, $width, $wert, $color1, $color2, $maxwert = 100)
    ;~ Author: yxyx
    Opt("MouseCoordMode", 0)
    Local $dll
    $dll = DllStructCreate("int;int;int;int;int;int;int;int;int")
    DllStructSetData($dll, 1, $x)
    DllStructSetData($dll, 2, $y)
    DllStructSetData($dll, 3, $wert)
    DllStructSetData($dll, 4, $color1)
    DllStructSetData($dll, 5, $color2)
    DllStructSetData($dll, 6, $hGraphics)
    DllStructSetData($dll, 8, $maxwert)
    DllStructSetData($dll, 9, $width)
    Return $dll

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _GDIPlus_CheckSlider($dll)
    ;~ Author: yxyx
    Local $pos = MouseGetPos(), $userdll = DllOpen("user32.dll"), $dllread[9] = [DllStructGetData($dll, 1), DllStructGetData($dll, 2), DllStructGetData($dll, 3), DllStructGetData($dll, 4), DllStructGetData($dll, 5), DllStructGetData($dll, 6), DllStructGetData($dll, 7), DllStructGetData($dll, 8), DllStructGetData($dll, 9)]
    Local $dllwrite, $step = $dllread[8]/$dllread[7], $penlines = _GDIPlus_PenCreate($dllread[3], 2), $penfill = _GDIPlus_BrushCreateSolid($dllread[4])
    _GDIPlus_GraphicsDrawLine($dllread[5], $dllread[0], $dllread[1]+10, $dllread[0]+$dllread[8], $dllread[1]+10, $penlines)

    [/autoit] [autoit][/autoit] [autoit]

    If _IsPressed("01", $userdll) Then
    If ($pos[0] > $dllread[0]+$step*$dllread[2]-5 and $pos[0] < $dllread[0]+$step*$dllread[2]+5 and $pos[1] > $dllread[1] and $pos[1] < $dllread[1]+20) or $dllread[6] Then
    DllStructSetData($dll, 7, "1")
    $dllwrite = Round(($pos[0]-$dllread[0])/$step)
    If $pos[0] <= $dllread[0] Then $dllwrite = 0
    If $pos[0] >= $dllread[0]+$dllread[8] Then $dllwrite = $dllread[7]
    DllStructSetData($dll, 3, $dllwrite)
    Else
    DllStructSetData($dll, 7, "0")
    EndIf
    Else
    DllStructSetData($dll, 7, "0")
    EndIf
    Local $points[6][2] = [[5,0], [$dllread[0]+$step*$dllread[2] -5, $dllread[1]],[$dllread[0]+$step*$dllread[2] -5, $dllread[1]+17],[$dllread[0]+$step*$dllread[2], $dllread[1]+20],[$dllread[0]+$step*$dllread[2] +5, $dllread[1]+17],[$dllread[0]+$step*$dllread[2] +5, $dllread[1]]]

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsFillPolygon($dllread[5], $points, $penfill)
    _GDIPlus_GraphicsDrawPolygon($dllread[5], $points, $penlines)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _GDIPlus_ReadSlider($dll)
    ;~ Author: yxyx
    Return DllStructGetData($dll, 3)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _GDIPlus_SetSliderColor($dll, $color, $number)
    ;~ Author: yxyx
    If $number < 1 and $number > 2 Then Return
    Return DllStructSetData($dll, 3+$number, $color)
    EndFunc

    [/autoit]