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
27f98f31
Commit
27f98f31
authored
Aug 04, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remember last target track and restore when another clip is selected
parent
47cd52bc
Pipeline
#6198
passed with stage
in 20 minutes and 2 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
src/timeline2/view/timelinecontroller.cpp
src/timeline2/view/timelinecontroller.cpp
+34
-2
src/timeline2/view/timelinecontroller.h
src/timeline2/view/timelinecontroller.h
+6
-0
No files found.
src/timeline2/view/timelinecontroller.cpp
View file @
27f98f31
...
...
@@ -76,6 +76,8 @@ TimelineController::TimelineController(QObject *parent)
m_disablePreview
=
pCore
->
currentDoc
()
->
getAction
(
QStringLiteral
(
"disable_preview"
));
connect
(
m_disablePreview
,
&
QAction
::
triggered
,
this
,
&
TimelineController
::
disablePreview
);
connect
(
this
,
&
TimelineController
::
selectionChanged
,
this
,
&
TimelineController
::
updateClipActions
);
connect
(
this
,
&
TimelineController
::
videoTargetChanged
,
this
,
&
TimelineController
::
updateVideoTarget
);
connect
(
this
,
&
TimelineController
::
audioTargetChanged
,
this
,
&
TimelineController
::
updateAudioTarget
);
m_disablePreview
->
setEnabled
(
false
);
connect
(
pCore
.
get
(),
&
Core
::
finalizeRecording
,
this
,
&
TimelineController
::
finishRecording
);
}
...
...
@@ -111,8 +113,8 @@ void TimelineController::setTargetTracks(QPair<int, int> targets)
//setAudioTarget(targets.second >= 0 && targets.second < m_model->getTracksCount() ? m_model->getTrackIndexFromPosition(targets.second) : -1);
m_hasVideoTarget
=
targets
.
first
>=
0
;
m_hasAudioTarget
=
targets
.
second
>=
0
;
setVideoTarget
(
targets
.
first
);
setAudioTarget
(
targets
.
second
);
setVideoTarget
(
m_hasVideoTarget
&&
(
m_lastVideoTarget
>
-
1
)
?
m_lastVideoTarget
:
targets
.
first
);
setAudioTarget
(
m_hasAudioTarget
&&
(
m_lastAudioTarget
>
-
1
)
?
m_lastAudioTarget
:
targets
.
second
);
}
std
::
shared_ptr
<
TimelineItemModel
>
TimelineController
::
getModel
()
const
...
...
@@ -915,18 +917,27 @@ void TimelineController::setPosition(int position)
void
TimelineController
::
setAudioTarget
(
int
track
)
{
if
(
track
>
-
1
&&
!
m_model
->
isTrack
(
track
))
{
return
;
}
m_model
->
m_audioTarget
=
track
;
emit
audioTargetChanged
();
}
void
TimelineController
::
setVideoTarget
(
int
track
)
{
if
(
track
>
-
1
&&
!
m_model
->
isTrack
(
track
))
{
return
;
}
m_model
->
m_videoTarget
=
track
;
emit
videoTargetChanged
();
}
void
TimelineController
::
setActiveTrack
(
int
track
)
{
if
(
track
>
-
1
&&
!
m_model
->
isTrack
(
track
))
{
return
;
}
m_activeTrack
=
track
;
emit
activeTrackChanged
();
}
...
...
@@ -2551,3 +2562,24 @@ void TimelineController::finishRecording(const QString &recordedFile)
pCore
->
pushUndo
(
undo
,
redo
,
i18n
(
"Record audio"
));
}
}
void
TimelineController
::
updateVideoTarget
()
{
if
(
videoTarget
()
>
-
1
)
{
m_lastVideoTarget
=
videoTarget
();
m_videoTargetActive
=
true
;
}
else
{
m_videoTargetActive
=
false
;
}
}
void
TimelineController
::
updateAudioTarget
()
{
if
(
audioTarget
()
>
-
1
)
{
m_lastAudioTarget
=
audioTarget
();
m_audioTargetActive
=
true
;
}
else
{
m_audioTargetActive
=
false
;
}
}
src/timeline2/view/timelinecontroller.h
View file @
27f98f31
...
...
@@ -483,6 +483,8 @@ public slots:
private
slots
:
void
updateClipActions
();
void
updateVideoTarget
();
void
updateAudioTarget
();
public:
/** @brief a list of actions that have to be enabled/disabled depending on the timeline selection */
...
...
@@ -501,6 +503,10 @@ private:
int
m_audioRef
;
bool
m_hasAudioTarget
{
false
};
bool
m_hasVideoTarget
{
false
};
int
m_lastVideoTarget
{
-
1
};
int
m_lastAudioTarget
{
-
1
};
bool
m_videoTargetActive
{
true
};
bool
m_audioTargetActive
{
true
};
QPair
<
int
,
int
>
m_recordStart
;
int
m_recordTrack
;
QPoint
m_zone
;
...
...
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