~nagos/openshot/nagos

« back to all changes in this revision

Viewing changes to openshot/classes/project.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:
72
72
                        self.canvas = None
73
73
                        self.is_modified = False
74
74
                        self.refresh_xml = True
 
75
                        self.mlt_profile = None
75
76
                        
76
77
                        # reference to the main GTK form
77
78
                        self.form = None
96
97
                
97
98
        def fps(self):
98
99
                # get the profile object
99
 
                fps = profiles.mlt_profiles(self).get_profile(self.project_type).fps()
 
100
                if self.mlt_profile == None:
 
101
                        self.mlt_profile = profiles.mlt_profiles(self).get_profile(self.project_type)
100
102
 
101
103
                # return the frames per second
102
 
                return fps
 
104
                return self.mlt_profile.fps()
103
105
        
104
106
        
105
107
 
171
173
                state['THEMES_DIR'] = empty_project.THEMES_DIR
172
174
                state['USER_PROFILES_DIR'] = empty_project.USER_PROFILES_DIR
173
175
                state['refresh_xml'] = True
174
 
                
 
176
                state['mlt_profile'] = None
175
177
                
176
178
                empty_project = None
177
179
 
192
194
                
193
195
        def GenerateXML(self, file_name):
194
196
                """This method creates the MLT Westley XML used by OpenShot"""
 
197
                
195
198
                # get locale info
196
199
                lc, encoding = locale.getdefaultlocale()
197
200