bulk commit
[talkcutter.git] / src / talkcutter.py
1 #!/usr/bin/env python
2 import os
3 import gst, gtk, gobject
4 import sys
5 from videoplayer import videoplayer
6 from audioplayer import audioplayer
7 from tree import tree
8
9 try:
10     import pygtk
11     pygtk.require("2.0")
12 except:
13     pass
14 try:
15     import gtk
16     import gtk.glade
17 except:
18     print("GTK Not Availible")
19     sys.exit(1)
20
21
22 class TalkCutter:
23
24     wTree = None
25
26     def __init__( self ):
27         self.wTree = gtk.glade.XML( "main.glade" )
28
29         dic = {
30             "on_quit_clicked" : self.quit,
31             "on_video_realize" : self.on_video_realize,
32         }
33
34         self.wTree.signal_autoconnect( dic )
35
36         self.drawingarea = self.wTree.get_widget("video")
37
38         print self.drawingarea
39
40         self.audio = audioplayer(self)
41         self.audio.play('file:///mnt/dl/dkuug/video/osd10/dan/dan.wav');
42
43         self.video = videoplayer(self)
44         self.video.play('file:///mnt/dl/dkuug/video/osd10/dan/dan.dv')
45
46         self.tree = tree()
47         self.wTree.get_widget('hpaned6').add(self.tree.get_tree())
48
49         print self.wTree.get_widget('dMain').show()
50
51         self.wTree.visible = True
52         gtk.main()
53
54     def on_destroy(self, window):
55         self.playbin.set_state(gst.STATE_NULL)
56         gtk.main_quit()
57
58     def on_video_realize(self, sender):
59         print 'triggered'
60         print self.drawingarea.window.xid
61
62     def quit(self, widget):
63         gtk.main_quit()
64         sys.exit(0)
65
66 if __name__ == "__main__":
67     try:
68         TalkCutter()
69     except KeyboardInterrupt:
70         print ''
71     except SystemExit:
72         pass
73