1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. chip

Beiträge von chip

  • Musikcd abspielen an bestimmter Position

    • chip
    • 8. Oktober 2010 um 00:56

    Problem ist, dass die Bass.au3 scheinbar nicht Win 7 kompatiebel ist. Zumindestens die Beispiele in der Bass_CD funktionieren nicht und wird schon direkt bei _BASS_Startup() abgebrochen mit ledichlich einem @error = -1

    Edit:

    So habs nun gelöst und es geschaft direkt eine Track anzusprechen.

    Spoiler anzeigen
    [autoit]

    #include <Array.au3>
    OnAutoItExitRegister("MyTestFunc")

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

    $track = 5
    $dll = DllOpen("winmm.dll")
    $res = DllCall($dll, "int", "mciSendString", "str", "open cdaudio", "str", "", "int", 255, "long", 0)
    $res = DllCall($dll, "int", "mciSendString", "str", "status cdaudio position track " & $Track, "str", "", "int", 255, "long", 0)
    $res = DllCall($dll, "int", "mciSendString", "str", "play cdaudio from " & $res[2], "str", "", "int", 255, "long", 0)

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

    While 1
    WEnd

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

    Func MyTestFunc()
    $res = DllCall($dll, "int", "mciSendString", "str", "stop cdaudio", "str", "", "int", 255, "long", 0)
    $res = DllCall($dll, "int", "mciSendString", "str", "close cdaudio", "str", "", "int", 255, "long", 0)
    DllClose($dll)
    EndFunc ;==>MyTestFunc

    [/autoit]

    Hier noch die mögliche Paramter die mciSendString genutzt werden können: http://msdn.microsoft.com/en-us/library/ms712587

  • Musikcd abspielen an bestimmter Position

    • chip
    • 7. Oktober 2010 um 23:20

    Hab einen Player gefunden der es kann, allerdings komme ich nicht so ganz dahinter wie es funktioniert:

    Spoiler anzeigen
    [autoit]

    #include <WindowsConstants.au3>
    #include <EditConstants.au3>
    #include <StaticConstants.au3>
    #include <GUIConstantsEx.au3>
    ; ----------------------------------------------------------------------------
    ;
    ; AutoIt Version: 3.1.0
    ; Author: TheSaint <[email='thsaint@ihug.com.au'][/email]>
    ;
    ; Script Function: Play CD from a selected drive and display details, etc
    ; Template AutoIt script.
    ;
    ; ----------------------------------------------------------------------------

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

    ; FUNCTIONS
    ; ChangeDrive(), CheckContent(), CheckSelectedCD(), CloseCDAndExitDll(), GetCDDetails(), GetCDid()
    ; GetCDPlayerIniDetails(), StopCDAndResetValues(), UpdateTrack()

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

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

    [/autoit] [autoit][/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.3 (updated Feb. 2009)", $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)
    GUICtrlSetFont($Button_x, 9, 600)
    ;
    $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
    ;
    CheckSelectedCD()

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

    GuiSetState()
    While 1
    If GUICtrlRead($Input_s) = "playing" Then
    $res = DllCall($dll, "int", "mciSendString", "str", "Status CD 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 CD wait", "str", "", "int", 255, "long", 0)
    EndIf
    GUIDelete($Cdplay)
    ExitLoop
    Case $msg = $Button_S
    ; STOP CD
    StopCDAndResetValues()
    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 CD", "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 CD", "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 CD Mode", "str", "", "int", 255, "long", 0)
    GUICtrlSetData($Input_s, $res[2])
    Case $msg = $Button_P
    ; PLAY CD
    $res = DllCall($dll, "int", "mciSendString", "str", "Status CD Position Track " & $trk, "str", "", "int", 255, "long", 0)
    $posi = $res[2]
    $res = DllCall($dll, "int", "mciSendString", "str", "Play CD From " & $posi, "str", "", "int", 255, "long", 0)
    $res = DllCall($dll, "int", "mciSendString", "str", "Status CD 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 CD 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 CD 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 CD 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 CD 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 CD Door Closed wait", "str", "", "int", 255, "long", 0)
    $res = DllCall($dll, "int", "mciSendString", "str", "Status CD 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 CD 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")
    ChangeDrive()
    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")
    ChangeDrive()
    Case $msg = $Radio_1
    ; USE DRIVE 1
    $use = IniRead($inifile, "Drives", "1", "")
    IniWrite($inifile, "Drive", "use", $use)
    IniWrite($inifile, "Drive", "num", "1")
    ChangeDrive()
    Case Else
    ;;;
    EndSelect
    WEnd

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

    CloseCDAndExitDll()

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

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

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

    Func ChangeDrive()
    StopCDAndResetValues()
    CloseCDAndExitDll()
    CheckSelectedCD()
    EndFunc ;=> ChangeDrive

    [/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 ;=> CheckContent

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

    Func CheckSelectedCD()
    $dll = DllOpen("winmm.dll")
    If $dll <> 1 Then MsgBox(0, "DLL OPEN - RESULT", $dll)
    ;
    $res = DllCall($dll, "int", "mciSendString", "str", "Open CDAudio" & "!" & $use & " alias CD shareable wait", "str", "", "int", 0, "long", 0)
    If @error <> 0 Then MsgBox(0, "DLL CALL - OPEN CD RESULT", @error)
    ;
    $res = DllCall($dll, "int", "mciSendString", "str", "Status CD 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 CD Time Format tfmsf wait", "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 CD 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
    EndFunc ;=> CheckSelectedCD

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

    Func CloseCDAndExitDll()
    $res = DllCall($dll, "int", "mciSendString", "str", "Close CD", "str", "", "int", 255, "long", 0)
    If @error <> 0 Then MsgBox(0, "DLL CALL - CLOSE CD RESULT", @error)
    ;
    DllClose($dll)
    EndFunc ;=> CloseCDAndExitDll

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

    Func GetCDDetails()
    $res = DllCall($dll, "int", "mciSendString", "str", "Status CD 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 CD Number of Tracks", "str", "", "int", 255, "long", 0)
    $tot = $res[2]
    GUICtrlSetData($Input_tr, $tot)
    ;
    CheckContent()
    ;
    If $dcon <> "Data" Then
    $res = DllCall($dll, "int", "mciSendString", "str", "Status CD Current Track", "str", "", "int", 255, "long", 0)
    $trk = $res[2]
    GUICtrlSetData($Input_n, $trk)
    ;
    $res = DllCall($dll, "int", "mciSendString", "str", "Status CD 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 CD 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 CD Length", "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 ;=> GetCDDetails

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

    Func GetCDid()
    ; set CD time format Milliseconds wait
    $res = DllCall($dll, "int", "mciSendString", "str", "Set CD 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 CD 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 CD 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 ;=> GetCDid

    [/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 ;=> GetCDPlayerIniDetails

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

    Func StopCDAndResetValues()
    $res = DllCall($dll, "int", "mciSendString", "str", "Stop CD 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 CD 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)
    EndFunc ;=> StopCDAndResetValues

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

    Func UpdateTrack()
    $res = DllCall($dll, "int", "mciSendString", "str", "Status CD Position Track " & $trk, "str", "", "int", 255, "long", 0)
    $posi = $res[2]
    If GUICtrlRead($Input_s) = "playing" Then
    $res = DllCall($dll, "int", "mciSendString", "str", "Play CD From " & $posi, "str", "", "int", 255, "long", 0)
    EndIf
    GUICtrlSetData($Input_n, $trk)
    GUICtrlSetData($Input_t2, $posi)
    $res = DllCall($dll, "int", "mciSendString", "str", "Status CD Length Track " & $trk, "str", "", "int", 255, "long", 0)
    GUICtrlSetData($Input_t3, $res[2])
    ;
    $trak = IniRead($cdini, $cdid, $trk - 1, "")
    GUICtrlSetData($Input_tn, $trak)
    EndFunc ;=> UpdateTrack

    [/autoit]
  • Musikcd abspielen an bestimmter Position

    • chip
    • 7. Oktober 2010 um 22:12

    Habe das leider nichts gefunden in der Bass.au3 was funktionieren könnte. Der Starplayer von Oscar spielt wie ich gesehen habe auch nur mp3 ab.

  • Musikcd abspielen an bestimmter Position

    • chip
    • 7. Oktober 2010 um 21:52

    Hi,

    ich würde gerne eine Musikcd in Autoit abspielen. Habe es zuerst mit den Soundfunktionen versucht und auch schon einige Musikplayer in Autoit angeschaut. Problem an der Sache ist, dass diese alle ein Musikfile(mp3, wav ect) benötigen um richtig zu arbeiten.
    Da nun aber auf Musikcds im Normalfall nur cda-Dateien vorhanden sind kann man diese zwar öffnen, aber die CD beginnt dann von vorne zu spielen und man kann nicht zu einem bestimmten Song springen.
    Da ich nun allerdings die Startoffsets der Songs habe an der diese beginnen müsste man ja auch irgendwie direkt zu diesen Offsets springen können und von dort aus dann die CD absspielen.
    Theoretisch hört es sich ja gut an, nur habe ich keine Ahnung wie ich das in der Praxis machen soll. Hoffe hat jemand eine Idee.

    mfg

  • Autoit System

    • chip
    • 7. Oktober 2010 um 16:27

    Definitiv nicht ungefährlich!

  • Autoit System

    • chip
    • 7. Oktober 2010 um 16:16

    Wenn das Programm startest und dann in der GUI auf Item klickst wird die Datei die beim Starten ausgewählt hast in einer Endlosschleife immer wieder geöffnet.

  • ALT+TAB umleiten/sperren

    • chip
    • 7. Oktober 2010 um 15:59

    Ja und unter Win 7 funktioniert es nicht :P

  • Autoit System

    • chip
    • 7. Oktober 2010 um 15:56

    Achtung das ist ein Scherzscript von Alizname. Auf keinenfall starten!!!!

  • ALT+TAB umleiten/sperren

    • chip
    • 7. Oktober 2010 um 15:53

    Nein ich will die Kombo ALT+Tab sperren, aber das geht nicht mit

    [autoit]

    HotKeySet("!{TAB}", "nichts")

    [/autoit]

    probiers doch mal aus ;)

  • ALT+TAB umleiten/sperren

    • chip
    • 7. Oktober 2010 um 15:37

    Funktioniert nicht weil Alt eine Modifikationstaste ist. Auszug aus HotKeySet:

    "Folgende HotKeys können nicht genutzt werden:
    .....
    Alt, Strg, Shift, Win Dies sind Modifizierungstasten
    .....
    "

  • ALT+TAB umleiten/sperren

    • chip
    • 7. Oktober 2010 um 15:27

    Hi,

    ich habe folgenden Scripts, wurde glaub von BugFix mal geschrieben.

    Spoiler anzeigen
    [autoit]

    #include <WinAPI.au3>
    #Include <WindowsConstants.au3>

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

    Global $hHookKeyboard, $pStub_KeyProc
    Global Const $VK_WIN_LEFT = 0x5B
    Global Const $VK_WIN_RIGHT = 0x5C
    Global Const $Key_NONE = 0x0

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

    $pStub_KeyProc = DllCallbackRegister("_KeyProc", "int", "int;ptr;ptr")
    $hHookKeyboard = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($pStub_KeyProc), _WinAPI_GetModuleHandle(0), 0)

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

    While 1
    Sleep(10)
    WEnd

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

    Func OnAutoITExit()
    DllCallbackFree($pStub_KeyProc)
    _WinAPI_UnhookWindowsHookEx($hHookKeyboard)
    EndFunc ;==>OnAutoITExit

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

    Func _KeyProc($nCode, $wParam, $lParam)
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHookKeyboard, $nCode, $wParam, $lParam)
    Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
    Local $vkCode = DllStructGetData($tKEYHOOKS, "vkCode")
    If ($wParam = $WM_KEYDOWN) And ($vkCode = $VK_WIN_LEFT Or $vkCode = $VK_WIN_RIGHT) Then
    DllCall('user32.dll', 'int', 'keybd_event', 'int', $Key_NONE, 'int', 0, 'int', 0, 'ptr', 0)
    Return -1
    EndIf
    Return _WinAPI_CallNextHookEx($hHookKeyboard, $nCode, $wParam, $lParam)
    EndFunc ;==>_KeyProc

    [/autoit]

    In dem Fall wird per Hook die Win-Taste sowohl die Linke als auch die Rechte ins "nichts" umgeleitet.
    Das gleiche habe ich nun versucht für ALT-Tab hinzubekommen und habe einfach mal versucht die ALT und ALT GR Taste umzuleiten.

    Spoiler anzeigen
    [autoit]

    #include <WinAPI.au3>
    #Include <WindowsConstants.au3>

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

    Global $hHookKeyboard, $pStub_KeyProc
    Global Const $VK_WIN_LEFT = 0x5B
    Global Const $VK_WIN_RIGHT = 0x5C
    Global Const $Key_NONE = 0x0
    ;Die HEX für die beiden Tasten
    Global Const $VK_ALT_LEFT = 0xA4
    Global Const $VK_ALT_RIGHT = 0xA2

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

    $pStub_KeyProc = DllCallbackRegister("_KeyProc", "int", "int;ptr;ptr")
    $hHookKeyboard = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($pStub_KeyProc), _WinAPI_GetModuleHandle(0), 0)

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

    While 1
    Sleep(10)
    WEnd

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

    Func OnAutoITExit()
    DllCallbackFree($pStub_KeyProc)
    _WinAPI_UnhookWindowsHookEx($hHookKeyboard)
    EndFunc ;==>OnAutoITExit

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

    Func _KeyProc($nCode, $wParam, $lParam)
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHookKeyboard, $nCode, $wParam, $lParam)
    Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
    Local $vkCode = DllStructGetData($tKEYHOOKS, "vkCode")
    ;In der IF wurden die zwei Tasten hinzugefügt
    If ($wParam = $WM_KEYDOWN) And ($vkCode = $VK_WIN_LEFT Or $vkCode = $VK_WIN_RIGHT Or $vkCode = $VK_ALT_LEFT Or $vkCode = $VK_ALT_RIGHT) Then
    DllCall('user32.dll', 'int', 'keybd_event', 'int', $Key_NONE, 'int', 0, 'int', 0, 'ptr', 0)
    Return -1
    EndIf
    Return _WinAPI_CallNextHookEx($hHookKeyboard, $nCode, $wParam, $lParam)
    EndFunc ;==>_KeyProc

    [/autoit]

    Leider ist das aber erfolglos und ALT+Tab funktioniert weiterhin normal.

  • Schriftgrad per Skript ändern

    • chip
    • 7. Oktober 2010 um 14:52

    Ich auch, besonders weil das ein Registryeintrag ist, der erst wieder nach dem Anmelden eingelesen wird.

  • Schriftgrad per Skript ändern

    • chip
    • 7. Oktober 2010 um 13:21
    Zitat von stayawayknight

    Ich glaube kaum, dass jemand versteht was du tun willst - was für eine Schrift soll geändert werden? Was hat Win7 und An- und Abmelden damit zu tun?

    Ist doch klar verständlich. Er will den Schriftgrad ("Systemsteuerung\Darstellung und Anpassung\Anzeige") ändern und das erfordert unter Win 7 nunmal ein an und abmelden damit es wirksam wird.

  • moin moin

    • chip
    • 7. Oktober 2010 um 12:53

    Willkommen im Forum. Nur als kleine Randinfo: Autoit ist eine Scriptsprache und keine Programmiersprache.

  • Autoit System

    • chip
    • 7. Oktober 2010 um 10:12

    Ist zwar schon Code, aber die Schaltflächen haben lediglich Hovereffekte also noch nichts was besonders schwer ist. Die nächsten Tage wird aber die Musikkomponente fertig werden (Erkennen ob Musikcd eingelegt ist, anzeigen des passenden Coverbildes, anzeigen des Liedtextest ect.) dann gibts dazu kleinen Testrelease.

  • Referenz oder Manual für OpenGL Au3GlPlugin

    • chip
    • 7. Oktober 2010 um 08:12

    Dann solltest nochmal das Googlen üben ;): klick mich

  • Eingabe bis zur Eingabe von Passwort blocken?

    • chip
    • 7. Oktober 2010 um 08:01

    Ich hab das Script mal etwas erweitert und mit diesem Scirpt kombinier: [ offen ] Windows Taste deaktivieren , so dass auch die Win-Taste abgefangen wird, denn zumindestens unter Win7 wird diese sonst nicht:

    Spoiler anzeigen
    [autoit]

    #include <WinAPI.au3>
    #include <WindowsConstants.au3>
    #include <StructureConstants.au3>

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

    Global $hHookKeyboard, $pStub_KeyProc
    Global Const $VK_WIN_LEFT = 0x5B
    Global Const $VK_WIN_RIGHT = 0x5C
    Global Const $Key_NONE = 0x0

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

    $pStub_KeyProc = DllCallbackRegister("_KeyProc", "int", "int;ptr;ptr")
    $hHookKeyboard = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($pStub_KeyProc), _WinAPI_GetModuleHandle(0), 0)

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

    DllCall("winlockdll.dll", "int", "Desktop_Show_Hide", "int", 0)
    DllCall("winlockdll.dll", "int", "Taskbar_Show_Hide", "int", 0)
    DllCall("winlockdll.dll", "int", "TaskSwitching_Enable_Disable", "int", 0)
    DllCall("winlockdll.dll", "int", "TaskManager_Enable_Disable", "int", 0)
    $gui = GUICreate("", @DesktopWidth + 5, @DesktopHeight + 5, -5, -5, 0x80000000, 0x00000080)
    GUISetBkColor(0x0)
    WinSetOnTop($gui, "", 1)
    WinSetTrans($gui, "", 25)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 50)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 75)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 100)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 125)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 150)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 180)
    GUISetState()
    Sleep(100)
    $popup = GUICreate("Computer gesperrt", 300, 300, -1, -1, "0x80000000", $WS_EX_TOPMOST)

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

    $id_progress1 = GUICtrlCreateProgress(0, 0, 300, 30, -1, -1)
    $id_progress2 = GUICtrlCreateProgress(0, 270, 300, 30, -1, -1)
    $id_pic3 = GUICtrlCreatePic("Locked.gif", 0, 30, 100, 100, -1, -1)
    $id_pic4 = GUICtrlCreatePic("pw.gif", 100, 30, 200, 100, -1, -1)
    $id_label5 = GUICtrlCreateLabel("Passwort eingeben:", 10, 174, 101, 13, -1, -1)
    $Input_1 = GUICtrlCreateInput("", 120, 170, 170, 22, -1, -1)
    $Button_2 = GUICtrlCreateButton("ENTSPERREN", 65, 226, 159, 34, -1, -1)
    GUISetState(@SW_SHOW)
    While 1
    If Not WinActive("Computer gesperrt") Then
    WinActivate("Computer gesperrt")
    WinClose("Task-Manager")
    EndIf
    $msg2 = GUIGetMsg()
    Select
    Case $msg2 = $Button_2
    If GUICtrlRead($Input_1) = "passwort" Then
    ExitLoop
    EndIf
    EndSelect
    WEnd
    GUIDelete($popup)

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

    Sleep(300)
    WinSetTrans($gui, "", 125)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 100)
    GUISetState()
    Sleep(100)
    WinSetTrans($gui, "", 50)
    GUISetState()
    Sleep(100)
    DllCall("winlockdll.dll", "int", "Desktop_Show_Hide", "int", 1)
    DllCall("winlockdll.dll", "int", "Taskbar_Show_Hide", "int", 1)
    DllCall("winlockdll.dll", "int", "TaskSwitching_Enable_Disable", "int", 1)
    DllCall("winlockdll.dll", "int", "TaskManager_Enable_Disable", "int", 1)

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

    Func OnAutoITExit()
    DllCallbackFree($pStub_KeyProc)
    _WinAPI_UnhookWindowsHookEx($hHookKeyboard)
    EndFunc ;==>OnAutoITExit

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

    Func _KeyProc($nCode, $wParam, $lParam)
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHookKeyboard, $nCode, $wParam, $lParam)
    Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
    Local $vkCode = DllStructGetData($tKEYHOOKS, "vkCode")
    If ($wParam = $WM_KEYDOWN) And ($vkCode = $VK_WIN_LEFT Or $vkCode = $VK_WIN_RIGHT) Then
    DllCall('user32.dll', 'int', 'keybd_event', 'int', $Key_NONE, 'int', 0, 'int', 0, 'ptr', 0)
    Return -1
    EndIf
    Return _WinAPI_CallNextHookEx($hHookKeyboard, $nCode, $wParam, $lParam)
    EndFunc ;==>_KeyProc

    [/autoit]
  • Dateinamen automatisch vervollständigen

    • chip
    • 7. Oktober 2010 um 07:43

    Oder du machst einfach eine ini in der die Version steht.

  • Eingabe bis zur Eingabe von Passwort blocken?

    • chip
    • 6. Oktober 2010 um 21:41

    Hier hat schonmal jemand genau das gemacht was du suchst: [ offen ] Maus und Tastatur sperren auch nicht mit Strg+alt+entf zu umgehen.

  • Eingabe bis zur Eingabe von Passwort blocken?

    • chip
    • 6. Oktober 2010 um 21:37

    Ja wie sperrst du es XP-User?

    Btw. dann ist JoGi auch nicht gebessert. weil da niemand mehr etwas an dem Rechner machen kann auch nicht durch PW-Eingabe.

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™