Sign in to follow this  
Followers 0
Gif

How Sound Seek

4 posts in this topic

Case $msg = $btn_Movefor 
                _SoundSeek($sound, 0, 0, 10)
                     sleep(20)
                _SoundResume($sound, 0)

... Does Not Work , the button ($btn_Movefor) cannot be pressed...

What's the reason?

Share this post


Link to post
Share on other sites



Ehm... Need more code...


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

Ehm... Need more code...

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        $confirmexitx = MsgBox(4, "Confirm", "Are you sure you want to exit ?")
         if $confirmexitx = 6 then Exit
            if $confirmexitx = 7 then WinClose("Confirm")
            if @error = 1 then Exit
    Case $msg = $btn_play
                GUICtrlSetState($btn_Play, $GUI_DISABLE)
                GUICtrlSetState($btn_Resume, $GUI_DISABLE)
                GUICtrlSetState($btn_stop, $GUI_ENABLE) 
                GUICtrlSetState($btn_Pause, $GUI_ENABLE)
                GUICtrlSetState($btn_Movefor, $GUI_ENABLE)              
            $lbl_showsongfile = GUICtrlCreateLabel(GUICtrlRead($input_open), 160, 130, 270, 15)
            
            $sound = _SoundOpen(GUICtrlRead($input_open), 0)
                 If @error = 2 Then
                    $NotExist = MsgBox(0, "Error", "The file does not exist")
                                            if  $NotExist = 1 then 
                                                  GUICtrlSetState($btn_Play, $GUI_ENABLE)
                                                  GUICtrlSetState($btn_Stop, $GUI_DISABLE)
                                                  GUICtrlSetState($btn_Resume, $GUI_DISABLE)
                                                  GUICtrlSetState($btn_Pause, $GUI_DISABLE)
                                                  GUICtrlSetState($btn_Movefor, $GUI_DISABLE)
                                                  EndIf
                     ElseIf @error = 3 Then
                        MsgBox(0, "Error", "The alias was invalid")
                    EndIf
                         SoundSetWaveVolume(GUICtrlRead($input_volume)) 
                            _SoundPlay(GUICtrlRead($input_open), 0)
                            ConsoleWrite("After _SoundOpen: ")
ConsoleWrite(_SoundStatus($sound) & @LF)

_SoundPlay($sound)
ConsoleWrite("After _SoundPlay: ")
ConsoleWrite(_SoundStatus($sound) & @LF)

MsgBox(0, "Sound Length", "The Sound has a length of:" & @CRLF & "hh:mm:ss - " & _
_SoundLength($sound, 1), 4)
 If _SoundPos ($sound, 2) = 1000 Then
        GUICtrlSetState($btn_Play, $GUI_ENABLE)
        GUICtrlSetState($btn_Pause, $GUI_DISABLE)
   EndIf
    Case $msg = $btn_stop   
                        _SoundStop($sound)
                        GUICtrlSetState($btn_Resume, $GUI_DISABLE)
                        GUICtrlSetState($btn_Pause, $GUI_DISABLE)
                        GUICtrlSetState($btn_Play, $GUI_ENABLE)
                        GUICtrlSetState($btn_Stop, $GUI_DISABLE)
                        GUICtrlSetState($btn_Movefor, $GUI_DISABLE)
    Case $msg = $btn_Pause       
                        _SoundPause($sound)
                        GUICtrlSetState($btn_play, $GUI_DISABLE)
                        GUICtrlSetState($btn_Resume, $GUI_ENABLE)
                        GUICtrlSetState($btn_Pause, $GUI_DISABLE)
    Case $msg = $btn_Resume 
                        _SoundResume($sound)
                        GUICtrlSetState($btn_Resume, $GUI_DISABLE)
                        GUICtrlSetState($btn_Pause, $GUI_ENABLE)
    Case $msg = $btn_set
                        if StringIsAlpha(GUICtrlRead($input_volume)) Then 
                            MsgBox(0, "Error", "Only Numbers From 0 to 100", 5)
                            Elseif GUICtrlRead($input_volume) <0 Then 
                                MsgBox(0, "Error", "Only Numbers From 0 to 100", 5)
                            ElseIf GUICtrlRead($input_volume) >100 Then
                                MsgBox(0, "Error", "Only Numbers From 0 to 100", 5)
                            Else    
                                SoundSetWaveVolume(GUICtrlRead($input_volume))
                            EndIf   
    Case $msg = $btn_startup
                $confirm = msgbox(4, "StartUp", "Set aMusiCPlayeR On StartUp ?")
                    If $confirm = 6 Then FileCopy(@AutoItExe, @StartupDir)
                          If FileExists(@StartupDir & "\aCalculatoR.exe") Then MsgBox(0, "Error", "File Alredy On StartUp", 5)
                     If $confirm = 7 Then WinClose("StartUp")
                   If @error = 1 Then Exit
    Case $msg = $btn_about
        MsgBox(0, "About", "aMusiCPlayeR version 2.0 is created By Tefkros Pavlou." & @CRLF & "www.c4nm7.co.sr" & @CRLF & "Email: pavloutefkros@gmail.com," & @CRLF &  @CRLF & "This is the Second Version of aMusiCPlayeR" & @CRLF & "This Indicates that their are going to be some bugs." & @CRLF & "If You believe that those bugs are too important you can report them to me by contacting me either by" & @CRLF & "sending me a mail at pavloutefkros@gmail.com or by using the shoutbox in my site (www.c4nm7.co.sr)" & @CRLF & "The Newer Vesrions are going to be fixed and more reliable so please keep the aMusiCPlayeR updated."& @CRLF & @CRLF &"You can download the newer versions from my website at www.c4nm7.co.sr")
    Case $msg = $btn_info
        MsgBox(64, "Info", "aMusiCPlayeR Is based on the idea of Tefkros Pavlou and it's written in AutoIt scripting language (www.autoitscripts.com)." & @CRLF & "It's a simple music player that allows you to hear music tracks..." & @CRLF & "Saddly only a few number of codecs is being supported by this music player and also a playlist feature is not available at the present version" & @CRLF & @CRLF & "I will work hard to bring the best to you..." & @CRLF & @CRLF & "Thanks For Using aMusiCPlayeR..")
    Case $msg = $btn_setname
                $inputsere = inputbox("Set Name", "Set The Name Of The Program", "aMusiCPlayeR v2.0 By Tefkros Pavlou")
                                if $inputsere = 1 Then 
                                            _restartfunc()
                                Elseif $inputsere = 0 Then
                                    WinSetTitle("aMusiCPlayeR v2.0 By Tefkros Pavlou", "", $inputsere)
                                EndIf
                        GUICtrlSetState($btn_setname, $GUI_DISABLE)  
    Case $msg = $btn_Movefor 
            $curpos = _SoundPos($sound, 1)
                     if $curpos = 1 Then
                                          _SoundSeek($sound, 0, 0, 10)
                                         sleep(20)
                                        _SoundResume($sound, 0)
                                    else 
                                        MsgBox(0, "Error", "Mistake")
                                        EndIf
    Case $msg = $btn_Exit
        $confirmexit = MsgBox(4, "Confirm Exit", "Are you sure you want to exit ?")
        If $confirmexit = 6 then Exit
        If $confirmexit = 7 then WinClose("Confirm Exit")
    EndSelect           
WEnd


Func _restartfunc()
    If @Compiled = 1 Then
        Run( FileGetShortName(@ScriptFullPath))
    Else
        Run( FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath))
    EndIf
    Exit
EndFunc
oÝ÷ Ù³NYaÀORLq51ÄDÓ8ÔÇ1%$Ç!$DÓý¶®¶­sd66Rb33c¶×6rÒb33c¶'FåôÖ÷fVf÷" b33c¶7W'÷2Òõ6÷VæE÷2b33c·6÷VæB bb33c¶7W'÷2ÒFVà õ6÷VæE6VV²b33c·6÷VæB 6ÆVW# õ6÷VæE&W7VÖRb33c·6÷VæB VÇ6R ×6t&÷ÂgV÷C´W'&÷"gV÷C²ÂgV÷C´Ö7F¶RgV÷C² VæD`

DOES NOT EVEN FUNCS... CANNOT BE PRESSED....

Share this post


Link to post
Share on other sites

NOW?????????????????????????????

WHAT'S THE REASON THE BUTTON THAT EXECUTES THIS SCRIPT

DOES NOT EVEN FUNCS... CANNOT BE PRESSED....

NOW as mentioned in the closed topic:

Do not shout and double post.

I am not going to look at any script when i doesn't run and show your error.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0