예제 #1
0
    def run(self):
        Gdk.threads_enter()
        recreate_progress_window = dialogs.recreate_icons_progress_dialog()
        time.sleep(0.1)
        Gdk.threads_leave()

        no_icon_path = respaths.IMAGE_PATH + projectdata.FALLBACK_THUMB
        loaded = 0
        for key in PROJECT().media_files.iterkeys():
            media_file = PROJECT().media_files[key]
            Gdk.threads_enter()
            recreate_progress_window.info.set_text(media_file.name)
            Gdk.threads_leave()

            if ((not isinstance(media_file, patternproducer.AbstractBinClip))
                    and
                (not isinstance(media_file, projectdata.BinColorClip))):
                if media_file.type == appconsts.AUDIO:
                    icon_path = respaths.IMAGE_PATH + "audio_file.png"
                    media_file.info = None
                else:
                    (icon_path, length,
                     info) = projectdata.thumbnailer.write_image(
                         media_file.path)
                    media_file.info = info
                media_file.icon_path = icon_path
                media_file.create_icon()

            loaded = loaded + 1

            Gdk.threads_enter()
            loaded_frac = float(loaded) / float(len(PROJECT().media_files))
            recreate_progress_window.progress_bar.set_fraction(loaded_frac)
            time.sleep(0.01)
            Gdk.threads_leave()

        # Update editor gui
        Gdk.threads_enter()
        recreate_progress_window.destroy()
        time.sleep(0.3)
        Gdk.threads_leave()

        Gdk.threads_enter()
        gui.media_list_view.fill_data_model()
        gui.bin_list_view.fill_data_model()
        gui.enable_save()
        Gdk.threads_leave()
예제 #2
0
def _reload_clip_media(data):
    clip, track, item_id, item_data = data

    # TODO: This ain't doing the clip icon update as wished.
    media_item = PROJECT().get_media_file_for_path(clip.path)
    media_item.create_icon()

    clip_index = track.clips.index(clip)
    new_clip = current_sequence().create_clone_clip(clip)

    data = {
        "old_clip": clip,
        "new_clip": new_clip,
        "track": track,
        "index": clip_index
    }
    action = edit.reload_replace(data)
    action.do_edit()
예제 #3
0
    def run(self):
        # NEEDS FIXING FOR COMPACT PROJECTS
        Gdk.threads_enter()
        recreate_progress_window = dialogs.recreate_icons_progress_dialog()
        time.sleep(0.1)
        Gdk.threads_leave()

        no_icon_path = respaths.IMAGE_PATH + projectdata.FALLBACK_THUMB
        loaded = 0
        for key in PROJECT().media_files.iterkeys():
            media_file = PROJECT().media_files[key]
            Gdk.threads_enter()
            recreate_progress_window.info.set_text(media_file.name)
            Gdk.threads_leave()

            if ((not isinstance(media_file, patternproducer.AbstractBinClip))
                and (not isinstance(media_file, projectdata.BinColorClip))):
                if media_file.icon_path == no_icon_path:
                    if media_file.type == appconsts.AUDIO:
                        icon_path = respaths.IMAGE_PATH + "audio_file.png"
                    else:
                        (icon_path, length) = projectdata.thumbnailer.write_image(media_file.path)
                    media_file.icon_path = icon_path
                    media_file.create_icon()

            loaded = loaded + 1
            
            Gdk.threads_enter()
            loaded_frac = float(loaded) / float(len(PROJECT().media_files))
            recreate_progress_window.progress_bar.set_fraction(loaded_frac)
            time.sleep(0.01)
            Gdk.threads_leave()

        # Update editor gui
        Gdk.threads_enter()
        recreate_progress_window.destroy()
        time.sleep(0.3)
        Gdk.threads_leave()
        
        Gdk.threads_enter()
        gui.media_list_view.fill_data_model()
        gui.bin_list_view.fill_data_model()
        gui.enable_save()
        Gdk.threads_leave()