Sender laden

  • Ich wollte in mein script einbauen dass man selbstdefinierte sender abrufen kann bisher habe ich folgendes:

    Spoiler anzeigen
    [autoit]

    #region radio
    $sender = "Antenne Bayern|Rock Antenne|Bayern 3|TechnoBase.FM"

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

    $var = IniReadSection($INR_INI,"Sender")
    If Not $var = "" Then
    For $i = 1 To $var[0][0]
    $sender & $var[$i][0]
    Next
    EndIf

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

    $oIE = _IECreateEmbedded()
    GUICtrlCreateObj($oIE, -300, -300, 0, 0)
    $SenderCombo = GUICtrlCreateCombo("", 445, 20, 153, 25)
    GUICtrlSetData(-1, $sender)
    GUICtrlCreateIcon("inradio.ico", "", 463, 165, 125, 50)
    $PlayRadio = GUICtrlCreateButton("Play", 465, 60, 121, 25, 0)
    GUICtrlSetOnEvent(-1, "Playradio")

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

    $StopRadio = GUICtrlCreateButton("Stop", 465, 92, 121, 25, 0)
    GUICtrlSetOnEvent(-1, "Stopradio")

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

    $Credits = GUICtrlCreateButton("Credits", 465, 124, 121, 25, 0)
    GUICtrlSetOnEvent(-1, "Credits")

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

    GUICtrlCreateLabel("Gerade gespielt:", 465, 230)
    $Playing = GUICtrlCreateLabel("", 465, 250, 150, 30)
    $URL_Y_N = GUICtrlCreateCheckbox("Internetadresse angeben", 405, 300)
    GUICtrlSetOnEvent(-1, "Url_y_n")

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

    $Urllink = GUICtrlCreateInput("Bitte URL angeben", 405, 330)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $OpenUrl = GUICtrlCreateButton("Laden", 405, 360)
    GUICtrlSetOnEvent(-1, "Openurl")

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

    GUICtrlSetState(-1, $GUI_DISABLE)
    $FeedSuport = GUICtrlCreateButton("Feedback/Support", 410, 400)
    GUICtrlSetOnEvent(-1, "FeedSupp")

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

    $Toolsstart = GUICtrlCreateButton("Tools", 520, 400, 50)
    GUICtrlSetOnEvent(-1, "Toolsstart")

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

    $senderadd = GUICtrlCreateButton("Sender Hinzufügen", 410, 420)
    GUICtrlSetOnEvent(-1, "senderadd")
    #endregion radio

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

    .......

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

    Func Playradio()
    GUICtrlSetData($Playing, GUICtrlRead($SenderCombo))
    If $Playingstate = 1 Or 2 Then
    _BASS_ChannelStop($hMusic)
    ElseIf $Playingstate = 3.1 Then
    _IENavigate($oIE, "about:blank")
    ElseIf $Playingstate = 3.2 Then
    $oWMP.controls.stop()
    $Playingstate = -1
    EndIf
    If GUICtrlRead($SenderCombo) = "" Then
    MsgBox(0, "Error", "Sie haben kein Radio ausgew?hlt!")
    ElseIf GUICtrlRead($SenderCombo) = "Antenne Bayern" Then
    $oWMP.URL = "http://www.antenne.de/webradio/antenne.wmx"
    $oWMP.controls.play()
    $Playingstate = 3
    ElseIf GUICtrlRead($SenderCombo) = "Bayern 3" Then
    $oWMP.URL = "http://streams.br-online.de/bayern3_1.asx"
    $oWMP.controls.play()
    $Playingstate = 3
    ElseIf GUICtrlRead($SenderCombo) = "Rock Antenne" Then
    $oWMP.URL = "http://www.rockantenne.de/webradio/rockantenne.wmx"
    $oWMP.controls.play()
    $Playingstate = 3
    ElseIf GUICtrlRead($SenderCombo) = "B5 Aktuell" Then
    $oWMP.URL = "http://streams.br-online.de/b5aktuell_1.asx"
    $oWMP.controls.play()
    $Playingstate = 3
    ElseIf GUICtrlRead($SenderCombo) = "TechnoBase.FM" Then
    $oWMP.URL = "http://listen.technobase.fm/tunein-dsl-asx"
    $oWMP.controls.play()
    $Playingstate = 3
    EndIf
    EndFunc ;==>Playradio

    [/autoit]

    Die urls stehen in $var[$i][1]
    wie kann ich das mit dem laden machen?
    Jmd ne idee?

    2 Mal editiert, zuletzt von JuraX (11. April 2010 um 22:18)

  • bau die Ini-Datei so auf:

    Code
    [Antenne Bayern]
    URL='...'
    [Rock Antenne]
    URL='...'
    [Bayern 3]
    URL='...'
    [TechnoBase.FM]
    URL='...'

    Und wenn du nun einen Sender auswählst, machst du folgendes:

    [autoit]

    $sSender = "Rock Antenne" ; kommt von wo auch immer her, ComboBox, Input, sonst was
    $sURL = IniRead("Settings.ini",$sSender,"URL","Nicht gefunden")
    If $sURL <> "Nicht gefunden" Then MsgBox(0,"URL","Die URL zum Sender '" & $sSender & "' lautet: " & @LF & $sURL)

    [/autoit]


    [MSIE_newline_end ]