.mp3 files mit meinem programm öffnen

  • hallo an alle :)

    also: ich habe mir eine Art Mp3-Player programmiert...klappt soweit ganz gut, aber jetzt will ich, dass wenn ich eine mp3-Datei öffne, sich statt dem Media-Player von Windows mein Programm öffnet und diese Datei abspielt...
    Beispiel: ich öffne eine mp3-Datei...irgendein Lied...jetzt öffnet sich mein Programm und spielt das Lied ab. Ohne dass sich der Windows Mediaplayer öffnet.
    ich weiß wie man bei mp3-Dateien einstellt dass sie mit meinem Programm geöffnet werden, aber dann ist nur mein Programm offen :( aber ich brauche ja den Pfad von der Mp3-Datei...un den krieg ich dann nicht raus :whistling:
    ich hoff mir kann jmd helfen :rolleyes:

    [autoit]


    While $Life = True
    $nMSG = BrainGetMsg()
    Switch $nMSG
    Case $Idea
    _Convert_Idea2Code()
    EndSwitch
    WEnd

    [/autoit]

    Einmal editiert, zuletzt von GE IXI TIM (15. August 2009 um 14:20)

  • Also am besten das Script wie es bis dato besteht posten, denn so kann man gleich schauen wo es rein soll und besonders man kann bereits mit den bestehenden Vab.'s arbeiten.

    So machst Du es uns leichter zu helfen.

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    k3mrwmIBHejryPvylQSFieDF5f3VOnk6iLAVBGVhKQegrFuWr3iraNIblLweSW4WgqI0SrRbS7U5jI3sn50R4a15Cthu1bEr

  • Du willst also, dass automatisch alle mp3 Dateien mit deinem Programm verknüpft werden.

    1. Möglichkeit bei WIN XP im Datei Explorer Rechte Maus auf eine mp3 Datei und Öffnen mit... anklicken, dann Programm wählen auswählen. Mit Durchsuchen dein Programm in die Liste audnehmen und dann WICHTIG! "Dateityp immer mit dem ausgewählten Programm öffnen" anwählen.

    2. Möglichkeit bei WIN XP stehen die ganzen Zuordnungen in der Regestry. Hier kann man die sicher auch direkt mit AutoIt ändern - da sind aber sicher andere besser geeignet dir das zu erklären.

    Gruß

    Steffen

  • 1. Die Hilfe zu CMDLine Parameter lesen
    2. Shift + Rechte maustaste auf eine MP3 datei dann öffnen mit, dein programm auswählen und dann noch den haken bei immer mit diesem programm öffnen reinmachen.

    wenn du den 2. schritt automatisch mchen willst (bei anderen leuten oder so) dann musst du mal nach Registry Classes Shell suchen ;)

    MFG FireFlyer

    *Paradox ist, wenn man sich im Handumdrehen den Fuss bricht* :D

  • hier ist das script...ist aber unübersichtlich :rolleyes: und noch nicht komplett fertig^^

    Spoiler anzeigen

    #cs ----------------------------------------------------------------------------

    AutoIt Version: 3.3.0.0
    Author: myName

    Script Function:
    Template AutoIt script.

    #ce ----------------------------------------------------------------------------

    ; Script Start - Add your code below here
    $xalpha = 0
    $sound = "none"
    $status = 0
    $what = "none"
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    $iLenMS = ""
    $iPosMS = ""


    #include <FF.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ListBoxConstants.au3>
    #include <ProgressConstants.au3>
    #include <SliderConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Sound.au3>
    #include <Array.au3>
    #include<GuiListView.au3>
    for $ii = 0 to 600 step 10

    GUICtrlSetData($progress,Int($ii * 1 / 1))
    Next
    sleep(600)
    GUIDelete($Form2)
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ListBoxConstants.au3>
    #include <ProgressConstants.au3>
    #include <SliderConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Guilistbox.au3>
    #Region ### START Koda GUI section ### Form=c:\users\tim\desktop\mp3.kxf
    $Form1 = GUICreate("Mp3-Player", 684, 448, 315, 98, -1, BitOR($WS_EX_ACCEPTFILES,$WS_EX_WINDOWEDGE))
    GUISetBkColor(0xB4B4B4)
    $List1 = GUICtrlCreateList("", 8, 0, 665, 292, BitOR($LBS_SORT,$LBS_STANDARD,$WS_HSCROLL,$WS_VSCROLL,$WS_BORDER))
    $play_pause = GUICtrlCreateButton("play", 8, 312, 35, 33, 0)
    $stop = GUICtrlCreateButton("back", 88, 312, 35, 33, 0)
    $Slider1 = GUICtrlCreateSlider(216, 304, 350, 37)
    $Progress1 = GUICtrlCreateProgress(8, 360, 518, 17)
    $wavelabel = GUICtrlCreateLabel("50%", 608, 312, 24, 17)
    $Label1 = GUICtrlCreateLabel("Aktueller Titel:", 8, 392, 71, 17)
    $nowtitle = GUICtrlCreateLabel("none", 88, 392, 204, 17)
    $nowtime = GUICtrlCreateLabel("0:00", 536, 360, 97, 17)
    $pause = GUICtrlCreateButton("next", 128, 312, 35, 33, 0)
    $Button1 = GUICtrlCreateButton("pause", 48, 312, 35, 33, 0)
    $Button2 = GUICtrlCreateButton("stop", 168, 312, 35, 33, 0)
    $datei = GUICtrlCreateMenu("&Datei")
    $end = GUICtrlCreateMenuItem("Beenden", $datei)
    $playlist = GUICtrlCreateMenu("&Playlist")
    $erstellen = GUICtrlCreateMenuItem("Erstellen", $playlist)
    $laden = GUICtrlCreateMenuItem("Laden", $playlist)
    $design = GUICtrlCreateMenu("D&esign")
    $open = GUICtrlCreateMenuItem("Öffnen", $datei)
    GUICtrlSetState($List1, $GUI_DROPACCEPTED)
    GUICtrlSetData($Slider1, "50%")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $end
    Exit
    case $open
    $path = FileOpenDialog("Öffnen", @DesktopDir, "Mp3-Dateien(*.mp3)|Wma-Dateien(*.wma)")
    GUICtrlSetData($List1,$path)
    case $play_pause
    if $status = 0 Then
    $what = Guictrlread($List1)
    $sound = _SoundOpen($what)
    _SoundPlay($sound)
    EndIf
    If $status = 1 Then _SoundResume($sound)
    case $pause
    _next()
    case $Button1
    _SoundPause($sound)
    $status = 1
    case $Button2
    _SoundStop($sound)
    _SoundClose($sound)
    $status = 0
    case $stop
    _last()
    case $GUI_EVENT_DROPPED
    if StringInStr(@GUI_DragFile, "mp3" ) Then
    GUICtrlSetData($List1, @GUI_DragFile)
    if StringInStr(@GUI_DragFile, "wma" ) Then GUICtrlSetData($List1, @GUI_DragFile)
    Else
    MsgBox(0, "Fehler", "Keine Gültige Audiodatei" & @crlf & "Nur .mp3 oder .wma Dateien!")
    EndIf

    EndSwitch


    Local $iLenMS = _SoundLength($sound, 2)
    Local $iPosMS = _SoundPos($sound, 2)
    $nowpos = _SoundPos($sound, 1)
    $nowlenght = _SoundLength($sound, 1)
    $info = $nowpos & "/" & $nowlenght
    GUICtrlSetData($nowtime, $info)
    GUICtrlSetData($Progress1, Int(100 / $iLenMS * $iPosMS))
    $changedwave = Guictrlread($Slider1)
    GUICtrlSetData($wavelabel, $changedwave & "%")
    SoundSetWaveVolume($changedwave)
    $title = Stringsplit($what, "\")
    $h = $title[0]
    GUICtrlSetData($nowtitle, $title[$h])
    if $nowpos <> "00:00:00" Then
    if $nowpos = $nowlenght or $nowpos > $nowlenght Then
    _SoundStop($sound)
    _SoundClose($sound)
    $theone = _GUICtrlListBox_GetCaretIndex($List1)
    $xbeta = $theone +1
    _GUICtrlListBox_ClickItem($List1, $xbeta)
    $what = guictrlread($List1)
    $sound = _soundopen($what)
    EndIf
    EndIf
    WEnd


    Func _next()
    _SoundStop($sound)
    _SoundClose($sound)
    $theone = _GUICtrlListBox_GetCaretIndex($List1)
    $xbeta = $theone +1
    _GUICtrlListBox_ClickItem($List1, $xbeta)
    $what = guictrlread($List1)
    $sound = _soundopen($what)
    _soundplay($sound)
    EndFunc

    Func _last()
    _SoundStop($sound)
    _SoundClose($sound)
    $theone = _GUICtrlListBox_GetCaretIndex($List1)
    $xbeta = $theone -1
    _GUICtrlListBox_ClickItem($List1, $xbeta)
    $what = guictrlread($List1)
    $sound = _soundopen($what)
    _soundplay($sound)
    EndFunc

    [autoit]


    While $Life = True
    $nMSG = BrainGetMsg()
    Switch $nMSG
    Case $Idea
    _Convert_Idea2Code()
    EndSwitch
    WEnd

    [/autoit]
  • jawoll^^ danke^^ habs mit cmdline[1] hinbekommen^^
    wie ich ne mp3 datei mit meim progg öffne musst ich ja^^ mit öffnen mit und so...aber von dem registy da hab ich überhaupt keine Ahnung 8|
    danke an alle ;)
    wenn mit jtz vielleicht noch jmd das andere erklären könnte :whistling:

    [autoit]


    While $Life = True
    $nMSG = BrainGetMsg()
    Switch $nMSG
    Case $Idea
    _Convert_Idea2Code()
    EndSwitch
    WEnd

    [/autoit]