Einfacher Audio-Recorder

  • [U]<Die Programmierung mit MCI-Befehlen>[/U]

    Diese Programm dient dazu Audio-Signale von der Soundkarte im "WAVE-Format" aufzuzeichnen.

    Hinweis:
    Bei Betätigung von "Stop" muss solange gewartet werden bis nicht mehr "Status: Recording... " sondern "Status: Bereit" dasteht.

    Nun das Script:

    -> Dieses ist im Anhang zu finden!

    Nun die Frage:

    Kennt jemand einen Befehl (Vieleicht MCI-Befehl) um mit AutoIT
    Avi-Videos aufzuzeichnen(Screen-Capture)?

  • Danke für das Kompliment.

    Als nächstes gedenke ich einen kleinen Audio-Player zu realisieren.

    Ich dachte da an die Verwendung der fmod.dll.

    Frage:
    Hat jemand Erfahrung mit der Verwendung der fmod.dll und ist diese überhaupt in AutoIT anwendbar?

  • Guck mal hier rein:

    Spoiler anzeigen
    [autoit]


    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.1.0
    ; Author: theSaint <[email='thsaint@ihug.com.au'][/email]>
    ;
    ; Script Function:
    ; Template AutoIt script.
    ;
    ; ----------------------------------------------------------------------------

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

    ; Script Start - Add your code below here

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

    #region --- GuiBuilder code Start ---
    ; Script generated by AutoBuilder 0.5 Prototype

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

    #include <GuiConstants.au3>
    #include <string.au3>

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

    If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

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

    Dim $Button_E, $Button_M, $Button_nx, $Button_P, $Button_pa, $Button_pr, $Button_R, $Button_S
    Dim $Button_x, $Group_1, $Group_2, $Group_3, $Input_ar, $Input_co, $Input_id, $Input_n, $Input_s
    Dim $Input_t1, $Input_t2, $Input_t3, $Input_t4, $Input_tn, $Input_tr, $Input_tt, $Input_yr
    Dim $Label_1, $Label_2, $Label_3, $Label_a, $Label_ar, $Label_au, $Label_b, $Label_c, $Label_co
    Dim $Label_d, $Label_tn, $Label_tt, $Label_yr, $Radio_1, $Radio_2, $Radio_3
    ;
    Dim $Cdplay, $Dialog
    Dim $art, $cdid, $cdini, $cdlen, $dcon, $dlbl, $dll, $drives, $drv, $frs, $i, $inifile, $len, $mgNum
    Dim $mins, $posi, $ready, $res, $result, $secs, $time, $tit, $tot, $trak, $trk, $use, $val, $width, $yr

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

    $inifile = @ScriptDir & "\Settings.ini"
    $cdini = @WindowsDir & "\Cdplayer.ini"

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

    $Dialog = $WS_OVERLAPPED + $WS_CAPTION + $WS_SYSMENU + $WS_VISIBLE + $WS_CLIPSIBLINGS
    $width = 390

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

    $Cdplay = GuiCreate("Simple CDPlayer v1.2", $width, 440, _
    (@DesktopWidth-$width)/2, (@DesktopHeight-440)/2 , $Dialog + $WS_MINIMIZEBOX)

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

    $Label_1 = GuiCtrlCreateLabel("Current Track", 20, 22, 70, 20)
    $Input_n = GuiCtrlCreateInput("", 95, 20, 20, 20)
    $Label_2 = GuiCtrlCreateLabel("/", 122, 23, 10, 20)
    $Input_tr = GuiCtrlCreateInput("", 135, 20, 20, 20)
    $Label_3 = GuiCtrlCreateLabel("Status", 175, 22, 40, 20)
    $Input_s = GuiCtrlCreateInput("", 215, 20, 55, 20)
    ;
    $Button_P = GuiCtrlCreateButton("PLAY", 20, 60, 70, 70)
    GUICtrlSetFont($Button_P, 9, 600)
    $Button_pa = GuiCtrlCreateButton("Pause", 20, 140, 70, 30)
    $Button_S = GuiCtrlCreateButton("Stop", 20, 180, 70, 40)
    ;
    $Button_pr = GuiCtrlCreateButton("|<", 110, 60, 30, 30)
    $Button_nx = GuiCtrlCreateButton(">|", 150, 60, 30, 30)
    ;
    $Button_R = GuiCtrlCreateButton("Restart", 110, 100, 70, 30)
    $Button_M = GuiCtrlCreateButton("Mute", 110, 140, 70, 30)
    $Button_x = GuiCtrlCreateButton("EXIT", 110, 180, 70, 40)
    ;
    $Button_E = GuiCtrlCreateButton("Open", 200, 60, 70, 40)
    ;
    $Group_1 = GUICtrlCreateGroup("Time", 290, 15, 80, 205)
    $Label_a = GuiCtrlCreateLabel("Played", 300, 35, 35, 20)
    $Input_t1 = GuiCtrlCreateInput("", 300, 50, 60, 20)
    $Label_b = GuiCtrlCreateLabel("Track Start", 300, 80, 60, 20)
    $Input_t2 = GuiCtrlCreateInput("", 300, 95, 60, 20)
    $Label_c = GuiCtrlCreateLabel("Duration", 300, 125, 50, 20)
    $Input_t3 = GuiCtrlCreateInput("", 300, 140, 60, 20)
    $Label_d = GuiCtrlCreateLabel("Total CD", 300, 170, 60, 20)
    $Input_t4 = GuiCtrlCreateInput("", 300, 185, 60, 20)
    ;
    $Group_1 = GUICtrlCreateGroup("CDPlayer.ini - ID && Entries", 20, 235, 350, 160)
    $Input_id = GuiCtrlCreateInput("", 200, 232, 70, 20, $ES_READONLY + $ES_CENTER)
    ;;;;;
    $Label_ar = GuiCtrlCreateLabel("Artist", 40, 267, 38, 20, $SS_RIGHT)
    GUICtrlSetFont($Label_ar, 9, 600)
    $Input_ar = GuiCtrlCreateInput("", 85, 265, 265, 20)
    $Label_tt = GuiCtrlCreateLabel("Title", 40, 297, 38, 20, $SS_RIGHT)
    GUICtrlSetFont($Label_tt, 9, 600)
    $Input_tt = GuiCtrlCreateInput("", 85, 295, 265, 20)
    $Label_tn = GuiCtrlCreateLabel("Track", 40, 327, 38, 20, $SS_RIGHT)
    GUICtrlSetFont($Label_tn, 9, 600)
    $Input_tn = GuiCtrlCreateInput("", 85, 325, 265, 20)
    $Label_yr = GuiCtrlCreateLabel("Year", 40, 357, 38, 20, $SS_RIGHT)
    GUICtrlSetFont($Label_yr, 9, 600)
    $Input_yr = GuiCtrlCreateInput("", 85, 355, 40, 20)
    ;$Label_pw = GuiCtrlCreateLabel("Please Wait!", 142, 359, 80, 20, $ES_CENTER)
    ;GUICtrlSetFont($Label_pw, 8, 600)
    ;GUICtrlSetColor($Label_pw, 0xF00000)
    $Label_co = GuiCtrlCreateLabel("Type", 224, 357, 38, 20, $SS_RIGHT)
    GUICtrlSetFont($Label_co, 9, 600)
    $Input_co = GuiCtrlCreateInput("", 270, 355, 80, 20, $ES_CENTER)
    ;
    $Group_3 = GUICtrlCreateGroup("Drives", 200, 115, 70, 100)
    $drives = DriveGetDrive("CDROM")
    If $drives[0] > 0 Then
    $drv = StringUpper($drives[1])
    $Radio_1 = GuiCtrlCreateRadio($drv, 223, 135, 30, 20)
    IniWrite($inifile, "Drives", "1", $drv)
    $use = IniRead($inifile, "Drive", "use", "")
    If $use = "" Then
    $use = $drv
    IniWrite($inifile, "Drive", "use", $use)
    IniWrite($inifile, "Drive", "num", "1")
    EndIf
    EndIf
    If $drives[0] > 1 Then
    $drv = StringUpper($drives[2])
    $Radio_2 = GuiCtrlCreateRadio($drv, 223, 160, 30, 20)
    IniWrite($inifile, "Drives", "2", $drv)
    EndIf
    If $drives[0] > 2 Then
    $drv = StringUpper($drives[3])
    $Radio_3 = GuiCtrlCreateRadio($drv, 223, 185, 30, 20)
    IniWrite($inifile, "Drives", "3", $drv)
    EndIf
    ;
    $Label_au = GuiCtrlCreateLabel("© theSaint (April 2006)", _
    $width / 2 - (140 / 2), 410, 140, 17, $SS_SUNKEN + $SS_CENTER + $SS_NOPREFIX)
    GUICtrlSetColor($Label_au, 0xffffff) ; White
    GUICtrlSetBkColor($Label_au, 0x000000) ; Black

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

    ; SETTINGS
    GUICtrlSetState($Button_P, $GUI_DISABLE)
    GUICtrlSetState($Button_pa, $GUI_DISABLE)
    GUICtrlSetState($Button_S, $GUI_DISABLE)
    GUICtrlSetState($Button_pr, $GUI_DISABLE)
    GUICtrlSetState($Button_nx, $GUI_DISABLE)
    GUICtrlSetState($Button_R, $GUI_DISABLE)
    GUICtrlSetState($Button_M, $GUI_DISABLE)
    ;
    $drv = IniRead($inifile, "Drive", "num", "")
    If $drv = "1" Then
    GUICtrlSetState($Radio_1, $GUI_CHECKED)
    ElseIf $drv = "2" Then
    GUICtrlSetState($Radio_2, $GUI_CHECKED)
    ElseIf $drv = "3" Then
    GUICtrlSetState($Radio_3, $GUI_CHECKED)
    EndIf
    ;
    $dll = DllOpen("winmm.dll")
    If $dll <> 0 Then MsgBox(0, "DLL OPEN - RESULT", $dll)
    ;
    $res = DllCall($dll, "int", "mciSendString", "str", "open " & "!" & $use & " type cdaudio wait shareable", "str", "", "int", 0, "long", 0)
    If @error <> 0 Then MsgBox(0, "DLL CALL - OPEN CD RESULT", @error)
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio media present wait", "str", "", "int", 0, "long", 0)
    ;
    ;$res = DllCall($dll, "int", "mciSendString", "str", "set cdaudio time format milliseconds", "str", "True", "int", 255, "long", 0)
    $res = DllCall($dll, "int", "mciSendString", "str", "set cdaudio time format tmsf", "str", "", "int", 255, "long", 0)
    ;
    $ready = DriveStatus($use & "\")
    If $ready = "READY" Then
    SplashTextOn("", @CRLF & @CRLF & "Please Wait!", 150, 100, -1, -1, 1)
    ;
    GetCDDetails()
    ;
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio mode", "str", "", "int", 255, "long", 0)
    If @error <> 0 Then MsgBox(0, "DLL CALL - STATUS CD RESULT", @error)
    GUICtrlSetData($Input_s, $res[2])
    ;
    SplashOff()
    EndIf

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

    GuiSetState()
    While 1
    If GUICtrlRead($Input_s) = "playing" Then
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio position", "str", "", "int", 255, "long", 0)
    $time = $res[2]
    GUICtrlSetData($Input_t1, $time)
    EndIf
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $Button_x
    If GUICtrlRead($Input_s) = "playing" Then
    $res = DllCall($dll, "int", "mciSendString", "str", "stop cdaudio wait", "str", "", "int", 255, "long", 0)
    EndIf
    GUIDelete($Cdplay)
    ExitLoop
    Case $msg = $Button_S
    ; STOP CD
    $res = DllCall($dll, "int", "mciSendString", "str", "stop cdaudio wait", "str", "", "int", 255, "long", 0)
    If @error <> 0 Then MsgBox(0, "DLL CALL - STOP CD RESULT", @error)
    GUICtrlSetData($Input_t1, "00:02:00")
    If GUICtrlRead($Button_pa) = "Resume" Then
    GUICtrlSetData($Button_pa, "Pause")
    ElseIf GUICtrlRead($Button_pa) = "Pause" And GUICtrlRead($Input_s) = "stopped" Then
    $trk = 1
    GetCDDetails()
    EndIf
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio mode", "str", "", "int", 255, "long", 0)
    GUICtrlSetData($Input_s, $res[2])
    GUICtrlSetState($Button_pa, $GUI_DISABLE)
    GUICtrlSetState($Button_S, $GUI_DISABLE)
    GUICtrlSetState($Button_P, $GUI_ENABLE)
    Case $msg = $Button_R
    ; RESTART CD
    $trk = 1
    UpdateTrack()
    Case $msg = $Button_pr
    ; PREVIOUS TRACK
    If $trk > 1 Then
    $trk = $trk - 1
    UpdateTrack()
    EndIf
    Case $msg = $Button_pa
    ; PAUSE or RESUME PLAYING CD
    If GUICtrlRead($Button_pa) = "Pause" Then
    $res = DllCall($dll, "int", "mciSendString", "str", "pause cdaudio", "str", "", "int", 255, "long", 0)
    If @error <> 0 Then MsgBox(0, "DLL CALL - STOP CD RESULT", @error)
    GUICtrlSetData($Button_pa, "Resume")
    ElseIf GUICtrlRead($Button_pa) = "Resume" Then
    $res = DllCall($dll, "int", "mciSendString", "str", "resume cdaudio", "str", "", "int", 255, "long", 0)
    If @error <> 0 Then MsgBox(0, "DLL CALL - STOP CD RESULT", @error)
    GUICtrlSetData($Button_pa, "Pause")
    EndIf
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio mode", "str", "", "int", 255, "long", 0)
    GUICtrlSetData($Input_s, $res[2])
    Case $msg = $Button_P
    ; PLAY CD
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio position track " & $trk, "str", "", "int", 255, "long", 0)
    $posi = $res[2]
    $res = DllCall($dll, "int", "mciSendString", "str", "play cdaudio from " & $posi, "str", "", "int", 255, "long", 0)
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio mode", "str", "", "int", 255, "long", 0)
    GUICtrlSetData($Input_s, $res[2])
    If GUICtrlRead($Button_pa) = "Resume" Then GUICtrlSetData($Button_pa, "Pause")
    GUICtrlSetState($Button_P, $GUI_DISABLE)
    GUICtrlSetState($Button_pa, $GUI_ENABLE)
    GUICtrlSetState($Button_S, $GUI_ENABLE)
    Case $msg = $Button_nx
    ; NEXT TRACK
    If $trk < $tot Then
    $trk = $trk + 1
    UpdateTrack()
    EndIf
    Case $msg = $Button_M
    ; MUTE SOUND
    If GUICtrlRead($Button_M) = "Mute" Then
    Send("{VOLUME_MUTE}") ; WIN XP only
    $res = DllCall($dll, "int", "mciSendString", "str", "set cdaudio audio all off", "str", "", "int", 255, "long", 0)
    GUICtrlSetData($Button_M, "Muted")
    ElseIf GUICtrlRead($Button_M) = "Muted" Then
    ;Send("{VOLUME_UP}")
    Send("{VOLUME_MUTE}") ; WIN XP only
    $res = DllCall($dll, "int", "mciSendString", "str", "set cdaudio audio all on", "str", "", "int", 255, "long", 0)
    GUICtrlSetData($Button_M, "Mute")
    EndIf
    Case $msg = $Button_E
    ; EJECT or LOAD CD
    SplashTextOn("", @CRLF & @CRLF & "Please Wait!", 150, 100, -1, -1, 1)
    If GUICtrlRead($Input_s) = "stopped" Or GUICtrlRead($Input_s) = "" Then
    ; EJECT
    $res = DllCall($dll, "int", "mciSendString", "str", "set cdaudio door open wait", "str", "", "int", 255, "long", 0)
    GUICtrlSetData($Button_E, "Load")
    GUICtrlSetData($Input_n, "")
    GUICtrlSetData($Input_tr, "")
    GUICtrlSetData($Input_t1, "")
    GUICtrlSetData($Input_t2, "")
    GUICtrlSetData($Input_t3, "")
    GUICtrlSetData($Input_t4, "")
    GUICtrlSetData($Input_id, "")
    GUICtrlSetData($Input_ar, "")
    GUICtrlSetData($Input_tt, "")
    GUICtrlSetData($Input_tn, "")
    GUICtrlSetData($Input_yr, "")
    GUICtrlSetData($Input_co, "")
    GUICtrlSetState($Button_P, $GUI_DISABLE)
    GUICtrlSetState($Button_pa, $GUI_DISABLE)
    GUICtrlSetState($Button_S, $GUI_DISABLE)
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio mode", "str", "", "int", 255, "long", 0)
    GUICtrlSetData($Input_s, $res[2])
    ElseIf GUICtrlRead($Input_s) = "open" Then
    ; LOAD
    $res = DllCall($dll, "int", "mciSendString", "str", "set cdaudio door closed wait", "str", "", "int", 255, "long", 0)
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio media present wait", "str", "", "int", 0, "long", 0)
    ;Sleep(2000)
    $ready = DriveStatus($use & "\")
    If $ready = "READY" Then
    GetCDDetails()
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio mode", "str", "", "int", 255, "long", 0)
    GUICtrlSetData($Input_s, $res[2])
    Else
    GUICtrlSetData($Input_s, "")
    EndIf
    GUICtrlSetData($Button_E, "Open")
    EndIf
    SplashOff()
    Case $msg = $Radio_3 And $drives[0] > 2
    ; USE DRIVE 3
    $use = IniRead($inifile, "Drives", "3", "")
    IniWrite($inifile, "Drive", "use", $use)
    IniWrite($inifile, "Drive", "num", "3")
    Case $msg = $Radio_2 And $drives[0] > 1
    ; USE DRIVE 2
    $use = IniRead($inifile, "Drives", "2", "")
    IniWrite($inifile, "Drive", "use", $use)
    IniWrite($inifile, "Drive", "num", "2")
    Case $msg = $Radio_1
    ; USE DRIVE 1
    $use = IniRead($inifile, "Drives", "1", "")
    IniWrite($inifile, "Drive", "use", $use)
    IniWrite($inifile, "Drive", "num", "1")
    Case Else
    ;;;
    EndSelect
    WEnd

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

    $res = DllCall($dll, "int", "mciSendString", "str", "close cdaudio", "str", "", "int", 255, "long", 0)
    If @error <> 0 Then MsgBox(0, "DLL CALL - CLOSE CD RESULT", @error)

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

    DllClose($dll)

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

    Exit
    #endregion --- GuiBuilder generated code End ---

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

    Func GetCDDetails()
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio media present wait", "str", "", "int", 255, "long", 0)
    If @error <> 0 Then MsgBox(0, "DLL CALL - STATUS CD RESULT", @error)
    ;
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio number of tracks wait", "str", "", "int", 255, "long", 0)
    $tot = $res[2]
    GUICtrlSetData($Input_tr, $tot)
    ;
    CheckContent()
    ;
    If $dcon <> "Data" Then
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio current track", "str", "", "int", 255, "long", 0)
    $trk = $res[2]
    GUICtrlSetData($Input_n, $trk)
    ;
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio position track " & $trk, "str", "", "int", 255, "long", 0)
    If @error <> 0 Then MsgBox(0, "DLL CALL - TRACK POS", @error)
    GUICtrlSetData($Input_t2, $res[2])
    ;
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio length track " & $trk, "str", "", "int", 255, "long", 0)
    If @error <> 0 Then MsgBox(0, "DLL CALL - TRACK POS", @error)
    GUICtrlSetData($Input_t3, $res[2])
    ;
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio length wait", "str", "", "int", 255, "long", 0)
    If @error <> 0 Then MsgBox(0, "DLL CALL - TRACK POS", @error)
    GUICtrlSetData($Input_t4, $res[2])
    ;
    GUICtrlSetData($Input_t1, "00:02:00")
    ;
    GetCDid()
    ;
    GetCDPlayerIniDetails()
    ;
    GUICtrlSetState($Button_P, $GUI_ENABLE)
    GUICtrlSetState($Button_pr, $GUI_ENABLE)
    GUICtrlSetState($Button_nx, $GUI_ENABLE)
    GUICtrlSetState($Button_R, $GUI_ENABLE)
    GUICtrlSetState($Button_M, $GUI_ENABLE)
    EndIf
    ;
    EndFunc

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

    Func CheckContent()
    $dlbl = DriveGetLabel($use)
    If $dlbl <> "Audio CD" Then
    If $tot > 1 Then
    $dcon = "Audio & Data"
    ElseIf $tot = 1 Then
    $dcon = "Data"
    EndIf
    Else
    $dcon = "Audio"
    EndIf
    GUICtrlSetData($Input_co, $dcon)
    EndFunc

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

    Func GetCDid()
    $res = DllCall($dll, "int", "mciSendString", "str", "set cdaudio time format tfmsf wait", "str", "", "int", 255, "long", 0)
    $cdid = 0
    $mgNum = 0
    For $i = 1 To $tot
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio position track " & String($i), "str", "", "int", 255, "long", 0)
    $len = String($res[2]); * 30
    $mins = StringLeft($len, 2)
    $secs = StringMid($len, 4, 2)
    $frs = StringRight($len, 2)
    $cdid = $cdid + (($mins * 65536) + ($secs * 256) + $frs)
    If $i = 1 And $tot = 2 Then $mgNum = $frs
    Next
    If $tot < 3 Then
    ;$res = DllCall($dll, "int", "mciSendString", "str", "set cdaudio time format milliseconds wait", "str", "", "int", 255, "long", 0)
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio length", "str", "", "int", 255, "long", 0)
    ;
    $len = String($res[2]); * 30
    $mins = StringLeft($len, 2)
    $secs = StringMid($len, 4, 2)
    $frs = StringRight($len, 2)
    ;
    $cdlen = (($mins * 60) + $secs) * 75 + $frs
    ;MsgBox(0, "Values", "Value 1 = " & ($cdlen / 60 / 75) & @CRLF & _
    ;"Value 2 = " & $mins + (($secs + $frs) / 60))
    If $mins + ($secs + $frs / 60) <> ($cdlen / 60 / 75) Then $cdlen = $cdlen + 1
    ;
    $cdid = $cdid + $mgNum + $cdlen
    EndIf
    $cdid = Hex(String($cdid), 8)
    While StringLeft($cdid, 1) = "0"
    $cdid = StringMid($cdid, 2)
    WEnd
    GUICtrlSetData($Input_id, $cdid)
    EndFunc

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

    Func GetCDPlayerIniDetails()
    If FileExists($cdini) Then
    $art = IniRead($cdini, $cdid, "artist", "")
    GUICtrlSetData($Input_ar, $art)
    $tit = IniRead($cdini, $cdid, "title", "")
    GUICtrlSetData($Input_tt, $tit)
    $trak = IniRead($cdini, $cdid, "0", "")
    GUICtrlSetData($Input_tn, $trak)
    $yr = IniRead($cdini, $cdid, "year", "")
    GUICtrlSetData($Input_yr, $yr)
    EndIf
    EndFunc

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

    Func UpdateTrack()
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio position track " & $trk, "str", "", "int", 255, "long", 0)
    $posi = $res[2]
    If GUICtrlRead($Input_s) = "playing" Then
    $res = DllCall($dll, "int", "mciSendString", "str", "play cdaudio from " & $posi, "str", "", "int", 255, "long", 0)
    EndIf
    GUICtrlSetData($Input_n, $trk)
    GUICtrlSetData($Input_t2, $posi)
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio length track " & $trk, "str", "", "int", 255, "long", 0)
    GUICtrlSetData($Input_t3, $res[2])
    ;
    $trak = IniRead($cdini, $cdid, $trk - 1, "")
    GUICtrlSetData($Input_tn, $trak)
    EndFunc

    [/autoit]