Skip to content
GitLab
Menu
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
c0243124
Commit
c0243124
authored
Mar 22, 2021
by
Vincent Pinon
Browse files
fix some more warnings
parent
b2ae458f
Changes
47
Hide whitespace changes
Inline
Side-by-side
renderer/renderjob.cpp
View file @
c0243124
...
...
@@ -126,7 +126,7 @@ void RenderJob::receivedStderr()
if
(
m_args
.
contains
(
QStringLiteral
(
"pass=1"
)))
{
m_progress
/=
2.0
;
}
else
if
(
m_args
.
contains
(
QStringLiteral
(
"pass=2"
)))
{
m_progress
=
50
+
m_progress
/
2.0
;
m_progress
=
int
(
50
+
m_progress
/
2.0
)
;
}
if
((
m_kdenliveinterface
!=
nullptr
)
&&
m_kdenliveinterface
->
isValid
())
{
m_kdenliveinterface
->
callWithArgumentList
(
QDBus
::
NoBlock
,
QStringLiteral
(
"setRenderingProgress"
),
{
m_dest
,
m_progress
,
frame
});
...
...
@@ -152,7 +152,7 @@ void RenderJob::receivedStderr()
m_jobUiserver
->
call
(
QStringLiteral
(
"setProcessedAmount"
),
qulonglong
(
frame
-
m_framein
),
tr
(
"frames"
));
m_jobUiserver
->
call
(
QStringLiteral
(
"setSpeed"
),
qulonglong
(
speed
));
}
m_seconds
=
elapsedTime
;
m_seconds
=
int
(
elapsedTime
)
;
m_frame
=
frame
;
m_logstream
<<
QStringLiteral
(
"%1
\t
%2
\t
%3
\t
%4
\n
"
).
arg
(
m_seconds
).
arg
(
m_frame
).
arg
(
m_progress
).
arg
(
speed
);
}
...
...
@@ -180,7 +180,7 @@ void RenderJob::start()
QDBusInterface
kuiserver
(
QStringLiteral
(
"org.kde.JobViewServer"
),
QStringLiteral
(
"/JobViewServer"
),
QStringLiteral
(
"org.kde.JobViewServer"
));
QDBusReply
<
QDBusObjectPath
>
objectPath
=
kuiserver
.
asyncCall
(
QStringLiteral
(
"requestView"
),
QLatin1String
(
"kdenlive"
),
QLatin1String
(
"kdenlive"
),
0x0001
);
QString
reply
=
((
QDBusObjectPath
)
objectPath
).
path
();
QString
reply
=
QDBusObjectPath
(
objectPath
).
path
();
// Use of the KDE JobViewServer is an ugly hack, it is not reliable
QString
dbusView
=
QStringLiteral
(
"org.kde.JobViewV2"
);
...
...
@@ -188,7 +188,7 @@ void RenderJob::start()
if
((
m_jobUiserver
!=
nullptr
)
&&
m_jobUiserver
->
isValid
())
{
m_startTime
=
QDateTime
::
currentDateTime
();
if
(
!
m_args
.
contains
(
QStringLiteral
(
"pass=2"
)))
{
m_jobUiserver
->
call
(
QStringLiteral
(
"setPercent"
),
(
uint
)
0
);
m_jobUiserver
->
call
(
QStringLiteral
(
"setPercent"
),
0
);
}
m_jobUiserver
->
call
(
QStringLiteral
(
"setInfoMessage"
),
tr
(
"Rendering %1"
).
arg
(
QFileInfo
(
m_dest
).
fileName
()));
...
...
@@ -256,7 +256,7 @@ void RenderJob::slotCheckProcess(QProcess::ProcessState state)
void
RenderJob
::
slotIsOver
(
QProcess
::
ExitStatus
status
,
bool
isWritable
)
{
if
(
m_jobUiserver
)
{
m_jobUiserver
->
call
(
QStringLiteral
(
"setDescriptionField"
),
(
uint
)
1
,
tr
(
"Rendered file"
),
m_dest
);
m_jobUiserver
->
call
(
QStringLiteral
(
"setDescriptionField"
),
1
,
tr
(
"Rendered file"
),
m_dest
);
m_jobUiserver
->
call
(
QStringLiteral
(
"terminate"
),
QString
());
}
if
(
!
isWritable
)
{
...
...
@@ -280,7 +280,7 @@ void RenderJob::slotIsOver(QProcess::ExitStatus status, bool isWritable)
QStringList
args
;
QString
error
=
tr
(
"Rendering of %1 aborted, resulting video will probably be corrupted."
).
arg
(
m_dest
);
if
(
m_frame
>
0
)
{
error
+=
QLatin1Char
(
'\n'
)
+
tr
(
"Frame:
"
)
+
m_frame
;
error
+=
QLatin1Char
(
'\n'
)
+
tr
(
"Frame:
%1"
).
arg
(
m_frame
)
;
}
args
<<
QStringLiteral
(
"--error"
)
<<
error
;
m_logstream
<<
error
<<
"
\n
"
;
...
...
src/assets/abstractassetsrepository.ipp
View file @
c0243124
...
...
@@ -123,7 +123,7 @@ template <typename AssetType> bool AbstractAssetsRepository<AssetType>::parseInf
res.description = metadata->get("description") ? i18n(metadata->get("description")) + QString(" (%1)").arg(id) : id;
res.author = metadata->get("creator");
res.version_str = metadata->get("version");
res.version =
ceil
(100 * metadata->get_double("version"));
res.version =
int
(100 * metadata->get_double("version"));
res.id = res.mltId = assetId;
parseType(metadata, res);
// Create params
...
...
src/assets/keyframes/view/keyframeview.cpp
View file @
c0243124
...
...
@@ -59,7 +59,7 @@ KeyframeView::KeyframeView(std::shared_ptr<KeyframeModelList> model, int duratio
m_colSelected
=
palette
().
highlight
().
color
();
m_colKeyframe
=
scheme
.
foreground
(
KColorScheme
::
NormalText
).
color
();
m_size
=
QFontInfo
(
font
()).
pixelSize
()
*
3
;
m_lineHeight
=
m_size
/
2.1
;
m_lineHeight
=
int
(
m_size
/
2.1
)
;
m_zoomHeight
=
m_size
*
3
/
4
;
m_offset
=
m_size
/
4
;
setFixedHeight
(
m_size
);
...
...
@@ -278,7 +278,7 @@ void KeyframeView::mousePressEvent(QMouseEvent *event)
double
zoomStart
=
m_zoomHandle
.
x
()
*
(
width
()
-
2
*
m_offset
);
double
zoomEnd
=
m_zoomHandle
.
y
()
*
(
width
()
-
2
*
m_offset
);
double
zoomFactor
=
(
width
()
-
2
*
m_offset
)
/
(
zoomEnd
-
zoomStart
);
int
pos
=
((
event
->
x
()
-
m_offset
)
/
zoomFactor
+
zoomStart
)
/
m_scale
;
int
pos
=
int
(
((
event
->
x
()
-
m_offset
)
/
zoomFactor
+
zoomStart
)
/
m_scale
)
;
pos
=
qBound
(
0
,
pos
,
m_duration
-
1
);
m_moveKeyframeMode
=
false
;
if
(
event
->
button
()
==
Qt
::
LeftButton
)
{
...
...
@@ -561,7 +561,7 @@ void KeyframeView::mouseDoubleClickEvent(QMouseEvent *event)
double
zoomStart
=
m_zoomHandle
.
x
()
*
(
width
()
-
2
*
m_offset
);
double
zoomEnd
=
m_zoomHandle
.
y
()
*
(
width
()
-
2
*
m_offset
);
double
zoomFactor
=
(
width
()
-
2
*
m_offset
)
/
(
zoomEnd
-
zoomStart
);
int
pos
=
((
event
->
x
()
-
m_offset
)
/
zoomFactor
+
zoomStart
)
/
m_scale
;
int
pos
=
int
(
((
event
->
x
()
-
m_offset
)
/
zoomFactor
+
zoomStart
)
/
m_scale
)
;
pos
=
qBound
(
0
,
pos
,
m_duration
-
1
);
GenTime
position
(
pos
+
offset
,
pCore
->
getCurrentFps
());
bool
ok
;
...
...
@@ -677,12 +677,12 @@ void KeyframeView::paintEvent(QPaintEvent *event)
// Position of left border in frames
double
tickOffset
=
m_zoomStart
*
m_zoomFactor
;
double
frameSize
=
factor
*
m_scale
*
m_zoomFactor
;
int
base
=
tickOffset
/
frameSize
;
int
base
=
int
(
tickOffset
/
frameSize
)
;
tickOffset
=
frameSize
-
(
tickOffset
-
(
base
*
frameSize
));
// Draw frame ticks
int
scaledTick
=
0
;
for
(
int
i
=
0
;
i
<
maxWidth
/
frameSize
;
i
++
)
{
scaledTick
=
m_offset
+
(
i
*
frameSize
)
+
tickOffset
;
scaledTick
=
int
(
m_offset
+
(
i
*
frameSize
)
+
tickOffset
)
;
if
(
scaledTick
>=
maxWidth
+
m_offset
)
{
break
;
}
...
...
@@ -750,7 +750,7 @@ void KeyframeView::paintEvent(QPaintEvent *event)
scaledPos
*=
m_zoomFactor
;
scaledPos
+=
m_offset
;
QPolygon
pa
(
3
);
int
cursorwidth
=
(
m_zoomHeight
-
m_lineHeight
)
/
1.8
;
int
cursorwidth
=
int
(
(
m_zoomHeight
-
m_lineHeight
)
/
1.8
)
;
QPolygonF
position
=
QPolygonF
()
<<
QPointF
(
-
cursorwidth
,
m_zoomHeight
-
3
)
<<
QPointF
(
cursorwidth
,
m_zoomHeight
-
3
)
<<
QPointF
(
0
,
m_lineHeight
+
1
);
position
.
translate
(
scaledPos
,
0
);
p
.
setBrush
(
m_colKeyframe
);
...
...
@@ -759,8 +759,8 @@ void KeyframeView::paintEvent(QPaintEvent *event)
}
// Rubberband
if
(
m_clickEnd
>=
0
)
{
int
min
=
(
qMin
(
m_clickPoint
,
m_clickEnd
)
*
m_scale
-
m_zoomStart
)
*
m_zoomFactor
+
m_offset
;
int
max
=
(
qMax
(
m_clickPoint
,
m_clickEnd
)
*
m_scale
-
m_zoomStart
)
*
m_zoomFactor
+
m_offset
;
int
min
=
int
(
(
qMin
(
m_clickPoint
,
m_clickEnd
)
*
m_scale
-
m_zoomStart
)
*
m_zoomFactor
+
m_offset
)
;
int
max
=
int
(
(
qMax
(
m_clickPoint
,
m_clickEnd
)
*
m_scale
-
m_zoomStart
)
*
m_zoomFactor
+
m_offset
)
;
p
.
setOpacity
(
0.5
);
p
.
fillRect
(
QRect
(
min
,
0
,
max
-
min
,
m_lineHeight
),
palette
().
highlight
());
p
.
setOpacity
(
1
);
...
...
@@ -771,7 +771,11 @@ void KeyframeView::paintEvent(QPaintEvent *event)
p
.
setBrush
(
palette
().
mid
());
p
.
drawRoundedRect
(
m_offset
,
m_zoomHeight
+
3
,
width
()
-
2
*
m_offset
,
m_size
-
m_zoomHeight
-
3
,
m_lineHeight
/
5
,
m_lineHeight
/
5
);
p
.
setBrush
(
palette
().
highlight
());
p
.
drawRoundedRect
(
m_offset
+
(
width
()
-
m_offset
)
*
m_zoomHandle
.
x
(),
m_zoomHeight
+
3
,
(
width
()
-
2
*
m_offset
)
*
(
m_zoomHandle
.
y
()
-
m_zoomHandle
.
x
()),
m_size
-
m_zoomHeight
-
3
,
m_lineHeight
/
5
,
m_lineHeight
/
5
);
p
.
drawRoundedRect
(
int
(
m_offset
+
(
width
()
-
m_offset
)
*
m_zoomHandle
.
x
()),
m_zoomHeight
+
3
,
int
((
width
()
-
2
*
m_offset
)
*
(
m_zoomHandle
.
y
()
-
m_zoomHandle
.
x
())),
m_size
-
m_zoomHeight
-
3
,
m_lineHeight
/
5
,
m_lineHeight
/
5
);
}
...
...
src/assets/view/widgets/colorwheel.cpp
View file @
c0243124
...
...
@@ -124,7 +124,7 @@ WheelContainer::WheelContainer(QString id, QString name, NegQColor color, int un
,
m_name
(
std
::
move
(
name
))
{
m_initialSize
=
QSize
(
m_unitSize
*
11
,
m_unitSize
*
11
);
m_sliderWidth
=
m_unitSize
*
1.5
;
m_sliderWidth
=
int
(
m_unitSize
*
1.5
)
;
resize
(
m_initialSize
);
setMinimumSize
(
m_initialSize
*
.4
);
setMaximumSize
(
m_initialSize
*
1.5
);
...
...
@@ -405,9 +405,9 @@ void WheelContainer::drawSlider()
{
QPainter
painter
(
&
m_image
);
painter
.
setRenderHint
(
QPainter
::
Antialiasing
);
int
ws
=
wheelSize
()
+
m_unitSize
*
.2
;
int
ws
=
int
(
wheelSize
()
+
m_unitSize
*
.2
)
;
qreal
scale
=
qreal
(
ws
+
m_sliderWidth
)
/
maximumWidth
();
int
w
=
m_sliderWidth
*
scale
-
m_unitSize
*
.4
;
int
w
=
int
(
m_sliderWidth
*
scale
-
m_unitSize
*
.4
)
;
int
h
=
ws
-
m_margin
*
2
;
QLinearGradient
gradient
(
0
,
0
,
w
,
h
);
gradient
.
setColorAt
(
0.0
,
Qt
::
white
);
...
...
@@ -465,7 +465,7 @@ void WheelContainer::drawSliderBar(QPainter &painter)
}
int
ws
=
wheelSize
();
qreal
scale
=
qreal
(
ws
+
m_sliderWidth
)
/
maximumWidth
();
int
w
=
m_sliderWidth
*
scale
;
int
w
=
int
(
m_sliderWidth
*
scale
)
;
int
h
=
ws
-
m_margin
*
2
;
QPen
pen
(
Qt
::
white
);
pen
.
setWidth
(
2
);
...
...
src/assets/view/widgets/curves/abstractcurvewidget.ipp
View file @
c0243124
...
...
@@ -44,8 +44,8 @@ template <typename Curve_t> void AbstractCurveWidget<Curve_t>::paintBackground(Q
*/
m_wWidth = width() - 1;
m_wHeight = height() - 1;
int offsetX = 1 / 8. * m_zoomLevel * m_wWidth;
int offsetY = 1 / 8. * m_zoomLevel * m_wHeight;
int offsetX =
int(
1 / 8. * m_zoomLevel * m_wWidth
)
;
int offsetY =
int(
1 / 8. * m_zoomLevel * m_wHeight
)
;
m_wWidth -= 2 * offsetX;
m_wHeight -= 2 * offsetY;
...
...
src/assets/view/widgets/curves/curveparamwidget.ipp
View file @
c0243124
...
...
@@ -408,7 +408,7 @@ template <typename CurveWidget_t> void CurveParamWidget<CurveWidget_t>::slotRefr
if (m_model->data(m_index, AssetParameterModel::TypeRole).template value<ParamType>() == ParamType::Curve) {
QList<QPointF> points;
// Rounding gives really weird results. (int) (10 * 0.3) gives 2! So for now, add 0.5 to get correct result
int number = m_model->data(m_index, AssetParameterModel::Enum3Role).toDouble() * 10 + 0.5;
int number =
int(
m_model->data(m_index, AssetParameterModel::Enum3Role).toDouble() * 10 + 0.5
)
;
int start = m_model->data(m_index, AssetParameterModel::MinRole).toInt();
// for the curve, inpoints are numbered: 6, 8, 10, 12, 14
// outpoints, 7, 9, 11, 13,15 so we need to deduce these enums
...
...
src/assets/view/widgets/geometryeditwidget.cpp
View file @
c0243124
...
...
@@ -43,7 +43,7 @@ GeometryEditWidget::GeometryEditWidget(std::shared_ptr<AssetParameterModel> mode
Mlt
::
GeometryItem
item
;
QRect
rect
;
if
(
geometry
.
fetch
(
&
item
,
0
)
==
0
)
{
rect
=
QRect
(
item
.
x
(),
item
.
y
(),
item
.
w
(),
item
.
h
());
rect
=
QRect
(
int
(
item
.
x
()
)
,
int
(
item
.
y
()
)
,
int
(
item
.
w
()
)
,
int
(
item
.
h
())
)
;
}
else
{
// Cannot read value, use random default
rect
=
QRect
(
50
,
50
,
200
,
200
);
...
...
src/assets/view/widgets/keyframeimport.cpp
View file @
c0243124
...
...
@@ -505,7 +505,7 @@ void KeyframeImport::drawKeyFrameChannels(QPixmap &pix, int in, int out, int lim
double
frameFactor
=
double
(
out
-
in
)
/
br
.
width
();
int
offset
=
1
;
if
(
limitKeyframes
>
0
)
{
offset
=
(
out
-
in
)
/
limitKeyframes
/
frameFactor
;
offset
=
int
(
(
out
-
in
)
/
limitKeyframes
/
frameFactor
)
;
}
double
min
=
m_dataCombo
->
currentData
(
Qt
::
UserRole
+
2
).
toDouble
();
double
max
=
m_dataCombo
->
currentData
(
Qt
::
UserRole
+
3
).
toDouble
();
...
...
@@ -534,11 +534,11 @@ void KeyframeImport::drawKeyFrameChannels(QPixmap &pix, int in, int out, int lim
txtRect
.
setWidth
(
br
.
width
()
-
4
);
txtRect
.
moveTop
(
br
.
height
()
-
txtRect
.
height
());
QRectF
drawnText
;
int
maxHeight
=
br
.
height
()
-
txtRect
.
height
()
-
2
;
int
maxHeight
=
int
(
br
.
height
()
-
txtRect
.
height
()
-
2
)
;
painter
.
setPen
(
textColor
);
int
rectSize
=
txtRect
.
height
()
/
2
;
int
rectSize
=
int
(
txtRect
.
height
()
/
2
)
;
if
(
xDist
>
0
)
{
painter
.
fillRect
(
txtRect
.
x
(),
txtRect
.
top
()
+
rectSize
/
2
,
rectSize
,
rectSize
,
cX
);
painter
.
fillRect
(
int
(
txtRect
.
x
()
)
,
int
(
txtRect
.
top
()
+
rectSize
/
2
)
,
rectSize
,
rectSize
,
cX
);
txtRect
.
setX
(
txtRect
.
x
()
+
rectSize
*
2
);
painter
.
drawText
(
txtRect
,
0
,
i18nc
(
"X as in x coordinate"
,
"X"
)
+
QStringLiteral
(
" (%1-%2)"
).
arg
(
m_maximas
.
at
(
0
).
x
()).
arg
(
m_maximas
.
at
(
0
).
y
()),
&
drawnText
);
...
...
@@ -547,7 +547,7 @@ void KeyframeImport::drawKeyFrameChannels(QPixmap &pix, int in, int out, int lim
if
(
drawnText
.
isValid
())
{
txtRect
.
setX
(
drawnText
.
right
()
+
rectSize
);
}
painter
.
fillRect
(
txtRect
.
x
(),
txtRect
.
top
()
+
rectSize
/
2
,
rectSize
,
rectSize
,
cY
);
painter
.
fillRect
(
int
(
txtRect
.
x
()
)
,
int
(
txtRect
.
top
()
+
rectSize
/
2
)
,
rectSize
,
rectSize
,
cY
);
txtRect
.
setX
(
txtRect
.
x
()
+
rectSize
*
2
);
painter
.
drawText
(
txtRect
,
0
,
i18nc
(
"Y as in y coordinate"
,
"Y"
)
+
QStringLiteral
(
" (%1-%2)"
).
arg
(
m_maximas
.
at
(
1
).
x
()).
arg
(
m_maximas
.
at
(
1
).
y
()),
&
drawnText
);
...
...
@@ -556,7 +556,7 @@ void KeyframeImport::drawKeyFrameChannels(QPixmap &pix, int in, int out, int lim
if
(
drawnText
.
isValid
())
{
txtRect
.
setX
(
drawnText
.
right
()
+
rectSize
);
}
painter
.
fillRect
(
txtRect
.
x
(),
txtRect
.
top
()
+
rectSize
/
2
,
rectSize
,
rectSize
,
cW
);
painter
.
fillRect
(
int
(
txtRect
.
x
()
)
,
int
(
txtRect
.
top
()
+
rectSize
/
2
)
,
rectSize
,
rectSize
,
cW
);
txtRect
.
setX
(
txtRect
.
x
()
+
rectSize
*
2
);
painter
.
drawText
(
txtRect
,
0
,
i18n
(
"Width"
)
+
QStringLiteral
(
" (%1-%2)"
).
arg
(
m_maximas
.
at
(
2
).
x
()).
arg
(
m_maximas
.
at
(
2
).
y
()),
&
drawnText
);
}
...
...
@@ -564,7 +564,7 @@ void KeyframeImport::drawKeyFrameChannels(QPixmap &pix, int in, int out, int lim
if
(
drawnText
.
isValid
())
{
txtRect
.
setX
(
drawnText
.
right
()
+
rectSize
);
}
painter
.
fillRect
(
txtRect
.
x
(),
txtRect
.
top
()
+
rectSize
/
2
,
rectSize
,
rectSize
,
cH
);
painter
.
fillRect
(
int
(
txtRect
.
x
()
)
,
int
(
txtRect
.
top
()
+
rectSize
/
2
)
,
rectSize
,
rectSize
,
cH
);
txtRect
.
setX
(
txtRect
.
x
()
+
rectSize
*
2
);
painter
.
drawText
(
txtRect
,
0
,
i18n
(
"Height"
)
+
QStringLiteral
(
" (%1-%2)"
).
arg
(
m_maximas
.
at
(
3
).
x
()).
arg
(
m_maximas
.
at
(
3
).
y
()),
&
drawnText
);
}
...
...
@@ -607,26 +607,26 @@ void KeyframeImport::drawKeyFrameChannels(QPixmap &pix, int in, int out, int lim
mlt_rect
rect2
=
animData
->
anim_get_rect
(
"key"
,
int
(
i
*
frameFactor
)
+
in
);
if
(
xDist
>
0
)
{
painter
.
setPen
(
cX
);
int
val1
=
(
rect1
.
x
-
xOffset
)
*
maxHeight
/
xDist
;
int
val2
=
(
rect2
.
x
-
xOffset
)
*
maxHeight
/
xDist
;
int
val1
=
int
(
(
rect1
.
x
-
xOffset
)
*
maxHeight
/
xDist
)
;
int
val2
=
int
(
(
rect2
.
x
-
xOffset
)
*
maxHeight
/
xDist
)
;
painter
.
drawLine
(
prevPos
,
maxHeight
-
val1
,
i
,
maxHeight
-
val2
);
}
if
(
yDist
>
0
)
{
painter
.
setPen
(
cY
);
int
val1
=
(
rect1
.
y
-
yOffset
)
*
maxHeight
/
yDist
;
int
val2
=
(
rect2
.
y
-
yOffset
)
*
maxHeight
/
yDist
;
int
val1
=
int
(
(
rect1
.
y
-
yOffset
)
*
maxHeight
/
yDist
)
;
int
val2
=
int
(
(
rect2
.
y
-
yOffset
)
*
maxHeight
/
yDist
)
;
painter
.
drawLine
(
prevPos
,
maxHeight
-
val1
,
i
,
maxHeight
-
val2
);
}
if
(
wDist
>
0
)
{
painter
.
setPen
(
cW
);
int
val1
=
(
rect1
.
w
-
wOffset
)
*
maxHeight
/
wDist
;
int
val2
=
(
rect2
.
w
-
wOffset
)
*
maxHeight
/
wDist
;
int
val1
=
int
(
(
rect1
.
w
-
wOffset
)
*
maxHeight
/
wDist
)
;
int
val2
=
int
(
(
rect2
.
w
-
wOffset
)
*
maxHeight
/
wDist
)
;
painter
.
drawLine
(
prevPos
,
maxHeight
-
val1
,
i
,
maxHeight
-
val2
);
}
if
(
hDist
>
0
)
{
painter
.
setPen
(
cH
);
int
val1
=
(
rect1
.
h
-
hOffset
)
*
maxHeight
/
hDist
;
int
val2
=
(
rect2
.
h
-
hOffset
)
*
maxHeight
/
hDist
;
int
val1
=
int
(
(
rect1
.
h
-
hOffset
)
*
maxHeight
/
hDist
)
;
int
val2
=
int
(
(
rect2
.
h
-
hOffset
)
*
maxHeight
/
hDist
)
;
painter
.
drawLine
(
prevPos
,
maxHeight
-
val1
,
i
,
maxHeight
-
val2
);
}
rect1
=
rect2
;
...
...
src/audiomixer/audiolevelwidget.cpp
View file @
c0243124
...
...
@@ -202,7 +202,7 @@ void AudioLevelWidget::paintEvent(QPaintEvent *pe)
continue
;
}
//int val = (50 + m_values.at(i)) / 150.0 * rect.height();
p
.
fillRect
(
m_offset
+
i
*
(
m_channelWidth
+
m_channelDistance
)
+
1
,
0
,
m_channelFillWidth
,
height
()
-
(
m_values
.
at
(
i
)
*
rect
.
height
()),
palette
().
dark
());
p
.
fillRect
(
m_offset
+
i
*
(
m_channelWidth
+
m_channelDistance
)
+
1
,
height
()
-
(
m_peaks
.
at
(
i
)
*
rect
.
height
()),
m_channelFillWidth
,
1
,
palette
().
text
());
p
.
fillRect
(
m_offset
+
i
*
(
m_channelWidth
+
m_channelDistance
)
+
1
,
0
,
m_channelFillWidth
,
height
()
-
int
(
m_values
.
at
(
i
)
*
rect
.
height
()),
palette
().
dark
());
p
.
fillRect
(
m_offset
+
i
*
(
m_channelWidth
+
m_channelDistance
)
+
1
,
height
()
-
int
(
m_peaks
.
at
(
i
)
*
rect
.
height
()),
m_channelFillWidth
,
1
,
palette
().
text
());
}
}
src/audiomixer/mixerwidget.cpp
View file @
c0243124
...
...
@@ -131,7 +131,7 @@ MixerWidget::MixerWidget(int tid, Mlt::Tractor *service, QString trackTag, const
,
m_balanceFilter
(
nullptr
)
,
m_channels
(
pCore
->
audioChannels
())
,
m_balanceSlider
(
nullptr
)
,
m_maxLevels
(
qMax
(
30
,
(
int
)
(
service
->
get_fps
()
*
1.5
)))
,
m_maxLevels
(
qMax
(
30
,
int
(
service
->
get_fps
()
*
1.5
)))
,
m_solo
(
nullptr
)
,
m_record
(
nullptr
)
,
m_collapse
(
nullptr
)
...
...
src/bin/bin.cpp
View file @
c0243124
...
...
@@ -146,7 +146,7 @@ public:
int
type
=
index
.
data
(
AbstractProjectItem
::
ItemTypeRole
).
toInt
();
int
decoWidth
=
0
;
if
(
opt
.
decorationSize
.
height
()
>
0
)
{
decoWidth
+=
r1
.
height
()
*
pCore
->
getCurrentDar
();
decoWidth
+=
int
(
r1
.
height
()
*
pCore
->
getCurrentDar
()
)
;
}
int
mid
=
0
;
if
(
type
==
AbstractProjectItem
::
ClipItem
||
type
==
AbstractProjectItem
::
SubClipItem
)
{
...
...
src/bin/model/subtitlemodel.cpp
View file @
c0243124
...
...
@@ -989,7 +989,7 @@ void SubtitleModel::jsontoSubtitle(const QString &data)
}
double
startPos
=
entryObj
[
QLatin1String
(
"startPos"
)].
toDouble
();
//convert seconds to FORMAT= hh:mm:ss.SS (in .ass) and hh:mm:ss,SSS (in .srt)
int
millisec
=
startPos
*
1000
;
int
millisec
=
int
(
startPos
*
1000
)
;
int
seconds
=
millisec
/
1000
;
millisec
%=
1000
;
int
minutes
=
seconds
/
60
;
...
...
@@ -1009,7 +1009,7 @@ void SubtitleModel::jsontoSubtitle(const QString &data)
.
arg
(
millisec
,
3
,
10
,
QChar
(
'0'
));
QString
dialogue
=
entryObj
[
QLatin1String
(
"dialogue"
)].
toString
();
double
endPos
=
entryObj
[
QLatin1String
(
"endPos"
)].
toDouble
();
millisec
=
endPos
*
1000
;
millisec
=
int
(
endPos
*
1000
)
;
seconds
=
millisec
/
1000
;
millisec
%=
1000
;
minutes
=
seconds
/
60
;
...
...
src/bin/projectclip.cpp
View file @
c0243124
...
...
@@ -696,7 +696,7 @@ int ProjectClip::getRecordTime()
bool
ok
;
int
frames
=
recInfo
.
section
(
QLatin1Char
(
':'
),
-
1
).
toInt
(
&
ok
);
if
(
ok
)
{
frames
*=
pCore
->
getCurrentFps
()
/
producerFps
;
frames
*=
int
(
pCore
->
getCurrentFps
()
/
producerFps
)
;
recInfo
.
chop
(
2
);
recInfo
.
append
(
QString
::
number
(
frames
).
rightJustified
(
1
,
QChar
(
'0'
)));
}
...
...
src/bin/projectitemmodel.cpp
View file @
c0243124
...
...
@@ -505,7 +505,7 @@ void ProjectItemModel::clean()
{
QWriteLocker
locker
(
&
m_lock
);
std
::
vector
<
std
::
shared_ptr
<
AbstractProjectItem
>>
toDelete
;
toDelete
.
reserve
(
(
size_t
)
rootItem
->
childCount
());
toDelete
.
reserve
(
size_t
(
rootItem
->
childCount
())
)
;
for
(
int
i
=
0
;
i
<
rootItem
->
childCount
();
++
i
)
{
toDelete
.
push_back
(
std
::
static_pointer_cast
<
AbstractProjectItem
>
(
rootItem
->
child
(
i
)));
}
...
...
@@ -582,7 +582,7 @@ void ProjectItemModel::loadSubClips(const QString &id, const QString &dataMap, F
std
::
shared_ptr
<
AbstractProjectItem
>
ProjectItemModel
::
getBinItemByIndex
(
const
QModelIndex
&
index
)
const
{
READ_LOCK
();
return
std
::
static_pointer_cast
<
AbstractProjectItem
>
(
getItemById
(
(
int
)
index
.
internalId
()));
return
std
::
static_pointer_cast
<
AbstractProjectItem
>
(
getItemById
(
int
(
index
.
internalId
()))
)
;
}
bool
ProjectItemModel
::
requestBinClipDeletion
(
const
std
::
shared_ptr
<
AbstractProjectItem
>
&
clip
,
Fun
&
undo
,
Fun
&
redo
)
...
...
src/capture/v4lcapture.cpp
View file @
c0243124
...
...
@@ -54,7 +54,7 @@ QStringList V4lCaptureHandler::getDeviceName(const QString &input)
fprintf
(
stderr
,
"Cannot get capabilities."
);
// return nullptr;
}
else
{
devName
=
strdup
(
(
char
*
)
cap
.
card
);
devName
=
strdup
(
reinterpret_cast
<
char
*
>
(
cap
.
card
)
)
;
if
((
cap
.
capabilities
&
V4L2_CAP_VIDEO_CAPTURE
)
==
0u
)
{
// Device cannot capture
captureEnabled
=
0
;
...
...
src/dialogs/markerdialog.cpp
View file @
c0243124
...
...
@@ -59,7 +59,7 @@ MarkerDialog::MarkerDialog(ClipController *clip, const CommentedTime &t, const T
m_in
->
setRange
(
0
,
m_clip
->
getFramePlaytime
());
m_previewTimer
->
setInterval
(
100
);
connect
(
m_previewTimer
,
&
QTimer
::
timeout
,
this
,
&
MarkerDialog
::
slotUpdateThumb
);
int
width
=
200
*
pCore
->
getCurrentDar
();
int
width
=
int
(
200
*
pCore
->
getCurrentDar
()
)
;
QPixmap
p
(
width
,
200
);
p
.
fill
(
Qt
::
transparent
);
switch
(
m_clip
->
clipType
())
{
...
...
src/dialogs/profilesdialog.cpp
View file @
c0243124
...
...
@@ -41,7 +41,7 @@ ProfilesDialog::ProfilesDialog(const QString &profileDescription, QWidget *paren
m_view
.
setupUi
(
this
);
// Add message widget
auto
*
lay
=
(
QGridLayout
*
)
layout
();
auto
*
lay
=
static_cast
<
QGridLayout
*
>
(
layout
()
)
;
m_infoMessage
=
new
KMessageWidget
;
lay
->
addWidget
(
m_infoMessage
,
2
,
0
,
1
,
-
1
);
m_infoMessage
->
setCloseButtonVisible
(
true
);
...
...
@@ -100,7 +100,7 @@ ProfilesDialog::ProfilesDialog(const QString &profilePath, bool, QWidget *parent
m_view
.
setupUi
(
this
);
// Add message widget
auto
*
lay
=
(
QGridLayout
*
)
layout
();
auto
*
lay
=
static_cast
<
QGridLayout
*
>
(
layout
()
)
;
m_infoMessage
=
new
KMessageWidget
;
lay
->
addWidget
(
m_infoMessage
,
2
,
0
,
1
,
-
1
);
m_infoMessage
->
setCloseButtonVisible
(
true
);
...
...
@@ -350,9 +350,9 @@ void ProfilesDialog::slotUpdateDisplay(QString currentProfilePath)
m_view
.
frame_den
->
setValue
(
curProfile
->
frame_rate_den
());
m_view
.
progressive
->
setChecked
(
curProfile
->
progressive
()
!=
0
);
if
(
curProfile
->
progressive
()
!=
0
)
{
m_view
.
fields
->
setText
(
locale
.
toString
(
(
double
)
curProfile
->
frame_rate_num
()
/
curProfile
->
frame_rate_den
(),
'f'
,
2
));
m_view
.
fields
->
setText
(
locale
.
toString
(
double
(
curProfile
->
frame_rate_num
()
/
curProfile
->
frame_rate_den
()
)
,
'f'
,
2
));
}
else
{
m_view
.
fields
->
setText
(
locale
.
toString
(
(
double
)
2
*
curProfile
->
frame_rate_num
()
/
curProfile
->
frame_rate_den
(),
'f'
,
2
));
m_view
.
fields
->
setText
(
locale
.
toString
(
2.0
*
curProfile
->
frame_rate_num
()
/
curProfile
->
frame_rate_den
(),
'f'
,
2
));
}
int
colorix
=
m_view
.
colorspace
->
findData
(
curProfile
->
colorspace
());
...
...
src/dialogs/wizard.cpp
View file @
c0243124
...
...
@@ -89,7 +89,7 @@ Wizard::Wizard(bool autoClose, bool appImageCheck, QWidget *parent)
,
m_brokenModule
(
false
)
{
setWindowTitle
(
i18n
(
"Welcome to Kdenlive"
));
int
logoHeight
=
fontMetrics
().
height
()
*
2.5
;
int
logoHeight
=
int
(
fontMetrics
().
height
()
*
2.5
)
;
setWizardStyle
(
QWizard
::
ModernStyle
);
setOption
(
QWizard
::
NoBackButtonOnLastPage
,
true
);
// setOption(QWizard::ExtendedWatermarkPixmap, false);
...
...
src/effects/effectsrepository.cpp
View file @
c0243124
...
...
@@ -154,7 +154,7 @@ void EffectsRepository::parseCustomAssetFile(const QString &file_name, std::unor
const
QString
effectTag
=
currentEffect
.
attribute
(
QStringLiteral
(
"tag"
));
QScopedPointer
<
Mlt
::
Properties
>
metadata
(
getMetadata
(
effectTag
));
if
(
metadata
&&
metadata
->
is_valid
())
{
Mlt
::
Properties
tags
(
(
mlt_properties
)
metadata
->
get_data
(
"tags"
));
Mlt
::
Properties
tags
(
mlt_properties
(
metadata
->
get_data
(
"tags"
))
)
;
if
(
QString
(
tags
.
get
(
0
))
==
QLatin1String
(
"Audio"
))
{
result
.
type
=
AssetListType
::
AssetType
::
CustomAudio
;
currentEffect
.
setAttribute
(
QStringLiteral
(
"type"
),
QStringLiteral
(
"customAudio"
));
...
...
@@ -187,7 +187,7 @@ QStringList EffectsRepository::assetDirs() const
void
EffectsRepository
::
parseType
(
QScopedPointer
<
Mlt
::
Properties
>
&
metadata
,
Info
&
res
)
{
res
.
type
=
AssetListType
::
AssetType
::
Video
;
Mlt
::
Properties
tags
(
(
mlt_properties
)
metadata
->
get_data
(
"tags"
));
Mlt
::
Properties
tags
(
mlt_properties
(
metadata
->
get_data
(
"tags"
))
)
;
if
(
QString
(
tags
.
get
(
0
))
==
QLatin1String
(
"Audio"
))
{
res
.
type
=
AssetListType
::
AssetType
::
Audio
;
}
...
...
src/effects/effectstack/view/collapsibleeffectview.cpp
View file @
c0243124
...
...
@@ -289,7 +289,7 @@ CollapsibleEffectView::~CollapsibleEffectView()
void
CollapsibleEffectView
::
setWidgetHeight
(
qreal
value
)
{
widgetFrame
->
setFixedHeight
(
m_view
->
contentHeight
()
*
value
);
widgetFrame
->
setFixedHeight
(
int
(
m_view
->
contentHeight
()
*
value
)
)
;
}
void
CollapsibleEffectView
::
slotCreateGroup
()
...
...
Prev
1
2
3
Next
Eugen Mohr
@emohr
mentioned in issue
#596 (closed)
·
Mar 23, 2021
mentioned in issue
#596 (closed)
mentioned in issue #596
Toggle commit list
Write
Preview
Supports
Markdown
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