#!/usr/bin/env python import edje import ecore.evas import sys import os import ecore import emotion import evas import elementary import YalpInterfaces, CosNaming, YalpInterfaces__POA import evas.c_evas import media class Selection(object): def __init__(self, win, c): self.win = win self.c = c self.vid = emotion.Emotion(self.win.canvas, module_filename="xine") self.add_button() self.c.signal_callback_add("mouse,clicked,1", "medialist_buttonframe", self.play_video) def add_button(self): addbutton = elementary.Button(self.win) addbutton.label_set("Play") self.c.part_swallow("medialist_buttonframe", addbutton) addbutton.show() def set_stream(self, songs, servercon): self.songlist = songs self.servercon = servercon print "songlist", songs def play_video(self, dummy, dumm, duemmer): ip = "10.0.3.180" port = 9993 info = YalpInterfaces.AccessInfo("huhu", "huhu", "xine", "openmoko", YalpInterfaces.STREAM) stream = YalpInterfaces.Output(0, info, self.songlist, YalpInterfaces.CREATE, ip) ret = self.servercon.control(stream) stream.outputAction = YalpInterfaces.START ret = self.servercon.control(stream) print "stream.info:", stream.info print "stream from", ip, port self.vid.file_set("http://"+ip+":"+str(port)) print "self.vid", self.vid self.c.part_swallow("video", self.vid) self.vid.show() self.vid.play = True