Inet Radio und Tray Menü

  • Hallo,
    es geht um folgendes:
    Ich hab ja ein Inet Radio script, das funktioniert auch und habs schon oft verwendet.
    Orig(in etwa)

    Spoiler anzeigen
    [autoit]


    $comSender = GUICtrlCreateCombo (" ",15, 35, 200, 25)
    GUICtrlSetData(-1, "Technobase.fm|Housetime.fm|Hardbase.fm|Happy Hardcore Radio|Trancebase.fm|Coretime.fm|Afterhours.fm|Psychedelik (Progressive Trance)|Psychedelik (Dark Psyché)|Psychedelik (Psy Trance)|DNB Radio", "Technobase.fm")
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $comSender
    ; Falls grade ein Stream abgespielt wird, wird er gestoppt
    $oWMP.controls.stop()
    Switch GUICtrlRead($comSender)
    Case 'Technobase.fm'
    $oWMP.URL = $urlTe ;Stellt die Eigenschaft "URL" zu dem Online-Stream
    Case 'Housetime.fm'
    $oWMP.URL = $urlHt
    Case 'Hardbase.fm'
    $oWMP.URL = $urlHb
    Case 'Happy Hardcore Radio'
    $oWMP.URL = $urlHhr
    Case 'Trancebase.fm'
    $oWMP.URL = $urlTb
    Case 'Coretime.fm'
    $oWMP.URL = $urlCt
    Case 'Afterhours.fm'
    $oWMP.URL = $urlAh
    EndSwitch
    $oWMP.controls.play()

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

    $zeit = TimerInit()
    Case $cmdStop
    $oWMP.controls.stop()
    Case $cmdPlay
    $oWMP.controls.play()
    EndSwitch

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

    WEnd

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


    Im Traymenu(in etwa^^)

    Spoiler anzeigen
    [autoit]


    Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown.

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

    $Radio = TrayCreateMenu("Radiolist")
    $radio1 = TrayCreateItem("Technobase.fm", $Radio, -1,1)
    $radio2 = TrayCreateItem("Housetime.fm", $Radio, -1,1)
    $radio3 = TrayCreateItem("Hardbase.fm", $Radio, -1,1)
    $radio4 = TrayCreateItem("Happy Hardcore Radio", $Radio, -1,1)
    $radio5 = TrayCreateItem("Coretime.fm", $Radio, -1,1)
    $radio6 = TrayCreateItem("Afterhours.fm", $Radio, -1,1)

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

    While 1

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

    $tmsg = TrayGetMsg()
    Select
    Case $tmsg = $Radio

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

    $oWMP.controls.stop()
    Switch TrayGetMsg()
    Case $radio1
    $oWMP.URL = $urlHt
    Case $radio2
    $oWMP.URL = $urlHb
    Case $radio3
    $oWMP.URL = $urlHhr
    Case $radio4
    $oWMP.URL = $urlTb
    Case $radio5
    $oWMP.URL = $urlCt
    Case $radio6
    $oWMP.URL = $urlAh

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

    EndSwitch

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

    $oWMP.controls.play()
    ; beim wechseln des Streams soll wieder von vorn gezählt werden.
    $zeit = TimerInit()
    Case $cmdStop
    $oWMP.controls.stop()
    Case $cmdPlay
    $oWMP.controls.play()

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

    EndSelect
    WEnd

    [/autoit]


    Also wie man hoffentlich sehen kann, wurde der Stream vorher per Combo ausgewählt, jetzt will ich ihn per TrayMenu einstellen...Weis einer weiter wie ich so ne ähnliche abfrage machen kann?
    Falls ihr mehr Daten braucht, bitte sagen <_>

    Einmal editiert, zuletzt von jakefrost77 (2. Mai 2010 um 19:56)

  • Ja vorher hat man Radiosender per combobox ausgewählt...man hat draufgeklickt, sender gewählt und er hat diesen abgespielt.
    Und jetzt soll er das gleiche machen, nur eben im Traymenu...also ja, im prinzip ne combobox im Traymenu ôo

  • wenn ichs richtig verstanden hab meinst du das in etwa so:

    Spoiler anzeigen
    [autoit]

    Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown.

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

    $oWMP = ObjCreate("WMPlayer.OCX")

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

    $Radio = TrayCreateMenu("Radiolist")
    $radio1 = TrayCreateItem("Technobase.fm", $Radio, -1,1)
    $radio2 = TrayCreateItem("Housetime.fm", $Radio, -1,1)
    $radio3 = TrayCreateItem("Hardbase.fm", $Radio, -1,1)
    $radio4 = TrayCreateItem("Happy Hardcore Radio", $Radio, -1,1)
    $radio5 = TrayCreateItem("Coretime.fm", $Radio, -1,1)
    $radio6 = TrayCreateItem("Afterhours.fm", $Radio, -1,1)
    $cmdPlay = TrayCreateItem("Play")
    $cmdStop = TrayCreateItem("Stop")

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

    While 1
    $tmsg = TrayGetMsg()
    Switch TrayGetMsg()
    Case $radio1
    $oWMP.URL = "http://listen.technobase.fm/tunein-dsl-asx"
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio2
    $oWMP.URL = $urlHb
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio3
    $oWMP.URL = $urlHhr
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio4
    $oWMP.URL = $urlTb
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio5
    $oWMP.URL = $urlCt
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio6
    $oWMP.URL = $urlAh
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $cmdStop
    $oWMP.controls.stop()
    Case $cmdPlay
    $oWMP.controls.play()
    EndSwitch
    WEnd

    [/autoit]

    Ich Garantiere für Fehler :D

    //P.S.: das is der code, den ich benutzt hatte, wollte jetzt nicht jeden sender einzelnd testen

    Mfg. PCKing


    Mein PC

    CPU: AMD FX 8350 8x4.00GHz
    Ram: 8GB DDR3
    Grafikkarte: Nvidia Geforce GTX 960 (4GB)
    Festplatten: 500GB SSD 1TB HDD
    Laufwerk: Blueray RW+ Brenner

    Einmal editiert, zuletzt von PCKing (2. Mai 2010 um 01:59)

  • also die combo haste jetz ja eigenlich schon

    also musste nur den code des traymenus einbaun

    und das select übernehmen


    edit

    also so

    Spoiler anzeigen
    [autoit]

    $comSender = GUICtrlCreateCombo (" ",15, 35, 200, 25)
    GUICtrlSetData(-1, "Technobase.fm|Housetime.fm|Hardbase.fm|Happy Hardcore Radio|Trancebase.fm|Coretime.fm|Afterhours.fm|Psychedelik (Progressive Trance)|Psychedelik (Dark Psyché)|Psychedelik (Psy Trance)|DNB Radio", "Technobase.fm")
    Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown.
    $Radio = TrayCreateMenu("Radiolist")
    $radio1 = TrayCreateItem("Technobase.fm", $Radio, -1,1)
    $radio2 = TrayCreateItem("Housetime.fm", $Radio, -1,1)
    $radio3 = TrayCreateItem("Hardbase.fm", $Radio, -1,1)
    $radio4 = TrayCreateItem("Happy Hardcore Radio", $Radio, -1,1)
    $radio5 = TrayCreateItem("Coretime.fm", $Radio, -1,1)
    $radio6 = TrayCreateItem("Afterhours.fm", $Radio, -1,1)
    While 1
    $tmsg = TrayGetMsg()
    Select
    Case $tmsg = $Radio
    $oWMP.controls.stop()
    Switch TrayGetMsg()
    Case $radio1
    $oWMP.URL = $urlHt
    Case $radio2
    $oWMP.URL = $urlHb
    Case $radio3
    $oWMP.URL = $urlHhr
    Case $radio4
    $oWMP.URL = $urlTb
    Case $radio5
    $oWMP.URL = $urlCt
    Case $radio6
    $oWMP.URL = $urlAh
    EndSwitch
    $oWMP.controls.play()
    ; beim wechseln des Streams soll wieder von vorn gezählt werden.
    $zeit = TimerInit()
    EndSelect
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $comSender
    ; Falls grade ein Stream abgespielt wird, wird er gestoppt
    $oWMP.controls.stop()
    Switch GUICtrlRead($comSender)
    Case 'Technobase.fm'
    $oWMP.URL = $urlTe ;Stellt die Eigenschaft "URL" zu dem Online-Stream
    Case 'Housetime.fm'
    $oWMP.URL = $urlHt
    Case 'Hardbase.fm'
    $oWMP.URL = $urlHb
    Case 'Happy Hardcore Radio'
    $oWMP.URL = $urlHhr
    Case 'Trancebase.fm'
    $oWMP.URL = $urlTb
    Case 'Coretime.fm'
    $oWMP.URL = $urlCt
    Case 'Afterhours.fm'
    $oWMP.URL = $urlAh
    EndSwitch
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $cmdStop
    $oWMP.controls.stop()
    Case $cmdPlay
    $oWMP.controls.play()
    EndSwitch
    WEnd

    [/autoit]
  • Erstmal danke für die Antworten, leider klappts immer noch nicht wirklich.
    Mein Poblem ist auch, dass ich GUI und Tray nebeneinander laufen lassen will...
    Also brauch ich ja 2 Abfragen, Gui und Tray damit ich beides usen kann...
    Nochmal die komplette schleife...hab ich das überhaupt richtig gemacht mit den Gui und TrayGetMsg?

    Spoiler anzeigen
    [autoit]

    While 1
    $msg = GUIGetMsg()
    $tmsg = TrayGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $slVolume
    $oWMP.settings.volume = GUICtrlRead($slVolume)
    Case $msg = $Start1
    MsgBox(4096,"Succes","Funktioniert!")
    Case $msg = $Start2
    MsgBox(4096,"Succes","Funktioniert!")
    Case $msg = $Exit
    Exit 0
    Case $tmsg = $exititem
    Exit 0
    Case $tmsg = $onitem
    $UG = False
    GUICtrlSetState ($onitem, $TRAY_CHECKED)
    GUICtrlSetState ($offitem, $TRAY_UNCHECKED)

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

    Case $tmsg = $offitem

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

    ;InputBox features: Title=Yes, Prompt=Yes, Default Text=No, Pwd Char=*, Mandatory, Width=100, Height=120
    $Answer = InputBox("Password","Please enter the password","","*M","100","120","-1","-1", 0, $controlGui)

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

    If $Answer = $Password Then
    $UG = True
    GUICtrlSetState ($onitem, $TRAY_UNCHECKED)
    GUICtrlSetState ($offitem, $TRAY_CHECKED)

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

    ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Info, Timeout=10 ss, Miscellaneous=Top-most attribute
    MsgBox(262208,"Password","Password accepted. The limits are removed now!",10, $controlGui)
    Else
    ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Critical, Timeout=10 ss, Miscellaneous=Top-most attribute
    MsgBox(262160,"Password","Access denied, your password was wrong.",10, $controlGui)
    EndIf
    Case $tmsg = $aboutitem
    MsgBox(4096,"Credits","")
    ; Hier wird die Lautstärke gesetzt

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

    Case $tmsg = TrayGetMsg()

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

    $oWMP.controls.stop()
    Switch TrayGetMsg()
    Case $radio1
    $oWMP.URL = 'http://listen.technobase.fm/tunein-dsl-asx'
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio2
    $oWMP.URL = 'http://listen.housetime.fm/tunein-dsl-asx'
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio3
    $oWMP.URL = 'http://listen.hardbase.fm/tunein-dsl-asx'
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio4
    $oWMP.URL = 'http://88.191.69.69:80/'
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio5
    $oWMP.URL = 'http://listen.trancebase.fm/tunein-dsl-asx'
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio6
    $oWMP.URL = 'http://listen.coretime.fm/tunein-dsl-asx'
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $cmdStop
    $oWMP.controls.stop()
    Case $cmdPlay
    $oWMP.controls.play()

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

    EndSwitch
    EndSelect
    WEnd

    [/autoit]

    Edit:Es sieht jetzt so aus, er startet radio aber ich kann den Sener leider nicht wechseln

    Spoiler anzeigen
    [autoit]

    While 1
    $msg = GUIGetMsg()

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

    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $slVolume
    $oWMP.settings.volume = GUICtrlRead($slVolume)
    Case $msg = $Start1
    MsgBox(4096,"Succes","Funktioniert!")
    Case $msg = $Start2
    MsgBox(4096,"Succes","Funktioniert!")
    Case $msg = $Exit
    Exit 0
    EndSelect

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

    $tmsg = TrayGetMsg()

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

    Select
    Case $tmsg = $exititem
    Exit 0
    Case $tmsg = $onitem
    $UG = False
    GUICtrlSetState ($onitem, $TRAY_CHECKED)
    GUICtrlSetState ($offitem, $TRAY_UNCHECKED)

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

    Case $tmsg = $offitem

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

    ;InputBox features: Title=Yes, Prompt=Yes, Default Text=No, Pwd Char=*, Mandatory, Width=100, Height=120
    $Answer = InputBox("Password","Please enter the password","","*M","100","120","-1","-1", 0, $controlGui)

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

    If $Answer = $Password Then
    $UG = True
    GUICtrlSetState ($onitem, $TRAY_UNCHECKED)
    GUICtrlSetState ($offitem, $TRAY_CHECKED)

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

    ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Info, Timeout=10 ss, Miscellaneous=Top-most attribute
    MsgBox(262208,"Password","Password accepted. The limits are removed now!",10, $controlGui)
    Else
    ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=Critical, Timeout=10 ss, Miscellaneous=Top-most attribute
    MsgBox(262160,"Password","Access denied, your password was wrong.",10, $controlGui)
    EndIf
    Case $tmsg = $aboutitem
    MsgBox(4096,"Credits","")
    ; Hier wird die Lautstärke gesetzt

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

    Case $tmsg = TrayGetMsg()

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

    $oWMP.controls.stop()
    Switch TrayGetMsg()
    Case $tmsg = $radio1
    $oWMP.URL = 'http://listen.technobase.fm/tunein-dsl-asx'
    $oWMP.controls.play()

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

    Case $tmsg = $radio2
    $oWMP.URL = 'http://listen.housetime.fm/tunein-dsl-asx'
    $oWMP.controls.play()

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

    Case $tmsg = $radio3
    $oWMP.URL = 'http://listen.hardbase.fm/tunein-dsl-asx'
    $oWMP.controls.play()

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

    Case $tmsg = $radio4
    $oWMP.URL = 'http://88.191.69.69:80/'
    $oWMP.controls.play()

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

    Case $tmsg = $radio5
    $oWMP.URL = 'http://listen.trancebase.fm/tunein-dsl-asx'
    $oWMP.controls.play()

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

    Case $tmsg = $radio6
    $oWMP.URL = 'http://listen.coretime.fm/tunein-dsl-asx'
    $oWMP.controls.play()

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

    Case $cmdStop
    $oWMP.controls.stop()
    Case $cmdPlay
    $oWMP.controls.play()

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

    EndSwitch
    EndSelect
    WEnd

    [/autoit]

    Einmal editiert, zuletzt von jakefrost77 (2. Mai 2010 um 02:24)

  • lad ma pls den ganzen code hoch

    mit so schnipseln zu arbeiten is etwas schwer


    edit

    [autoit]


    $tmsg = TrayGetMsg()
    Select
    Case $tmsg = TrayGetMsg()
    $oWMP.controls.stop()

    Endselect

    [/autoit]

    da is n fehler

    weil tmsg is ja immer traygetmsg()

  • Ok, ich poste mal das komplette Radio script...
    Genau das, soll halt eben als TrayMenü fungieren^^

    Spoiler anzeigen
    [autoit]


    Const $urlTe = 'http://listen.technobase.fm/tunein-dsl-asx'
    Const $urlHt = 'http://listen.housetime.fm/tunein-dsl-asx'
    Const $urlHb = 'http://listen.hardbase.fm/tunein-dsl-asx'
    Const $urlHhr = 'http://88.191.69.69:80/'
    Const $urlTb = 'http://listen.trancebase.fm/tunein-dsl-asx'
    Const $urlCt = 'http://listen.coretime.fm/tunein-dsl-asx'
    Const $urlAh = 'http://nl2.ah.fm:9000'
    Const $urlPg = 'http://88.191.40.72:8010'
    Const $urlDt = 'http://88.191.38.140:8014'
    Const $urlPt = 'http://88.191.18.242:8000'
    Const $urlDnb = 'http://80.237.204.49:8000/'

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

    ;Erstellt ein Windows Media Player Objekt (http://msdn.microsoft.com/en-us/library/bb249680(VS.85).aspx)
    $oWMP = ObjCreate ( "WMPLayer.ocx" )
    ;Default URL:
    $oWMP.URL = $urlTe ;Stellt die Eigenschaft "URL" zu dem Online-Stream
    $oWMP.controls.stop()

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

    ;Array für die einzelnen Zustande (Info)
    Dim $arrStatus[12]
    $arrStatus[0] = 'Unbekannt'
    $arrStatus[1] = 'Gestoppt'
    $arrStatus[2] = 'Pause'
    $arrStatus[3] = 'Playing'
    $arrStatus[4] = 'ScanForward'
    $arrStatus[5] = 'ScanReverse'
    $arrStatus[6] = 'Buffering'
    $arrStatus[7] = 'Warten'
    $arrStatus[8] = 'MediaEnded'
    $arrStatus[9] = 'Transitioning'
    $arrStatus[10] = 'Bereit'
    $arrStatus[11] = 'Wiederverbinden...'

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

    ; Variable für das Anzeigen der Info, damit ein blinken vermieden wird.Trotzdem blibkt die Sau manchma >-<
    $lastStatus = 0

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

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <GUIConstants.au3>

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

    ; Breite,Höhe, x ,y
    $Form1 = GUICreate ("Internet Radio by JakeFrost77", 230, 200, @DesktopWidth/2-250, @DesktopHeight/2-45) ;Durch die Beiden letzten Befehle, wird der Trainer, egal bei welcher Auflösung
    ; Immer an der selben Stelle geöffnet

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

    $credit = GUICtrlCreateLabel ("Script by JakeFrost77 =P", 15, 170 )
    $comSender = GUICtrlCreateCombo ("", 15, 35, 200, 25)
    GUICtrlSetData(-1, "Technobase.fm|Housetime.fm|Hardbase.fm|Happy Hardcore Radio|Trancebase.fm|Coretime.fm|Afterhours.fm|Psychedelik (Progressive Trance)|Psychedelik (Dark Psyché)|Psychedelik (Psy Trance)|DNB Radio", "Technobase.fm")
    $lblSender = GUICtrlCreateLabel ("Senderliste:", 15, 8, 59, 17)
    $cmdPlay = GUICtrlCreateButton ("Abspielen", 13, 70, 93, 23, $WS_GROUP)
    $cmdStop = GUICtrlCreateButton ("Start", 123, 70, 93, 23, $WS_GROUP)
    $lblInfo = GUICtrlCreateLabel ("Info...", 15, 100, 200 )
    $lblPlayTime = GUICtrlCreateLabel ("00:00:00", 170, 100)

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

    ; Das ist der Slider für die Lautstärke
    $slVolume = GUICtrlCreateSlider ( 15,130, 200, 25)
    GUICtrlSetData(-1,$oWMP.settings.volume()) ; Hier wird der Startwert gelesen, der ist immer 50

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

    GUISetState(@SW_SHOW)

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

    $zeit = 0

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    ; Hier wird die Lautstärke gesetzt
    Case $slVolume
    $oWMP.settings.volume = GUICtrlRead($slVolume)
    Case $comSender
    ; Falls grade ein Stream abgespielt wird, wird er gestoppt
    $oWMP.controls.stop()
    Switch GUICtrlRead($comSender)
    Case 'Technobase.fm'
    $oWMP.URL = $urlTe ;Stellt die Eigenschaft "URL" zu dem Online-Stream
    Case 'Housetime.fm'
    $oWMP.URL = $urlHt
    Case 'Hardbase.fm'
    $oWMP.URL = $urlHb
    Case 'Happy Hardcore Radio'
    $oWMP.URL = $urlHhr
    Case 'Trancebase.fm'
    $oWMP.URL = $urlTb
    Case 'Coretime.fm'
    $oWMP.URL = $urlCt
    Case 'Afterhours.fm'
    $oWMP.URL = $urlAh
    Case 'Psychedelik (Progressive Trance)'
    $oWMP.URL = $urlPg
    Case 'Psychedelik (Dark Psyché)'
    $oWMP.URL = $urlDt
    Case 'Psychedelik (Psy Trance)'
    $oWMP.URL = $urlPt
    Case 'DNB Radio'
    $oWMP.URL = $urlDnb
    EndSwitch
    $oWMP.controls.play()
    ; beim wechseln des Streams soll wieder von vorn gezählt werden.
    $zeit = TimerInit()
    Case $cmdStop
    $oWMP.controls.stop()
    Case $cmdPlay
    $oWMP.controls.play()
    EndSwitch

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

    ;Die komische Rechnung hier braucht ihr eigentlich gar nicht verstehen xD Hauptsache sie funktioniert =P
    $curStatus = $oWMP.playstate
    If $curStatus <> $lastStatus Then
    GUICtrlSetData($lblInfo, $arrStatus[$curStatus])
    $lastStatus = $curStatus
    EndIf

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

    ; ist der Status auf gestoppt (1) oder unbekannt (0)
    ; wir die Zeitanzeige wieder auf 0 gesetzt und die
    ; Variable zeit auf 0
    If $curStatus = 1 or $curStatus = 0 Then
    $zeit = 0
    GUICtrlSetData($lblPlayTime,'00:00:00')
    ; Wird der Stream abgespielt und ist die Variable
    ; zeit auf 0, dann setze zeit auf die Init Zeit
    ElseIf $curStatus = 3 And $zeit = 0 Then
    $zeit = TimerInit()
    EndIf

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

    ; ist zeit größer 0 berechne die Zeit
    ; und gib sie aus
    If $zeit > 0 Then
    ; wandele die Millisekunden in Sekunden um
    $diff = round(round(TimerDiff($zeit),0) / 1000,0)
    ; Berechne Stunden, Minuten und Sekunken und gib sie mit
    ; führenden Nullen aus.
    GUICtrlSetData($lblPlayTime,StringFormat("%02d:%02d:%02d",((($diff-mod($diff,60))/60)-mod(($diff-mod($diff,60))/60,60))/60,mod(($diff-mod($diff,60))/60,60),mod($diff,60)))
    EndIf
    WEnd
    exit

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

    $oWMP.URL = "http://listen.technobase.fm/tunein-dsl-asx" ;Stellt die Eigenschaft "URL" zu dem Online-Stream
    ;von hr3.de ein, sollte automatisch starten

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

    $oWMP.controls.play() ;explizit starten

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

    While $oWMP.playstate > 2 ;solang der Windows Media Player den Stream lädt, buffert, abspielt usw.
    Sleep ( 10 ) ;schlafen, damit AutoIt sich nicht beendet und die Musik aufhört
    WEnd

    [/autoit]
  • soa hier

    Spoiler anzeigen
    [autoit]

    Const $urlTe = 'http://listen.technobase.fm/tunein-dsl-asx'
    Const $urlHt = 'http://listen.housetime.fm/tunein-dsl-asx'
    Const $urlHb = 'http://listen.hardbase.fm/tunein-dsl-asx'
    Const $urlHhr = 'http://88.191.69.69:80/'
    Const $urlTb = 'http://listen.trancebase.fm/tunein-dsl-asx'
    Const $urlCt = 'http://listen.coretime.fm/tunein-dsl-asx'
    Const $urlAh = 'http://nl2.ah.fm:9000'
    Const $urlPg = 'http://88.191.40.72:8010'
    Const $urlDt = 'http://88.191.38.140:8014'
    Const $urlPt = 'http://88.191.18.242:8000'
    Const $urlDnb = 'http://80.237.204.49:8000/'
    ;Erstellt ein Windows Media Player Objekt (http://msdn.microsoft.com/en-us/library/bb249680(VS.85).aspx)
    $oWMP = ObjCreate ( "WMPLayer.ocx" )
    ;Default URL:
    $oWMP.URL = $urlTe ;Stellt die Eigenschaft "URL" zu dem Online-Stream
    $oWMP.controls.stop()
    ;Array für die einzelnen Zustande (Info)
    Dim $arrStatus[12]
    $arrStatus[0] = 'Unbekannt'
    $arrStatus[1] = 'Gestoppt'
    $arrStatus[2] = 'Pause'
    $arrStatus[3] = 'Playing'
    $arrStatus[4] = 'ScanForward'
    $arrStatus[5] = 'ScanReverse'
    $arrStatus[6] = 'Buffering'
    $arrStatus[7] = 'Warten'
    $arrStatus[8] = 'MediaEnded'
    $arrStatus[9] = 'Transitioning'
    $arrStatus[10] = 'Bereit'
    $arrStatus[11] = 'Wiederverbinden...'
    ; Variable für das Anzeigen der Info, damit ein blinken vermieden wird.Trotzdem blibkt die Sau manchma >-<
    $lastStatus = 0

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

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <GUIConstants.au3>

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

    ; Breite,Höhe, x ,y
    $Form1 = GUICreate ("Internet Radio by JakeFrost77", 230, 200, @DesktopWidth/2-250, @DesktopHeight/2-45) ;Durch die Beiden letzten Befehle, wird der Trainer, egal bei welcher Auflösung
    ; Immer an der selben Stelle geöffnet
    Opt("TrayMenuMode", 1) ; Default tray menu items (Script Paused/Exit) will not be shown.
    $credit = GUICtrlCreateLabel ("Script by JakeFrost77 =P", 15, 170 )
    $comSender = GUICtrlCreateCombo ("", 15, 35, 200, 25)
    GUICtrlSetData(-1, "Technobase.fm|Housetime.fm|Hardbase.fm|Happy Hardcore Radio|Trancebase.fm|Coretime.fm|Afterhours.fm|Psychedelik (Progressive Trance)|Psychedelik (Dark Psyché)|Psychedelik (Psy Trance)|DNB Radio", "Technobase.fm")
    $lblSender = GUICtrlCreateLabel ("Senderliste:", 15, 8, 59, 17)
    $cmdPlay = GUICtrlCreateButton ("Abspielen", 13, 70, 93, 23, $WS_GROUP)
    $cmdStop = GUICtrlCreateButton ("Start", 123, 70, 93, 23, $WS_GROUP)
    $lblInfo = GUICtrlCreateLabel ("Info...", 15, 100, 200 )
    $lblPlayTime = GUICtrlCreateLabel ("00:00:00", 170, 100)
    $Radio = TrayCreateMenu("Radiolist")
    $radio1 = TrayCreateItem("Technobase.fm", $Radio, -1,1)
    $radio2 = TrayCreateItem("Housetime.fm", $Radio, -1,1)
    $radio3 = TrayCreateItem("Hardbase.fm", $Radio, -1,1)
    $radio4 = TrayCreateItem("Happy Hardcore Radio", $Radio, -1,1)
    $radio5 = TrayCreateItem("Coretime.fm", $Radio, -1,1)
    $radio6 = TrayCreateItem("Afterhours.fm", $Radio, -1,1)

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

    ; Das ist der Slider für die Lautstärke
    $slVolume = GUICtrlCreateSlider ( 15,130, 200, 25)
    GUICtrlSetData(-1,$oWMP.settings.volume()) ; Hier wird der Startwert gelesen, der ist immer 50

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

    GUISetState(@SW_SHOW)
    $zeit = 0
    While 1
    $nMsg = GUIGetMsg()
    $tmsg = TrayGetMsg()
    If $tmsg = $Radio Then MsgBox(0, "", "")
    Switch $tmsg
    Case $radio1
    $oWMP.controls.stop()
    $oWMP.URL = $urlHt
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio2
    $oWMP.controls.stop()
    $oWMP.URL = $urlHb
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio3
    $oWMP.controls.stop()
    $oWMP.URL = $urlHhr
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio4
    $oWMP.controls.stop()
    $oWMP.URL = $urlTb
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio5
    $oWMP.controls.stop()
    $oWMP.URL = $urlCt
    $oWMP.controls.play()
    $zeit = TimerInit()
    Case $radio6
    $oWMP.controls.stop()
    $oWMP.URL = $urlAh
    $oWMP.controls.play()
    $zeit = TimerInit()
    EndSwitch

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

    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    ; Hier wird die Lautstärke gesetzt
    Case $slVolume
    $oWMP.settings.volume = GUICtrlRead($slVolume)
    Case $comSender
    ; Falls grade ein Stream abgespielt wird, wird er gestoppt
    $oWMP.controls.stop()
    Switch GUICtrlRead($comSender)
    Case 'Technobase.fm'
    $oWMP.URL = $urlTe ;Stellt die Eigenschaft "URL" zu dem Online-Stream
    Case 'Housetime.fm'
    $oWMP.URL = $urlHt
    Case 'Hardbase.fm'
    $oWMP.URL = $urlHb
    Case 'Happy Hardcore Radio'
    $oWMP.URL = $urlHhr
    Case 'Trancebase.fm'
    $oWMP.URL = $urlTb
    Case 'Coretime.fm'
    $oWMP.URL = $urlCt
    Case 'Afterhours.fm'
    $oWMP.URL = $urlAh
    Case 'Psychedelik (Progressive Trance)'
    $oWMP.URL = $urlPg
    Case 'Psychedelik (Dark Psyché)'
    $oWMP.URL = $urlDt
    Case 'Psychedelik (Psy Trance)'
    $oWMP.URL = $urlPt
    Case 'DNB Radio'
    $oWMP.URL = $urlDnb
    EndSwitch
    $oWMP.controls.play()
    ; beim wechseln des Streams soll wieder von vorn gezählt werden.
    $zeit = TimerInit()
    Case $cmdStop
    $oWMP.controls.stop()
    Case $cmdPlay
    $oWMP.controls.play()
    EndSwitch
    ;Die komische Rechnung hier braucht ihr eigentlich gar nicht verstehen xD Hauptsache sie funktioniert =P
    $curStatus = $oWMP.playstate
    If $curStatus <> $lastStatus Then
    GUICtrlSetData($lblInfo, $arrStatus[$curStatus])
    $lastStatus = $curStatus
    EndIf
    ; ist der Status auf gestoppt (1) oder unbekannt (0)
    ; wir die Zeitanzeige wieder auf 0 gesetzt und die
    ; Variable zeit auf 0
    If $curStatus = 1 or $curStatus = 0 Then
    $zeit = 0
    GUICtrlSetData($lblPlayTime,'00:00:00')
    ; Wird der Stream abgespielt und ist die Variable
    ; zeit auf 0, dann setze zeit auf die Init Zeit
    ElseIf $curStatus = 3 And $zeit = 0 Then
    $zeit = TimerInit()
    EndIf
    ; ist zeit größer 0 berechne die Zeit
    ; und gib sie aus
    If $zeit > 0 Then
    ; wandele die Millisekunden in Sekunden um
    $diff = round(round(TimerDiff($zeit),0) / 1000,0)
    ; Berechne Stunden, Minuten und Sekunken und gib sie mit
    ; führenden Nullen aus.
    GUICtrlSetData($lblPlayTime,StringFormat("%02d:%02d:%02d",((($diff-mod($diff,60))/60)-mod(($diff-mod($diff,60))/60,60))/60,mod(($diff-mod($diff,60))/60,60),mod($diff,60)))
    EndIf
    WEnd
    exit
    $oWMP.URL = "http://listen.technobase.fm/tunein-dsl-asx" ;Stellt die Eigenschaft "URL" zu dem Online-Stream
    ;von hr3.de ein, sollte automatisch starten
    $oWMP.controls.play() ;explizit starten
    While $oWMP.playstate > 2 ;solang der Windows Media Player den Stream lädt, buffert, abspielt usw.
    Sleep ( 10 ) ;schlafen, damit AutoIt sich nicht beendet und die Musik aufhört
    WEnd

    [/autoit]