Beispiel #1
0
	def GenerateXML(self, dom, xmlParentNode):
		
		# get frames per second
		fps = self.project.fps()
		
		multitrack = dom.createElement("multitrack")
		xmlParentNode.appendChild(multitrack)
		
		# create fake background track (i.e. black background)
		bg_track = track.track("Background Track", self)
		bg_track.parent = self
		bg_end_time = self.Calculate_Length()
		bg_image = files.OpenShotFile(self.project)
		#bg_image.name = "background_track"
		bg_image.name = os.path.join(self.project.IMAGE_DIR, "black.png")
		#bg_image.name = "/home/jonathan/Desktop/Temp OpenShot/background.png"
		bg_image.length = bg_end_time
		bg_image.max_frames = round(bg_end_time * fps)
		bg_clip = clip.clip("Background Clip", "Gold", 0.0, 0.0, bg_end_time, bg_track, bg_image)
		bg_clip.distort = True
		bg_clip.fill = True
		bg_track.clips.append(bg_clip)
		
		# add XML for background track
		bg_track.GenerateXML(dom, multitrack, fps=fps)
		
		# loop through each track, from the bottom up
		for MyTrack in reversed(self.tracks):
			
			# Render track			
			MyTrack.GenerateXML(dom, multitrack, fps=fps)
Beispiel #2
0
    def GenerateXML(self, dom, xmlParentNode):

        # get frames per second
        fps = self.project.fps()

        multitrack = dom.createElement("multitrack")
        xmlParentNode.appendChild(multitrack)

        # create fake background track (i.e. black background)
        bg_track = track.track("Background Track", self)
        bg_track.parent = self
        bg_end_time = self.Calculate_Length()
        bg_image = files.LibreShotFile(self.project)
        bg_image.name = os.path.join(self.project.IMAGE_DIR, "black.png")
        bg_image.length = bg_end_time
        bg_image.max_frames = round(bg_end_time * fps)

        # set remaining length
        remaining_length = bg_end_time
        position = 0.0
        current_length = 0.0

        # Add the background black clip in sections (5 minute (i.e. 300 seconds) sections)
        while remaining_length > 0.0:
            # calculate length of this section
            if remaining_length > 300.0:
                current_length = 300.0
                remaining_length -= 300.0
            else:
                current_length = remaining_length
                remaining_length = 0.0

            bg_clip = clip.clip("Background Clip", "Gold", position, 0.0,
                                current_length, bg_track, bg_image)
            bg_clip.distort = True
            bg_clip.fill = True
            bg_track.clips.append(bg_clip)

            # calculate position for next section
            position += current_length

        # add XML for background track
        bg_track.GenerateXML(dom, multitrack, fps=fps)

        # loop through each track, from the bottom up
        for MyTrack in reversed(self.tracks):

            # Render track
            MyTrack.GenerateXML(dom, multitrack, fps=fps)
Beispiel #3
0
	def AddClip(self, clip_name, color, position_on_track, start_time, end_time, file_object, record_to_history = True):
		# Create new clip object and append to list
		NewClip = clip.clip(clip_name, color, position_on_track, start_time, end_time, self, file_object)

		# Adjust default length of images (all images default to 300 seconds.. i.e. 5 minutes)
		# But since nobody wants an image to default to 5 minutes long, we adjust it to the default image length.
		if NewClip.file_object.file_type == "image" and end_time == 300.0:
			from windows import preferences
			NewClip.end_time = NewClip.start_time + float(preferences.Settings.general["imported_image_length"])#7.0

		# Add clip to track's clip list
		self.clips.append(NewClip)		

		# return the new clip
		return NewClip
Beispiel #4
0
	def GenerateXML(self, dom, xmlParentNode):

		# get frames per second
		fps = self.project.fps()

		multitrack = dom.createElement("multitrack")
		xmlParentNode.appendChild(multitrack)

		# create fake background track (i.e. black background)
		bg_track = track.track("Background Track", self)
		bg_track.parent = self
		bg_end_time = self.Calculate_Length()
		bg_image = files.OpenShotFile(self.project)
		bg_image.name = os.path.join(self.project.IMAGE_DIR, "black.png")
		bg_image.length = bg_end_time
		bg_image.max_frames = round(bg_end_time * fps)

		# set remaining length
		remaining_length = bg_end_time
		position = 0.0
		current_length = 0.0

		# Add the background black clip in sections (5 minute (i.e. 300 seconds) sections)
		while remaining_length > 0.0:
			# calculate length of this section
			if remaining_length > 300.0:
				current_length = 300.0
				remaining_length -= 300.0
			else:
				current_length = remaining_length
				remaining_length = 0.0

			bg_clip = clip.clip("Background Clip", "Gold", position, 0.0, current_length, bg_track, bg_image)
			bg_clip.distort = True
			bg_clip.fill = True
			bg_track.clips.append(bg_clip)

			# calculate position for next section
			position += current_length

		# add XML for background track
		bg_track.GenerateXML(dom, multitrack, fps=fps)

		# loop through each track, from the bottom up
		for MyTrack in reversed(self.tracks):

			# Render track			
			MyTrack.GenerateXML(dom, multitrack, fps=fps)
Beispiel #5
0
    def AddClip(self,
                clip_name,
                color,
                position_on_track,
                start_time,
                end_time,
                file_object,
                record_to_history=True):
        # Create new clip object and append to list
        NewClip = clip.clip(clip_name, color, position_on_track, start_time,
                            end_time, self, file_object)

        # Adjust default length of images (all images default to 300 seconds.. i.e. 5 minutes)
        # But since nobody wants an image to default to 5 minutes long, we adjust it to the default image length.
        if NewClip.file_object.file_type == "image" and end_time == 300.0:
            from windows import preferences
            NewClip.end_time = NewClip.start_time + float(
                preferences.Settings.general["imported_image_length"])  #7.0

        # Add clip to track's clip list
        self.clips.append(NewClip)

        # return the new clip
        return NewClip