Skip to content

Auto duck - #1877

Open
bmatherly wants to merge 4 commits into
masterfrom
auto_duck
Open

Auto duck#1877
bmatherly wants to merge 4 commits into
masterfrom
auto_duck

Conversation

@bmatherly

Copy link
Copy Markdown
Member

depends on mltframework/mlt#1272

One downside is that the ducking can not look ahead at the audio. So it can't start fading until after the upper tracks have already crossed the threshold.

image

Ensure that track audio is mixed from top to bottom. This allows
the automatic ducking to work intuitively from top to bottom.
Add undo buttons to the controls
Update the labels
Add tooltips

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds “automatic ducking” controls to track properties and introduces logic to keep MLT mix transition ordering consistent with Shotcut’s UI track order (important for correct ducking behavior), along with a regression test for the transition ordering.

Changes:

  • Add UI controls (threshold, max reduction, fade in/out, live reduction meter) and periodic status refresh for mix-transition ducking properties in TrackPropertiesWidget.
  • Add an undoable command (ChangeTransitionPropertyCommand) to edit numeric mix transition properties per-track.
  • Add Timeline::reorderMixTransitions() plus model hooks and a new Qt test to verify correct mix-transition insertion/traversal order.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_mix_transition_order.cpp New QtTest covering mix transition ordering semantics.
tests/CMakeLists.txt Builds/runs the new mix-transition-order test.
src/widgets/trackpropertieswidget.ui Adds ducking UI controls and live gain-reduction meter.
src/widgets/trackpropertieswidget.h Extends widget API and adds ducking-related slots/timer member.
src/widgets/trackpropertieswidget.cpp Implements ducking UI wiring, undo integration, and status polling.
src/widgets/doublesliderspinner.h New reusable slider+double-spinbox widget for numeric controls.
src/widgets/doublesliderspinner.cpp Implements the slider/spinbox synchronization and reset behavior.
src/models/multitrackmodel.h Adds reorderMixTransitions() slot.
src/models/multitrackmodel.cpp Calls mix-transition reorder after track add/remove/insert/move.
src/models/mixtransitionorder.h Declares Timeline::reorderMixTransitions() helper.
src/models/mixtransitionorder.cpp Implements transition disconnect/replant to enforce UI order.
src/mainwindow.cpp Adjusts TrackPropertiesWidget construction to selectively show blend/ducking UI.
src/commands/timelinecommands.h Adds UndoIdChangeTransitionProperty and command declaration.
src/commands/timelinecommands.cpp Implements property-change undo command and mix-transition lookup helper.
src/CMakeLists.txt Adds new model/widget sources to the main build.

Comment thread src/models/mixtransitionorder.cpp
Comment thread src/mainwindow.cpp
return w;
}
bool isTopTrack = trackIndex == 0;
w = new TrackPropertiesWidget(*producer, !isBottomVideo, !isTopTrack, this);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a check for MLT version >= 7.41.0 or mix \version >=4 to allow showDucking to be true

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.

3 participants