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 _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 _save_as_dialog_callback(dialog, response_id): if response_id == gtk.RESPONSE_ACCEPT: filenames = dialog.get_filenames() PROJECT().last_save_path = filenames[0] PROJECT().name = os.path.basename(filenames[0]) updater.set_info_icon(gtk.STOCK_SAVE) if len( PROJECT().events ) == 0: # Save as... with 0 project events is considered Project creation p_event = projectdata.ProjectEvent( projectdata.EVENT_CREATED_BY_SAVING, PROJECT().last_save_path) PROJECT().events.append(p_event) else: p_event = projectdata.ProjectEvent( projectdata.EVENT_SAVED_AS, (PROJECT().name, PROJECT().last_save_path)) PROJECT().events.append(p_event) persistance.save_project(PROJECT(), PROJECT().last_save_path) #<----- HERE app.stop_autosave() app.start_autosave() global save_icon_remove_event_id save_icon_remove_event_id = gobject.timeout_add(500, remove_save_icon) global save_time save_time = time.clock() gui.editor_window.window.set_title(PROJECT().name + " - Flowblade") gui.editor_window.uimanager.get_widget( "/MenuBar/FileMenu/Save").set_sensitive(False) gui.editor_window.uimanager.get_widget( "/MenuBar/EditMenu/Undo").set_sensitive(False) gui.editor_window.uimanager.get_widget( "/MenuBar/EditMenu/Redo").set_sensitive(False) editorpersistance.add_recent_project_path(PROJECT().last_save_path) editorpersistance.fill_recents_menu_widget( gui.editor_window.uimanager.get_widget( '/MenuBar/FileMenu/OpenRecent'), open_recent_project) projectinfogui.update_project_info() dialog.destroy() else: dialog.destroy()
def _save_as_dialog_callback(dialog, response_id): if response_id == Gtk.ResponseType.ACCEPT: filenames = dialog.get_filenames() PROJECT().last_save_path = filenames[0] PROJECT().name = unicode(os.path.basename(filenames[0]), "utf-8") updater.set_info_icon(Gtk.STOCK_SAVE) try: persistance.save_project(PROJECT(), PROJECT().last_save_path) #<----- HERE except IOError as ioe: dialog.destroy() updater.set_info_icon(None) primary_txt = "I/O error({0})".format(ioe.errno) secondary_txt = ioe.strerror + "." dialogutils.warning_message(primary_txt, secondary_txt, gui.editor_window.window, is_info=False) return if len(PROJECT().events) == 0: # Save as... with 0 project events is considered Project creation p_event = projectdata.ProjectEvent(projectdata.EVENT_CREATED_BY_SAVING, PROJECT().last_save_path) PROJECT().events.append(p_event) else: p_event = projectdata.ProjectEvent(projectdata.EVENT_SAVED_AS, (PROJECT().name, PROJECT().last_save_path)) PROJECT().events.append(p_event) app.stop_autosave() app.start_autosave() global save_icon_remove_event_id save_icon_remove_event_id = GObject.timeout_add(500, remove_save_icon) global save_time save_time = time.clock() gui.editor_window.window.set_title(PROJECT().name + " - Flowblade") gui.editor_window.uimanager.get_widget("/MenuBar/FileMenu/Save").set_sensitive(False) gui.editor_window.uimanager.get_widget("/MenuBar/EditMenu/Undo").set_sensitive(False) gui.editor_window.uimanager.get_widget("/MenuBar/EditMenu/Redo").set_sensitive(False) editorpersistance.add_recent_project_path(PROJECT().last_save_path) editorpersistance.fill_recents_menu_widget(gui.editor_window.uimanager.get_widget('/MenuBar/FileMenu/OpenRecent'), open_recent_project) projectinfogui.update_project_info() dialog.destroy() else: dialog.destroy()
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 _save_as_dialog_callback(dialog, response_id): if response_id == gtk.RESPONSE_ACCEPT: filenames = dialog.get_filenames() PROJECT().last_save_path = filenames[0] PROJECT().name = os.path.basename(filenames[0]) updater.set_info_icon(gtk.STOCK_SAVE) if len(PROJECT().events) == 0: # Save as... with 0 project events is considered Project creation p_event = projectdata.ProjectEvent(projectdata.EVENT_CREATED_BY_SAVING, PROJECT().last_save_path) PROJECT().events.append(p_event) else: p_event = projectdata.ProjectEvent(projectdata.EVENT_SAVED_AS, (PROJECT().name, PROJECT().last_save_path)) PROJECT().events.append(p_event) persistance.save_project(PROJECT(), PROJECT().last_save_path) #<----- HERE app.stop_autosave() app.start_autosave() global save_icon_remove_event_id save_icon_remove_event_id = gobject.timeout_add(500, remove_save_icon) global save_time save_time = time.clock() gui.editor_window.window.set_title(PROJECT().name + " - Flowblade") gui.editor_window.uimanager.get_widget("/MenuBar/FileMenu/Save").set_sensitive(False) gui.editor_window.uimanager.get_widget("/MenuBar/EditMenu/Undo").set_sensitive(False) gui.editor_window.uimanager.get_widget("/MenuBar/EditMenu/Redo").set_sensitive(False) editorpersistance.add_recent_project_path(PROJECT().last_save_path) editorpersistance.fill_recents_menu_widget(gui.editor_window.uimanager.get_widget('/MenuBar/FileMenu/OpenRecent'), open_recent_project) projectinfogui.update_project_info() dialog.destroy() else: dialog.destroy()
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 _save_as_dialog_callback(dialog, response_id): if response_id == Gtk.ResponseType.ACCEPT: filenames = dialog.get_filenames() PROJECT().last_save_path = filenames[0] PROJECT().name = unicode(os.path.basename(filenames[0]), "utf-8") updater.set_info_icon(Gtk.STOCK_SAVE) try: persistance.save_project(PROJECT(), PROJECT().last_save_path) #<----- HERE except IOError as ioe: dialog.destroy() updater.set_info_icon(None) primary_txt = "I/O error({0})".format(ioe.errno) secondary_txt = ioe.strerror + "." dialogutils.warning_message(primary_txt, secondary_txt, gui.editor_window.window, is_info=False) return if len( PROJECT().events ) == 0: # Save as... with 0 project events is considered Project creation p_event = projectdata.ProjectEvent( projectdata.EVENT_CREATED_BY_SAVING, PROJECT().last_save_path) PROJECT().events.append(p_event) else: p_event = projectdata.ProjectEvent( projectdata.EVENT_SAVED_AS, (PROJECT().name, PROJECT().last_save_path)) PROJECT().events.append(p_event) app.stop_autosave() app.start_autosave() global save_icon_remove_event_id save_icon_remove_event_id = GObject.timeout_add(500, remove_save_icon) global save_time save_time = time.clock() gui.editor_window.window.set_title(PROJECT().name + " - Flowblade") gui.editor_window.uimanager.get_widget( "/MenuBar/FileMenu/Save").set_sensitive(False) gui.editor_window.uimanager.get_widget( "/MenuBar/EditMenu/Undo").set_sensitive(False) gui.editor_window.uimanager.get_widget( "/MenuBar/EditMenu/Redo").set_sensitive(False) editorpersistance.add_recent_project_path(PROJECT().last_save_path) editorpersistance.fill_recents_menu_widget( gui.editor_window.uimanager.get_widget( '/MenuBar/FileMenu/OpenRecent'), open_recent_project) projectinfogui.update_project_info() dialog.destroy() else: dialog.destroy()