Created
January 17, 2012 22:33
-
-
Save cdecker/1629438 to your computer and use it in GitHub Desktop.
GTK Frontend for Wilmaa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gtk | |
from mplayer.gtk2 import GtkPlayerView | |
import threading | |
import time | |
channels = { | |
'SF1': { | |
'url': "http://gartenhof.live1-f.akamaihd.net/sf1_1_800@43046" | |
}, | |
'SF2': { | |
'url': "http://gartenhof.live1-f.akamaihd.net/sf2_1_800@43048" | |
}, | |
'SFINFO': { | |
'url': "http://gartenhoflive4-f.akamaihd.net/sfinfo_1_800@45505" | |
}, | |
'RTL': { | |
'url': "http://gartenhof.live1-f.akamaihd.net/rtl_1_800@43050" | |
}, | |
'PRO7': { | |
'url': "http://gartenhof.live1-f.akamaihd.net/pro7_1_800@43051" | |
}, | |
'VOX': { | |
'url': "http://gartenhof.live1-f.akamaihd.net/vox_1_800@43052" | |
}, | |
'RTL2': { | |
'url': "http://gartenhof.live1-f.akamaihd.net/rtl2_1_800@43053" | |
}, | |
'SRTL': { | |
'url': "http://gartenhoflive2-f.akamaihd.net/superrtl_1_800@44489" | |
}, | |
'KABEL1': { | |
'url': "http://gartenhof.live1-f.akamaihd.net/kabel1_1_800@43055" | |
}, | |
'MTV': { | |
'url': "http://gartenhoflive2-f.akamaihd.net/mtv_1_800@44488" | |
}, | |
'VIVA': { | |
'url': "http://gartenhoflive4-f.akamaihd.net/viva_1_800@45507" | |
}, | |
'STARTV': { | |
'url': "http://gartenhoflive6-f.akamaihd.net/startv_1_800@45526" | |
}, | |
'ORF1': { | |
'url': "http://gartenhof.live1-f.akamaihd.net/orf1_1_800@43059" | |
}, | |
'ORF2': { | |
'url': "http://gartenhoflive3-f.akamaihd.net/orf2_1_800@45502" | |
}, | |
'ARD': { | |
'url': "http://gartenhoflive2-f.akamaihd.net/ard_1_800@45494" | |
}, | |
'ZDF': { | |
'url': "http://gartenhoflive4-f.akamaihd.net/zdf_1_800@45509" | |
}, | |
'SAT1': { | |
'url': "http://gartenhoflive2-f.akamaihd.net/sat1_1_800@44490" | |
}, | |
'TELEZH': { | |
'url': "http://gartenhoflive2-f.akamaihd.net/telezueri_1_800@44503" | |
}, | |
'EURNWS': { | |
'url': "http://gartenhoflive6-f.akamaihd.net/euronews_1_800@45525" | |
}, | |
'CNN': { | |
'url': "http://gartenhoflive3-f.akamaihd.net/cnn_1_800@45497" | |
}, | |
'BBCWN': { | |
'url': "http://gartenhoflive4-f.akamaihd.net/bbcworld_1_800@45508" | |
}, | |
'ARTE': { | |
'url': "http://gartenhoflive3-f.akamaihd.net/arte_1_800@45495" | |
}, | |
'_3SAT': { | |
'url': "http://gartenhoflive2-f.akamaihd.net/3sat_1_800@45493" | |
}, | |
'ZDFNEO': { | |
'url': "http://gartenhoflive2-f.akamaihd.net/zdfneo_1_800@44504" | |
}, | |
'KIKA': { | |
'url': "http://gartenhoflive3-f.akamaihd.net/kika_1_800@45500" | |
}, | |
'SIXX': { | |
'url': "http://gartenhoflive5-f.akamaihd.net/sixx_1_800@45516" | |
}, | |
'DMAX': { | |
'url': "http://gartenhoflive3-f.akamaihd.net/dmax_1_800@45498" | |
}, | |
'VIERTE': { | |
'url': "http://gartenhoflive4-f.akamaihd.net/dasvierte_1_800@45510" | |
}, | |
'EUROSP': { | |
'url': "http://gartenhoflive5-f.akamaihd.net/eurosport_1_800@45515" | |
}, | |
'SPORT1': { | |
'url': "http://gartenhoflive5-f.akamaihd.net/sport1_1_800@45517" | |
}, | |
'NICKCC': { | |
'url': "http://gartenhoflive5-f.akamaihd.net/nick_cc_1_800@45519" | |
}, | |
'NTV': { | |
'url': "http://gartenhoflive6-f.akamaihd.net/ntv_1_800@45520" | |
}, | |
'TSR1': { | |
'url': "http://gartenhoflive6-f.akamaihd.net/tsr1_1_800@45522" | |
}, | |
'TSR2': { | |
'url': "http://gartenhoflive6-f.akamaihd.net/tsr2_1_800@45523" | |
}, | |
'TV5M': { | |
'url': "http://gartenhoflive5-f.akamaihd.net/tv5monde_1_800@45511" | |
}, | |
'FRANCE2': { | |
'url': "http://gartenhoflive3-f.akamaihd.net/france2_1_800@45496" | |
}, | |
'FRANCE3': { | |
'url': "http://gartenhoflive3-f.akamaihd.net/france3_1_800@45499" | |
}, | |
'FRANCE5': { | |
'url': "http://gartenhoflive3-f.akamaihd.net/france5_1_800@45501" | |
}, | |
'RTL9': { | |
'url': "http://gartenhoflive4-f.akamaihd.net/rtl9_1_800@45503" | |
}, | |
'TF1': { | |
'url': "http://gartenhoflive4-f.akamaihd.net/tf1_1_800@45504" | |
}, | |
'M6': { | |
'url': "http://gartenhoflive4-f.akamaihd.net/m6_1_800@45506" | |
}, | |
'ARTEFR': { | |
'url': "http://gartenhoflive5-f.akamaihd.net/arte_fr_1_800@45512" | |
}, | |
'RSILA1': { | |
'url': "http://gartenhoflive5-f.akamaihd.net/rsila1_1_800@45513" | |
}, | |
'RSILA2': { | |
'url': "http://gartenhoflive5-f.akamaihd.net/rsila2_1_800@45514" | |
}, | |
'RAIUNO': { | |
'url': "http://gartenhoflive2-f.akamaihd.net/rai1_1_800@44470" | |
}, | |
'RUSTOD': { | |
'url': "http://gartenhoflive6-f.akamaihd.net/rusiya_1_800@45521" | |
} | |
} | |
# Create a window | |
w = gtk.Window() | |
w.set_size_request(640, 480) | |
w.fullscreen() | |
w.set_title('pyWilmaa') | |
# Quit application when this window is closed | |
w.connect('destroy', gtk.main_quit) | |
# Create a player view | |
v = GtkPlayerView() | |
v.set_size_request(900,-1) | |
# Quit application after file has finished playing | |
#v.connect('eof', gtk.main_quit) | |
hbox = gtk.HBox() | |
w.add(hbox) | |
hbox.add(v) | |
channelBoxWindow = gtk.ScrolledWindow() | |
channelBoxWindow.set_size_request(50, -1) | |
channelBox = gtk.VBox() | |
hbox.add(channelBoxWindow) | |
channelBoxWindow.add_with_viewport(channelBox) | |
channelBox.set_size_request(50,-1) | |
# Play the file | |
def waitAndChange(a, k): | |
global v | |
print a | |
v.player.stop() | |
v.player.loadfile(channels[k]['url']) | |
for k in channels: | |
button = gtk.Button(label=k, stock=None) | |
button.connect("clicked", waitAndChange, k) | |
channelBox.add(button) | |
w.show_all() | |
v.player.loadfile('http://gartenhof.live1-f.akamaihd.net/sf1_1_800@43046') | |
# Enter the GTK event loop | |
gtk.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment