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
cc00a839
Commit
cc00a839
authored
Dec 07, 2021
by
Julius Künzel
Browse files
CppCheck fixes Pt. 3
parent
3853a4af
Pipeline
#106646
passed with stage
in 5 minutes and 17 seconds
Changes
31
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/assets/model/assetparametermodel.cpp
View file @
cc00a839
...
...
@@ -40,7 +40,8 @@ AssetParameterModel::AssetParameterModel(std::unique_ptr<Mlt::Properties> asset,
m_isAudio
=
assetXml
.
attribute
(
QStringLiteral
(
"type"
))
==
QLatin1String
(
"audio"
);
bool
needsLocaleConversion
=
false
;
QChar
separator
,
oldSeparator
;
QChar
separator
;
QChar
oldSeparator
;
// Check locale, default effects xml has no LC_NUMERIC defined and always uses the C locale
if
(
assetXml
.
hasAttribute
(
QStringLiteral
(
"LC_NUMERIC"
)))
{
QLocale
effectLocale
=
QLocale
(
assetXml
.
attribute
(
QStringLiteral
(
"LC_NUMERIC"
)));
// Check if effect has a special locale → probably OK
...
...
src/assets/view/widgets/abstractparamwidget.hpp
View file @
cc00a839
...
...
@@ -51,7 +51,7 @@ signals:
public
slots
:
/** @brief Toggle the comments on or off
*/
virtual
void
slotShowComment
(
bool
)
{
qDebug
()
<<
"DEBUG: show_comment not correctly overridden"
;
}
virtual
void
slotShowComment
(
bool
/*show*/
)
{
qDebug
()
<<
"DEBUG: show_comment not correctly overridden"
;
}
/** @brief refresh the properties to reflect changes in the model
*/
...
...
src/assets/view/widgets/coloreditwidget.cpp
View file @
cc00a839
...
...
@@ -6,6 +6,7 @@
#include "coloreditwidget.hpp"
#include "assets/model/assetparametermodel.hpp"
#include "widgets/colorpickerwidget.h"
#include "utils/qcolorutils.h"
#include <QHBoxLayout>
#include <QLabel>
...
...
@@ -13,64 +14,6 @@
#include <KColorButton>
static
QColor
stringToColor
(
QString
strColor
)
{
bool
ok
=
false
;
QColor
color
(
"black"
);
uint
intval
=
0
;
if
(
strColor
.
startsWith
(
QLatin1String
(
"0x"
)))
{
if
(
strColor
.
length
()
==
10
)
{
// 0xRRGGBBAA
intval
=
strColor
.
toUInt
(
&
ok
,
16
);
color
.
setRgb
(
int
((
intval
>>
24
)
&
0xff
),
// r
(
intval
>>
16
)
&
0xff
,
// g
(
intval
>>
8
)
&
0xff
,
// b
intval
&
0xff
);
// a
}
else
{
// 0xRRGGBB, 0xRGB
color
.
setNamedColor
(
strColor
.
replace
(
0
,
2
,
QLatin1Char
(
'#'
)));
}
}
else
{
if
(
strColor
.
length
()
==
9
)
{
// #AARRGGBB
strColor
=
strColor
.
replace
(
'#'
,
QLatin1String
(
"0x"
));
intval
=
strColor
.
toUInt
(
&
ok
,
16
);
color
.
setRgb
((
intval
>>
16
)
&
0xff
,
// r
(
intval
>>
8
)
&
0xff
,
// g
intval
&
0xff
,
// b
int
((
intval
>>
24
)
&
0xff
));
// a
}
else
if
(
strColor
.
length
()
==
8
)
{
// 0xRRGGBB
strColor
=
strColor
.
replace
(
'#'
,
QLatin1String
(
"0x"
));
color
.
setNamedColor
(
strColor
);
}
else
{
// #RRGGBB, #RGB
color
.
setNamedColor
(
strColor
);
}
}
return
color
;
}
static
QString
colorToString
(
const
QColor
&
color
,
bool
alpha
)
{
QString
colorStr
;
QTextStream
stream
(
&
colorStr
);
stream
<<
"0x"
;
stream
.
setIntegerBase
(
16
);
stream
.
setFieldWidth
(
2
);
stream
.
setFieldAlignment
(
QTextStream
::
AlignRight
);
stream
.
setPadChar
(
'0'
);
stream
<<
color
.
red
()
<<
color
.
green
()
<<
color
.
blue
();
if
(
alpha
)
{
stream
<<
color
.
alpha
();
}
else
{
// MLT always wants 0xRRGGBBAA format
stream
<<
"ff"
;
}
return
colorStr
;
}
ColorEditWidget
::
ColorEditWidget
(
std
::
shared_ptr
<
AssetParameterModel
>
model
,
QModelIndex
index
,
QWidget
*
parent
)
:
AbstractParamWidget
(
std
::
move
(
model
),
index
,
parent
)
{
...
...
@@ -91,7 +34,7 @@ ColorEditWidget::ColorEditWidget(std::shared_ptr<AssetParameterModel> model, QMo
rightSideLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
rightSideLayout
->
setSpacing
(
0
);
m_button
=
new
KColorButton
(
stringToColor
(
color
),
rightSide
);
m_button
=
new
KColorButton
(
QColorUtils
::
stringToColor
(
color
),
rightSide
);
if
(
alphaEnabled
)
{
m_button
->
setAlphaChannelEnabled
(
alphaEnabled
);
}
...
...
@@ -122,12 +65,12 @@ void ColorEditWidget::slotRefresh()
{
QSignalBlocker
bk
(
this
);
QString
color
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
ValueRole
).
toString
();
m_button
->
setColor
(
stringToColor
(
color
));
m_button
->
setColor
(
QColorUtils
::
stringToColor
(
color
));
}
QString
ColorEditWidget
::
getColor
()
const
{
return
colorToString
(
m_button
->
color
(),
m_button
->
isAlphaChannelEnabled
());
return
QColorUtils
::
colorToString
(
m_button
->
color
(),
m_button
->
isAlphaChannelEnabled
());
}
void
ColorEditWidget
::
setColor
(
const
QColor
&
color
)
...
...
src/assets/view/widgets/colorwheel.h
View file @
cc00a839
...
...
@@ -8,7 +8,7 @@
#ifndef COLORWHEELPARAM_H
#define COLORWHEELPARAM_H
#include "utils/
neg
qcolor.h"
#include "utils/qcolor
utils
.h"
#include <QPainter>
#include <QResizeEvent>
...
...
src/assets/view/widgets/curves/cubic/kis_curve_widget.cpp
View file @
cc00a839
...
...
@@ -236,18 +236,6 @@ void KisCurveWidget::mouseMoveEvent(QMouseEvent *e)
}
}
double
KisCurveWidget
::
io2sp
(
int
x
)
const
{
int
rangeLen
=
m_inOutMax
-
m_inOutMin
;
return
double
(
x
-
m_inOutMin
)
/
rangeLen
;
}
int
KisCurveWidget
::
sp2io
(
double
x
)
const
{
int
rangeLen
=
m_inOutMax
-
m_inOutMin
;
return
int
(
x
*
rangeLen
+
0.5
)
+
m_inOutMin
;
}
bool
KisCurveWidget
::
jumpOverExistingPoints
(
QPointF
&
pt
,
int
skipIndex
)
{
for
(
QPointF
&
it
:
m_curve
.
points
())
{
...
...
src/assets/view/widgets/curves/cubic/kis_curve_widget.h
View file @
cc00a839
...
...
@@ -81,10 +81,6 @@ private:
bool
m_guideVisible
;
QColor
m_colorGuide
;
/* Working range of them */
int
m_inOutMin
;
int
m_inOutMax
;
};
#endif
/* KIS_CURVE_WIDGET_H */
src/assets/view/widgets/keyframeimport.cpp
View file @
cc00a839
...
...
@@ -830,7 +830,6 @@ void KeyframeImport::importSelectedData()
bool
useOpacity
=
m_dataCombo
->
currentData
(
Qt
::
UserRole
+
4
).
toBool
();
if
(
ix
==
m_targetCombo
->
currentData
().
toModelIndex
()
||
fakeRect
)
{
// Import our keyframes
int
frame
=
0
;
KeyframeImport
::
ImportRoles
convertMode
=
static_cast
<
KeyframeImport
::
ImportRoles
>
(
m_sourceCombo
->
currentData
().
toInt
());
if
(
convertMode
==
ImportRoles
::
RotoData
&&
m_targetCombo
->
currentText
()
==
i18n
(
"Rotoscoping shape"
))
{
QJsonObject
json
=
QJsonDocument
::
fromJson
(
selectedData
().
toLocal8Bit
()).
object
();
...
...
@@ -843,6 +842,7 @@ void KeyframeImport::importSelectedData()
mlt_keyframe_type
type
;
mlt_rect
firstRect
=
animData
->
anim_get_rect
(
"key"
,
anim
->
key_get_frame
(
0
));
for
(
int
i
=
0
;
i
<
anim
->
key_count
();
i
++
)
{
int
frame
=
0
;
int
error
=
anim
->
key_get
(
i
,
frame
,
type
);
if
(
error
)
{
continue
;
...
...
@@ -1080,8 +1080,7 @@ void KeyframeImport::updateView()
qDebug
()
<<
"=== Original parameter not found"
;
return
;
}
QString
kfrData
=
m_originalParams
.
value
(
ix
);
animData
->
set
(
"original"
,
kfrData
.
toUtf8
().
constData
());
animData
->
set
(
"original"
,
m_originalParams
.
value
(
ix
).
toUtf8
().
constData
());
std
::
shared_ptr
<
Mlt
::
Animation
>
animo
(
new
Mlt
::
Animation
(
animData
->
get_animation
(
"original"
)));
animo
->
interpolate
();
// wether we are mapping to a fake rectangle
...
...
src/assets/view/widgets/urllistparamwidget.cpp
View file @
cc00a839
...
...
@@ -88,7 +88,7 @@ void UrlListParamWidget::slotRefresh()
m_list
->
clear
();
QStringList
names
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
ListNamesRole
).
toStringList
();
QStringList
values
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
ListValuesRole
).
toStringList
();
QString
v
alue
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
ValueRole
).
toString
();
QString
currentV
alue
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
ValueRole
).
toString
();
QString
filter
=
m_model
->
data
(
m_index
,
AssetParameterModel
::
FilterRole
).
toString
();
filter
.
remove
(
0
,
filter
.
indexOf
(
"("
)
+
1
);
filter
.
remove
(
filter
.
indexOf
(
")"
)
-
1
,
-
1
);
...
...
@@ -127,14 +127,14 @@ void UrlListParamWidget::slotRefresh()
}
}
// add all matching files in the location of the current item too
if
(
!
v
alue
.
isEmpty
())
{
QString
path
=
QUrl
(
v
alue
).
adjusted
(
QUrl
::
RemoveFilename
).
toString
();
if
(
!
currentV
alue
.
isEmpty
())
{
QString
path
=
QUrl
(
currentV
alue
).
adjusted
(
QUrl
::
RemoveFilename
).
toString
();
QDir
dir
(
path
);
for
(
const
auto
&
filename
:
dir
.
entryList
(
m_fileExt
,
QDir
::
Files
))
{
values
.
append
(
dir
.
filePath
(
filename
));
}
// make sure the current value is added. If it is a duplicate we remove it later
values
<<
v
alue
;
values
<<
currentV
alue
;
}
values
.
removeDuplicates
();
...
...
@@ -164,8 +164,8 @@ void UrlListParamWidget::slotRefresh()
m_list
->
addItem
(
i18n
(
"Custom…"
),
QStringLiteral
(
"custom_file"
));
// select current value
if
(
!
v
alue
.
isEmpty
())
{
int
ix
=
m_list
->
findData
(
v
alue
);
if
(
!
currentV
alue
.
isEmpty
())
{
int
ix
=
m_list
->
findData
(
currentV
alue
);
if
(
ix
>
-
1
)
{
m_list
->
setCurrentIndex
(
ix
);
m_currentIndex
=
ix
;
...
...
src/bin/bin.cpp
View file @
cc00a839
...
...
@@ -1900,7 +1900,7 @@ const QString Bin::setDocument(KdenliveDoc *project, const QString &id)
QAction
*
disableEffects
=
pCore
->
window
()
->
actionCollection
()
->
action
(
QStringLiteral
(
"disable_bin_effects"
));
if
(
disableEffects
)
{
if
(
binEffectsDisabled
!=
disableEffects
->
isChecked
())
{
QSignalBlocker
b
k
(
disableEffects
);
QSignalBlocker
effectB
k
(
disableEffects
);
disableEffects
->
setChecked
(
binEffectsDisabled
);
}
}
...
...
@@ -1940,26 +1940,25 @@ void Bin::rebuildFilters(QMap <QString, QString> tags)
}
// Add rating filters
m_filterMenu
->
addSeparator
();
QAction
*
rateFilter
;
for
(
int
i
=
1
;
i
<
6
;
++
i
)
{
rateFilter
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"favorite"
)),
i18np
(
"%1 star"
,
"%1 stars"
,
i
),
&
m_filterRateGroup
);
for
(
int
i
=
1
;
i
<
6
;
++
i
)
{
auto
*
rateFilter
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"favorite"
)),
i18np
(
"%1 star"
,
"%1 stars"
,
i
),
&
m_filterRateGroup
);
rateFilter
->
setData
(
QString
(
".%1"
).
arg
(
2
*
i
));
rateFilter
->
setCheckable
(
true
);
m_filterMenu
->
addAction
(
rateFilter
);
}
// Add unused filter
m_filterMenu
->
addSeparator
();
QAction
*
unusedFilter
=
new
QAction
(
i18n
(
"Unused clips"
),
this
);
auto
*
unusedFilter
=
new
QAction
(
i18n
(
"Unused clips"
),
this
);
unusedFilter
->
setData
(
QStringLiteral
(
"unused"
));
unusedFilter
->
setCheckable
(
true
);
m_filterMenu
->
addAction
(
unusedFilter
);
// Add type filters
m_filterMenu
->
addSeparator
();
QMenu
*
typeMenu
=
new
QMenu
(
i18n
(
"Filter by type"
),
m_filterMenu
);
auto
*
typeMenu
=
new
QMenu
(
i18n
(
"Filter by type"
),
m_filterMenu
);
m_filterMenu
->
addMenu
(
typeMenu
);
m_filterMenu
->
addSeparator
();
QAction
*
typeFilter
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"video-x-generic"
)),
i18n
(
"AV Clip"
),
&
m_filterTypeGroup
);
auto
*
typeFilter
=
new
QAction
(
QIcon
::
fromTheme
(
QStringLiteral
(
"video-x-generic"
)),
i18n
(
"AV Clip"
),
&
m_filterTypeGroup
);
typeFilter
->
setData
(
ClipType
::
AV
);
typeFilter
->
setCheckable
(
true
);
typeMenu
->
addAction
(
typeFilter
);
...
...
@@ -3478,7 +3477,7 @@ void Bin::switchTag(const QString &tag, bool add)
for
(
auto
&
clp
:
children
)
{
allClips
<<
clp
->
clipId
();
}
}
else
if
(
parentItem
->
itemType
()
!=
AbstractProjectItem
::
FolderItem
)
{
}
else
{
allClips
<<
parentItem
->
clipId
();
}
}
...
...
@@ -4812,8 +4811,7 @@ bool Bin::addProjectClipInFolder(const QString &path, const QString &parentFolde
Fun
redo
=
[]()
{
return
true
;
};
// Check if folder exists
QString
folderId
=
QStringLiteral
(
"-1"
);
bool
found
=
false
;
QString
folderId
=
QStringLiteral
(
"-1"
);
// We first try to see if it exists
std
::
shared_ptr
<
ProjectFolder
>
baseFolder
=
m_itemModel
->
getFolderByBinId
(
parentFolder
);
if
(
!
baseFolder
)
{
...
...
@@ -4823,6 +4821,7 @@ bool Bin::addProjectClipInFolder(const QString &path, const QString &parentFolde
// Put clip in parentFolder
folderId
=
baseFolder
->
clipId
();
}
else
{
bool
found
=
false
;
for
(
int
i
=
0
;
i
<
baseFolder
->
childCount
();
++
i
)
{
auto
currentItem
=
std
::
static_pointer_cast
<
AbstractProjectItem
>
(
baseFolder
->
child
(
i
));
if
(
currentItem
->
itemType
()
==
AbstractProjectItem
::
FolderItem
&&
currentItem
->
name
()
==
folderName
)
{
...
...
src/bin/projectclip.cpp
View file @
cc00a839
...
...
@@ -2142,8 +2142,8 @@ QStringList ProjectClip::getAudioStreamEffect(int streamIndex) const
void
ProjectClip
::
updateTimelineOnReload
()
{
if
(
m_registeredClips
.
size
()
>
0
&&
m_registeredClips
.
size
()
<
3
)
{
bool
reloadProducer
=
true
;
for
(
const
auto
&
clip
:
m_registeredClips
)
{
bool
reloadProducer
=
true
;
if
(
auto
timeline
=
clip
.
second
.
lock
())
{
if
(
timeline
->
getClipPlaytime
(
clip
.
first
)
<
static_cast
<
int
>
(
frameDuration
()))
{
reloadProducer
=
false
;
...
...
src/bin/projectitemmodel.cpp
View file @
cc00a839
...
...
@@ -402,10 +402,10 @@ const QVector<uint8_t> ProjectItemModel::getAudioLevelsByBinID(const QString &bi
double
ProjectItemModel
::
getAudioMaxLevel
(
const
QString
&
binId
,
int
stream
)
{
READ_LOCK
();
for
(
const
auto
&
clip
:
m_allItems
)
{
auto
c
=
std
::
static_pointer_cast
<
AbstractProjectItem
>
(
clip
.
second
.
lock
());
if
(
c
->
itemType
()
==
AbstractProjectItem
::
ClipItem
&&
c
->
clipId
()
==
binId
)
{
auto
clip
=
std
::
static_pointer_cast
<
ProjectClip
>
(
c
);
for
(
const
auto
&
item
:
m_allItems
)
{
auto
i
=
std
::
static_pointer_cast
<
AbstractProjectItem
>
(
item
.
second
.
lock
());
if
(
i
->
itemType
()
==
AbstractProjectItem
::
ClipItem
&&
i
->
clipId
()
==
binId
)
{
auto
clip
=
std
::
static_pointer_cast
<
ProjectClip
>
(
i
);
if
(
clip
)
{
return
clip
->
getAudioMax
(
stream
);
}
...
...
src/dialogs/renderwidget.cpp
View file @
cc00a839
...
...
@@ -1572,7 +1572,7 @@ void RenderWidget::generateRenderFiles(QDomDocument doc, const QString &playlist
QString
playlistName
=
playlistPath
;
myConsumer
.
setAttribute
(
QStringLiteral
(
"mlt_service"
),
QStringLiteral
(
"avformat"
));
if
(
passes
==
2
&&
i
==
1
)
{
playlistName
=
playlistName
.
section
(
QLatin1Char
(
'.'
),
0
,
-
2
)
+
QString
(
"-pass%1."
).
arg
(
i
+
1
)
+
playlistName
.
section
(
QLatin1Char
(
'.'
),
-
1
);
playlistName
=
playlistName
.
section
(
QLatin1Char
(
'.'
),
0
,
-
2
)
+
QString
(
"-pass%1."
).
arg
(
2
)
+
playlistName
.
section
(
QLatin1Char
(
'.'
),
-
1
);
}
playlists
<<
playlistName
;
myConsumer
.
setAttribute
(
QStringLiteral
(
"target"
),
mytarget
);
...
...
src/dialogs/textbasededit.cpp
View file @
cc00a839
...
...
@@ -967,7 +967,7 @@ void TextBasedEdit::slotProcessSpeech()
}
val
=
obj2
.
last
();
if
(
val
.
isObject
()
&&
val
.
toObject
().
keys
().
contains
(
"end"
))
{
double
ms
=
val
.
toObject
().
value
(
"end"
).
toDouble
()
+
m_clipOffset
;
ms
=
val
.
toObject
().
value
(
"end"
).
toDouble
()
+
m_clipOffset
;
sentenceZone
.
second
=
ms
;
m_lastPosition
=
GenTime
(
ms
).
frames
(
pCore
->
getCurrentFps
());
if
(
m_clipDuration
>
0.
)
{
...
...
src/dialogs/timeremap.cpp
View file @
cc00a839
...
...
@@ -955,13 +955,13 @@ void RemapView::wheelEvent(QWheelEvent *event)
update
();
return
;
}
int
change
=
event
->
angleDelta
().
y
()
>
0
?
-
1
:
1
;
int
pos
=
qBound
(
0
,
m_position
+
change
,
m_duration
-
1
);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
if
(
event
->
position
().
y
()
<
m_bottomView
)
{
#else
if
(
event
->
y
()
<
m_bottomView
)
{
#endif
int
change
=
event
->
angleDelta
().
y
()
>
0
?
-
1
:
1
;
int
pos
=
qBound
(
0
,
m_position
+
change
,
m_duration
-
1
);
emit
seekToPos
(
pos
+
m_inFrame
,
-
1
);
}
else
{
// Wheel on zoom bar, scroll
...
...
@@ -1425,9 +1425,9 @@ void RemapView::paintEvent(QPaintEvent *event)
QMapIterator
<
int
,
int
>
i
(
m_keyframes
);
while
(
i
.
hasNext
())
{
i
.
next
();
double
o
utPos
=
(
double
)(
i
.
key
()
-
m_inFrame
)
*
m_scale
;
double
i
nPos
=
(
double
)(
i
.
value
()
-
m_inFrame
)
*
m_scale
;
if
((
i
nPos
<
m_zoomStart
&&
o
utPos
<
m_zoomStart
)
||
(
qFloor
(
i
nPos
)
>
zoomEnd
&&
qFloor
(
o
utPos
)
>
zoomEnd
))
{
double
kfO
utPos
=
(
double
)(
i
.
key
()
-
m_inFrame
)
*
m_scale
;
double
kfI
nPos
=
(
double
)(
i
.
value
()
-
m_inFrame
)
*
m_scale
;
if
((
kfI
nPos
<
m_zoomStart
&&
kfO
utPos
<
m_zoomStart
)
||
(
qFloor
(
kfI
nPos
)
>
zoomEnd
&&
qFloor
(
kfO
utPos
)
>
zoomEnd
))
{
continue
;
}
if
(
m_currentKeyframe
.
first
==
i
.
key
())
{
...
...
@@ -1440,18 +1440,18 @@ void RemapView::paintEvent(QPaintEvent *event)
p
.
setPen
(
m_colKeyframe
);
p
.
setBrush
(
m_colKeyframe
);
}
i
nPos
-=
m_zoomStart
;
i
nPos
*=
m_zoomFactor
;
i
nPos
+=
m_offset
;
o
utPos
-=
m_zoomStart
;
o
utPos
*=
m_zoomFactor
;
o
utPos
+=
m_offset
;
kfI
nPos
-=
m_zoomStart
;
kfI
nPos
*=
m_zoomFactor
;
kfI
nPos
+=
m_offset
;
kfO
utPos
-=
m_zoomStart
;
kfO
utPos
*=
m_zoomFactor
;
kfO
utPos
+=
m_offset
;
p
.
drawLine
(
i
nPos
,
m_lineHeight
+
m_lineHeight
*
0.75
,
o
utPos
,
m_bottomView
-
m_lineHeight
*
1.75
);
p
.
drawLine
(
i
nPos
,
m_lineHeight
,
i
nPos
,
m_lineHeight
+
m_lineHeight
/
2
);
p
.
drawLine
(
o
utPos
,
m_bottomView
-
m_lineHeight
,
o
utPos
,
m_bottomView
-
m_lineHeight
*
1.5
);
p
.
drawEllipse
(
QRectF
(
i
nPos
-
m_lineHeight
/
4.0
,
m_lineHeight
+
m_lineHeight
/
2
,
m_lineHeight
/
2
,
m_lineHeight
/
2
));
p
.
drawEllipse
(
QRectF
(
o
utPos
-
m_lineHeight
/
4.0
,
m_bottomView
-
2
*
m_lineHeight
,
m_lineHeight
/
2
,
m_lineHeight
/
2
));
p
.
drawLine
(
kfI
nPos
,
m_lineHeight
+
m_lineHeight
*
0.75
,
kfO
utPos
,
m_bottomView
-
m_lineHeight
*
1.75
);
p
.
drawLine
(
kfI
nPos
,
m_lineHeight
,
kfI
nPos
,
m_lineHeight
+
m_lineHeight
/
2
);
p
.
drawLine
(
kfO
utPos
,
m_bottomView
-
m_lineHeight
,
kfO
utPos
,
m_bottomView
-
m_lineHeight
*
1.5
);
p
.
drawEllipse
(
QRectF
(
kfI
nPos
-
m_lineHeight
/
4.0
,
m_lineHeight
+
m_lineHeight
/
2
,
m_lineHeight
/
2
,
m_lineHeight
/
2
));
p
.
drawEllipse
(
QRectF
(
kfO
utPos
-
m_lineHeight
/
4.0
,
m_bottomView
-
2
*
m_lineHeight
,
m_lineHeight
/
2
,
m_lineHeight
/
2
));
}
/*
...
...
@@ -1771,12 +1771,12 @@ void TimeRemap::setClip(std::shared_ptr<ProjectClip> clip, int in, int out)
case
mlt_service_chain_type
:
{
Mlt
::
Chain
fromChain
(
*
track
.
get
());
int
count
=
fromChain
.
link_count
();
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
QScopedPointer
<
Mlt
::
Link
>
fromLink
(
fromChain
.
link
(
i
));
for
(
int
j
=
0
;
j
<
count
;
j
++
)
{
QScopedPointer
<
Mlt
::
Link
>
fromLink
(
fromChain
.
link
(
j
));
if
(
fromLink
&&
fromLink
->
is_valid
()
&&
fromLink
->
get
(
"mlt_service"
))
{
if
(
fromLink
->
get
(
"mlt_service"
)
==
QLatin1String
(
"timeremap"
))
{
// Found a timeremap effect, read params
m_view
->
m_remapLink
=
std
::
make_shared
<
Mlt
::
Link
>
(
fromChain
.
link
(
i
)
->
get_link
());
m_view
->
m_remapLink
=
std
::
make_shared
<
Mlt
::
Link
>
(
fromChain
.
link
(
j
)
->
get_link
());
QString
mapData
(
fromLink
->
get
(
"map"
));
m_view
->
loadKeyframes
(
mapData
);
keyframesLoaded
=
true
;
...
...
@@ -1789,20 +1789,20 @@ void TimeRemap::setClip(std::shared_ptr<ProjectClip> clip, int in, int out)
case
mlt_service_playlist_type
:
{
// that is a single track
Mlt
::
Playlist
local_playlist
(
*
track
);
int
max
=
local_playlist
.
count
();
qDebug
()
<<
"==== PLAYLIST COUNT: "
<<
max
;
if
(
max
==
1
)
{
int
count
=
local_playlist
.
count
();
qDebug
()
<<
"==== PLAYLIST COUNT: "
<<
count
;
if
(
count
==
1
)
{
Mlt
::
Producer
prod
=
local_playlist
.
get_clip
(
0
)
->
parent
();
qDebug
()
<<
"==== GOT PROD TYPE: "
<<
prod
.
type
()
<<
" = "
<<
prod
.
get
(
"mlt_service"
)
<<
" = "
<<
prod
.
get
(
"resource"
);
if
(
prod
.
type
()
==
mlt_service_chain_type
)
{
Mlt
::
Chain
fromChain
(
prod
);
int
count
=
fromChain
.
link_count
();
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
QScopedPointer
<
Mlt
::
Link
>
fromLink
(
fromChain
.
link
(
i
));
for
(
int
j
=
0
;
j
<
count
;
j
++
)
{
QScopedPointer
<
Mlt
::
Link
>
fromLink
(
fromChain
.
link
(
j
));
if
(
fromLink
&&
fromLink
->
is_valid
()
&&
fromLink
->
get
(
"mlt_service"
))
{
if
(
fromLink
->
get
(
"mlt_service"
)
==
QLatin1String
(
"timeremap"
))
{
// Found a timeremap effect, read params
m_view
->
m_remapLink
=
std
::
make_shared
<
Mlt
::
Link
>
(
fromChain
.
link
(
i
)
->
get_link
());
m_view
->
m_remapLink
=
std
::
make_shared
<
Mlt
::
Link
>
(
fromChain
.
link
(
j
)
->
get_link
());
QString
mapData
(
fromLink
->
get
(
"map"
));
m_view
->
loadKeyframes
(
mapData
);
keyframesLoaded
=
true
;
...
...
src/doc/documentvalidator.cpp
View file @
cc00a839
...
...
@@ -1800,14 +1800,14 @@ bool DocumentValidator::upgrade(double version, const double currentVersion)
newNodeTag
.
appendChild
(
text
);
root
.
replaceChild
(
newNodeTag
,
nodelist
);
QDomElement
e
=
doc
.
documentElement
();
e
.
setAttribute
(
"id"
,
newId
);
//
QDomElement e = doc.documentElement();
//
e.setAttribute("id", newId);
auto
params
=
doc
.
elementsByTagName
(
QStringLiteral
(
"parameter"
));
for
(
int
i
=
0
;
i
<
params
.
count
();
i
++
)
{
QString
paramName
=
params
.
at
(
i
).
attributes
().
namedItem
(
"name"
).
nodeValue
();
for
(
int
j
=
0
;
j
<
params
.
count
();
j
++
)
{
QString
paramName
=
params
.
at
(
j
).
attributes
().
namedItem
(
"name"
).
nodeValue
();
if
(
paramName
==
QStringLiteral
(
"transition.geometry"
))
{
QDomElement
e
=
params
.
at
(
i
).
toElement
();
QDomElement
e
=
params
.
at
(
j
).
toElement
();
e
.
setAttribute
(
"name"
,
QStringLiteral
(
"transition.rect"
));
}
}
...
...
src/doc/kdenlivedoc.cpp
View file @
cc00a839
...
...
@@ -1710,7 +1710,7 @@ QDir KdenliveDoc::getCacheDir(CacheType type, bool *ok) const
// Use specified folder to store all files
kdenliveCacheDir
=
m_projectFolder
;
}
basePath
=
kdenliveCacheDir
+
QLatin1Char
(
'/'
)
+
documentId
;
basePath
=
kdenliveCacheDir
+
QLatin1Char
(
'/'
)
+
documentId
;
// CacheBase
switch
(
type
)
{
case
SystemCacheRoot
:
return
QStandardPaths
::
writableLocation
(
QStandardPaths
::
CacheLocation
);
...
...
src/effects/effectstack/view/qml/colorwheelitem.h
View file @
cc00a839
...
...
@@ -10,7 +10,7 @@
#ifndef COLORWHEELITEM_H
#define COLORWHEELITEM_H
#include "utils/
neg
qcolor.h"
#include "utils/qcolor
utils
.h"
#include <QImage>
#include <QQuickPaintedItem>
...
...
src/jobs/transcodetask.cpp
View file @
cc00a839
...
...
@@ -216,8 +216,6 @@ void TranscodeTask::run()
QMetaObject
::
invokeMethod
(
pCore
.
get
(),
"displayBinLogMessage"
,
Qt
::
QueuedConnection
,
Q_ARG
(
QString
,
i18n
(
"Failed to create file."
)),
Q_ARG
(
int
,
int
(
KMessageWidget
::
Warning
)),
Q_ARG
(
QString
,
m_logDetails
));
}
else
{
QString
id
=
QString
::
number
(
m_owner
.
second
);
auto
binClip
=
pCore
->
projectItemModel
()
->
getClipByBinID
(
id
);
if
(
m_replaceProducer
&&
binClip
)
{
QMap
<
QString
,
QString
>
sourceProps
;
QMap
<
QString
,
QString
>
newProps
;
...
...
@@ -225,7 +223,8 @@ void TranscodeTask::run()
sourceProps
.
insert
(
QStringLiteral
(
"kdenlive:clipname"
),
binClip
->
clipName
());
newProps
.
insert
(
QStringLiteral
(
"resource"
),
destUrl
);
newProps
.
insert
(
QStringLiteral
(
"kdenlive:clipname"
),
QFileInfo
(
destUrl
).
fileName
());
pCore
->
bin
()
->
slotEditClipCommand
(
id
,
sourceProps
,
newProps
);
QString
id
=
QString
::
number
(
m_owner
.
second
);
pCore
->
bin
()
->
slotEditClipCommand
(
binClip
->
clipId
(),
sourceProps
,
newProps
);
}
else
{
QString
folder
=
QStringLiteral
(
"-1"
);
if
(
binClip
)
{
...
...
@@ -252,7 +251,6 @@ void TranscodeTask::processLogInfo()
{
const
QString
buffer
=
QString
::
fromUtf8
(
m_jobProcess
->
readAllStandardError
());
m_logDetails
.
append
(
buffer
);
int
progress
=
0
;
if
(
m_isFfmpegJob
)
{
// Parse FFmpeg output
if
(
m_jobDuration
==
0
)
{
...
...
@@ -267,6 +265,7 @@ void TranscodeTask::processLogInfo()
}
}
}
else
if
(
buffer
.
contains
(
QLatin1String
(
"time="
)))
{
int
progress
=
0
;
QString
time
=
buffer
.
section
(
QStringLiteral
(
"time="
),
1
,
1
).
simplified
().
section
(
QLatin1Char
(
' '
),
0
,
0
);
if
(
!
time
.
isEmpty
())
{
QStringList
numbers
=
time
.
split
(
QLatin1Char
(
':'
));
...
...
@@ -288,7 +287,6 @@ void TranscodeTask::processLogInfo()
if
(
buffer
.
contains
(
QLatin1String
(
"percentage:"
)))
{
m_progress
=
buffer
.
section
(
QStringLiteral
(
"percentage:"
),
1
).
simplified
().
section
(
QLatin1Char
(
' '
),
0
,
0
).
toInt
();
QMetaObject
::
invokeMethod
(
m_object
,
"updateJobProgress"
);
//emit jobProgress(progress);
}
}
}
src/lib/audio/audioCorrelation.cpp
View file @
cc00a839
...
...
@@ -127,7 +127,7 @@ void AudioCorrelation::correlate(const qint64 *envMain, size_t sizeMain, const q
t
.
start
();
for
(
size_t
shift
=
-
sizeSub
;
shift
<=
sizeMain
;
++
shift
)
{
if
(
shift
<
=
0
)
{
if
(
shift
=
=
0
)
{
left
=
envSub
-
shift
;
right
=
envMain
;
size
=
std
::
min
(
sizeSub
+
shift
,
sizeMain
);
...
...
src/lib/audio/audioInfo.cpp
View file @
cc00a839
...
...
@@ -12,10 +12,10 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#include <cstdlib>
AudioInfo
::
AudioInfo
(
const
std
::
shared_ptr
<
Mlt
::
Producer
>
&
producer
)
:
m_list
(
QList
<
AudioStreamInfo
*>
())
{
// Since we already receive an MLT producer, we do not need to initialize MLT:
// Mlt::Factory::init(nullptr);
m_list
=
QList
<
AudioStreamInfo
*>
();
// Get the number of streams and add the information of each of them if it is an audio stream.
int
streams
=
producer
->
get_int
(
"meta.media.nb_streams"
);
for
(
int
i
=
0
;
i
<
streams
;
++
i
)
{
...
...
Prev
1
2
Next
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