def init_tool_for_clip(clip, track, edit_type=VOLUME_KF_EDIT): clip_index = track.clips.index(clip) # Save data needed to do the keyframe edits. global edit_data #, pressed_on_selected, drag_disabled edit_data = {"draw_function":_tline_overlay, "clip_index":clip_index, "clip_start_in_timeline":track.clip_start(clip_index), "clip":clip, "track":track, "initializing":True} # Always brightness keyframes for media types that contain no audio. if edit_data["clip"].media_type != appconsts.VIDEO and edit_data["clip"].media_type != appconsts.AUDIO: edit_type = BRIGHTNESS_KF_EDIT # Volume keyframes on audio track for video and audio if track.type == appconsts.AUDIO and not(edit_data["clip"].media_type != appconsts.VIDEO and edit_data["clip"].media_type != appconsts.AUDIO): edit_type = VOLUME_KF_EDIT # Init for edit type if edit_type == VOLUME_KF_EDIT: ep = _get_volume_editable_property(clip, track, clip_index) if ep == None: filter_info = mltfilters.get_volume_filters_info() data = {"clip":clip, "filter_info":filter_info, "filter_edit_done_func":_filter_create_dummy_func} action = edit.add_multipart_filter_action(data) action.do_edit() ep = _get_volume_editable_property(clip, track, clip_index) edit_data["editable_property"] = ep global _kf_editor _kf_editor = TLineKeyFrameEditor(ep, True, VOLUME_KF_EDIT) elif edit_type == BRIGHTNESS_KF_EDIT: ep = _get_brightness_editable_property(clip, track, clip_index) if ep == None: filter_info = mltfilters.get_brightness_filter_info() data = {"clip":clip, "filter_info":filter_info, "filter_edit_done_func":_filter_create_dummy_func} action = edit.add_filter_action(data) action.do_edit() ep = _get_brightness_editable_property(clip, track, clip_index) edit_data["editable_property"] = ep global _kf_editor _kf_editor = TLineKeyFrameEditor(ep, True, BRIGHTNESS_KF_EDIT) tlinewidgets.set_edit_mode_data(edit_data) updater.repaint_tline()
def get_filter_add_action(filter_info, target_clip): if filter_info.multipart_filter == False: data = {"clip":target_clip, "filter_info":filter_info, "filter_edit_done_func":filter_edit_done} action = edit.add_filter_action(data) else: data = {"clip":target_clip, "filter_info":filter_info, "filter_edit_done_func":filter_edit_done} action = edit.add_multipart_filter_action(data) return action
def init_tool_for_clip(clip, track, edit_type=VOLUME_KF_EDIT): clip_index = track.clips.index(clip) # Save data needed to do the keyframe edits. global edit_data #, pressed_on_selected, drag_disabled edit_data = {"draw_function":_tline_overlay, "clip_index":clip_index, "clip_start_in_timeline":track.clip_start(clip_index), "clip":clip, "track":track, "initializing":True} # Always brightness keyframes for media types that contain no audio. if not(edit_data["clip"].media_type == appconsts.VIDEO or edit_data["clip"].media_type != appconsts.AUDIO): edit_type = BRIGHTNESS_KF_EDIT # Init for edit type if edit_type == VOLUME_KF_EDIT: ep = _get_volume_editable_property(clip, track, clip_index) if ep == None: filter_info = mltfilters.get_volume_filters_info() data = {"clip":clip, "filter_info":filter_info, "filter_edit_done_func":_filter_create_dummy_func} action = edit.add_multipart_filter_action(data) action.do_edit() ep = _get_volume_editable_property(clip, track, clip_index) edit_data["editable_property"] = ep global _kf_editor _kf_editor = TLineKeyFrameEditor(ep, True, VOLUME_KF_EDIT) elif edit_type == BRIGHTNESS_KF_EDIT: ep = _get_brightness_editable_property(clip, track, clip_index) if ep == None: filter_info = mltfilters.get_brightness_filter_info() data = {"clip":clip, "filter_info":filter_info, "filter_edit_done_func":_filter_create_dummy_func} action = edit.add_filter_action(data) action.do_edit() ep = _get_brightness_editable_property(clip, track, clip_index) edit_data["editable_property"] = ep global _kf_editor _kf_editor = TLineKeyFrameEditor(ep, True, BRIGHTNESS_KF_EDIT) tlinewidgets.set_edit_mode_data(edit_data) updater.repaint_tline()
def get_filter_add_action(filter_info, target_clip): if filter_info.multipart_filter == False: # Maybe show info on using alpha filters if filter_info.group == "Alpha": GLib.idle_add(_alpha_filter_add_maybe_info, filter_info) data = {"clip":target_clip, "filter_info":filter_info, "filter_edit_done_func":filter_edit_done} action = edit.add_filter_action(data) else: data = {"clip":target_clip, "filter_info":filter_info, "filter_edit_done_func":filter_edit_done} action = edit.add_multipart_filter_action(data) return action
def get_filter_add_action(filter_info, target_clip): if filter_info.multipart_filter == False: # Maybe show info on using alpha filters if filter_info.group == "Alpha": GLib.idle_add(_alpha_filter_add_maybe_info, filter_info) data = {"clip":target_clip, "filter_info":filter_info, "filter_edit_done_func":filter_edit_done} action = edit.add_filter_action(data) else: data = {"clip":target_clip, "filter_info":filter_info, "filter_edit_done_func":filter_edit_done} action = edit.add_multipart_filter_action(data) return action