At this point, this implementation is only a way to evaluate if KDDockWidgets fits our workflow.
Although in the initial testing it looks nice, we need to ensure our implementation is solid enough to cover all use cases.
**Blocker**
- [x] when a detached widget is focused, keyboard shortcuts don't work
**Currently works**
- [x] saving and restoring the current layout
- [x] saving the layout in the project file
- [x] View menu to show/hide individual widgets
- [x] Undock/redock all widgets including timeline
**To improve**
- [x] Hide / Show title bars sometimes creates 2 titlebars in undocked widgets
- [x] On re-opening, in some cases undocked widgets are hidden
- [ ] Undocked widgets position is not properly restored on re-opening: this is a [Wayland limitation](https://github.com/KDAB/KDDockWidgets/issues/662)
**To fix**
- [x] Docking widget to tab it on a QtQuickWidget with qml like the monitors or the timeline does not work (see https://github.com/KDAB/KDDockWidgets/issues/658)
This adds a new "Kdenlive" component in the About Dialog showing the git revision and package type.
It also makes it available in the debug info.
{width=540 height=528}
This is needed because with pkg-config the linking of libav or better its depdencies like zlib does not work properly with MSVC
The FindFFmpeg.cmake file is assembled from kfilemetadata and krita. It is currently also in review to be added to extra-cmake-modules, however until this is accepted and we have a dependency on that ECM version we need a copy of the file in our code base
# Rewrite Audio Waveform generation + drawing
Addresses #1888.
This work is done as part of contract work with KDE e.V.
# Summary
## Waveform generation performance improvements
The original MLT method has been improved and a faster libav* -based one is used when possible. The original method used the "audiolevel" MLT filter, which only supported 1 point per frame and was quite slow.
Measured time taken for audio levels generation in release builds on my machine (AMD Ryzen 7 3700U with SSD).
- _original MLT_ is before these changes, with one point per frame;
- _new MLT_ is the improved method, with 5 points per frame;
- _new libav_ is the method using libav directly, with 5 points per frame.
| file | new libav (s) | new MLT (s) | original MLT (s) |
|-----------------------------------------|---------------|-------------|------------------|
| 1h 20min of stereo uncompressed WAV | 2.477 | 5.187 | 8.131 |
| 1h 20min of stereo max-compressed FLAC | 6.818 | 9.03 | 12.513 |
| 26min of OPUS audio in a MKV video file | 4.774 | 6.86 | 8.614 |
## Better waveform resolution
This merge requests brings better waveform temporal resolution (1 -> N points per frame) and better vertical resolution (256 -> 65,535 levels).
**Before changes (KDenlive 24.08.3):**

**After changes:**

## Fix incorrect waveform drawing function
When drawing the waveform, the current implementation samples the audio levels at points corresponding to the pixels to draw. This is incorrect and results in distorted waveforms, missing peaks, and visual artifacts. The new implementations uses a slower but correct max-based resampling method.
**Before changes (KDenlive 24.08.3)**

**After changes:**

**Reference (audacity)**

**Stretching a waveform, before changes:**

**Stretching a waveform, after changes:**

# Detailed changes
- Change audiolevels sample format to uint16_t for increased precision
- Add support for N points per frame, currently set to 5
- projectclip.cpp:
- Use TimelineWaveform to render the audio clip thumbnails
- do not store audiolevels in object
- generate larger thumbnails
- Change audio max property key from "kdenlive:audio_max%1" to "_kdenlive:audio_max%1"
- audiolevelstask.cpp: major refactor
- Replace audiolevels PNG (de)serializer with a dumber one
- add fast libav-based generation
- simplify and improve MLT-based generation
- disable caching
- disable resampling
- remove useless audiochannels filter
- remove redundant stream selection
- replace audiolevel filter with direct levels calculation
- add generic computePeaks() function
- kdenliveclipmonitor.qml: fix incorrect clip duration passed to waveform renderer
- timelineitems.cpp: separated items into their own source/header files (timelineplayhead, timelinerecwaveform, timelinetriangle, timelinewaveform)
- timelinewaveform.cpp: simplify and improve waveform rendering
- add support for N points per frame
- add support for fractional in and outpoints
- replace incorrect sampling drawing function with correct max-based one
- remove unused properties
- add even and odd color properties
- Add tests
- Add tests for computePeaks and both generation methods
- Add audio tests files + script to generate them