Darksider3

Musik

Aug 7th, 2010
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.49 KB | None | 0 0
  1. #include <GUIConstants.au3>
  2. #include <Sound.au3>
  3. #include <WindowsConstants.au3>
  4. #NoTrayIcon
  5.  
  6.  
  7. Global $File
  8. $Form1_1 = GUICreate("Musik Player v0.1 BETA", 257, 309, 224, 193)
  9. $Label1 = GUICtrlCreateLabel("Datei Öffnen:", 16, 16, 67, 17)
  10. $Button1 = GUICtrlCreateButton("...", 88, 16, 33, 17, 0)
  11. $Button2 = GUICtrlCreateButton("Abspielen", 8, 200, 105, 41, 0)
  12. $Button3 = GUICtrlCreateButton("Pausieren", 112, 200, 105, 41, 0)
  13. $Button4 = GUICtrlCreateButton("Beenden", 112, 240, 105, 41, 0)
  14. $Button5 = GUICtrlCreateButton("Fortsetzen", 8, 240, 105, 41, 0)
  15. $Checkbox1 = GUICtrlCreateCheckbox("Widerholen", 16, 72, 97, 17)
  16. $Slider1 = GUICtrlCreateSlider(16, 120, 113, 41)
  17. GUISetState(@SW_SHOW)
  18.  
  19.  
  20. While 1
  21.     $nMsg = GUIGetMsg()
  22.     Switch $nMsg
  23.        
  24.     Case $GUI_EVENT_CLOSE
  25.             Exit
  26.     Case $Button1
  27.         $File = FileOpenDialog( "Musik Datei Wählen", @ScriptDir & "\", "Musik (*.mp3;*.mp4;*.avi*)", 1 + 2)
  28.         if $File = True Then
  29.             $M1 = MsgBox(0x1, "OK", "Du kannst nun das Lied Abspielen !")
  30.         Else
  31.             $M2 = MsgBox( 0x1, "Error", @error &"Sry du hast irgendetwas falsch gemacht")
  32.         Endif
  33.        
  34.     Case $Button2
  35.         _SoundOpen( $File )
  36.         _SoundPlay( $File )
  37.  
  38.     Case $Button3
  39.         _SoundPause ( $File )
  40.  
  41.     Case $Button4
  42.         Exit
  43.  
  44.     Case $Button5
  45.         _SoundResume( $File )
  46.    
  47.     Case $Checkbox1
  48.         If $Checkbox1 = 1 Then
  49.             While 1
  50.                 Sleep( 2000 )
  51.                 _SoundOpen( $File )
  52.                 _SoundPlay( $File )
  53.                 _SoundClose( $File )
  54.             WEnd
  55.         EndIf
  56.     Case $Slider1
  57.         SoundSetWaveVolume( $Slider1 )
  58.        
  59.     EndSwitch
  60. WEnd
Add Comment
Please, Sign In to add comment