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
7c915ded
Commit
7c915ded
authored
Aug 31, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix disabling clip only disable audio part of an AV clip.
BUG: 411466
parent
9a51d703
Pipeline
#7204
passed with stage
in 18 minutes and 41 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
16 deletions
+27
-16
src/timeline2/model/timelinefunctions.cpp
src/timeline2/model/timelinefunctions.cpp
+20
-10
src/timeline2/model/timelinefunctions.hpp
src/timeline2/model/timelinefunctions.hpp
+1
-1
src/timeline2/view/timelinecontroller.cpp
src/timeline2/view/timelinecontroller.cpp
+5
-4
src/timeline2/view/timelinecontroller.h
src/timeline2/view/timelinecontroller.h
+1
-1
No files found.
src/timeline2/model/timelinefunctions.cpp
View file @
7c915ded
...
...
@@ -581,20 +581,30 @@ void TimelineFunctions::showCompositionKeyframes(const std::shared_ptr<TimelineI
timeline
->
dataChanged
(
modelIndex
,
modelIndex
,
{
TimelineModel
::
ShowKeyframesRole
});
}
bool
TimelineFunctions
::
switchEnableState
(
const
std
::
shared_ptr
<
TimelineItemModel
>
&
timeline
,
int
clipId
)
bool
TimelineFunctions
::
switchEnableState
(
const
std
::
shared_ptr
<
TimelineItemModel
>
&
timeline
,
std
::
unordered_set
<
int
>
selection
)
{
PlaylistState
::
ClipState
oldState
=
timeline
->
getClipPtr
(
clipId
)
->
clipState
();
PlaylistState
::
ClipState
state
=
PlaylistState
::
Disabled
;
bool
disable
=
true
;
if
(
oldState
==
PlaylistState
::
Disabled
)
{
state
=
timeline
->
getTrackById_const
(
timeline
->
getClipTrackId
(
clipId
))
->
trackType
();
disable
=
false
;
}
Fun
undo
=
[]()
{
return
true
;
};
Fun
redo
=
[]()
{
return
true
;
};
bool
result
=
changeClipState
(
timeline
,
clipId
,
state
,
undo
,
redo
);
bool
result
=
false
;
bool
disable
=
true
;
for
(
int
clipId
:
selection
)
{
if
(
!
timeline
->
isClip
(
clipId
))
{
continue
;
}
PlaylistState
::
ClipState
oldState
=
timeline
->
getClipPtr
(
clipId
)
->
clipState
();
PlaylistState
::
ClipState
state
=
PlaylistState
::
Disabled
;
disable
=
true
;
if
(
oldState
==
PlaylistState
::
Disabled
)
{
state
=
timeline
->
getTrackById_const
(
timeline
->
getClipTrackId
(
clipId
))
->
trackType
();
disable
=
false
;
}
result
=
changeClipState
(
timeline
,
clipId
,
state
,
undo
,
redo
);
if
(
!
result
)
{
break
;
}
}
if
(
result
)
{
pCore
->
pushUndo
(
undo
,
redo
,
disable
?
i18n
(
"Disable clip"
)
:
i18n
(
"Enable clip"
));
pCore
->
pushUndo
(
undo
,
redo
,
disable
?
i18n
(
"Disable clip"
)
:
i18n
(
"Enable clip"
));
}
return
result
;
}
...
...
src/timeline2/model/timelinefunctions.hpp
View file @
7c915ded
...
...
@@ -102,7 +102,7 @@ struct TimelineFunctions
* @param status: target status of the clip
This function creates an undo object and returns true on success
*/
static
bool
switchEnableState
(
const
std
::
shared_ptr
<
TimelineItemModel
>
&
timeline
,
int
clipId
);
static
bool
switchEnableState
(
const
std
::
shared_ptr
<
TimelineItemModel
>
&
timeline
,
std
::
unordered_set
<
int
>
selection
);
/* @brief change the clip state and accumulates for undo/redo
*/
static
bool
changeClipState
(
const
std
::
shared_ptr
<
TimelineItemModel
>
&
timeline
,
int
clipId
,
PlaylistState
::
ClipState
status
,
Fun
&
undo
,
Fun
&
redo
);
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
7c915ded
...
...
@@ -1752,12 +1752,13 @@ void TimelineController::showCompositionKeyframes(int clipId, bool value)
TimelineFunctions
::
showCompositionKeyframes
(
m_model
,
clipId
,
value
);
}
void
TimelineController
::
switchEnableState
(
int
clipId
)
void
TimelineController
::
switchEnableState
(
std
::
unordered_set
<
int
>
selection
)
{
if
(
clipId
==
-
1
)
{
clipId
=
getMainSelectedItem
(
false
,
false
);
if
(
selection
.
empty
())
{
selection
=
m_model
->
getCurrentSelection
();
//clipId = getMainSelectedItem(false, false);
}
TimelineFunctions
::
switchEnableState
(
m_model
,
clipId
);
TimelineFunctions
::
switchEnableState
(
m_model
,
selection
);
}
void
TimelineController
::
addCompositionToClip
(
const
QString
&
assetId
,
int
clipId
,
int
offset
)
...
...
src/timeline2/view/timelinecontroller.h
View file @
7c915ded
...
...
@@ -332,7 +332,7 @@ public:
Q_INVOKABLE
void
removeSpace
(
int
trackId
=
-
1
,
int
frame
=
-
1
,
bool
affectAllTracks
=
false
);
/* @brief If clip is enabled, disable, otherwise enable
*/
Q_INVOKABLE
void
switchEnableState
(
int
clipId
=
-
1
);
Q_INVOKABLE
void
switchEnableState
(
std
::
unordered_set
<
int
>
selection
=
{}
);
Q_INVOKABLE
void
addCompositionToClip
(
const
QString
&
assetId
,
int
clipId
,
int
offset
);
Q_INVOKABLE
void
addEffectToClip
(
const
QString
&
assetId
,
int
clipId
);
...
...
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