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
81a863f0
Commit
81a863f0
authored
Mar 18, 2020
by
Jean-Baptiste Mardelle
Browse files
Add make all tracks in/active (Shift+Alt+a)
parent
01c81aff
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/doc/kdenlivedoc.cpp
View file @
81a863f0
...
...
@@ -346,10 +346,10 @@ QDomDocument KdenliveDoc::createEmptyDocument(int videotracks, int audiotracks)
videoTrack
.
duration
=
0
;
tracks
.
append
(
videoTrack
);
}
return
createEmptyDocument
(
tracks
,
audiotracks
);
return
createEmptyDocument
(
tracks
);
}
QDomDocument
KdenliveDoc
::
createEmptyDocument
(
const
QList
<
TrackInfo
>
&
tracks
,
int
audiotracks
)
QDomDocument
KdenliveDoc
::
createEmptyDocument
(
const
QList
<
TrackInfo
>
&
tracks
)
{
// Creating new document
QDomDocument
doc
;
...
...
src/doc/kdenlivedoc.h
View file @
81a863f0
...
...
@@ -192,7 +192,7 @@ private:
/** @brief Creates a new project. */
QDomDocument
createEmptyDocument
(
int
videotracks
,
int
audiotracks
);
QDomDocument
createEmptyDocument
(
const
QList
<
TrackInfo
>
&
tracks
,
int
audiotracks
);
QDomDocument
createEmptyDocument
(
const
QList
<
TrackInfo
>
&
tracks
);
/** @brief Updates the project folder location entry in the kdenlive file dialogs to point to the current project folder. */
void
updateProjectFolderPlacesEntry
();
...
...
src/kdenliveui.rc
View file @
81a863f0
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui
name=
"kdenlive"
version=
"17
8
"
translationDomain=
"kdenlive"
>
<kpartgui
name=
"kdenlive"
version=
"17
9
"
translationDomain=
"kdenlive"
>
<MenuBar>
<Menu
name=
"file"
>
<Action
name=
"dvd_wizard"
/>
...
...
@@ -146,6 +146,7 @@
<Action
name=
"switch_track_target"
/>
<Action
name=
"switch_active_target"
/>
<Action
name=
"switch_all_targets"
/>
<Action
name=
"activate_all_targets"
/>
</Menu>
<Separator
/>
<Menu
name=
"video_effects_menu"
><text>
Add Effect
</text>
...
...
src/mainwindow.cpp
View file @
81a863f0
...
...
@@ -1692,7 +1692,9 @@ void MainWindow::setupActions()
addAction
(
QStringLiteral
(
"switch_active_target"
),
i18n
(
"Toggle Track Active"
),
pCore
->
projectManager
(),
SLOT
(
slotSwitchTrackActive
()),
QIcon
(),
Qt
::
Key_A
);
addAction
(
QStringLiteral
(
"switch_all_targets"
),
i18n
(
"Toggle All Tracks Active"
),
pCore
->
projectManager
(),
SLOT
(
slotSwitchAllTrackActive
()),
QIcon
(),
Qt
::
SHIFT
+
Qt
::
Key_A
);
Qt
::
SHIFT
+
Qt
::
Key_A
);
addAction
(
QStringLiteral
(
"activate_all_targets"
),
i18n
(
"Switch All Tracks Active"
),
pCore
->
projectManager
(),
SLOT
(
slotMakeAllTrackActive
()),
QIcon
(),
Qt
::
SHIFT
+
Qt
::
ALT
+
Qt
::
Key_A
);
addAction
(
QStringLiteral
(
"add_project_note"
),
i18n
(
"Add Project Note"
),
pCore
->
projectManager
(),
SLOT
(
slotAddProjectNote
()),
QIcon
::
fromTheme
(
QStringLiteral
(
"bookmark"
)));
...
...
src/project/projectmanager.cpp
View file @
81a863f0
...
...
@@ -758,6 +758,11 @@ void ProjectManager::slotSwitchAllTrackActive()
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
switchAllTrackActive
();
}
void
ProjectManager
::
slotMakeAllTrackActive
()
{
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
makeAllTrackActive
();
}
void
ProjectManager
::
slotSwitchAllTrackLock
()
{
pCore
->
window
()
->
getMainTimeline
()
->
controller
()
->
switchTrackLock
(
true
);
...
...
src/project/projectmanager.h
View file @
81a863f0
...
...
@@ -139,7 +139,10 @@ public slots:
/** @brief Make current timeline track active/inactive*/
void
slotSwitchTrackActive
();
/** @brief Toogle the active/inactive state of all tracks*/
void
slotSwitchAllTrackActive
();
/** @brief Make all tracks active or inactive */
void
slotMakeAllTrackActive
();
/** @brief Un/Set current track as target */
void
slotSwitchTrackTarget
();
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
81a863f0
...
...
@@ -2099,6 +2099,27 @@ void TimelineController::switchAllTrackActive()
}
}
void
TimelineController
::
makeAllTrackActive
()
{
// Check current status
auto
it
=
m_model
->
m_allTracks
.
cbegin
();
bool
makeActive
=
false
;
while
(
it
!=
m_model
->
m_allTracks
.
cend
())
{
if
(
!
(
*
it
)
->
isTimelineActive
())
{
// There is an inactive track, activate all
makeActive
=
true
;
break
;
}
++
it
;
}
it
=
m_model
->
m_allTracks
.
cbegin
();
while
(
it
!=
m_model
->
m_allTracks
.
cend
())
{
int
target_track
=
(
*
it
)
->
getId
();
m_model
->
setTrackProperty
(
target_track
,
QStringLiteral
(
"kdenlive:timeline_active"
),
makeActive
?
QStringLiteral
(
"1"
)
:
QStringLiteral
(
"0"
));
++
it
;
}
}
void
TimelineController
::
switchTrackLock
(
bool
applyToAll
)
{
if
(
!
applyToAll
)
{
...
...
src/timeline2/view/timelinecontroller.h
View file @
81a863f0
...
...
@@ -387,8 +387,12 @@ public:
Q_INVOKABLE
void
removeEffectKeyframe
(
int
cid
,
int
frame
);
Q_INVOKABLE
void
updateEffectKeyframe
(
int
cid
,
int
oldFrame
,
int
newFrame
,
const
QVariant
&
normalizedValue
=
QVariant
());
/** @brief Make current timeline track active/inactive*/
Q_INVOKABLE
void
switchTrackActive
(
int
trackId
=
-
1
);
/** @brief Toogle the active/inactive state of all tracks*/
void
switchAllTrackActive
();
/** @brief Make all tracks active or inactive */
void
makeAllTrackActive
();
void
switchTrackLock
(
bool
applyToAll
=
false
);
void
switchTargetTrack
();
...
...
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