Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Multimedia
Kdenlive
Commits
274bbb25
Commit
274bbb25
authored
May 13, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix "merge all streams"
Related to
#382
parent
78459841
Pipeline
#20125
passed with stage
in 9 minutes and 14 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
12 deletions
+48
-12
src/lib/audio/audioStreamInfo.cpp
src/lib/audio/audioStreamInfo.cpp
+8
-4
src/mltcontroller/clippropertiescontroller.cpp
src/mltcontroller/clippropertiescontroller.cpp
+7
-1
src/monitor/monitor.cpp
src/monitor/monitor.cpp
+24
-6
src/monitor/view/kdenliveclipmonitor.qml
src/monitor/view/kdenliveclipmonitor.qml
+9
-1
No files found.
src/lib/audio/audioStreamInfo.cpp
View file @
274bbb25
...
...
@@ -110,10 +110,14 @@ QMap <int, QString> AudioStreamInfo::activeStreams() const
{
QMap
<
int
,
QString
>
active
;
QMapIterator
<
int
,
QString
>
i
(
m_audioStreams
);
while
(
i
.
hasNext
())
{
i
.
next
();
if
(
m_activeStreams
.
contains
(
i
.
key
()))
{
active
.
insert
(
i
.
key
(),
i
.
value
());
if
(
m_activeStreams
.
size
()
==
1
&&
m_activeStreams
.
contains
(
INT_MAX
))
{
active
.
insert
(
INT_MAX
,
i18n
(
"Merged streams"
));
}
else
{
while
(
i
.
hasNext
())
{
i
.
next
();
if
(
m_activeStreams
.
contains
(
i
.
key
()))
{
active
.
insert
(
i
.
key
(),
i
.
value
());
}
}
}
return
active
;
...
...
src/mltcontroller/clippropertiescontroller.cpp
View file @
274bbb25
...
...
@@ -629,7 +629,6 @@ ClipPropertiesController::ClipPropertiesController(ClipController *controller, Q
m_audioStreamsView
=
new
QListWidget
(
this
);
m_audioStreamsView
->
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
MinimumExpanding
);
audioVbox
->
addWidget
(
m_audioStreamsView
);
//m_audioStream = new QComboBox(this);
QMapIterator
<
int
,
QString
>
i
(
audioStreamsInfo
);
while
(
i
.
hasNext
())
{
i
.
next
();
...
...
@@ -672,6 +671,12 @@ ClipPropertiesController::ClipPropertiesController(ClipController *controller, Q
}
}
else
if
(
checked
)
{
// Stream was selected
if
(
streamId
==
INT_MAX
)
{
// merge all streams should not have any other stream selected
activeStreams
.
clear
();
}
else
{
activeStreams
.
removeAll
(
QString
::
number
(
INT_MAX
));
}
activeStreams
<<
QString
::
number
(
streamId
);
activeStreams
.
sort
();
streamModified
=
true
;
...
...
@@ -860,6 +865,7 @@ void ClipPropertiesController::slotReloadProperties()
//m_audioStream->setCurrentIndex(m_audioStream->findData(audio_ix));
}
QList
<
int
>
enabledStreams
=
m_controller
->
activeStreams
().
keys
();
qDebug
()
<<
"=== GOT ACTIVE STREAMS: "
<<
enabledStreams
;
QSignalBlocker
bk
(
m_audioStreamsView
);
for
(
int
ix
=
0
;
ix
<
m_audioStreamsView
->
count
();
ix
++
)
{
QListWidgetItem
*
item
=
m_audioStreamsView
->
item
(
ix
);
...
...
src/monitor/monitor.cpp
View file @
274bbb25
...
...
@@ -283,14 +283,32 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
m_audioChannels
=
new
QMenu
(
this
);
m_streamsButton
->
setMenu
(
m_audioChannels
);
m_streamAction
->
setVisible
(
false
);
connect
(
m_audioChannels
,
&
QMenu
::
triggered
,
[
this
]
()
{
m_audioChannels
->
show
();
connect
(
m_audioChannels
,
&
QMenu
::
triggered
,
[
this
]
(
QAction
*
ac
)
{
//
m_audioChannels->show();
QList
<
QAction
*>
actions
=
m_audioChannels
->
actions
();
QMap
<
int
,
QString
>
enabledStreams
;
for
(
const
auto
act
:
actions
)
{
if
(
act
->
isChecked
())
{
// Audio stream is selected
enabledStreams
.
insert
(
act
->
data
().
toInt
(),
act
->
text
().
remove
(
QLatin1Char
(
'&'
)));
if
(
ac
->
data
().
toInt
()
==
INT_MAX
)
{
// Merge stream selected, clear all others
enabledStreams
.
clear
();
enabledStreams
.
insert
(
INT_MAX
,
i18n
(
"Merged streams"
));
// Disable all other streams
QSignalBlocker
bk
(
m_audioChannels
);
for
(
auto
act
:
actions
)
{
if
(
act
->
isChecked
()
&&
act
!=
ac
)
{
act
->
setChecked
(
false
);
}
}
}
else
{
for
(
auto
act
:
actions
)
{
if
(
act
->
isChecked
())
{
// Audio stream is selected
if
(
act
->
data
().
toInt
()
==
INT_MAX
)
{
QSignalBlocker
bk
(
m_audioChannels
);
act
->
setChecked
(
false
);
}
else
{
enabledStreams
.
insert
(
act
->
data
().
toInt
(),
act
->
text
().
remove
(
QLatin1Char
(
'&'
)));
}
}
}
}
if
(
!
enabledStreams
.
isEmpty
())
{
...
...
src/monitor/view/kdenliveclipmonitor.qml
View file @
274bbb25
...
...
@@ -42,6 +42,11 @@ Item {
font
:
fixedFont
}
Timer
{
id
:
thumbTimer
interval
:
3000
;
running
:
false
;
}
signal
editCurrentMarker
()
onDurationChanged
:
{
...
...
@@ -128,7 +133,7 @@ Item {
Item
{
id
:
audioThumb
property
bool
stateVisible
:
(
clipMonitorRuler
.
containsMouse
||
thumbMouseArea
.
containsMouse
)
property
bool
stateVisible
:
(
clipMonitorRuler
.
containsMouse
||
thumbMouseArea
.
containsMouse
||
thumbTimer
.
running
)
property
bool
isAudioClip
:
controller
.
clipType
==
ProducerType
.
Audio
anchors
{
left
:
parent
.
left
...
...
@@ -179,6 +184,9 @@ Item {
Repeater
{
id
:
streamThumb
model
:
controller
.
audioThumb
.
length
onCountChanged
:
{
thumbTimer
.
start
()
}
property
double
streamHeight
:
parent
.
height
/
streamThumb
.
count
Item
{
anchors.fill
:
parent
...
...
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