Skip to content
GitLab
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
63418f4d
Commit
63418f4d
authored
Jul 05, 2019
by
Jean-Baptiste Mardelle
Browse files
make all clips in selection show grab status
Add action for disable/enable clip Fixes
#272
parent
c1f06eaa
Pipeline
#4896
failed with stage
in 1 second
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/kdenliveui.rc
View file @
63418f4d
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui
name=
"kdenlive"
version=
"16
2
"
translationDomain=
"kdenlive"
>
<kpartgui
name=
"kdenlive"
version=
"16
5
"
translationDomain=
"kdenlive"
>
<MenuBar>
<Menu
name=
"file"
>
<Action
name=
"dvd_wizard"
/>
...
...
@@ -106,6 +106,7 @@
<Action
name=
"edit_item_duration"
/>
<Action
name=
"edit_item_speed"
/>
<Action
name=
"clip_split"
/>
<Action
name=
"clip_switch"
/>
<Action
name=
"clip_disable"
/>
<Action
name=
"clip_in_project_tree"
/>
<Action
name=
"expand_timeline_clip"
/>
...
...
src/mainwindow.cpp
View file @
63418f4d
...
...
@@ -1164,8 +1164,7 @@ void MainWindow::setupActions()
QIcon
::
fromTheme
(
QStringLiteral
(
"media-record"
)));
addAction
(
QStringLiteral
(
"project_clean"
),
i18n
(
"Clean Project"
),
this
,
SLOT
(
slotCleanProject
()),
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-clear"
)));
QAction
*
resetAction
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"reload"
)),
i18n
(
"Reset configuration"
),
this
);
addAction
(
QStringLiteral
(
"reset_config"
),
resetAction
);
connect
(
resetAction
,
&
QAction
::
triggered
,
[
&
]()
{
...
...
@@ -1306,6 +1305,12 @@ void MainWindow::setupActions()
splitAudio
->
setData
(
'S'
);
splitAudio
->
setEnabled
(
false
);
QAction
*
switchEnable
=
addAction
(
QStringLiteral
(
"clip_switch"
),
i18n
(
"Disable Clip"
),
this
,
SLOT
(
slotSwitchClip
()),
QIcon
(),
QKeySequence
(),
clipActionCategory
);
// "S" will be handled specifically to change the action name depending on current selection
switchEnable
->
setData
(
'W'
);
switchEnable
->
setEnabled
(
false
);
QAction
*
setAudioAlignReference
=
addAction
(
QStringLiteral
(
"set_audio_align_ref"
),
i18n
(
"Set Audio Reference"
),
this
,
SLOT
(
slotSetAudioAlignReference
()),
QIcon
(),
QKeySequence
(),
clipActionCategory
);
// "A" as data means this action should only be available for clips with audio
...
...
@@ -2931,6 +2936,11 @@ void MainWindow::slotSplitAV()
getMainTimeline
()
->
controller
()
->
splitAV
();
}
void
MainWindow
::
slotSwitchClip
()
{
getMainTimeline
()
->
controller
()
->
switchEnableState
();
}
void
MainWindow
::
slotSetAudioAlignReference
()
{
// TODO refac
...
...
@@ -3509,6 +3519,7 @@ void MainWindow::configureToolbars()
void
MainWindow
::
rebuildTimlineToolBar
()
{
// Timeline toolbar settings changed, we can now re-add our toolbar to custom location
return
;
m_timelineToolBar
=
toolBar
(
QStringLiteral
(
"timelineToolBar"
));
removeToolBar
(
m_timelineToolBar
);
m_timelineToolBar
->
setToolButtonStyle
(
Qt
::
ToolButtonIconOnly
);
...
...
src/mainwindow.h
View file @
63418f4d
...
...
@@ -394,6 +394,7 @@ private slots:
void
slotClipInProjectTree
();
// void slotClipToProjectTree();
void
slotSplitAV
();
void
slotSwitchClip
();
void
slotSetAudioAlignReference
();
void
slotAlignAudio
();
void
slotUpdateClipType
(
QAction
*
action
);
...
...
src/timeline2/model/timelinemodel.cpp
View file @
63418f4d
...
...
@@ -3269,9 +3269,7 @@ bool TimelineModel::requestClearSelection(bool onDeletion)
for
(
auto
&
id
:
items
)
{
if
(
isGroup
(
id
))
{
std
::
unordered_set
<
int
>
children
=
m_groups
->
getLeaves
(
id
);
for
(
int
c
:
children
)
{
items
.
insert
(
c
);
}
items
.
insert
(
children
.
begin
(),
children
.
end
());
}
else
if
(
isClip
(
id
))
{
m_allClips
[
id
]
->
clearOffset
();
m_allClips
[
id
]
->
setGrab
(
false
);
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
63418f4d
...
...
@@ -1705,6 +1705,9 @@ void TimelineController::showCompositionKeyframes(int clipId, bool value)
void
TimelineController
::
switchEnableState
(
int
clipId
)
{
if
(
clipId
==
-
1
)
{
clipId
=
getMainSelectedItem
(
false
,
false
);
}
TimelineFunctions
::
switchEnableState
(
m_model
,
clipId
);
}
...
...
@@ -2120,6 +2123,11 @@ void TimelineController::updateClipActions()
if
(
enableAction
&&
actionData
==
QLatin1Char
(
'S'
))
{
act
->
setText
(
clip
->
clipState
()
==
PlaylistState
::
AudioOnly
?
i18n
(
"Split video"
)
:
i18n
(
"Split audio"
));
}
}
else
if
(
actionData
==
QLatin1Char
(
'W'
))
{
enableAction
=
clip
!=
nullptr
;
if
(
enableAction
)
{
act
->
setText
(
clip
->
clipState
()
==
PlaylistState
::
Disabled
?
i18n
(
"Enable clip"
)
:
i18n
(
"Disable clip"
));
}
}
else
if
(
actionData
==
QLatin1Char
(
'C'
)
&&
clip
==
nullptr
)
{
enableAction
=
false
;
}
...
...
@@ -2139,16 +2147,24 @@ void TimelineController::grabCurrent()
// TODO: error displayMessage
return
;
}
int
id
=
*
m_model
->
getCurrentSelection
().
begin
();
while
(
m_model
->
isGroup
(
id
))
{
id
=
*
m_model
->
m_groups
->
getLeaves
(
id
).
begin
();
std
::
unordered_set
<
int
>
ids
=
m_model
->
getCurrentSelection
();
std
::
unordered_set
<
int
>
items_list
;
for
(
int
i
:
ids
)
{
if
(
m_model
->
isGroup
(
i
))
{
std
::
unordered_set
<
int
>
children
=
m_model
->
m_groups
->
getLeaves
(
i
);
items_list
.
insert
(
children
.
begin
(),
children
.
end
());
}
else
{
items_list
.
insert
(
i
);
}
}
if
(
m_model
->
isClip
(
id
))
{
std
::
shared_ptr
<
ClipModel
>
clip
=
m_model
->
getClipPtr
(
id
);
clip
->
setGrab
(
!
clip
->
isGrabbed
());
}
else
if
(
m_model
->
isComposition
(
id
))
{
std
::
shared_ptr
<
CompositionModel
>
clip
=
m_model
->
getCompositionPtr
(
id
);
clip
->
setGrab
(
!
clip
->
isGrabbed
());
for
(
int
id
:
items_list
)
{
if
(
m_model
->
isClip
(
id
))
{
std
::
shared_ptr
<
ClipModel
>
clip
=
m_model
->
getClipPtr
(
id
);
clip
->
setGrab
(
!
clip
->
isGrabbed
());
}
else
if
(
m_model
->
isComposition
(
id
))
{
std
::
shared_ptr
<
CompositionModel
>
clip
=
m_model
->
getCompositionPtr
(
id
);
clip
->
setGrab
(
!
clip
->
isGrabbed
());
}
}
}
...
...
src/timeline2/view/timelinecontroller.h
View file @
63418f4d
...
...
@@ -320,7 +320,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
);
Q_INVOKABLE
void
switchEnableState
(
int
clipId
=
-
1
);
Q_INVOKABLE
void
addCompositionToClip
(
const
QString
&
assetId
,
int
clipId
,
int
offset
);
Q_INVOKABLE
void
addEffectToClip
(
const
QString
&
assetId
,
int
clipId
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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