예제 #1
0
def display_monitor_clip_name():#we're displaying length and range length also
    clip_len = utils.get_tc_string(gui.pos_bar.producer.get_length())
    range_info = _get_marks_range_info(MONITOR_MEDIA_FILE().mark_in, MONITOR_MEDIA_FILE().mark_out)

    gui.editor_window.monitor_tc_info.set_source_name(MONITOR_MEDIA_FILE().name + " - ")
    gui.editor_window.monitor_tc_info.set_source_tc(clip_len)

    gui.editor_window.monitor_tc_info.set_range_info(*range_info)
예제 #2
0
def display_monitor_clip_name():#we're displaying length and range length also
    tc_info = utils.get_tc_string(gui.pos_bar.producer.get_length()) 
    if  MONITOR_MEDIA_FILE().mark_in != -1 and MONITOR_MEDIA_FILE().mark_out != -1:
        clip_length = utils.get_tc_string(MONITOR_MEDIA_FILE().mark_out - MONITOR_MEDIA_FILE().mark_in + 1) #+1 out incl.
        tc_info = tc_info + "  ][ " + str(clip_length)
    else:
        tc_info = tc_info + "  ][ --:--:--:--" 

    gui.editor_window.monitor_source.set_text(MONITOR_MEDIA_FILE().name)
    gui.editor_window.info1.set_text(tc_info)
예제 #3
0
def up_arrow_seek_on_monitor_clip():
    current_frame = PLAYER().producer.frame()

    if current_frame < MONITOR_MEDIA_FILE().mark_in:
        PLAYER().seek_frame(MONITOR_MEDIA_FILE().mark_in)
        return

    if current_frame < MONITOR_MEDIA_FILE().mark_out:
        PLAYER().seek_frame(MONITOR_MEDIA_FILE().mark_out)
        return

    PLAYER().seek_frame(PLAYER().producer.get_length() - 1)
예제 #4
0
def _do_marks_update():

    if timeline_visible():
        producer = PLAYER().producer
    else:
        producer = current_sequence().monitor_clip
        MONITOR_MEDIA_FILE().mark_in = producer.mark_in
        MONITOR_MEDIA_FILE().mark_out = producer.mark_out
        gui.media_list_view.widget.queue_draw()

    gui.pos_bar.update_display_from_producer(producer)
    gui.tline_scale.widget.queue_draw()
예제 #5
0
def display_monitor_clip_name():
    # Display clip name
    if MONITOR_MEDIA_FILE().mark_in != -1 and MONITOR_MEDIA_FILE(
    ).mark_out != -1:
        clip_length = utils.get_tc_string(MONITOR_MEDIA_FILE().mark_out -
                                          MONITOR_MEDIA_FILE().mark_in +
                                          1)  #+1 out incl.
        range_text = " / ][ " + str(clip_length)
    else:
        range_text = ""

    gui.editor_window.monitor_source.set_text(MONITOR_MEDIA_FILE().name +
                                              range_text)
예제 #6
0
def down_arrow_seek_on_monitor_clip():
    current_frame = PLAYER().producer.frame()
    mark_in = MONITOR_MEDIA_FILE().mark_in
    mark_out = MONITOR_MEDIA_FILE().mark_out

    if current_frame > mark_out and mark_out != -1:
        PLAYER().seek_frame(MONITOR_MEDIA_FILE().mark_out)
        return

    if current_frame > mark_in and mark_in != -1:
        PLAYER().seek_frame(MONITOR_MEDIA_FILE().mark_in)
        return

    PLAYER().seek_frame(0)
예제 #7
0
def _get_new_clip_from_clip_monitor():
    """
    Creates and returns new clip from current clip monitor clip
    with user set in and out points.
    """
    if MONITOR_MEDIA_FILE() == None:
        # Info window here
        return

    if MONITOR_MEDIA_FILE().type != appconsts.PATTERN_PRODUCER:
        new_clip = current_sequence().create_file_producer_clip(
            MONITOR_MEDIA_FILE().path)
    else:
        new_clip = current_sequence().create_pattern_producer(
            MONITOR_MEDIA_FILE())

    # Set clip in and out points
    new_clip.mark_in = MONITOR_MEDIA_FILE().mark_in
    new_clip.mark_out = MONITOR_MEDIA_FILE().mark_out
    new_clip.name = MONITOR_MEDIA_FILE().name

    if new_clip.mark_in == -1:
        new_clip.mark_in = 0
    if new_clip.mark_out == -1:
        new_clip.mark_out = new_clip.get_length() - 1  #-1 == out inclusive

    return new_clip
예제 #8
0
def update_frame_displayers(frame):
    """
    Display frame position in position bar and time code display.
    """
    # Update position bar with normalized pos
    if timeline_visible():
        producer_length = PLAYER().producer.get_length()
    else:
        producer_length = gui.pos_bar.producer.get_length()
        if save_monitor_frame:
            MONITOR_MEDIA_FILE().current_frame = frame

    norm_pos = frame / float(producer_length)
    gui.pos_bar.set_normalized_pos(norm_pos)

    gui.tline_scale.widget.queue_draw()
    gui.tline_canvas.widget.queue_draw()
    gui.big_tc.widget.queue_draw()
    clipeffectseditor.display_kfeditors_tline_frame(frame)
    compositeeditor.display_kfeditors_tline_frame(frame)
예제 #9
0
def display_clip_in_monitor(clip_monitor_currently_active=False):
    """
    Sets mltplayer producer to be video file clip and updates GUI.
    """
    if MONITOR_MEDIA_FILE() == None:
        gui.editor_window.clip_editor_b.set_active(False)
        return

    global save_monitor_frame
    save_monitor_frame = True

    # Opening clip exits trim modes
    if not editorstate.current_is_move_mode():
        set_clip_edit_mode_callback()

    gui.clip_editor_b.set_sensitive(True)
    editorstate._timeline_displayed = False

    # Save timeline pos if so directed.
    if clip_monitor_currently_active == False:
        global saved_timeline_pos
        saved_timeline_pos = PLAYER().current_frame()
        editorstate.tline_shadow_frame = saved_timeline_pos

    # If we're already displaying monitor clip we stop consumer
    # to supress timeline flashing between monitor clips
    if clip_monitor_currently_active == False:
        editorstate.PLAYER().consumer.stop()

    # Clear old clip
    current_sequence().clear_hidden_track()

    # Create and display clip on hidden track
    if MONITOR_MEDIA_FILE(
    ).type == appconsts.PATTERN_PRODUCER or MONITOR_MEDIA_FILE(
    ).type == appconsts.IMAGE_SEQUENCE:
        # pattern producer or image sequence
        clip_producer = current_sequence().display_monitor_clip(
            None, MONITOR_MEDIA_FILE())
    else:
        # File producers
        clip_producer = current_sequence().display_monitor_clip(
            MONITOR_MEDIA_FILE().path)

    # Timeline flash does not happen if we start consumer after monitor clip is
    # already on sequence
    if clip_monitor_currently_active == False:
        editorstate.PLAYER().consumer.start()

    # IMAGE_SEQUENCE files always returns 15000 for get_length from mlt so we have to monkeypatch that method to get correct results
    if MONITOR_MEDIA_FILE().type == appconsts.IMAGE_SEQUENCE:
        clip_producer.get_length = lambda: MONITOR_MEDIA_FILE().length

    clip_producer.mark_in = MONITOR_MEDIA_FILE().mark_in
    clip_producer.mark_out = MONITOR_MEDIA_FILE().mark_out

    # Give IMAGE and PATTERN_PRODUCER media types default mark in and mark out if not already set.
    # This makes them reasonably short and trimmable in both directions.
    if clip_producer.media_type == appconsts.IMAGE or clip_producer.media_type == appconsts.PATTERN_PRODUCER:
        if clip_producer.mark_in == -1 and clip_producer.mark_out == -1:
            center_frame = clip_producer.get_length() / 2
            default_length_half = 75
            mark_in = center_frame - default_length_half
            mark_out = center_frame + default_length_half - 1
            clip_producer.mark_in = mark_in
            clip_producer.mark_out = mark_out
            MONITOR_MEDIA_FILE().mark_in = mark_in
            MONITOR_MEDIA_FILE().mark_out = mark_out

    # Display frame, marks and pos
    gui.pos_bar.update_display_from_producer(clip_producer)

    display_monitor_clip_name()

    if MONITOR_MEDIA_FILE().type == appconsts.IMAGE or \
        MONITOR_MEDIA_FILE().type == appconsts.PATTERN_PRODUCER:
        PLAYER().seek_frame(0)
    else:
        if editorpersistance.prefs.remember_monitor_clip_frame:
            PLAYER().seek_frame(MONITOR_MEDIA_FILE().current_frame)
        else:
            PLAYER().seek_frame(0)

    display_marks_tc()

    gui.pos_bar.widget.grab_focus()
    gui.media_list_view.widget.queue_draw()

    if editorpersistance.prefs.auto_play_in_clip_monitor == True:
        PLAYER().start_playback()

    repaint_tline()