def _auto_renconvert_after_proxy_render_in_proxy_mode(): # Save to temp to convert to using original media project = editorstate.PROJECT() project.proxy_data.proxy_mode = appconsts.CONVERTING_TO_USE_ORIGINAL_MEDIA conv_temp_project_path = utils.get_hidden_user_dir_path() + "proxy_conv.flb" persistance.save_project(editorstate.PROJECT(), conv_temp_project_path) project.proxy_data.proxy_mode = appconsts.USE_ORIGINAL_MEDIA # Load saved temp original media project persistance.show_messages = False project = persistance.load_project(conv_temp_project_path) # Save to temp to convert back to using proxy media project.proxy_data.proxy_mode = appconsts.CONVERTING_TO_USE_PROXY_MEDIA persistance.save_project(project, conv_temp_project_path) project.proxy_data.proxy_mode = appconsts.USE_PROXY_MEDIA # Load saved temp proxy project project = persistance.load_project(conv_temp_project_path) # Open saved temp project app.stop_autosave() gtk.gdk.threads_enter() app.open_project(project) gtk.gdk.threads_leave() app.start_autosave() editorstate.update_current_proxy_paths() persistance.show_messages = True
def _auto_renconvert_after_proxy_render_in_proxy_mode(): # Save to temp to convert to using original media project = editorstate.PROJECT() project.proxy_data.proxy_mode = appconsts.CONVERTING_TO_USE_ORIGINAL_MEDIA conv_temp_project_path = utils.get_hidden_user_dir_path( ) + "proxy_conv.flb" persistance.save_project(editorstate.PROJECT(), conv_temp_project_path) project.proxy_data.proxy_mode = appconsts.USE_ORIGINAL_MEDIA # Load saved temp original media project persistance.show_messages = False project = persistance.load_project(conv_temp_project_path) # Save to temp to convert back to using proxy media project.proxy_data.proxy_mode = appconsts.CONVERTING_TO_USE_PROXY_MEDIA persistance.save_project(project, conv_temp_project_path) project.proxy_data.proxy_mode = appconsts.USE_PROXY_MEDIA # Load saved temp proxy project project = persistance.load_project(conv_temp_project_path) # Open saved temp project app.stop_autosave() Gdk.threads_enter() app.open_project(project) Gdk.threads_leave() app.start_autosave() editorstate.update_current_proxy_paths() persistance.show_messages = True
def run(self): pulse_runner = guiutils.PulseThread(self.progressbar) pulse_runner.start() time.sleep(2.0) persistance.show_messages = False try: Gdk.threads_enter() project = persistance.load_project(self.proxy_project_path) sequence.set_track_counts(project) Gdk.threads_leave() except persistance.FileProducerNotFoundError as e: print "did not find file:", e pulse_runner.running = False time.sleep(0.3) # need to be sure pulse_runner has stopped project.c_seq.tractor.mark_in = self.mark_in project.c_seq.tractor.mark_out = self.mark_out app.stop_autosave() Gdk.threads_enter() app.open_project(project) Gdk.threads_leave() # Loaded project has been converted, set proxy mode to correct mode if project.proxy_data.proxy_mode == appconsts.CONVERTING_TO_USE_PROXY_MEDIA: project.proxy_data.proxy_mode = appconsts.USE_PROXY_MEDIA else: project.proxy_data.proxy_mode = appconsts.USE_ORIGINAL_MEDIA app.start_autosave() global load_thread load_thread = None persistance.show_messages = True Gdk.threads_enter() selections = project.get_project_property( appconsts.P_PROP_LAST_RENDER_SELECTIONS) if selections != None: render.set_saved_gui_selections(selections) _converting_proxy_mode_done() Gdk.threads_leave()
def run(self): pulse_runner = guiutils.PulseThread(self.progressbar) pulse_runner.start() time.sleep(2.0) persistance.show_messages = False try: Gdk.threads_enter() project = persistance.load_project(self.proxy_project_path) sequence.set_track_counts(project) Gdk.threads_leave() except persistance.FileProducerNotFoundError as e: print "did not find file:", e pulse_runner.running = False time.sleep(0.3) # need to be sure pulse_runner has stopped project.c_seq.tractor.mark_in = self.mark_in project.c_seq.tractor.mark_out = self.mark_out app.stop_autosave() Gdk.threads_enter() app.open_project(project) Gdk.threads_leave() # Loaded project has been converted, set proxy mode to correct mode if project.proxy_data.proxy_mode == appconsts.CONVERTING_TO_USE_PROXY_MEDIA: project.proxy_data.proxy_mode = appconsts.USE_PROXY_MEDIA else: project.proxy_data.proxy_mode = appconsts.USE_ORIGINAL_MEDIA app.start_autosave() global load_thread load_thread = None persistance.show_messages = True Gdk.threads_enter() selections = project.get_project_property(appconsts.P_PROP_LAST_RENDER_SELECTIONS) if selections != None: render.set_saved_gui_selections(selections) _converting_proxy_mode_done() Gdk.threads_leave()
def _close_dialog_callback(dialog, response_id): dialog.destroy() if response_id == Gtk.ResponseType.CLOSE:# "Don't Save" pass elif response_id == Gtk.ResponseType.YES:# "Save" if editorstate.PROJECT().last_save_path != None: persistance.save_project(editorstate.PROJECT(), editorstate.PROJECT().last_save_path) else: dialogutils.warning_message(_("Project has not been saved previously"), _("Save project with File -> Save As before closing."), gui.editor_window.window) return else: # "Cancel" return # This is the same as opening default project sequence.AUDIO_TRACKS_COUNT = 4 sequence.VIDEO_TRACKS_COUNT = 5 new_project = projectdata.get_default_project() app.open_project(new_project)
def run(self): pulse_runner = guiutils.PulseThread(self.progressbar) pulse_runner.start() time.sleep(2.0) persistance.show_messages = False try: gtk.gdk.threads_enter() project = persistance.load_project(self.proxy_project_path) sequence.set_track_counts(project) gtk.gdk.threads_leave() except persistance.FileProducerNotFoundError as e: print "did not find file:", e pulse_runner.running = False time.sleep(0.3) # need to be sure pulse_runner has stopped app.stop_autosave() gtk.gdk.threads_enter() app.open_project(project) gtk.gdk.threads_leave() # Loaded project has been converted, set proxy mode to correct mode if project.proxy_data.proxy_mode == appconsts.CONVERTING_TO_USE_PROXY_MEDIA: project.proxy_data.proxy_mode = appconsts.USE_PROXY_MEDIA else: project.proxy_data.proxy_mode = appconsts.USE_ORIGINAL_MEDIA app.start_autosave() global load_thread load_thread = None persistance.show_messages = True gtk.gdk.threads_enter() _converting_proxy_mode_done() gtk.gdk.threads_leave()
def run(self): Gdk.threads_enter() updater.set_info_icon(Gtk.STOCK_OPEN) dialog = dialogs.load_dialog() persistance.load_dialog = dialog Gdk.threads_leave() ticker = utils.Ticker(_load_pulse_bar, 0.15) ticker.start_ticker() old_project = editorstate.project try: editorstate.project_is_loading = True project = persistance.load_project(self.filename) sequence.set_track_counts(project) editorstate.project_is_loading = False except persistance.FileProducerNotFoundError as e: print "did not find file:", e self._error_stop(dialog, ticker) primary_txt = _("Media asset was missing!") secondary_txt = _("Path of missing asset:") + "\n <b>" + e.value + "</b>\n\n" + \ _("Relative search for replacement file in sub folders of project file failed.") + "\n\n" + \ _("To load the project you will need to either:") + "\n" + \ u"\u2022" + " " + _("Use 'Media Linker' tool to relink media assets to new files, or") + "\n" + \ u"\u2022" + " " + _("Place a file with the same exact name and path on the hard drive") dialogutils.warning_message(primary_txt, secondary_txt, None, is_info=False) editorstate.project = old_project # persistance.load_project() changes this, # we simply change it back as no GUI or other state is yet changed return except persistance.ProjectProfileNotFoundError as e: self._error_stop(dialog, ticker) primary_txt = _("Profile with Description: '") + e.value + _("' was not found on load!") secondary_txt = _("It is possible to load the project by creating a User Profile with exactly the same Description\nas the missing profile. ") + "\n\n" + \ _("User Profiles can be created by selecting 'Edit->Profiles Manager'.") dialogutils.warning_message(primary_txt, secondary_txt, None, is_info=False) editorstate.project = old_project # persistance.load_project() changes this, # we simply change it back as no GUI or other state is yet changed return Gdk.threads_enter() dialog.info.set_text(_("Opening")) Gdk.threads_leave() time.sleep(0.3) Gdk.threads_enter() app.open_project(project) if self.block_recent_files: # naming flipped ???? editorpersistance.add_recent_project_path(self.filename) editorpersistance.fill_recents_menu_widget(gui.editor_window.uimanager.get_widget('/MenuBar/FileMenu/OpenRecent'), open_recent_project) Gdk.threads_leave() Gdk.threads_enter() updater.set_info_icon(None) dialog.destroy() Gdk.threads_leave() ticker.stop_ticker()