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
259
Issues
259
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
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
17a9ef37
Commit
17a9ef37
authored
Oct 14, 2020
by
Sashmita Raghav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add function to enable subtitle clips' movement in subtitle track
parent
27b5e631
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
src/timeline2/view/timelinecontroller.cpp
src/timeline2/view/timelinecontroller.cpp
+16
-1
src/timeline2/view/timelinecontroller.h
src/timeline2/view/timelinecontroller.h
+3
-1
No files found.
src/timeline2/view/timelinecontroller.cpp
View file @
17a9ef37
...
...
@@ -3672,13 +3672,28 @@ void TimelineController::editSubtitle(int startFrame, QString text, int endFrame
GenTime
startPos
(
startFrame
,
pCore
->
getCurrentFps
());
GenTime
endPos
(
endFrame
,
pCore
->
getCurrentFps
());
subtitleModel
->
editSubtitle
(
startPos
,
text
,
endPos
);
return
;
}
void
TimelineController
::
moveSubtitle
(
int
oldStartFrame
,
int
newStartFrame
)
{
qDebug
()
<<
"Moving existing subtitle in controller from"
<<
oldStartFrame
<<
" to "
<<
newStartFrame
;
qDebug
()
<<
"Moving existing subtitle
start position
in controller from"
<<
oldStartFrame
<<
" to "
<<
newStartFrame
;
auto
subtitleModel
=
pCore
->
projectManager
()
->
current
()
->
getSubtitleModel
();
GenTime
oldStartPos
(
oldStartFrame
,
pCore
->
getCurrentFps
());
GenTime
newStartPos
(
newStartFrame
,
pCore
->
getCurrentFps
());
subtitleModel
->
moveSubtitle
(
oldStartPos
,
newStartPos
);
return
;
}
void
TimelineController
::
shiftSubtitle
(
int
oldStartFrame
,
int
newStartFrame
,
int
endFrame
,
QString
text
)
{
qDebug
()
<<
"Shifting existing subtitle in controller from"
<<
oldStartFrame
<<
" to "
<<
newStartFrame
;
auto
subtitleModel
=
pCore
->
projectManager
()
->
current
()
->
getSubtitleModel
();
GenTime
oldStartPos
(
oldStartFrame
,
pCore
->
getCurrentFps
());
GenTime
newStartPos
(
newStartFrame
,
pCore
->
getCurrentFps
());
GenTime
endPos
(
endFrame
,
pCore
->
getCurrentFps
());
subtitleModel
->
removeSubtitle
(
oldStartPos
);
//first delete subtitle at old start position
subtitleModel
->
addSubtitle
(
newStartPos
,
endPos
,
text
);
//next, add a new subtitle at new start position
}
src/timeline2/view/timelinecontroller.h
View file @
17a9ef37
...
...
@@ -558,8 +558,10 @@ public:
QPoint
selectionInOut
()
const
;
/** @brief Edit the subtitle text and/or end timings */
Q_INVOKABLE
void
editSubtitle
(
int
startFrame
,
QString
text
,
int
endFrame
);
/** @brief Move position of subtitle */
/** @brief Move position of subtitle
start timing
*/
Q_INVOKABLE
void
moveSubtitle
(
int
oldStartFrame
,
int
newStartFrame
);
/** @brief Shift subtitle clips without changing the clip duration */
Q_INVOKABLE
void
shiftSubtitle
(
int
oldStartFrame
,
int
newStartFrame
,
int
endFrame
=
0
,
QString
text
=
""
);
public
slots
:
void
resetView
();
...
...
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