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
121e26f0
Commit
121e26f0
authored
Mar 21, 2019
by
Jean-Baptiste Mardelle
Browse files
Add track: add possibility to create AV track and Audio rec track
parent
7a65673b
Pipeline
#1729
passed with stage
in 15 minutes and 48 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/dialogs/trackdialog.cpp
View file @
121e26f0
...
...
@@ -94,9 +94,19 @@ int TrackDialog::selectedTrackId() const
return
-
1
;
}
bool
TrackDialog
::
addAVTrack
()
const
{
return
av_track
->
isChecked
();
}
bool
TrackDialog
::
addRecTrack
()
const
{
return
arec_track
->
isChecked
();
}
bool
TrackDialog
::
addAudioTrack
()
const
{
return
!
video
_track
->
isChecked
();
return
audio_track
->
isChecked
()
||
arec
_track
->
isChecked
();
}
const
QString
TrackDialog
::
trackName
()
const
{
...
...
src/timeline2/view/dialogs/trackdialog.h
View file @
121e26f0
...
...
@@ -39,6 +39,12 @@ public:
/** @brief: returns true if we want to insert an audio track
*/
bool
addAudioTrack
()
const
;
/** @brief: returns true if we want to insert an audio record track
*/
bool
addRecTrack
()
const
;
/** @brief: returns true if we want to insert an audio and video track
*/
bool
addAVTrack
()
const
;
/** @brief: returns the newly created track name
*/
const
QString
trackName
()
const
;
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
121e26f0
...
...
@@ -470,9 +470,23 @@ void TimelineController::addTrack(int tid)
QPointer
<
TrackDialog
>
d
=
new
TrackDialog
(
m_model
,
tid
,
qApp
->
activeWindow
());
if
(
d
->
exec
()
==
QDialog
::
Accepted
)
{
int
newTid
;
bool
audioRecTrack
=
d
->
addRecTrack
();
bool
addAVTrack
=
d
->
addAVTrack
();
m_model
->
requestTrackInsertion
(
d
->
selectedTrackPosition
(),
newTid
,
d
->
trackName
(),
d
->
addAudioTrack
());
if
(
addAVTrack
)
{
int
newTid2
;
int
mirrorPos
=
0
;
int
mirrorId
=
m_model
->
getMirrorAudioTrackId
(
newTid
);
if
(
mirrorId
>
-
1
)
{
mirrorPos
=
m_model
->
getTrackMltIndex
(
mirrorId
);
}
m_model
->
requestTrackInsertion
(
mirrorPos
,
newTid2
,
d
->
trackName
(),
true
);
}
m_model
->
buildTrackCompositing
(
true
);
m_model
->
_resetView
();
if
(
audioRecTrack
)
{
m_model
->
setTrackProperty
(
newTid
,
"kdenlive:audio_rec"
,
QStringLiteral
(
"1"
));
}
}
}
...
...
src/ui/addtrack_ui.ui
View file @
121e26f0
...
...
@@ -6,28 +6,22 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
4
30
</width>
<height>
20
8
</height>
<width>
4
96
</width>
<height>
16
8
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Dialog
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"3"
column=
"2"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
10
</height>
</size>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Insert track
</string>
</property>
</
spacer
>
</
widget
>
</item>
<item
row=
"0"
column=
"1"
colspan=
"2"
>
<item
row=
"0"
column=
"1"
>
<widget
class=
"KComboBox"
name=
"before_select"
>
<item>
<property
name=
"text"
>
...
...
@@ -41,39 +35,56 @@
</item>
</widget>
</item>
<item
row=
"4"
column=
"1"
colspan=
"4"
>
<widget
class=
"QDialogButtonBox"
name=
"buttonBox"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"standardButtons"
>
<set>
QDialogButtonBox::Cancel|QDialogButtonBox::Ok
</set>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
colspan=
"2"
>
<widget
class=
"QRadioButton"
name=
"video_track"
>
<property
name=
"text"
>
<string>
Video
&
track
</string>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Insert track
</string>
</property>
</widget>
<item
row=
"0"
column=
"2"
>
<widget
class=
"KComboBox"
name=
"comboTracks"
/>
</item>
<item
row=
"1"
column=
"2"
colspan=
"2"
>
<widget
class=
"QRadioButton"
name=
"audio_track"
>
<property
name=
"text"
>
<string>
A
&
udio track
</string>
</property>
</widget>
<item
row=
"1"
column=
"0"
colspan=
"3"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<widget
class=
"QRadioButton"
name=
"video_track"
>
<property
name=
"text"
>
<string>
Video
&
track
</string>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
<widget
class=
"QRadioButton"
name=
"audio_track"
>
<property
name=
"text"
>
<string>
A
&
udio track
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QRadioButton"
name=
"av_track"
>
<property
name=
"text"
>
<string>
AV track
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QRadioButton"
name=
"arec_track"
>
<property
name=
"text"
>
<string>
Au
&
dio record track
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"name_label"
>
...
...
@@ -82,24 +93,31 @@
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
colspan=
"
4
"
>
<item
row=
"2"
column=
"1"
colspan=
"
2
"
>
<widget
class=
"QLineEdit"
name=
"track_name"
/>
</item>
<item
row=
"
1
"
column=
"
4
"
>
<spacer
name=
"
horizont
alSpacer"
>
<item
row=
"
3
"
column=
"
1
"
>
<spacer
name=
"
vertic
alSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::
Horizont
al
</enum>
<enum>
Qt::
Vertic
al
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
4
0
</width>
<height>
2
0
</height>
<width>
2
0
</width>
<height>
1
0
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"0"
column=
"3"
colspan=
"2"
>
<widget
class=
"KComboBox"
name=
"comboTracks"
/>
<item
row=
"3"
column=
"2"
>
<widget
class=
"QDialogButtonBox"
name=
"buttonBox"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"standardButtons"
>
<set>
QDialogButtonBox::Cancel|QDialogButtonBox::Ok
</set>
</property>
</widget>
</item>
</layout>
</widget>
...
...
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