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
453cfaad
Commit
453cfaad
authored
Apr 26, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix glitch in bin item selection, causing some actions to be disabled
BUG: 420628
parent
2d4f686e
Pipeline
#19005
passed with stage
in 9 minutes and 10 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
29 deletions
+45
-29
src/bin/bin.cpp
src/bin/bin.cpp
+19
-7
src/bin/projectitemmodel.cpp
src/bin/projectitemmodel.cpp
+1
-1
src/monitor/monitor.cpp
src/monitor/monitor.cpp
+25
-21
No files found.
src/bin/bin.cpp
View file @
453cfaad
...
...
@@ -1515,6 +1515,7 @@ void Bin::slotDuplicateClip()
}
items
<<
m_itemModel
->
getBinItemByIndex
(
m_proxyModel
->
mapToSource
(
ix
));
}
QString
lastId
;
for
(
auto
item
:
items
)
{
if
(
item
->
itemType
()
==
AbstractProjectItem
::
ClipItem
)
{
auto
currentItem
=
std
::
static_pointer_cast
<
ProjectClip
>
(
item
);
...
...
@@ -1535,7 +1536,7 @@ void Bin::slotDuplicateClip()
}
QString
id
;
m_itemModel
->
requestAddBinClip
(
id
,
xml
,
item
->
parent
()
->
clipId
(),
i18n
(
"Duplicate clip"
));
selectClipById
(
id
)
;
lastId
=
id
;
}
}
}
else
if
(
item
->
itemType
()
==
AbstractProjectItem
::
SubClipItem
)
{
...
...
@@ -1543,9 +1544,12 @@ void Bin::slotDuplicateClip()
QString
id
;
QPoint
clipZone
=
currentItem
->
zone
();
m_itemModel
->
requestAddBinSubClip
(
id
,
clipZone
.
x
(),
clipZone
.
y
(),
{},
currentItem
->
getMasterClip
()
->
clipId
());
selectClipById
(
id
)
;
lastId
=
id
;
}
}
if
(
!
lastId
.
isEmpty
())
{
selectClipById
(
lastId
);
}
}
void
Bin
::
setMonitor
(
Monitor
*
monitor
)
...
...
@@ -1553,7 +1557,9 @@ void Bin::setMonitor(Monitor *monitor)
m_monitor
=
monitor
;
connect
(
m_monitor
,
&
Monitor
::
addClipToProject
,
this
,
&
Bin
::
slotAddClipToProject
);
connect
(
m_monitor
,
&
Monitor
::
refreshCurrentClip
,
this
,
&
Bin
::
slotOpenCurrent
);
connect
(
this
,
&
Bin
::
openClip
,
[
&
](
std
::
shared_ptr
<
ProjectClip
>
clip
,
int
in
,
int
out
)
{
m_monitor
->
slotOpenClip
(
clip
,
in
,
out
);
});
connect
(
this
,
&
Bin
::
openClip
,
[
&
](
std
::
shared_ptr
<
ProjectClip
>
clip
,
int
in
,
int
out
)
{
m_monitor
->
slotOpenClip
(
clip
,
in
,
out
);
});
}
void
Bin
::
setDocument
(
KdenliveDoc
*
project
)
...
...
@@ -2378,7 +2384,7 @@ void Bin::reloadClip(const QString &id, bool reloadAudio)
void
Bin
::
reloadMonitorIfActive
(
const
QString
&
id
)
{
if
(
m_monitor
->
activeClipId
()
==
id
)
{
if
(
m_monitor
->
activeClipId
()
==
id
||
m_monitor
->
activeClipId
().
isEmpty
()
)
{
slotOpenCurrent
();
}
}
...
...
@@ -3862,18 +3868,24 @@ void Bin::setCurrent(const std::shared_ptr<AbstractProjectItem> &item)
{
switch
(
item
->
itemType
())
{
case
AbstractProjectItem
::
ClipItem
:
{
openProducer
(
std
::
static_pointer_cast
<
ProjectClip
>
(
item
));
std
::
shared_ptr
<
ProjectClip
>
clp
=
std
::
static_pointer_cast
<
ProjectClip
>
(
item
);
emit
requestShowEffectStack
(
clp
->
clipName
(),
clp
->
m_effectStack
,
clp
->
getFrameSize
(),
false
);
if
(
clp
&&
clp
->
isReady
())
{
openProducer
(
clp
);
emit
requestShowEffectStack
(
clp
->
clipName
(),
clp
->
m_effectStack
,
clp
->
getFrameSize
(),
false
);
}
break
;
}
case
AbstractProjectItem
::
SubClipItem
:
{
auto
subClip
=
std
::
static_pointer_cast
<
ProjectSubClip
>
(
item
);
QPoint
zone
=
subClip
->
zone
();
openProducer
(
subClip
->
getMasterClip
(),
zone
.
x
(),
zone
.
y
());
std
::
shared_ptr
<
ProjectClip
>
master
=
subClip
->
getMasterClip
();
if
(
master
&&
master
->
isReady
())
{
openProducer
(
master
,
zone
.
x
(),
zone
.
y
());
}
break
;
}
case
AbstractProjectItem
::
FolderItem
:
openProducer
(
nullptr
);
default:
break
;
}
...
...
src/bin/projectitemmodel.cpp
View file @
453cfaad
...
...
@@ -166,7 +166,7 @@ Qt::ItemFlags ProjectItemModel::flags(const QModelIndex &index) const
break
;
case
AbstractProjectItem
::
ClipItem
:
if
(
!
item
->
statusReady
())
{
return
Qt
::
ItemIsSelectable
;
return
Qt
::
ItemIsEnabled
|
Qt
::
ItemIsSelectable
;
}
return
Qt
::
ItemIsEnabled
|
Qt
::
ItemIsSelectable
|
Qt
::
ItemIsDragEnabled
|
Qt
::
ItemIsDropEnabled
|
Qt
::
ItemIsEditable
;
break
;
...
...
src/monitor/monitor.cpp
View file @
453cfaad
...
...
@@ -1420,29 +1420,33 @@ void Monitor::slotOpenClip(const std::shared_ptr<ProjectClip> &controller, int i
// we are in record mode, don't display clip
return
;
}
m_timePos
->
setRange
(
0
,
(
int
)
m_controller
->
frameDuration
()
-
1
);
m_glMonitor
->
setRulerInfo
((
int
)
m_controller
->
frameDuration
()
-
1
,
controller
->
getMarkerModel
());
loadQmlScene
(
MonitorSceneDefault
);
updateMarkers
();
connect
(
m_glMonitor
->
getControllerProxy
(),
&
MonitorProxy
::
addSnap
,
this
,
&
Monitor
::
addSnapPoint
,
Qt
::
DirectConnection
);
connect
(
m_glMonitor
->
getControllerProxy
(),
&
MonitorProxy
::
removeSnap
,
this
,
&
Monitor
::
removeSnapPoint
,
Qt
::
DirectConnection
);
if
(
out
==
-
1
)
{
m_glMonitor
->
getControllerProxy
()
->
setZone
(
m_controller
->
zone
(),
false
);
if
(
m_controller
->
isReady
())
{
m_timePos
->
setRange
(
0
,
(
int
)
m_controller
->
frameDuration
()
-
1
);
m_glMonitor
->
setRulerInfo
((
int
)
m_controller
->
frameDuration
()
-
1
,
controller
->
getMarkerModel
());
loadQmlScene
(
MonitorSceneDefault
);
updateMarkers
();
connect
(
m_glMonitor
->
getControllerProxy
(),
&
MonitorProxy
::
addSnap
,
this
,
&
Monitor
::
addSnapPoint
,
Qt
::
DirectConnection
);
connect
(
m_glMonitor
->
getControllerProxy
(),
&
MonitorProxy
::
removeSnap
,
this
,
&
Monitor
::
removeSnapPoint
,
Qt
::
DirectConnection
);
if
(
out
==
-
1
)
{
m_glMonitor
->
getControllerProxy
()
->
setZone
(
m_controller
->
zone
(),
false
);
}
else
{
m_glMonitor
->
getControllerProxy
()
->
setZone
(
in
,
out
+
1
,
false
);
}
m_snaps
->
addPoint
((
int
)
m_controller
->
frameDuration
()
-
1
);
// Loading new clip / zone, stop if playing
if
(
m_playAction
->
isActive
())
{
m_playAction
->
setActive
(
false
);
}
m_audioMeterWidget
->
audioChannels
=
controller
->
audioInfo
()
?
controller
->
audioInfo
()
->
channels
()
:
0
;
if
(
!
m_controller
->
hasVideo
()
||
KdenliveSettings
::
displayClipMonitorInfo
()
&
0x10
)
{
m_glMonitor
->
getControllerProxy
()
->
setAudioThumb
(
m_audioMeterWidget
->
audioChannels
==
0
?
QUrl
()
:
ThumbnailCache
::
get
()
->
getAudioThumbPath
(
m_controller
->
clipId
()));
}
m_controller
->
getMarkerModel
()
->
registerSnapModel
(
m_snaps
);
m_glMonitor
->
getControllerProxy
()
->
setClipProperties
(
controller
->
clipId
().
toInt
(),
controller
->
clipType
(),
controller
->
hasAudioAndVideo
(),
controller
->
clipName
());
m_glMonitor
->
setProducer
(
m_controller
->
originalProducer
(),
isActive
(),
in
);
}
else
{
m_glMonitor
->
getControllerProxy
()
->
setZone
(
in
,
out
+
1
,
false
);
}
m_snaps
->
addPoint
((
int
)
m_controller
->
frameDuration
()
-
1
);
// Loading new clip / zone, stop if playing
if
(
m_playAction
->
isActive
())
{
m_playAction
->
setActive
(
false
);
}
m_audioMeterWidget
->
audioChannels
=
controller
->
audioInfo
()
?
controller
->
audioInfo
()
->
channels
()
:
0
;
if
(
!
m_controller
->
hasVideo
()
||
KdenliveSettings
::
displayClipMonitorInfo
()
&
0x10
)
{
m_glMonitor
->
getControllerProxy
()
->
setAudioThumb
(
m_audioMeterWidget
->
audioChannels
==
0
?
QUrl
()
:
ThumbnailCache
::
get
()
->
getAudioThumbPath
(
m_controller
->
clipId
()));
qDebug
()
<<
"*************** CONTROLLER NOT READY"
;
}
m_controller
->
getMarkerModel
()
->
registerSnapModel
(
m_snaps
);
m_glMonitor
->
getControllerProxy
()
->
setClipProperties
(
controller
->
clipId
().
toInt
(),
controller
->
clipType
(),
controller
->
hasAudioAndVideo
(),
controller
->
clipName
());
m_glMonitor
->
setProducer
(
m_controller
->
originalProducer
(),
isActive
(),
in
);
// hasEffects = controller->hasEffects();
}
else
{
loadQmlScene
(
MonitorSceneDefault
);
...
...
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