def __init__(self, name="", uri=None, **kwargs): """ @param name: the name of the project @param uri: the uri of the project """ Loggable.__init__(self) self.log("name:%s, uri:%s", name, uri) self.name = name self.author = "" self.year = "" self.settings = None self.description = "" self.uri = uri self.urichanged = False self.format = None self.medialibrary = MediaLibrary() self._dirty = False self.timeline = ges.timeline_new_audio_video() # We add a Selection to the timeline as there is currently # no such feature in GES self.timeline.selection = Selection() self.pipeline = Pipeline() self.pipeline.add_timeline(self.timeline) self.seeker = Seeker() self.settings = MultimediaSettings()
def testTimeline(self): tl = ges.timeline_new_audio_video() lyr = ges.SimpleTimelineLayer() src = ges.TimelineTestSource() src2 = ges.TimelineTestSource() tr = ges.TimelineStandardTransition("crossfade") pip = ges.TimelinePipeline() bus = pip.get_bus() self.mainloop = glib.MainLoop() # Let's add the layer to the timeline, and the sources # and transition to the layer. tl.add_layer(lyr) src.set_duration(long(gst.SECOND * 10)) src2.set_duration(long(gst.SECOND * 10)) src.set_vpattern("Random (television snow)") tr.set_duration(long(gst.SECOND * 10)) lyr.add_object(src, -1) lyr.add_object(tr, -1) assert (lyr.add_object(src2, -1) == True) pip.add_timeline(tl) bus.set_sync_handler(self.bus_handler) self.pipeline = pip self.layer = lyr #Mainloop is finished, tear down. self.pipeline = None
def testTextOverlay(self): ovrl = ges.TimelineTextOverlay() lyr = ges.TimelineLayer() tl = ges.timeline_new_audio_video() tck = tl.get_tracks()[0] ovrl.set_text("Foo") self.failIf (ovrl.get_text() != "Foo") ovrl.set_font_desc ("Arial") self.failIf (ovrl.get_font_desc() != "Arial") ovrl.set_valign("top") self.failIf (ovrl.get_valignment().value_name != "top") ovrl.set_halign("left") self.failIf (ovrl.get_halignment().value_name != "left") #We will test Timeline Object class functions here ovrl.set_start(long(100)) ovrl.set_inpoint(long(50)) ovrl.set_duration(long(500)) ovrl.set_priority(2) ovrl.set_layer(lyr) tck_obj = ovrl.create_track_object(tck) self.failIf (ovrl.release_track_object(tck_obj) != True) self.failIf (ovrl.add_track_object(tck_obj) != True) self.failIf (len(ovrl.get_track_objects()) != 1) self.failIf (ovrl.get_layer() != lyr) ovrl.release_track_object(tck_obj) #We test TrackTextOverlay and TrackObject here tck_obj.set_text("Bar") self.failIf (tck_obj.get_text() != "Bar") tck_obj.set_font_desc ("Arial") self.failIf (tck_obj.get_font_desc() != "Arial") tck_obj.set_valignment("top") self.failIf (tck_obj.get_valignment().value_name != "top") tck_obj.set_halignment("left") self.failIf (tck_obj.get_halignment().value_name != "left") tck_obj.set_locked(False) self.failIf (tck_obj.is_locked() != False) tck_obj.set_start(long(100)) tck_obj.set_inpoint(long(50)) tck_obj.set_duration(long(500)) tck_obj.set_priority(2) self.failIf (tck_obj.get_start() != 100) self.failIf (tck_obj.get_inpoint() != 50) self.failIf (tck_obj.get_duration() != 500) self.failIf (tck_obj.get_priority() != 2) tck_obj.set_timeline_object(ovrl) self.failIf(tck_obj.get_timeline_object() != ovrl)
def testTimeline(self): tl = ges.timeline_new_audio_video() lyr = ges.SimpleTimelineLayer() tck = ges.track_audio_raw_new() assert (tl.add_track(tck) == True) #We should have two tracks from the timeline_new_audio_video() function + 1 self.failIf(len(tl.get_tracks()) != 3) assert (tl.remove_track(tck) == True) assert (tl.add_layer(lyr) == True) self.failIf(len(tl.get_layers()) != 1) assert (tl.remove_layer(lyr) == True)
def __init__(self, effects): ges.init() self.mainloop = glib.MainLoop() self.timeline = ges.timeline_new_audio_video() layer = ges.TimelineLayer() self.src = ges.TimelineTestSource() self.src.set_start(long(0)) self.src.set_duration(long(3000000000)) self.src.set_vpattern("smpte75") layer.add_object(self.src) self.timeline.add_layer(layer) self.add_effects(effects) self.pipeline = ges.TimelinePipeline() self.pipeline.add_timeline(self.timeline) bus = self.pipeline.get_bus() bus.set_sync_handler(self.bus_handler)
def testGlobalFunctions(self): tl = ges.timeline_new_audio_video() tr = ges.timeline_standard_transition_new_for_nick("crossfade")