Bug 359402

Summary: Insert track should increment over existing track
Product: [Applications] kdenlive Reporter: Peter <Peter>
Component: User InterfaceAssignee: Clint Moyer <cmoyer91>
Status: RESOLVED MOVED    
Severity: normal CC: AtomicCanine, cmoyer91, ed.rogalsky, fritzibaby, jepe
Priority: NOR Keywords: junior-jobs
Version: 18.08.1Flags: fritzibaby: low_hanging+
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
URL: https://phabricator.kde.org/T9816
Latest Commit: Version Fixed In:
Attachments: Wrong audio track allocation

Description Peter 2016-02-14 20:29:22 UTC
When I add a track using insert track, I expect it to use a number greater than the previous every time I add a new one.

e.g. The last autonamed track that is given by default is Video 3. When I do an insert track, the autofilled preset name for the new track is Video 3. It should be Video 4, and then when I insert track again after adding Video 4, it should be Video 5, so on and so forth.

Version 15.12.2 from PackmanRepo

Reproducible: Always

Steps to Reproduce:
1. Insert Track
2.
3.

Actual Results:  
Prefilled name is Video 3, Video 3, Video 3, Video 3 ...

Expected Results:  
Prefilled  name is Video 4, Video 5, Video 6, Video 7 ...

It always uses Video 3, even for Audio Tracks, Audio tracks should work the same way as described here, but with Audio instead of Video.
Comment 1 eddrog 2016-02-14 22:04:43 UTC
Confirmed
Comment 2 emohr 2018-10-06 12:42:32 UTC
Same behavior for video and audio tracks on Windows Kdenlive 18.08.1
Comment 3 Clint Moyer 2018-10-07 09:04:58 UTC
Not happening for me in v18.08.1 on Linux. The insert track feature checks the list of existing track names and increments by 1 when a previous value exists. So when "Video 3" exists it moves on to "Video 4".

https://cgit.kde.org/kdenlive.git/tree/src/timeline/customtrackview.cpp?h=v18.08.1#n7036
Comment 4 emohr 2018-10-07 12:23:03 UTC
Created attachment 115466 [details]
Wrong audio track allocation

You are right. But the insert track works only correct with the video track. On the audio track it doesn’t change to “audio track” and the track name is still “Video 3”. See attached screen shot.
Comment 5 Clint Moyer 2018-10-07 18:28:20 UTC
Okay I understand better. Two things will need to be changed.

1. The default track type is hard-coded to "Video" and instead should be pre-determined based on the currently selected track. I'm unable to select multiple tracks or de-select all tracks, which means this should be a safe action. I am confused though because there are dedicated buttons in the menu to do those actions, they just don't work.

https://cgit.kde.org/kdenlive.git/tree/src/ui/addtrack_ui.ui?h=v18.08.1#n54

2. The proposed name should be based on the the track type. Currently it is hard-coded to "Video %l".

https://cgit.kde.org/kdenlive.git/tree/src/timeline/customtrackview.cpp?h=v18.08.1#n7028
Comment 6 emohr 2018-10-07 19:11:08 UTC
You got it. Is exactly what I meant. In the screenshot, I made a right click on audio track 2 to add 1 audio track. With adding an audio track it should change “insert Track” to “below” as well (instead of “above”).
Comment 7 Clint Moyer 2018-10-07 19:33:22 UTC
I've posted a fix.

https://phabricator.kde.org/T9816
Comment 8 emohr 2019-01-19 08:36:07 UTC
*** Bug 403346 has been marked as a duplicate of this bug. ***
Comment 9 Ed 2021-08-25 11:39:19 UTC
I see that this is marked "RESOLVED MOVED" and that there was a task started in Oct 2018 about it.  Issue of odd "insert track" behavior is still present in 21.08 (Linux Mint 19.3, Cinnamon).

Just for information, I started a completely new project, inserted a new A/V track above the top A/V track: worked as expected.  I then deleted an AUDIO track.  When inserting a new A/V track at this point, the VIDEO portion was correctly named, but the AUDIO portion had the number of the deleted track and was not adjacent to the VIDEO track just inserted.