BrettF Posted January 22, 2007 Share Posted January 22, 2007 It wont play when i press the play button.... How can i make it seek?? expandcollapse popup#include <GUIConstants.au3> #include <Xskin.au3> #include <Sound.au3> #include <GUIList.au3> #include <file.au3> Global $hFile, $Sound Dim $aRecords $Skin_Folder = @ScriptDir & "\Blue-Gray" $Form1 = XskinGUICreate("AForm1", 536, 520,$Skin_Folder) $Group1 = GUICtrlCreateGroup("Currently Playing: ", 32, 48, 465, 73) $Label1 = GUICtrlCreateLabel("Time", 48, 72, 43, 17) $Label2 = GUICtrlCreateLabel("Song", 48, 96, 400, 17) $Group2 = GUICtrlCreateGroup("Controls: ", 32, 128, 465, 161) $Slider1 = GUICtrlCreateSlider(40, 144, 446, 45, BitOR($TBS_BOTH,$TBS_NOTICKS,$TBS_Left)) GUICtrlSetLimit ($Slider1, 100, 1) $Button1 = GUICtrlCreateButton("Play", 168, 200, 75, 25, 0) $Slider2 = GUICtrlCreateSlider(40, 192, 30, 93,$TBS_VERT) GUICtrlSetLimit ($Slider2, 100,0) $Button2 = GUICtrlCreateButton("Previous", 168, 232, 75, 25, 0) $Button3 = GUICtrlCreateButton("Next", 248, 232, 75, 25, 0) $Button4 = GUICtrlCreateButton("Stop", 248, 200, 75, 25, 0) $Group3 = GUICtrlCreateGroup("Playlist", 32, 296, 465, 177) $Button5 = GUICtrlCreateButton("Add File", 440, 320, 49, 25, 0) $List1 = GUICtrlCreateList("", 40, 312, 393, 149) $Button6 = GUICtrlCreateButton("Close", 440, 432, 49, 25, 0) GUISetState(@SW_SHOW) $file = FileOpen (@ScriptDir & "playlist.txt", 1) If Not _FileReadToArray(@ScriptDir & "playlist.txt",$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf For $x = 1 to $aRecords[0] _GUICtrlListAddItem ($List1, $aRecords[$x]) Next While 1 $Msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE OR $msg = $Button6 Then Exit ElseIf $msg = $Label1 Then ElseIf $msg = $Label2 Then ElseIf $msg = $Slider1 Then ElseIf $msg = $Button1 Then $play = GUICtrlRead ($List1) GUICtrlSetData ($Label1, _SoundLength ($play)) $Sound = _SoundOpen($play) _SoundPlay($play) AdlibEnable ( "Adlibfunc") ElseIf $msg = $Slider2 Then ElseIf $msg = $Button2 Then ElseIf $msg = $Button3 Then ElseIf $msg = $Button4 Then _SoundStop ($Sound) ElseIf $msg = $Button5 Then $hFile = FileOpenDialog ("Open", "", "MP3 Files (*.MP3)") FileWriteLine ($file, $hfile) _GUICtrlListAddItem ($List1, $hfile) FileClose ($file) ElseIf $msg = $List1 Then EndIf WEnd Func AdLibFunc () Local $Pos = Int((_SoundPos($Sound, 2) / _SoundLength($Sound, 2)) * 100) $volume = 100 - GUICtrlRead($slider2) SoundSetWaveVolume ($volume) GUICtrlSetData($Label1, _SoundPos($Sound)) GUICtrlSetData ($Slider1, $Pos) EndFunc Its starting to drive me insane..... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Danny35d Posted January 22, 2007 Share Posted January 22, 2007 ElseIf $msg = $Button1 Then $play = _GUICtrlListGetSelItemsText ($List1) If IsArray($play) Then GUICtrlSetData ($Label1, _SoundLength ($play[$play[0]])) $Sound = _SoundOpen($play[$play[0]]) _SoundPlay($Sound) AdlibEnable ( "Adlibfunc") EndIf AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
BrettF Posted January 22, 2007 Author Share Posted January 22, 2007 Thankyou. I didnt realise it was an array... Do you have any idea on how to make it seek. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
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