Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
d31b1cbb
Commit
d31b1cbb
authored
Jul 11, 2018
by
Jean-Baptiste Mardelle
Browse files
New timeline display option, you can now choose between A2,A1,V1,V2 and A1,V1,A2,V2
parent
023fd40d
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/kdenlivesettings.kcfg
View file @
d31b1cbb
...
...
@@ -254,9 +254,9 @@
<default>
0
</default>
</entry>
<entry
name=
"
clipcornertype
"
type=
"
Int
"
>
<label>
Timeline clip corner
s.
</label>
<default>
1
</default>
<entry
name=
"
audiotracksbelow
"
type=
"
Bool
"
>
<label>
Display audio tracks grouped below video track
s.
</label>
<default>
false
</default>
</entry>
<entry
name=
"raisepropsclips"
type=
"Bool"
>
...
...
src/kdenliveui.rc
View file @
d31b1cbb
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui
name=
"kdenlive"
version=
"15
3
"
translationDomain=
"kdenlive"
>
<kpartgui
name=
"kdenlive"
version=
"15
5
"
translationDomain=
"kdenlive"
>
<MenuBar>
<Menu
name=
"file"
>
<Action
name=
"dvd_wizard"
/>
...
...
@@ -64,18 +64,17 @@
<Menu
name=
"clip"
><text>
Clip
</text>
<Menu
name=
"marker_menu"
><text>
Markers
</text>
<Action
name=
"add_clip_marker"
/>
<Action
name=
"add_marker_guide_quickly"
/>
<Action
name=
"edit_clip_marker"
/>
<Action
name=
"delete_clip_marker"
/>
<Action
name=
"delete_all_clip_markers"
/>
</Menu>
<Action
name=
"add_clip_marker"
/>
<Action
name=
"add_marker_guide_quickly"
/>
<Action
name=
"edit_clip_marker"
/>
<Action
name=
"delete_clip_marker"
/>
<Action
name=
"delete_all_clip_markers"
/>
</Menu>
<Action
name=
"auto_transition"
/>
<Action
name=
"split_audio"
/>
<Separator
/>
<Action
name=
"clip_audio_and_video"
/>
<Action
name=
"clip_video_only"
/>
<Action
name=
"clip_audio_only"
/>
<Action
name=
"clip_video_only"
/>
<Action
name=
"clip_audio_only"
/>
</Menu>
<Menu
name=
"timeline"
><text>
Timeline
</text>
...
...
@@ -230,7 +229,7 @@
</MenuBar>
<ToolBar
name=
"timelineToolBar"
fullWidth=
"true"
newline=
"true"
noMerge=
"1"
position=
"bottom"
>
<text>
Timeline Toolbar
</text>
<Action
name=
"timeline_
composi
ting"
/>
<Action
name=
"timeline_
set
ting
s
"
/>
<Action
name=
"timeline_mode"
/>
<Separator
/>
<Action
name=
"use_timeline_zone_in_edit"
/>
...
...
src/mainwindow.cpp
View file @
d31b1cbb
...
...
@@ -1018,6 +1018,31 @@ void MainWindow::setupActions()
connect
(
m_compositeAction
,
static_cast
<
void
(
KSelectAction
::*
)(
QAction
*
)
>
(
&
KSelectAction
::
triggered
),
this
,
&
MainWindow
::
slotUpdateCompositing
);
addAction
(
QStringLiteral
(
"timeline_compositing"
),
m_compositeAction
);
QAction
*
splitView
=
new
QAction
(
KoIconUtils
::
themedIcon
(
QStringLiteral
(
"view-split-top-bottom"
)),
i18n
(
"Split Audio Tracks"
),
this
);
addAction
(
QStringLiteral
(
"timeline_view_split"
),
splitView
);
splitView
->
setData
(
QVariant
::
fromValue
(
1
));
splitView
->
setCheckable
(
true
);
splitView
->
setChecked
(
KdenliveSettings
::
audiotracksbelow
());
QAction
*
mixedView
=
new
QAction
(
KoIconUtils
::
themedIcon
(
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
());
QActionGroup
*
clipTypeGroup
=
new
QActionGroup
(
this
);
clipTypeGroup
->
addAction
(
mixedView
);
clipTypeGroup
->
addAction
(
splitView
);
connect
(
clipTypeGroup
,
&
QActionGroup
::
triggered
,
this
,
&
MainWindow
::
slotUpdateTimelineView
);
auto
tlsettings
=
new
QMenu
(
this
);
tlsettings
->
setIcon
(
KoIconUtils
::
themedIcon
(
QStringLiteral
(
"configure"
)));
tlsettings
->
addAction
(
m_compositeAction
);
tlsettings
->
addAction
(
mixedView
);
tlsettings
->
addAction
(
splitView
);
addAction
(
QStringLiteral
(
"timeline_settings"
),
tlsettings
->
menuAction
());
m_timeFormatButton
=
new
KSelectAction
(
QStringLiteral
(
"00:00:00:00 / 00:00:00:00"
),
this
);
m_timeFormatButton
->
setFont
(
QFontDatabase
::
systemFont
(
QFontDatabase
::
FixedFont
));
m_timeFormatButton
->
addAction
(
i18n
(
"hh:mm:ss:ff"
));
...
...
@@ -3080,6 +3105,13 @@ void MainWindow::slotUpdateClipType(QAction *action)
*/
}
void
MainWindow
::
slotUpdateTimelineView
(
QAction
*
action
)
{
int
viewMode
=
action
->
data
().
toInt
();
KdenliveSettings
::
setAudiotracksbelow
(
viewMode
==
1
);
getMainTimeline
()
->
controller
()
->
getModel
()
->
_resetView
();
}
void
MainWindow
::
slotDvdWizard
(
const
QString
&
url
)
{
// We must stop the monitors since we create a new on in the dvd wizard
...
...
src/mainwindow.h
View file @
d31b1cbb
...
...
@@ -393,6 +393,7 @@ private slots:
void
slotSetAudioAlignReference
();
void
slotAlignAudio
();
void
slotUpdateClipType
(
QAction
*
action
);
void
slotUpdateTimelineView
(
QAction
*
action
);
void
slotShowTimeline
(
bool
show
);
void
slotTranscode
(
const
QStringList
&
urls
=
QStringList
());
void
slotTranscodeClip
();
...
...
src/timeline2/model/timelineitemmodel.cpp
View file @
d31b1cbb
...
...
@@ -217,7 +217,7 @@ QVariant TimelineItemModel::data(const QModelIndex &index, int role) const
}
if
(
role
==
SortRole
)
{
if
(
isTrack
(
id
))
{
return
getTrack
MltIndex
(
id
);
return
getTrack
SortValue
(
id
,
KdenliveSettings
::
audiotracksbelow
()
);
}
return
id
;
}
...
...
src/timeline2/model/timelinemodel.cpp
View file @
d31b1cbb
...
...
@@ -262,6 +262,41 @@ int TimelineModel::getTrackMltIndex(int trackId) const
return
getTrackPosition
(
trackId
)
+
1
;
}
int
TimelineModel
::
getTrackSortValue
(
int
trackId
,
bool
separated
)
const
{
if
(
separated
)
{
return
getTrackPosition
(
trackId
)
+
1
;
}
auto
it
=
m_allTracks
.
end
();
int
aCount
=
0
;
int
vCount
=
0
;
bool
isAudio
=
false
;
int
trackPos
=
0
;
while
(
it
!=
m_allTracks
.
begin
())
{
--
it
;
bool
audioTrack
=
(
*
it
)
->
isAudioTrack
();
if
(
audioTrack
)
{
aCount
++
;
}
else
{
vCount
++
;
}
if
(
trackId
==
(
*
it
)
->
getId
())
{
isAudio
=
audioTrack
;
trackPos
=
audioTrack
?
aCount
:
vCount
;
}
}
int
trackDiff
=
aCount
-
vCount
;
if
(
trackDiff
>
0
)
{
// more audio tracks
if
(
!
isAudio
)
{
trackPos
-=
trackDiff
;
}
else
if
(
trackPos
>
vCount
)
{
return
-
trackPos
;
}
}
return
isAudio
?
((
aCount
*
trackPos
)
-
1
)
:
(
vCount
+
1
-
trackPos
)
*
2
;
}
QList
<
int
>
TimelineModel
::
getLowerTracksId
(
int
trackId
,
TrackType
type
)
const
{
READ_LOCK
();
...
...
src/timeline2/model/timelinemodel.hpp
View file @
d31b1cbb
...
...
@@ -276,6 +276,11 @@ public:
/* @brief Returns the track's index in terms of mlt's internal representation
*/
int
getTrackMltIndex
(
int
trackId
)
const
;
/* @brief Returns a sort position for tracks.
* @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
;
/* @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
Supports
Markdown
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