10
from itertools import cycle
14
root = os.path.abspath(os.path.curdir)
16
if not root in sys.path:
17
sys.path.insert(0, root)
19
from complextimeline import ComplexTrack
20
from pitivi.timeline.objects import MEDIA_TYPE_VIDEO
23
("source1", 300 * gst.SECOND),
24
("source2", 200 * gst.SECOND),
25
("source3", 10 * gst.SECOND),
28
class TestComposition(gobject.GObject):
29
__gtype_name__ = "TestComposition"
31
"source-added" : (gobject.SIGNAL_RUN_LAST,
33
(gobject.TYPE_PYOBJECT, )),
34
"source-removed" : (gobject.SIGNAL_RUN_LAST,
36
(gobject.TYPE_PYOBJECT, )),
39
def __init__(self, *args, **kwargs):
40
gobject.GObject.__init__(self, *args, **kwargs)
41
self.media_type = MEDIA_TYPE_VIDEO
43
def addSource(self, source, position):
44
self.emit("source-added", source)
46
def removeSource(self, source):
47
self.emit("source-removed", source)
49
class TestTimelineObject(gobject.GObject):
50
__gtype_name__ = "TestObject"
52
"start-duration-changed" : (gobject.SIGNAL_RUN_LAST,
54
(gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT, )),
60
def __init__(self, name, start, duration):
61
gobject.GObject.__init__(self)
63
self.duration = duration
64
self.factory = self.Factory()
65
self.factory.name=name
67
def setStartDurationTime(self, start=-1, duration=-1):
71
self.duration = duration
72
self.emit("start-duration-changed", self.start, self.duration)
74
c = goocanvas.Canvas()
76
model = TestComposition()
77
t.set_composition(model)
78
c.get_root_item().add_child(t)
80
for name, duration in SOURCES:
81
model.addSource(TestTimelineObject(name, cur, duration), None)
84
c.set_size_request(int(t.width), int(t.height))
85
s = gtk.ScrolledWindow()
86
s.set_policy(gtk.POLICY_ALWAYS, gtk.POLICY_NEVER)
88
z = gtk.HScale(t.get_zoom_adjustment())
90
b.pack_start(s, True, True)
91
b.pack_start(z, False, False)
95
w.connect("destroy", gtk.main_quit)