def _do_split_audio_edit(popup_data): # NOTE: THIS HARD CODES ALL SPLITS TO HAPPEN ON TRACK A1, THIS MAY CHANGE to_track = current_sequence().tracks[current_sequence().first_video_index - 1] clip, track, item_id, x = popup_data press_frame = tlinewidgets.get_frame(x) index = current_sequence().get_clip_index(track, press_frame) frame = track.clip_start(index) audio_clip = current_sequence().create_file_producer_clip( clip.path, None, False, clip.ttl) audio_clip.media_type = appconsts.AUDIO split_length = clip.clip_out - clip.clip_in + 1 # +1 out is inclusive and we're looking for length data = { "parent_clip": clip, "audio_clip": audio_clip, "over_in": frame, "over_out": frame + split_length, "to_track": to_track } action = edit.audio_splice_action(data) action.do_edit() return (clip, audio_clip, to_track)
def _do_split_audio_edit(popup_data): # NOTE: THIS HARD CODES ALL SPLITS TO HAPPEN ON TRACK A1, THIS MAY CHANGE to_track = current_sequence().tracks[current_sequence().first_video_index - 1] clip, track, item_id, x = popup_data press_frame = tlinewidgets.get_frame(x) index = current_sequence().get_clip_index(track, press_frame) frame = track.clip_start(index) audio_clip = current_sequence().create_file_producer_clip(clip.path) audio_clip.media_type = appconsts.AUDIO split_length = clip.clip_out - clip.clip_in + 1 # +1 out is inclusive and we're looking for length data = { "parent_clip":clip, "audio_clip":audio_clip, "over_in":frame, "over_out":frame + split_length, "to_track":to_track} action = edit.audio_splice_action(data) action.do_edit() return (clip, audio_clip, to_track)