def Load(self, importPath=None): wxvJob = VisualJob(_("Loading project %s") % self._filename, self.__Load, args=(importPath,)) wxvJob.SetAltPath = self.SetAltPath dlg = DlgJobVisual(self.__wxParent, wxvJob) dlg.Bind(EVT_JOB_RESULT, self.__OnJobDone) wxvJob.AddVisualJobHandler(dlg) self.__wxvJob = wxvJob JobManager().EnqueueContext(wxvJob) try: return self.__WaitUntilJobDone() finally: dlg.Destroy()
def Save(self, includePics=False): wxvJob = VisualJob(_("Saving project %s") % self._filename, self.__Save, args=(includePics,), maxProgress=len(self._project.GetPictures())) dlg = DlgJobVisual(self.__wxParent, wxvJob) dlg.Bind(EVT_JOB_RESULT, self.__OnJobDone) wxvJob.AddVisualJobHandler(dlg) self.__wxvJob = wxvJob JobManager().EnqueueContext(wxvJob) try: return self.__WaitUntilJobDone() finally: dlg.Destroy()
def _OnStart(self, outpath, profile=None, gstElements=None): self._UpdateProject() vj = StoryEngine(self.__story.GetMedias(), outpath, profile, gstElements) if outpath is None: # do a preview label = "Preview" groupId = "general" else: label = _("Generate video %s") % outpath groupId = "render" wxvJob = VisualJob(label, vj.Execute, maxProgress=100, groupId=groupId) if outpath: wxvJob.GetOutputFile = lambda: outpath JobManager().EnqueueContext(wxvJob)