Code:
#NoTrayIcon
#include <INet.au3>
#include <String.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <GuiConstants.au3>
Const $CBS_DROPDOWNLIST=0x0003
$GUI=GuiCreate("We aRe oNe Player", 200, 180, -1, -1)
GUISetBkColor(0x000000)
GUISetFont(11, 700)
$auswahl_combo=GUICtrlCreateCombo("", 10, 10, 180, 25, $CBS_DROPDOWNLIST)
GUICtrlSetData($auswahl_combo, "Technobase.fm|Housetime.fm|Hardbase.fm|Trancebase.fm|Coretime.fm")
$anzeige_input=GUICtrlCreateEdit("", 10, 50, 180, 40, $ES_MULTILINE+$ES_CENTER+$ES_READONLY)
$starten_button=GUICtrlCreateButton("Play", 40, 100, 50, 25)
$stoppen_button=GUICtrlCreateButton("Stop", 110, 100, 50, 25)
$lautstaerke_slider=GUICtrlCreateSlider(10, 140, 180, 25)
GUICtrlSetData($lautstaerke_slider, 50)
GUICtrlSetBkColor($starten_button, 0x000000)
GUICtrlSetBkColor($stoppen_button, 0x000000)
GUICtrlSetBkColor($auswahl_combo, 0x000000)
GUICtrlSetBkColor($anzeige_input, 0x000000)
GUICtrlSetBkColor($lautstaerke_slider, 0x000000)
GUICtrlSetColor($starten_button, 0x20B2AA)
GUICtrlSetColor($stoppen_button, 0x20B2AA)
GUICtrlSetColor($auswahl_combo, 0xB22222)
GUICtrlSetColor($anzeige_input, 0x00FF00)
;~ GUICtrlSetColor($lautstaerke_slider, 0x0F4A460)
GUISetState()
AdlibRegister("aktualisieren", 5000)
$stream = ObjCreate("WMPlayer.OCX.7")
With $stream
.settings.Balance = 0
.controls.stop()
EndWith
Global $text=abrufen()
GUICtrlSetData($anzeige_input, $text)
While 1
stream.settings.volume = GUICtrlRead($lautstaerke_slider)
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ende()
Case $starten_button
starten()
Case $stoppen_button
stoppen()
EndSwitch
WEnd
Func abrufen()
$auswahl=GUICtrlRead($auswahl_combo)
If Not $auswahl="" Then
$url="http://www." & $auswahl & "/tracklist.php"
$quelle=_INetGetSource($url)
$return=_StringBetween($quelle, '<th style="width:100%">', '</th></tr></tbody>')
$return=saeubern($return[0])
If @error Then
Return "Unbekanntes Lied/Playlist"
EndIf
return $return
Else
Return "-"
EndIf
EndFunc
Func saeubern($zeichen)
$return=StringRegExpReplace($zeichen, '<a href="(.)*">', "")
$return=StringReplace($return, '</a>', "")
$return=StringReplace($return, '&', "&")
Return $return
EndFunc
Func aktualisieren()
$stream.settings.volume = GUICtrlRead($lautstaerke_slider)
$text_neu=abrufen()
If $text<>$text_neu Then
GUICtrlSetData($anzeige_input, $text_neu)
EndIf
EndFunc
Func starten()
$auswahl=GUICtrlRead($auswahl_combo)
If Not $auswahl="" Then
GUICtrlSetState($auswahl_combo, $GUI_DISABLE)
Switch $auswahl
Case "Technobase.fm"
$stream.URL = "http://listen.technobase.fm/dsl.asx"
Case "Housetime.fm"
$stream.URL = "http://listen.housetime.fm/dsl.asx"
Case "Hardbase.fm"
$stream.URL = "http://listen.hardbase.fm/dsl.asx"
Case "Trancebase.fm"
$stream.URL = "http://listen.trancebase.fm/dsl.asx"
Case "coretime.fm"
$stream.URL = "http://listen.coretime.fm/dsl.asx"
EndSwitch
$stream.controls.play()
Else
MsgBox(16, "Fehler", "Bitte wählen sie ein Radio aus")
EndIf
EndFunc
Func stoppen()
$stream.controls.stop()
GUICtrlSetState($auswahl_combo, $GUI_ENABLE)
EndFunc
Func ende()
$stream.controls.stop()
MsgBox(0, "Copyright", "(c) .Infinite")
Exit
EndFunc