Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
ae97c609
Commit
ae97c609
authored
Jul 01, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to sort audio tracks in reverse order
https://phabricator.kde.org/T11116
parent
0b7e2df7
Pipeline
#4787
passed with stage
in 14 minutes and 6 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
8 deletions
+41
-8
src/kdenlivesettings.kcfg
src/kdenlivesettings.kcfg
+2
-2
src/mainwindow.cpp
src/mainwindow.cpp
+11
-3
src/timeline2/model/timelinemodel.cpp
src/timeline2/model/timelinemodel.cpp
+27
-2
src/timeline2/model/timelinemodel.hpp
src/timeline2/model/timelinemodel.hpp
+1
-1
No files found.
src/kdenlivesettings.kcfg
View file @
ae97c609
...
...
@@ -278,9 +278,9 @@
<default>
0
</default>
</entry>
<entry
name=
"audiotracksbelow"
type=
"
Bool
"
>
<entry
name=
"audiotracksbelow"
type=
"
Int
"
>
<label>
Display audio tracks grouped below video tracks.
</label>
<default>
true
</default>
<default>
1
</default>
</entry>
<entry
name=
"raisepropsclips"
type=
"Bool"
>
...
...
src/mainwindow.cpp
View file @
ae97c609
...
...
@@ -952,17 +952,24 @@ void MainWindow::setupActions()
addAction
(
QStringLiteral
(
"timeline_view_split"
),
splitView
);
splitView
->
setData
(
QVariant
::
fromValue
(
1
));
splitView
->
setCheckable
(
true
);
splitView
->
setChecked
(
KdenliveSettings
::
audiotracksbelow
());
splitView
->
setChecked
(
KdenliveSettings
::
audiotracksbelow
()
==
1
);
QAction
*
splitView2
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"view-split-top-bottom"
)),
i18n
(
"Split Audio Tracks (reverse)"
),
this
);
addAction
(
QStringLiteral
(
"timeline_view_split_reverse"
),
splitView2
);
splitView2
->
setData
(
QVariant
::
fromValue
(
2
));
splitView2
->
setCheckable
(
true
);
splitView2
->
setChecked
(
KdenliveSettings
::
audiotracksbelow
()
==
2
);
QAction
*
mixedView
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"document-new"
)),
i18n
(
"Mixed Audio tracks"
),
this
);
addAction
(
QStringLiteral
(
"timeline_mixed_view"
),
mixedView
);
mixedView
->
setData
(
QVariant
::
fromValue
(
0
));
mixedView
->
setCheckable
(
true
);
mixedView
->
setChecked
(
!
KdenliveSettings
::
audiotracksbelow
()
);
mixedView
->
setChecked
(
KdenliveSettings
::
audiotracksbelow
()
==
0
);
auto
*
clipTypeGroup
=
new
QActionGroup
(
this
);
clipTypeGroup
->
addAction
(
mixedView
);
clipTypeGroup
->
addAction
(
splitView
);
clipTypeGroup
->
addAction
(
splitView2
);
connect
(
clipTypeGroup
,
&
QActionGroup
::
triggered
,
this
,
&
MainWindow
::
slotUpdateTimelineView
);
auto
tlsettings
=
new
QMenu
(
this
);
...
...
@@ -970,6 +977,7 @@ void MainWindow::setupActions()
tlsettings
->
addAction
(
m_compositeAction
);
tlsettings
->
addAction
(
mixedView
);
tlsettings
->
addAction
(
splitView
);
tlsettings
->
addAction
(
splitView2
);
QToolButton
*
timelineSett
=
new
QToolButton
(
this
);
timelineSett
->
setPopupMode
(
QToolButton
::
InstantPopup
);
...
...
@@ -2954,7 +2962,7 @@ void MainWindow::slotUpdateClipType(QAction *action)
void
MainWindow
::
slotUpdateTimelineView
(
QAction
*
action
)
{
int
viewMode
=
action
->
data
().
toInt
();
KdenliveSettings
::
setAudiotracksbelow
(
viewMode
==
1
);
KdenliveSettings
::
setAudiotracksbelow
(
viewMode
);
getMainTimeline
()
->
controller
()
->
getModel
()
->
_resetView
();
}
...
...
src/timeline2/model/timelinemodel.cpp
View file @
ae97c609
...
...
@@ -326,11 +326,36 @@ int TimelineModel::getTrackMltIndex(int trackId) const
return
getTrackPosition
(
trackId
)
+
1
;
}
int
TimelineModel
::
getTrackSortValue
(
int
trackId
,
bool
separated
)
const
int
TimelineModel
::
getTrackSortValue
(
int
trackId
,
int
separated
)
const
{
if
(
separated
)
{
if
(
separated
==
1
)
{
return
getTrackPosition
(
trackId
)
+
1
;
}
if
(
separated
==
2
)
{
// Count audio/video tracks
auto
it
=
m_allTracks
.
cbegin
();
int
aCount
=
0
;
int
vCount
=
0
;
int
refPos
=
0
;
bool
isVideo
=
true
;
while
(
it
!=
m_allTracks
.
cend
())
{
if
((
*
it
)
->
isAudioTrack
())
{
if
((
*
it
)
->
getId
()
==
trackId
)
{
refPos
=
aCount
;
isVideo
=
false
;
}
aCount
++
;
}
else
{
// video track
if
((
*
it
)
->
getId
()
==
trackId
)
{
refPos
=
vCount
;
}
vCount
++
;
}
++
it
;
}
return
isVideo
?
aCount
+
refPos
+
1
:
aCount
-
refPos
;
}
auto
it
=
m_allTracks
.
cend
();
int
aCount
=
0
;
int
vCount
=
0
;
...
...
src/timeline2/model/timelinemodel.hpp
View file @
ae97c609
...
...
@@ -305,7 +305,7 @@ public:
* @param separated: if true, the tracks will be sorted like: V2,V1,A1,A2
* Otherwise, the tracks will be sorted like V2,A2,V1,A1
*/
int
getTrackSortValue
(
int
trackId
,
bool
separated
)
const
;
int
getTrackSortValue
(
int
trackId
,
int
separated
)
const
;
/* @brief Returns the ids of the tracks below the given track in the order of the tracks
Returns an empty list if no track available
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment