diff options
Diffstat (limited to 'src/YalpClients/EflClient/playlist.py')
| -rwxr-xr-x | src/YalpClients/EflClient/playlist.py | 103 |
1 files changed, 71 insertions, 32 deletions
diff --git a/src/YalpClients/EflClient/playlist.py b/src/YalpClients/EflClient/playlist.py index 4d3f12c..6e356c7 100755 --- a/src/YalpClients/EflClient/playlist.py +++ b/src/YalpClients/EflClient/playlist.py @@ -17,54 +17,93 @@ 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) - self.c.signal_callback_add("mouse,clicked,1", "stop_buttonframe", - self.stop_video) - - def add_button(self): - addbutton = elementary.Button(self.win) - addbutton.label_set("Play") - self.c.part_swallow("medialist_buttonframe", addbutton) - addbutton.show() + self.vid = emotion.Emotion(self.win.canvas, module_filename="xine") + + self.is_playing = False - stopbutton = elementary.Button(self.win) - stopbutton.label_set("Stop") - self.c.part_swallow("stop_buttonframe", stopbutton) - stopbutton.show() + def add_button(self): + self.addbutton = elementary.Button(self.win) + self.addbutton.label_set("Play") + self.c.part_swallow("medialist_buttonframe", self.addbutton) + self.addbutton.show() - hidebutton = elementary.Button(self.win) - hidebutton.label_set("Hide") - self.c.part_swallow("hide_buttonframe", hidebutton) - hidebutton.show() + self.pausebutton = elementary.Button(self.win) + self.pausebutton.label_set("Pause") + self.c.part_swallow("pause_buttonframe", self.pausebutton) + self.pausebutton.show() + self.hidebutton = elementary.Button(self.win) + self.hidebutton.label_set("Hide") + self.c.part_swallow("hide_buttonframe", self.hidebutton) + self.hidebutton.show() + + self.stopbutton = elementary.Button(self.win) + self.stopbutton.label_set("Stop") + self.c.part_swallow("stop_buttonframe", self.stopbutton) + self.stopbutton.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 - self.info = YalpInterfaces.AccessInfo("huhu", "huhu", "xine", "openmoko", - YalpInterfaces.STREAM) - self.stream = YalpInterfaces.Output(0, self.info, self.songlist, - YalpInterfaces.CREATE, ip) - ret = self.servercon.control(self.stream) - self.stream.outputAction = YalpInterfaces.START - ret = self.servercon.control(self.stream) - print "stream.info:", self.stream.info + #self.vid = emotion.Emotion(self.win.canvas, module_filename="xine") + if self.is_playing == True: + self.vid = emotion.Emotion(self.win.canvas, module_filename="xine") + self.stream.outputAction = YalpInterfaces.PLAY + ret = self.servercon.control(self.stream) + self.vid.file_set("http://"+ip+":"+str(port)) + self.c.part_swallow("video", self.vid) + self.vid.show() + self.vid.play = True + + + if self.is_playing == False: + #self.vid = emotion.Emotion(self.win.canvas, module_filename="xine") + self.addbutton.visible = False + + self.c.signal_callback_add("mouse,clicked,1", "pause_buttonframe", + self.pause_video) + self.c.signal_callback_add("mouse,clicked,1", "stop_buttonframe", + self.stop_video) + + self.info = YalpInterfaces.AccessInfo("huhu1", "huhu", "xine", + "openmoko",YalpInterfaces.STREAM) + self.stream = YalpInterfaces.Output(0, self.info, self.songlist, + YalpInterfaces.CREATE, ip) + ret = self.servercon.control(self.stream) + self.stream.outputAction = YalpInterfaces.START + ret = self.servercon.control(self.stream) + print "stream.info:", self.stream.info - print "stream from", ip, port - self.vid.file_set("http://"+ip+":"+str(port)) - self.c.part_swallow("video", self.vid) - self.vid.show() - self.vid.play = True + print "stream from", ip, port + self.vid.file_set("http://"+ip+":"+str(port)) + self.c.part_swallow("video", self.vid) + + self.vid.show() + self.vid.play = True + self.is_playing = True + def pause_video(self, huhu, haha, hoho): + self.stream.outputAction = YalpInterfaces.PAUSE + ret = self.servercon.control(self.stream) + self.vid.delete() def stop_video(self, huhu, haha, hoho): self.stream.outputAction = YalpInterfaces.STOP ret = self.servercon.control(self.stream) + self.stream.outputAction = YalpInterfaces.DELETE + ret = self.servercon.control(self.stream) + self.vid.play = False + self.vid.file_set("") + self.vid.hide() + self.is_playing = False + + #def continue_video(self, huhu, haha, hoho): + #self.stream.outputAction = YalpInterfaces.PLAY + #ret = self.servercon.control(self.stream) |
