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
eaaecc94
Commit
eaaecc94
authored
Apr 26, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use drop frame timecode for 23.98
CCBUG: 420580
parent
34ce4c10
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
58 deletions
+19
-58
src/monitor/monitor.cpp
src/monitor/monitor.cpp
+1
-2
src/timecode.cpp
src/timecode.cpp
+16
-53
src/timecodedisplay.cpp
src/timecodedisplay.cpp
+2
-3
No files found.
src/monitor/monitor.cpp
View file @
eaaecc94
...
...
@@ -1491,10 +1491,9 @@ void Monitor::resetProfile()
m_timePos
->
updateTimeCode
(
pCore
->
timecode
());
m_glMonitor
->
reloadProfile
();
m_glMonitor
->
rootObject
()
->
setProperty
(
"framesize"
,
QRect
(
0
,
0
,
m_glMonitor
->
profileSize
().
width
(),
m_glMonitor
->
profileSize
().
height
()));
double
fps
=
pCore
->
getCurrentFps
();
// Update drop frame info
m_qmlManager
->
setProperty
(
QStringLiteral
(
"dropped"
),
false
);
m_qmlManager
->
setProperty
(
QStringLiteral
(
"fps"
),
QString
::
number
(
fps
,
'g'
,
2
));
m_qmlManager
->
setProperty
(
QStringLiteral
(
"fps"
),
QString
::
number
(
pCore
->
getCurrentFps
()
,
'g'
,
2
));
}
void
Monitor
::
resetConsumer
(
bool
fullReset
)
...
...
src/timecode.cpp
View file @
eaaecc94
...
...
@@ -92,7 +92,7 @@ Timecode::~Timecode() = default;
void
Timecode
::
setFormat
(
double
framesPerSecond
,
Formats
format
)
{
m_displayedFramesPerSecond
=
(
int
)(
framesPerSecond
+
0.5
);
m_dropFrameTimecode
=
!
qFuzzyCompare
(
framesPerSecond
,
qRound
(
framesPerSecond
)
);
m_dropFrameTimecode
=
qFuzzyCompare
(
framesPerSecond
,
30000.0
/
1001.0
);
m_format
=
format
;
m_realFps
=
framesPerSecond
;
if
(
m_dropFrameTimecode
)
{
...
...
@@ -128,7 +128,7 @@ const QString Timecode::mask(const GenTime &t) const
QString
Timecode
::
reformatSeparators
(
QString
duration
)
const
{
if
(
m_dropFrameTimecode
)
{
return
duration
.
replace
(
8
,
1
,
'
,
'
);
return
duration
.
replace
(
8
,
1
,
'
;
'
);
}
return
duration
.
replace
(
8
,
1
,
':'
);
}
...
...
@@ -222,18 +222,9 @@ QString Timecode::getStringTimecode(int frames, const double &fps, bool showFram
seconds
=
seconds
%
60
;
int
hours
=
minutes
/
60
;
minutes
=
minutes
%
60
;
QString
text
;
QString
text
=
showFrames
?
QString
(
"%1:%2:%3.%4"
).
arg
(
hours
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
minutes
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
seconds
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
frms
,
2
,
10
,
QLatin1Char
(
'0'
))
:
QString
(
"%1:%2:%3"
).
arg
(
hours
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
minutes
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
seconds
,
2
,
10
,
QLatin1Char
(
'0'
))
;
if
(
negative
)
{
text
.
append
(
'-'
);
}
text
.
append
(
QString
::
number
(
hours
).
rightJustified
(
2
,
'0'
,
false
));
text
.
append
(
':'
);
text
.
append
(
QString
::
number
(
minutes
).
rightJustified
(
2
,
'0'
,
false
));
text
.
append
(
':'
);
text
.
append
(
QString
::
number
(
seconds
).
rightJustified
(
2
,
'0'
,
false
));
if
(
showFrames
)
{
text
.
append
(
'.'
);
text
.
append
(
QString
::
number
(
frms
).
rightJustified
(
2
,
'0'
,
false
));
text
.
prepend
(
'-'
);
}
return
text
;
}
...
...
@@ -258,26 +249,18 @@ const QString Timecode::getTimecodeHH_MM_SS_FF(int frames) const
frames
=
qAbs
(
frames
);
}
int
seconds
=
frames
/
m_displayedFramesPerSecond
;
frames
=
frames
%
m_displayedFramesPerSecond
;
int
hours
=
frames
/
(
m_realFps
*
3600
)
;
frames
-=
floor
(
hours
*
3600
*
m_realFps
)
;
int
minutes
=
seconds
/
60
;
seconds
=
seconds
%
60
;
int
hours
=
minutes
/
60
;
minutes
=
minutes
%
60
;
int
minutes
=
frames
/
(
m_realFps
*
60
);
frames
-=
floor
(
minutes
*
60
*
m_realFps
);
QString
text
;
int
seconds
=
frames
/
m_realFps
;
frames
-=
ceil
(
seconds
*
m_realFps
);
QString
text
=
QString
(
"%1:%2:%3:%4"
).
arg
(
hours
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
minutes
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
seconds
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
frames
,
2
,
10
,
QLatin1Char
(
'0'
));
if
(
negative
)
{
text
.
ap
pend
(
'-'
);
text
.
pre
pend
(
'-'
);
}
text
.
append
(
QString
::
number
(
hours
).
rightJustified
(
2
,
'0'
,
false
));
text
.
append
(
':'
);
text
.
append
(
QString
::
number
(
minutes
).
rightJustified
(
2
,
'0'
,
false
));
text
.
append
(
':'
);
text
.
append
(
QString
::
number
(
seconds
).
rightJustified
(
2
,
'0'
,
false
));
text
.
append
(
':'
);
text
.
append
(
QString
::
number
(
frames
).
rightJustified
(
2
,
'0'
,
false
));
return
text
;
}
...
...
@@ -298,22 +281,10 @@ const QString Timecode::getTimecodeHH_MM_SS_HH(const GenTime &time) const
int
hours
=
minutes
/
60
;
minutes
=
minutes
%
60
;
QString
text
;
QString
text
=
QString
(
"%1:%2:%3%5%4"
).
arg
(
hours
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
minutes
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
seconds
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
hundredths
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
m_dropFrameTimecode
?
QLatin1Char
(
','
)
:
QLatin1Char
(
':'
))
;
if
(
negative
)
{
text
.
ap
pend
(
'-'
);
text
.
pre
pend
(
'-'
);
}
text
.
append
(
QString
::
number
(
hours
).
rightJustified
(
2
,
'0'
,
false
));
text
.
append
(
':'
);
text
.
append
(
QString
::
number
(
minutes
).
rightJustified
(
2
,
'0'
,
false
));
text
.
append
(
':'
);
text
.
append
(
QString
::
number
(
seconds
).
rightJustified
(
2
,
'0'
,
false
));
if
(
m_dropFrameTimecode
)
{
text
.
append
(
','
);
}
else
{
text
.
append
(
':'
);
}
text
.
append
(
QString
::
number
(
hundredths
).
rightJustified
(
2
,
'0'
,
false
));
return
text
;
}
...
...
@@ -361,17 +332,9 @@ const QString Timecode::getTimecodeDropFrame(int framenumber) const
int
minutes
=
(
int
)
floor
(
floor
(
framenumber
/
m_displayedFramesPerSecond
)
/
60
)
%
60
;
int
hours
=
floor
(
floor
(
floor
(
framenumber
/
m_displayedFramesPerSecond
)
/
60
)
/
60
);
QString
text
;
QString
text
=
QString
(
"%1:%2:%3,%4"
).
arg
(
hours
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
minutes
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
seconds
,
2
,
10
,
QLatin1Char
(
'0'
)).
arg
(
frames
,
2
,
10
,
QLatin1Char
(
'0'
))
;
if
(
negative
)
{
text
.
ap
pend
(
'-'
);
text
.
pre
pend
(
'-'
);
}
text
.
append
(
QString
::
number
(
hours
).
rightJustified
(
2
,
'0'
,
false
));
text
.
append
(
':'
);
text
.
append
(
QString
::
number
(
minutes
).
rightJustified
(
2
,
'0'
,
false
));
text
.
append
(
':'
);
text
.
append
(
QString
::
number
(
seconds
).
rightJustified
(
2
,
'0'
,
false
));
text
.
append
(
','
);
text
.
append
(
QString
::
number
(
frames
).
rightJustified
(
2
,
'0'
,
false
));
return
text
;
}
src/timecodedisplay.cpp
View file @
eaaecc94
...
...
@@ -120,7 +120,7 @@ void TimecodeDisplay::slotUpdateTimeCodeFormat()
void
TimecodeDisplay
::
updateTimeCode
(
const
Timecode
&
t
)
{
m_timecode
=
t
;
setTimeCodeFormat
(
KdenliveSettings
::
frametimecode
());
setTimeCodeFormat
(
KdenliveSettings
::
frametimecode
()
,
true
);
}
void
TimecodeDisplay
::
keyPressEvent
(
QKeyEvent
*
e
)
...
...
@@ -214,8 +214,7 @@ void TimecodeDisplay::setValue(int value)
return
;
}
m_value
=
value
;
QString
v
=
m_timecode
.
getTimecodeFromFrames
(
value
-
m_minimum
);
lineEdit
()
->
setText
(
v
);
lineEdit
()
->
setText
(
m_timecode
.
getTimecodeFromFrames
(
value
-
m_minimum
));
}
}
...
...
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