Player erstellen ?!

  • hi zusammen ,
    also ich habe mir mal so einen player erstellt! (der auch geht)

    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Sound.au3>
    opt("guioneventmode",1)
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("doPe's Player", 596, 469, 317, 144)
    GUISetBkColor(0x000000)
    $Pic1 = GUICtrlCreatePic("C:\Users\mathias\Pictures\mussik.jpg", 0, 56, 572, 244, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
    $Button1 = GUICtrlCreateButton("Song beenden",16, 328, 131, 41)
    GUICtrlSetOnEvent(-1,"stop")
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetFont(-1, 14, 400, 0, "Rage Italic")
    $Button2 = GUICtrlCreateButton("Play", 16, 392, 131, 41)
    GUICtrlSetOnEvent(-1,"Play")
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetFont(-1, 14, 400, 0, "Rage Italic")
    $Button3 = GUICtrlCreateButton("Pause", 160, 360, 131, 41)
    GUICtrlSetOnEvent(-1,"Pause")
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetFont(-1, 14, 400, 0, "Rage Italic")
    $Button4 = GUICtrlCreateButton("Weiter", 368, 360, 131, 41)
    GUICtrlSetOnEvent(-1,"Resume")
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetFont(-1, 14, 400, 0, "Rage Italic")
    $Label1 = GUICtrlCreateLabel("Player by dope³", 8, 8, 388, 33)
    GUICtrlSetFont(-1, 14, 400, 0, "Rage Italic")
    GUICtrlSetColor(-1, 0xFF0000)
    guisetonevent($GUI_EVENT_CLOSE,"_exit")
    GUICtrlSetState($Button1, $GUI_DISABLE)
    GUICtrlSetState($Button3, $GUI_DISABLE)
    GUICtrlSetState($Button4, $GUI_DISABLE)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    WEnd

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

    func play()
    $choosefile=fileopendialog("Choose a sound","C:\Users\" & @username & "\Music","Musik(*.mp3)",1+4)
    global $sound=_soundopen($choosefile)
    global $play=_SoundPlay($sound)
    GUICtrlSetState($Button3, $GUI_Enable)
    GUICtrlSetState($Button1, $GUI_Enable)

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

    endfunc

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

    func stop()
    _soundstop($sound)
    GUICtrlSetState($Button3, $GUI_DISABLE)
    GUICtrlSetState($Button4, $GUI_DISABLE)
    GUICtrlSetState($Button1, $GUI_DISABLE)

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

    EndFunc

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

    func _exit()
    _soundclose($sound)
    exit
    endfunc

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

    func resume()
    _soundresume($sound)
    GUICtrlSetState($Button3, $GUI_enable)
    GUICtrlSetState($Button4, $GUI_DISABLE)

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

    EndFunc

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

    func pause()
    _SoundPause($sound)
    GUICtrlSetState($Button4, $GUI_Enable)
    GUICtrlSetState($Button3, $GUI_DISABLE)

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

    endfunc

    [/autoit]


    Nun wollte ich wissen wir der code heißen muss wenn ich da so ein silder drin hab also das ich vorspulen kann und dann noch einen 2ten slider zur vol. änderung... bedanke mich schonmal im vorraus...

  • sry wie das mit nem slider geht weiss ich nicht ich hatte das über einen plus und nen minus Button geregelt mit der Volume
    aber ich kann dir mal die codesegmente geben wie das in etwa geht ^^


    Spoiler anzeigen
    [autoit]

    Func Laut ()
    _AnimButton ($Form1, $Pic5)
    $Vol = _SoundGetWaveVolume ()
    $NeuVol = $Vol + 10
    SoundSetWaveVolume($NeuVol)
    EndFunc

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

    Func Leis ()
    _AnimButton ($Form1, $Pic6)
    $Vol2 = _SoundGetWaveVolume ()
    $NeuVol3 = $Vol2 - 10
    SoundSetWaveVolume($NeuVol3)
    EndFunc

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

    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
    $p = 0
    Return $WaveVol
    EndFunc

    [/autoit]


    MFG Eistee