Jump to content

Recommended Posts

Posted

the red X close gui button only works sometimes...

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Posted

this is one way to fix the stop

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
Dim $stopped = False
$Form1 = GUICreate("Guitar Tabber", 578, 137, 193, 115)
GUISetOnEvent($GUI_EVENT_CLOSE, "quit")
$tabedit = GUICtrlCreateEdit("", 8, 8, 563, 89, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN))
GUICtrlSetData(-1, StringFormat("|--4-2-0-2-4-4-4--2-2-2|4-4-4--4-2-0-2-4-4-4--|4-2-2-4-2-0-------------|---------------------------|---------------------------|" & @CRLF & "|---------------------------|---------------------------|---------------------------|---------------------------|---------------------------|" & @CRLF & "|---------------------------|---------------------------|---------------------------|---------------------------|---------------------------|" & @CRLF & "|---------------------------|---------------------------|---------------------------|---------------------------|---------------------------|" & @CRLF & "|---------------------------|---------------------------|---------------------------|---------------------------|---------------------------|" & @CRLF & "|---------------------------|---------------------------|---------------------------|---------------------------|---------------------------|"))
GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman")
$Play = GUICtrlCreateButton("Play", 8, 104, 75, 25, 0)
GUICtrlSetOnEvent(-1, "play")
$Stop = GUICtrlCreateButton("Stop", 88, 104, 75, 25, 0)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetOnEvent(-1, "stop")
$Rate = GUICtrlCreateInput("200", 176, 104, 41, 21)
GUICtrlCreateUpdown(-1)
$Ratelabel = GUICtrlCreateLabel("Rate", 224, 107, 27, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    Sleep(10)
    If $stopped = True Then
        $tabs = StringSplit(GUICtrlRead($tabedit), @CRLF)
        ConsoleWrite(StringLen($tabs[1]))
        For $step = 1 To StringLen($tabs[1])
            For $i = 0 To 5
                If $stopped = False Then ExitLoop
                If StringIsInt(StringMid($tabs[$i], $step, 1)) Then SoundPlay(@ScriptDir & "\sounds\" & $i & "-" & StringMid($tabs[$i], $step, 1) & ".wav", 0)
            Next
            If $stopped = False Then ExitLoop
            Sleep(GUICtrlRead($Rate))
        Next
        $stopped = False
        GUICtrlSetState($Stop, $GUI_DISABLE)
        GUICtrlSetState($Play, $GUI_ENABLE)
    EndIf
WEnd

Func play()
    $stopped = True
    GUICtrlSetState($Play, $GUI_DISABLE)
    GUICtrlSetState($Stop, $GUI_ENABLE)
EndFunc   ;==>play

Func stop()
    $stopped = False
    GUICtrlSetState($Stop, $GUI_DISABLE)
    GUICtrlSetState($Play, $GUI_ENABLE)    
EndFunc   ;==>stop

Func quit()
    Exit
EndFunc   ;==>quit

8)

NEWHeader1.png

Posted

why the string format?

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

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
×
×
  • Create New...