Skip to content

Improve linked A/V track hierarchy and timeline deletion - #159

Open
gorio wants to merge 2 commits into
CutWire-Studios:mainfrom
gorio:contrib/linked-av-track-hierarchy-delete
Open

Improve linked A/V track hierarchy and timeline deletion#159
gorio wants to merge 2 commits into
CutWire-Studios:mainfrom
gorio:contrib/linked-av-track-hierarchy-delete

Conversation

@gorio

@gorio gorio commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR improves linked video/audio behavior in the timeline.

It addresses two related editing workflows:

  1. Detached audio tracks now mirror the relative hierarchy of their source video tracks.
  2. Delete / Backspace can remove the current timeline selection while respecting A/V links.

Audio track hierarchy

Previously, extracting audio from multiple video tracks could reuse an existing audio track, causing audio clips to overlap.

The resulting layout could become inconsistent depending on the order in which audio was extracted.

This change keeps media types grouped:

Video 1
Video 2
Video 3
Audio 1
Audio 2
Audio 3

The detached audio hierarchy mirrors the source video hierarchy regardless of extraction order.

For example, extracting audio in this order:

Video 3
Video 1
Video 2

still produces:

Video 1
Video 2
Video 3
Audio 1
Audio 2
Audio 3

Each detached audio clip remains linked to its source video.

Timeline Delete / Backspace

Timeline clips can now be removed with Delete or Backspace when the timeline clip owns keyboard focus.

On macOS this supports both:

  • the MacBook Delete key, which Qt reports as Backspace
  • forward Delete on extended keyboards

The behavior respects A/V linking:

Linked video/audio

Deleting either the video or the detached audio removes the complete linked pair.

Unlinked video/audio

After using Unlink, deleting one item removes only the selected item.

Focus safety

The keyboard handler is scoped to the focused timeline clip.

This avoids stealing Delete from:

  • the Media Bin
  • dialogs
  • text fields
  • other editor surfaces

Undo

Deletion remains a normal project edit and can be restored with a single Undo operation.

Tests

Added regression coverage for:

  • three video tracks with audio extracted in non-sequential order
  • stable Video 1 / Video 2 / Video 3 + Audio 1 / Audio 2 / Audio 3 hierarchy
  • linked pair deletion
  • unlink followed by single-item deletion
  • undo behavior

The full project test suite passes locally on macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant