~nagos/openshot/nagos

« back to all changes in this revision

Viewing changes to openshot/classes/sequences.py

  • Committer: Jonathan Thomas
  • Date: 2010-01-28 07:39:38 UTC
  • Revision ID: jonathan@jonathan64-20100128073938-xlmzndtbuqwgtama
Bumped version to 1.0.3

Intergrated a patch from Cody to fix some translation
strings missing (i.e. Track 1, Track 2)

Improved the speed of GenerateXML() 1300%.  This was mainly due to 
a very poor project.fps() method, which was slow and used all
over the place.  So, I tried to not call the method as much,
and I implemented some caching of the fps value.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
                self.play_head_position = 0 # position of the play head in seconds
47
47
                # init the tracks on the sequence
48
48
                self.tracks = []
49
 
                self.tracks.append(track.track(_("Track 2"), self))
50
 
                self.tracks.append(track.track(_("Track 1"), self))
 
49
                self.tracks.append(track.track(_("Track %s" % 2), self))
 
50
                self.tracks.append(track.track(_("Track %s" % 1), self))
51
51
 
52
52
                # init markers
53
53
                self.markers = []
204
204
                bg_track.clips.append(bg_clip)
205
205
                
206
206
                # add XML for background track
207
 
                bg_track.GenerateXML(dom, multitrack)
 
207
                bg_track.GenerateXML(dom, multitrack, fps=fps)
208
208
                
209
209
                # loop through each track, from the bottom up
210
210
                for MyTrack in reversed(self.tracks):
211
211
                        
212
212
                        # Render track                  
213
 
                        MyTrack.GenerateXML(dom, multitrack)
 
213
                        MyTrack.GenerateXML(dom, multitrack, fps=fps)
214
214
                        
215
215
 
216
216
        def Calculate_Length(self):
550
550
                
551
551
                
552
552
        def on_motion_notify_x (self, item, target, event):
553
 
                #print "on_motion_notify_x"
554
553
                """this method allows the clip to be dragged and dropped on a track"""
555
554
 
556
555
                if (event.state & gtk.gdk.BUTTON1_MASK):