GUI - Musik - Lautstärke!

  • Spoiler anzeigen
    [autoit]

    #NoTrayIcon
    #include <GUIConstants.au3>
    #include <Sound.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Player", 633, 226, 193, 115, BitOR($WS_CAPTION,$WS_BORDER,$WS_CLIPSIBLINGS))
    $Button1 = GUICtrlCreateButton("Replay", 368, 152, 65, 33, 0)
    $Pausebutton = GUICtrlCreateButton("&Pause", 432, 152, 65, 33, 0)
    $Button3 = GUICtrlCreateButton("&Next", 496, 152, 65, 33, 0)
    $Button4 = GUICtrlCreateButton("&Open", 560, 152, 65, 33, 0)
    $Button5 = GUICtrlCreateButton("EXIT", 24, 160, 41, 25, 0)
    $Volume = GUICtrlCreateSlider(0, 192, 625, 25)
    GUICtrlSetData(-1, 50)
    GUICtrlSetCursor($Volume, 5)
    $List1 = GUICtrlCreateList("Halllo Du Da !", 0, 0, 625, 149)
    $Checkbox2 = GUICtrlCreateCheckbox("Repeat All!", 104, 160, 73, 17)
    $Checkbox3 = GUICtrlCreateCheckbox("Repeat ", 200, 160, 57, 17)
    $Input1 = GUICtrlCreateInput("0", 280, 160, 17, 21)
    $Label1 = GUICtrlCreateLabel("ALabel1", 376, 152, 43, 17)
    $Label2 = GUICtrlCreateLabel("Times", 304, 160, 42, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    ;hier muß die IF abfrage beginnen (wenn pause schon gedrückt ($pause=1 oder so)
    ;dann wieder abspielen und $pause = 0 setzen
    ; wenns nicht so ist dann pause machen und $pause = 1 setzen
    SoundPlay($re)
    case $Pausebutton
    _SoundPause($re)
    Dim $Pause = 0

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

    Case $Button4
    $re = FileOpenDialog('','','Mp3-Files (*.mp3;*.wav)')
    SoundPlay($re) ; das hier macht absolout keinen sinn. Wenn du den
    Case $Button3 ;Open Button nimmst um an das MP3 zu kommen und $re = FileFindNextFile("start.wav") ;dann das wieder zunichte machst

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

    SoundPlay($re)
    Case $Volume
    SoundSetWaveVolume(1)
    Case $Button5
    WinClose("Player")

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

    EndSwitch
    SoundSetWaveVolume(GUICtrlRead($Volume))
    WEnd

    [/autoit]

    MfG

    akira2012

    ***---____---Wer RechtSCHRAIBfehler findet der darf Sie behalLTEN!---___---***

    Einmal editiert, zuletzt von akira2012 (10. August 2007 um 20:39)

  • Hallo
    etwa so ?

    Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.2.4.9
    Author: myName

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

    Script Function:
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------

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

    ; Script Start - Add your code below here
    #NoTrayIcon
    #include <GUIConstants.au3>
    #include <Sound.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Player", 633, 226, 193, 115, BitOR($WS_CAPTION,$WS_BORDER,$WS_CLIPSIBLINGS))
    $Button1 = GUICtrlCreateButton("RePlay", 368, 152, 65, 33, 0)
    $Pausebutton = GUICtrlCreateButton("&Pause", 432, 152, 65, 33, 0)
    $Button3 = GUICtrlCreateButton("&Next", 496, 152, 65, 33, 0)
    $Button4 = GUICtrlCreateButton("&Open", 560, 152, 65, 33, 0)
    $Button5 = GUICtrlCreateButton("EXIT", 24, 160, 41, 25, 0)
    $Volume = GUICtrlCreateSlider(0, 192, 625, 25)
    GUICtrlSetData(-1, 50)
    GUICtrlSetCursor($Volume, 5)
    $List1 = GUICtrlCreateList("Halllo Du Da !", 0, 0, 625, 149)
    $Checkbox2 = GUICtrlCreateCheckbox("Repeat All!", 104, 160, 73, 17)
    $Checkbox3 = GUICtrlCreateCheckbox("Repeat ", 200, 160, 57, 17)
    $Input1 = GUICtrlCreateInput("0", 280, 160, 17, 21)
    $Label1 = GUICtrlCreateLabel("ALabel1", 376, 152, 43, 17)
    $Label2 = GUICtrlCreateLabel("Times", 304, 160, 42, 20)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    If $pause = 1 Then
    SoundPlay($re) and $pause = 0

    EndIf
    Case $Pausebutton
    _SoundPause($re)
    Dim $Pause = 0
    Case $Button4
    $re = FileOpenDialog('','','Mp3-Files (*.mp3;*.wav)')
    SoundPlay($re);Funzt doch alles ?!
    Case $Button3
    ;kann man das irgentwie machen das er das nächste Lied im Ordner spielt ?

    SoundPlay($re)
    Case $Volume
    SoundSetWaveVolume(1)
    Case $Button5
    WinClose("Player")

    EndSwitch
    SoundSetWaveVolume(GUICtrlRead($Volume))
    WEnd

    [/autoit]


    òder so ?

    Spoiler anzeigen
    [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    SoundPlay($re)
    Case $Pausebutton
    If _soundpause ($pause = 1) Then
    SoundPlay($re) and $pause = 0
    if not _SoundPause then $pause = 1
    Dim $Pause = 0
    EndIf
    Case $Button4
    $re = FileOpenDialog('','','Mp3-Files (*.mp3;*.wav)')
    SoundPlay($re)
    Case $Button3
    ;kann man das irgentwie machen das er das nächste Lied im Ordner spielt ?

    SoundPlay($re)
    Case $Volume
    SoundSetWaveVolume(1)
    Case $Button5
    WinClose("Player")

    EndSwitch
    SoundSetWaveVolume(GUICtrlRead($Volume))
    WEnd

    [/autoit]


    ---------lenny--------

    Jaja, Moo does the Cow!

    3 Mal editiert, zuletzt von Lenny (11. August 2007 um 10:45)

    • Offizieller Beitrag

    Zum letzten mal:
    Du weißt überhaupt nicht, was du tust.
    Es ist wenig sinnvoll mit komplexen Skripten zu beginnen, wenn einem nicht mal der Ablauf klar ist.
    Nach einer gesetzten Pause [ _SoundPause() ] kann zum Fortsetzen von der letzten Position nur _SoundResume() genutzt werden. Steht alles in der Hilfe.
    Und du solltest dich doch erst mal mit den Programmstrukturen vertraut machen.
    z.B. "If.. Then.. (Else).. EndiIf"

    Spoiler anzeigen
    [autoit]

    Case $Pausebutton
    If $pause = 1 Then
    _SoundResume($re)
    $pause = 0
    Else
    _SoundPause($re)
    $pause = 1
    EndIf

    [/autoit]

    PS. Solange du nicht erstmal an deinen Grundkenntnissen arbeitest, war dies vorest meine letzte Hilfe.

  • Dein

    [autoit]

    Case $Pausebutton
    If $pause = 1 Then
    _SoundResume($re)
    $pause = 0
    Else
    _SoundPause($re)
    $pause = 1
    EndIf

    [/autoit]

    Funzt irgentwie nicht ! Naya ich glaube ich bin zu Blöd!
    Error:
    Varialbe used without being declared ...


    Spoiler anzeigen
    [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    SoundPlay($re)

    Case $Pausebutton
    If $pause = 1 Then
    _SoundResume($re)
    $pause = 0
    Else
    _SoundPause($re)
    $pause = 1
    EndIf
    Case $Button4
    $re = FileOpenDialog('','','Mp3-Files (*.mp3;*.wav)')

    Case $Button3


    SoundPlay($re)
    Case $Volume
    SoundSetWaveVolume(100)
    Case $Button5
    WinClose("Player")

    EndSwitch
    SoundSetWaveVolume(GUICtrlRead($Volume))
    WEnd

    [/autoit]


    Könnte mir den mal jemand einfache anfangs Aufgaben geben?

    Naya ich versuche mal wat!
    Edit: Also ich habe jetzt mit einem sehr simplen Prog angefangen:

    Ein Fenster, zwei Buttons, der eine heißt OPEN und der andere PLAY/PAUSE ich habe OPEN schon hinbekommen und PLAY auch und an PAUSE arbeite ich gerade !


    Danke für deine Hilfe !!!

    (und mutivation :]) XD

    Naya das müsse doch auch mit deinem "

    Spoiler anzeigen
    [autoit]

    Case $Pausebutton
    If $pause = 1 Then
    _SoundResume($re)
    $pause = 0
    Else
    _SoundPause($re)
    $pause = 1
    EndIf

    [/autoit]

    "
    gehen ... !


    Danke

    Jaja, Moo does the Cow!

    3 Mal editiert, zuletzt von Lenny (11. August 2007 um 12:41)

  • Wie alt bist du eigentlich? o_O Nur so aus reinem interesse. Es scheint als würdest du einfach nicht verstehn was Bugfix von dir will. Natürlich kannst du immer irgendwas hinschreiben und dann fragen "SO?" Aber nach dem 1000 mal wird das echt nervig.
    Wenn du eine Aufgabe haben willst dann klicke hier links auf AutoIT Tutorial und AutoIT Doku - die Links sind beide erstklassig zum erlenen von den AutoIT Grundfunktionen. Na klar könnte jeder von uns dir das Skript innerhalb von 5 min grade biegen aber dann wärs nicht mehr deins...


    MfG

    akira2012

    EDIT: Da du ja kein Englisch kannst. https://autoit.de/www.leo.org ist ein Online Wörterbuch zum üersetzen. Und "Variable used without beeing declared" heißt soviel wie das du eine Variable benutzt hast bevor du ihr einen Wert zugewiesen hast. (das war eine Gratisübersetzung alle weiteren kosten Kohle :P )

    MfG

    akira2012

    ***---____---Wer RechtSCHRAIBfehler findet der darf Sie behalLTEN!---___---***

    Einmal editiert, zuletzt von akira2012 (11. August 2007 um 13:20)

  • Hallo!
    Ich bin 13 Jahre alt gehe auf ein Gymnasium und doch ich verstehe was er mir sagen will ! XD


    Also ich bin ein 13 Jähriger gymnasiast der eine Frage hat:

    Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.2.4.9
    Author: myName

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

    Script Function:
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------

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

    ; Script Start - Add your code below here
    #NoTrayIcon
    #include <Date.au3>
    #include <GUIConstants.au3>
    #include <Sound.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Player", 636, 124, 197, 126, BitOR($WS_CAPTION,$WS_BORDER,$WS_CLIPSIBLINGS))
    $Button1 = GUICtrlCreateButton("RePlay", 368, 20, 65, 33, 0)
    $Pausebutton = GUICtrlCreateButton("&Pause", 432, 20, 65, 33, 0)
    $Button3 = GUICtrlCreateButton("&Next", 496, 20, 65, 33, 0)
    $Button4 = GUICtrlCreateButton("&Open", 560, 20, 65, 33, 0)
    $Button5 = GUICtrlCreateButton("EXIT", 24, 20, 41, 25, 0)
    $Volume = GUICtrlCreateSlider(0, 100, 640, 25)
    GUICtrlSetData(-1, 50)
    GUISetCursor (3)
    GUISetBkColor(0x000000)

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

    $Input1 = GUICtrlCreateInput("Notizen:", 88, 16, 249, 57)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1 ; Hier verstehe ich nicht warum "Keine Datei geöffnet" auch erscheint wenn man eine geöffnet hat Oo warscheinlich wieder einer
    Dim $re = 0 ;von meinen blöden fehlern^^
    IF $re = 1 Then
    SoundPlay($re)
    Else
    If $re = 0 Then
    MsgBox(64, "Error", "Keine Datei geöffnet!")
    EndIf
    EndIf

    Case $Pausebutton ;|
    Dim $Pause = 0 ;|
    If $pause = 1 Then ;|
    _SoundResume($re) ;|
    $pause = 0 ;| ; und das hier habe ich doch genau nach seiner Beschreibung gemacht ..! ?
    Else ;|
    _SoundPause($re) ;|
    $pause = 1 ;|
    EndIf ;|
    Case $Button4
    $re = FileOpenDialog('','','Mp3-Files (*.mp3;*.wav)', 1)
    If @error = 2 Then
    MsgBox(0, "Error", "The file does not exist")
    Exit
    ElseIf @error = 3 Then
    MsgBox(0, "Error", "The alias was invalid")
    Exit
    ElseIf @extended <> 0 Then
    $extended = @extended
    $errorstring = DllCall("winmm.dll","int","mciGetErrorStringA","str",$extended,"str","","int",65534,"hwnd",0)
    MsgBox(0, "Error", "The open failed." & @CRLF & "Error Number: " & $extended & @CRLF & "Error Description: " & $errorstring[2] & @CRLF & "Please Note: The sound may still play correctly.")
    Else
    MsgBox(0, "Success", "The file opened successfully")
    EndIf

    Case $Volume
    SoundSetWaveVolume(100)
    Case $Button5
    WinClose("Player")
    MsgBox(0,'',"The time is:" & _NowTime())
    EndSwitch
    SoundSetWaveVolume(GUICtrlRead($Volume))
    WEnd

    [/autoit]


    Vielen Dank im Vorraus!

    PS: ich habe mich jetzt 100 % mit den schleifen und 'if' dinger befasst!

    @über mir Google übersetzung ist besser ^^ aber danke ... hast du ein Konto wo ich das Geld überweisen kann für die nächsten übersetzungen ? :P :D XD

    Lenny

    Jaja, Moo does the Cow!

    Einmal editiert, zuletzt von Lenny (11. August 2007 um 16:47)

  • Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.2.4.9
    Author: myName

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

    Script Function:
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------

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

    ; Script Start - Add your code below here
    #NoTrayIcon
    #include <Date.au3>
    #include <GUIConstants.au3>
    #include <Sound.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Player", 636, 124, 197, 126, BitOR($WS_CAPTION,$WS_BORDER,$WS_CLIPSIBLINGS))
    $Button1 = GUICtrlCreateButton("RePlay", 368, 20, 65, 33, 0)
    $Pausebutton = GUICtrlCreateButton("&Pause", 432, 20, 65, 33, 0)
    $Button3 = GUICtrlCreateButton("&Next", 496, 20, 65, 33, 0)
    $Button4 = GUICtrlCreateButton("&Open", 560, 20, 65, 33, 0)
    $Button5 = GUICtrlCreateButton("EXIT", 24, 20, 41, 25, 0)
    $Volume = GUICtrlCreateSlider(0, 100, 640, 25)
    GUICtrlSetData(-1, 50)
    GUISetCursor (3)
    GUISetBkColor(0x000000)

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

    $Input1 = GUICtrlCreateInput("Notizen:", 88, 16, 249, 57)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1 ;
    Dim $re = 0 ; Das hier ist ein so blöder Fehler
    ;das man merkt das du einfach nicht weißt was du tust und NICHTS
    ;selber versucht hast. Ich übersetze mal für dich was du da stehen
    ;hast: $re=0 Wenn $re = 1 ist DANN _soundplay(1). Allein bis dahin ist
    ;es so ein blöder 'Fehler... Sry aber ich schließe mich Bugfix an. Les die
    ;Links durch die ich dir weiter oben genannt habe anpnsten hat es
    ;keinen Sinn und ich helfe auczh nicht weiter!
    IF $re = 1 Then
    SoundPlay($re)
    Else
    If $re = 0 Then
    MsgBox(64, "Error", "Keine Datei geöffnet!")
    EndIf
    EndIf

    Case $Pausebutton ;|
    Dim $Pause = 0 ;|
    If $pause = 1 Then ;|
    _SoundResume($re) ;|
    $pause = 0 ;| ; und das hier habe ich doch genau nach seiner Beschreibung gemacht ..! ?
    Else ;|
    _SoundPause($re) ;|
    $pause = 1 ;|
    EndIf ;|
    Case $Button4
    $re = FileOpenDialog('','','Mp3-Files (*.mp3;*.wav)', 1)
    If @error = 2 Then
    MsgBox(0, "Error", "The file does not exist")
    Exit
    ElseIf @error = 3 Then
    MsgBox(0, "Error", "The alias was invalid")
    Exit
    ElseIf @extended <> 0 Then
    $extended = @extended
    $errorstring = DllCall("winmm.dll","int","mciGetErrorStringA","str",$extended,"str","","int",65534,"hwnd",0)
    MsgBox(0, "Error", "The open failed." & @CRLF & "Error Number: " & $extended & @CRLF & "Error Description: " & $errorstring[2] & @CRLF & "Please Note: The sound may still play correctly.")
    Else
    MsgBox(0, "Success", "The file opened successfully")
    EndIf

    Case $Volume
    SoundSetWaveVolume(100)
    Case $Button5
    WinClose("Player")
    MsgBox(0,'',"The time is:" & _NowTime())
    EndSwitch
    SoundSetWaveVolume(GUICtrlRead($Volume))
    WEnd

    [/autoit]

    MfG

    akira2012

    ***---____---Wer RechtSCHRAIBfehler findet der darf Sie behalLTEN!---___---***

  • Hallo ihr!
    Ich präsentiere meinen fast fertigen Mediaplayer....Oo pls keine negativen kommentare!

    Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------

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

    AutoIt Version: 3.2.4.9
    Author: myName

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

    Script Function:
    Template AutoIt script.

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

    #ce ----------------------------------------------------------------------------

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

    ; Script Start - Add your code below here
    #include <sound.au3>
    #include <GUIConstants.au3>
    $antwort = MsgBox(0, "MediaPlayer", "Datei öffnen!")
    $file = FileOpenDialog('','','musik-dat (*.wav;*.mp3)', 1)
    _SoundOpen($file, "bla")
    _SoundPlay("bla")
    #Region ### START Koda GUI section ### Form=C:\Programme\Valve\dfdsf.kxf
    $Form1 = GUICreate("MediaPlayer", 633, 97, 193, 114, BitOR($WS_MINIMIZEBOX,$WS_CAPTION,$WS_GROUP,$WS_BORDER,$WS_CLIPSIBLINGS))
    GUISetCursor (3)
    GUISetBkColor(0xA6CAF0)
    $Button1 = GUICtrlCreateButton("Play", 26, 8, 81, 25, 0)
    GUICtrlSetFont(-1, 10, 400, 0, "comic sans ms")
    $Button2 = GUICtrlCreateButton("Before", 126, 8, 81, 25, 0)
    $Button3 = GUICtrlCreateButton("Next", 226, 8, 81, 25, 0)
    $Button4 = GUICtrlCreateButton("Pause", 326, 8, 81, 25, 0)
    $Button5 = GUICtrlCreateButton("Repeat", 426, 8, 81, 25, 0)
    $Button6 = GUICtrlCreateButton("Exit", 526, 8, 81, 25, 0)
    $Slider1 = GUICtrlCreateSlider(35, 64, 553, 25)
    GUICtrlSetData(-1, 50)
    GUICtrlSetCursor ($Slider1, 3)
    $Icon1 = GUICtrlCreateIcon("", 0, 8, 8, 49, 49, BitOR($SS_NOTIFY,$WS_GROUP))
    GUISetState(@SW_SHOW)
    GUICtrlSetCursor($Slider1, 3)
    #EndRegion ### END Koda GUI section ###
    $l = 0
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    _SoundResume("bla")
    Case $Button2
    Case $Button3
    _SoundClose("bla")
    $file = FileOpenDialog('','','musik-dat (*.wav;*mp3)', 1)
    _SoundOpen($file, "bla")
    _SoundPlay("bla", 0)
    Case $Button4
    _soundpause("bla")
    Case $Button5
    _SoundClose("bla")
    _SoundOpen($file, "bla")
    _SoundPlay("bla", 0)
    Case $Button6
    WinClose("MediaPlayer")
    Case $Slider1
    SoundSetWaveVolume(50)
    SoundSetWaveVolume(GUICtrlRead($Slider1))
    EndSwitch
    WEnd

    [/autoit]

    Nur das mit dem before bekomme ich nicht hin ! ^^ aber ich möchte keine Hilfe sondern selber schaffen!

    Wie ist er bis jetzt?? (wenn man bedenkt das ich ein total noob bin!)


    Vielen dank im Vorraus

    mfg Lenny :P

    Jaja, Moo does the Cow!

  • hi, vll könnt ihr mir helfen mein problem ist das die volumen reglung nicht funktioniert ich weiss nicht ob das an vista liegt oder ob sich ein fehler eingeschlichen hat könnt ihr euch mal vll bitte den code anguggen und mir sagen wenn ihr was gefunden habt danke.

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

    ; Script Start - Add your code below here
    #NoTrayIcon
    #include <Date.au3>
    #include <GUIConstants.au3>
    #include <Sound.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Player", 636, 124, 197, 126, BitOR($WS_CAPTION,$WS_BORDER,$WS_CLIPSIBLINGS))
    $Button1 = GUICtrlCreateButton("RePlay", 368, 20, 65, 33, 0)
    $Pausebutton = GUICtrlCreateButton("&Pause", 432, 20, 65, 33, 0)
    $Button3 = GUICtrlCreateButton("&Next", 496, 20, 65, 33, 0)
    $Button4 = GUICtrlCreateButton("&Open", 560, 20, 65, 33, 0)
    $Button5 = GUICtrlCreateButton("EXIT", 24, 20, 41, 25, 0)
    $Volume = GUICtrlCreateSlider(0, 100, 640, 25)
    GUICtrlSetData(-1, 50)
    GUISetCursor (3)
    GUISetBkColor(0x000000)
    $r = 0
    $l = 0
    $Input1 = GUICtrlCreateInput("Notizen:", 88, 16, 249, 57)
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1 = 1
    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = $GUI_EVENT_CLOSE
    Exit
    Case $nMsg = $Button1
    Dim $soundst = 0
    IF $soundst = 0 Then
    _SoundPlay($sound)
    Else
    If $soundst = 1 Then
    MsgBox(64, "Error", "Keine Datei geöffnet!")
    EndIf
    EndIf

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

    Case $nMsg = $Pausebutton
    If $r = 0 Then
    MsgBox(0,'',"Lied angehalten!")
    _SoundPause("bla")
    $r = 1
    Else
    MsgBox(0,'',"Lied wieder gestartet!")
    _SoundResume("bla")
    $r = 0
    EndIf

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

    Case $nMsg = $Button4
    $sound = FileOpenDialog('','','Mp3-Files (*.mp3;*.wav)', 1)
    If @error = 2 Then
    MsgBox(0, "Error", "The file does not exist")
    Exit
    ElseIf @error = 3 Then
    MsgBox(0, "Error", "The alias was invalid")
    Exit
    ElseIf @extended <> 0 Then
    $extended = @extended
    $errorstring = DllCall("winmm.dll","int","mciGetErrorStringA","str",$extended,"str","","int",65534,"hwnd",0)
    MsgBox(0, "Error", "The open failed." & @CRLF & "Error Number: " & $extended & @CRLF & "Error Description: " & $errorstring[2] & @CRLF & "Please Note: The sound may still play correctly.")
    Else
    MsgBox(0,'',"Datei erfolgreich geöffnet!")
    EndIf

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

    if $l = 1 Then
    _SoundClose("bla")
    $l = 0
    EndIf
    if $l = 0 Then
    _SoundOpen($sound, "bla")
    _SoundPlay("bla", 0)
    $l = 1
    EndIf

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

    Case $nMsg = $Volume
    $vol = GUICtrlRead($Volume)
    SoundSetWaveVolume($vol)
    Case $nMsg = $Button5
    WinClose("Player")
    MsgBox(0,'',"The time is:" & _NowTime())

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

    EndSelect
    WEnd

    [/autoit]
  • Halllo Black Psycho!
    Bei mir funktioniert er einwand frei!
    Und auf einem anderen Vista rechner auch!

    Jetzt habe ich mal wieder eine Frage!°-°


    Kann man es irgentwie hinbekommen das irgentwo der Titel und interprät vom lied beim mp3-player steht?

    Vielen Dank im Vorraus!

    Jaja, Moo does the Cow!

  • hi Warkenny,
    den namen der datei kannst du mit diesem befehl anzeigen lassen.

    [autoit]

    _PathSplit

    [/autoit]


    gugg einfach in der hilfe nach dem befehl
    mfg Psycho

  • @All guggt euch plz ma das script an versuch schon 2 std die lautstärkereglung zum laufen zu bringen, und bin schon 20 mal die englische hilfe durch gegangen danke. Ps: gibt es bei AutoIt sowas sie doppel buffering?

    Spoiler anzeigen
    [autoit]


    ; Script Start - Add your code below here
    #NoTrayIcon
    #include <File.au3>
    #include <Date.au3>
    #include <GUIConstants.au3>
    #include <Sound.au3>
    #Region ### START Koda GUI section ### Form=
    Dim $szDrive, $szDir, $szFName, $szExt, $soundlength
    $none = "None"
    $Form1 = GUICreate("Player", 636, 124, 197, 126, BitOR($WS_CAPTION, $WS_BORDER, $WS_CLIPSIBLINGS))
    $Pausebutton = GUICtrlCreateButton("&Pause/Play", 432, 20, 65, 33, 0)
    $Button4 = GUICtrlCreateButton("&Open", 560, 20, 65, 33, 0)
    $Button5 = GUICtrlCreateButton("EXIT", 24, 20, 41, 25, 0)
    $Volume = GUICtrlCreateSlider(0, 100, 640, 25)
    $labelname = GUICtrlCreateLabel("Title: " & $none, 88, 16, 200, 30)
    $labelext = GUICtrlCreateLabel("Extension: " & $none, 300, 41, 100, 20)
    $labellenght = GUICtrlCreateLabel("Playtime: " & $none, 88, 68, 249, 20)
    $labelstat = GUICtrlCreateLabel("Status: stopped", 300, 16, 100, 20)
    GUICtrlSetData($Volume, 50)
    GUICtrlSetColor($labelname, 0xFFFFFF)
    GUICtrlSetColor($labelext, 0xFFFFFF)
    GUICtrlSetColor($labellenght, 0xFFFFFF)
    GUICtrlSetFont($labelstat, 10)
    GUICtrlSetColor($labelstat, 0xFFFFFF)
    GUICtrlSetFont($labelname, 10)
    GUICtrlSetFont($labelext, 10)
    GUISetCursor(3)
    GUISetBkColor(0x000000)
    GUICtrlSetLimit($Volume, 100, 0)
    $r = 0
    $l = 0
    GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    $stat = 0
    While 1 = 1
    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = $GUI_EVENT_CLOSE
    Exit
    Case $nMsg = $Pausebutton
    If $r = 0 Then
    MsgBox(0, '', "Lied angehalten!")
    _SoundPause("bla")
    $r = 1

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

    Else
    MsgBox(0, '', "Lied wieder gestartet!")
    _SoundResume("bla")
    $r = 0
    EndIf
    Case $nMsg = $Button4
    $sound = FileOpenDialog('', '', 'Mp3-Files (*.mp3;*.wav)', 1)
    If @error = 2 Then
    MsgBox(0, "Error", "The file does not exist")
    Exit
    ElseIf @error = 3 Then
    MsgBox(0, "Error", "The alias was invalid")
    Exit
    ElseIf @error = 1 Then
    MsgBox(0, "Error", "No File chosen")
    _SoundClose("bla")
    GUICtrlSetData($labelname, "Title: " & $none)
    GUICtrlSetData($labelext, "Extension: " & $none)
    GUICtrlSetData($labellenght, "Playtime: " & $none)
    GUICtrlSetData($labelstat, "Status: stopped")
    $l = 0
    Else
    MsgBox(0, '', "Datei erfolgreich geöffnet!")
    _PathSplit($sound, $szDrive, $szDir, $szFName, $szExt)
    GUICtrlSetData($labelname, "Title: " & $szFName)
    GUICtrlSetData($labelext, "Extension: " & $szExt)
    If $l = 1 Then
    _SoundClose("bla")
    $l = 0
    EndIf
    If $l = 0 Then
    _SoundOpen($sound, "bla")
    _SoundPlay("bla", 0)
    $l = 1
    EndIf
    EndIf
    Case $nMsg = $Volume
    SoundSetWaveVolume(GUICtrlRead($Volume))
    Case $nMsg = $Button5
    WinClose("Player")
    MsgBox(0, '', "The time is:" & _NowTime())

    EndSelect
    If $l = 1 Then
    $soundpos = _SoundPos("bla")
    $soundlength = _SoundLength("bla")
    $sp = _SoundPos("bla", 2) ; nicht wundern ich hab versucht ein Replay knopf einzubauen was aber gescheitert ist :D
    $sl = _SoundLength("bla", 2); wie oben gesagt
    GUICtrlSetData($labellenght, "Playtime: " & $soundpos & " / " & $soundlength)
    $stat = _SoundStatus("bla")
    GUICtrlSetData($labelstat, "Status: " & $stat)
    EndIf
    WEnd

    [/autoit]

    2 Mal editiert, zuletzt von BlackPsycho (20. August 2007 um 21:26)