Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tagplay.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-01-30 18:51:34 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-01-30 18:51:34 (GMT)
commit4744cb84201c2c04d37a7abb392fa5136f7a20ef (patch)
tree3d0db1d78ff7478e8a871540a7dbe0321614de88 /tagplay.py
parent190c0561dd9112ada5505b6b2daf48dc276f57db (diff)
lots of cleaning up of multimedia code
Diffstat (limited to 'tagplay.py')
-rw-r--r--tagplay.py29
1 files changed, 11 insertions, 18 deletions
diff --git a/tagplay.py b/tagplay.py
index daffde0..b58a123 100644
--- a/tagplay.py
+++ b/tagplay.py
@@ -136,21 +136,14 @@ class PlayVideoWindow(gtk.Window):
del self.imagesink
self.imagesink = sink
- self.imagesink.set_xwindow_id(self.window.xid)
+ if self.window is not None:
+ self.imagesink.set_xwindow_id(self.window.xid)
-def play_audio(lc, audio):
- print "loading audio id: " + str(audio)
- if audio == "" or audio[6:] == "":
- raise logoerror("#nomedia")
- elif audio[6:] != "None":
- try:
- dsobject = datastore.get(audio[6:])
- print dsobject.file_path
- except:
- print "Couldn't open id: " + str(audio[6:])
- if lc.gplay == None:
- lc.gplay = Gplay()
- lc.gplay.setFile("file:///" + dsobject.file_path)
+def play_audio(lc, filepath):
+ print "loading audio id: " + filepath
+ if lc.gplay == None:
+ lc.gplay = Gplay()
+ lc.gplay.setFile("file:///" + filepath)
def play_video(lc, media, x, y, w, h):
print "loading media id: " + str(media)
@@ -164,20 +157,20 @@ def play_video(lc, media, x, y, w, h):
print "Couldn't open id: " + str(media[6:])
play_dsobject(lc, dsobject, x, y, w, h)
-def play_dsobject(lc, dsobject, x, y, w, h):
+def play_movie_from_file(lc, filepath, x, y, w, h):
if lc.gplay == None:
lc.gplay = Gplay()
# wait for current movie to stop playing
if lc.gplay.is_playing:
print "already playing..."
-# yield True
- lc.gplay.setFile("file:///" + dsobject.file_path)
+ lc.gplay.setFile("file:///" + filepath)
if lc.gplay.window == None:
gplayWin = PlayVideoWindow()
lc.gplay.window = gplayWin
gplayWin.set_type_hint( gtk.gdk.WINDOW_TYPE_HINT_DIALOG )
gplayWin.set_decorated( False )
- gplayWin.set_transient_for( lc.tw.activity )
+ if lc.tw.running_sugar():
+ gplayWin.set_transient_for( lc.tw.activity )
# y position is too high for some reason (toolbox?) adding offset
gplayWin.move( x, y+108 )
gplayWin.resize( w, h )