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
252
Issues
252
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
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
3ed27aac
Commit
3ed27aac
authored
Sep 04, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate videostab and videostab2, only keep vidstab filter.
Remember last settings and allow reset to default
parent
17a7e6f4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
37 deletions
+79
-37
src/assets/view/assetparameterview.cpp
src/assets/view/assetparameterview.cpp
+6
-1
src/jobs/stabilizejob.cpp
src/jobs/stabilizejob.cpp
+2
-2
src/mainwindow.cpp
src/mainwindow.cpp
+1
-1
src/project/clipstabilize.cpp
src/project/clipstabilize.cpp
+30
-4
src/project/clipstabilize.h
src/project/clipstabilize.h
+4
-1
src/ui/clipstabilize_ui.ui
src/ui/clipstabilize_ui.ui
+36
-28
No files found.
src/assets/view/assetparameterview.cpp
View file @
3ed27aac
...
...
@@ -141,7 +141,12 @@ void AssetParameterView::resetValues()
{
const
QVector
<
QPair
<
QString
,
QVariant
>>
values
=
getDefaultValues
();
auto
*
command
=
new
AssetUpdateCommand
(
m_model
,
values
);
pCore
->
pushUndo
(
command
);
if
(
m_model
->
getOwnerId
().
second
!=
-
1
)
{
pCore
->
pushUndo
(
command
);
}
else
{
command
->
redo
();
delete
command
;
}
// Unselect preset if any
QAction
*
ac
=
m_presetGroup
->
checkedAction
();
if
(
ac
)
{
...
...
src/jobs/stabilizejob.cpp
View file @
3ed27aac
...
...
@@ -76,7 +76,7 @@ void StabilizeJob::configureFilter()
// static
std
::
unordered_set
<
QString
>
StabilizeJob
::
supportedFilters
()
{
return
{
QLatin1String
(
"vidstab"
)
,
QLatin1String
(
"videostab2"
),
QLatin1String
(
"videostab"
)
};
return
{
QLatin1String
(
"vidstab"
)};
}
// static
...
...
@@ -84,7 +84,7 @@ int StabilizeJob::prepareJob(const std::shared_ptr<JobManager> &ptr, const std::
const
QString
&
filterName
)
{
Q_ASSERT
(
supportedFilters
().
count
(
filterName
)
>
0
);
if
(
filterName
==
QLatin1String
(
"vidstab"
)
||
filterName
==
QLatin1String
(
"videostab2"
)
||
filterName
==
QLatin1String
(
"videostab"
)
)
{
if
(
filterName
==
QLatin1String
(
"vidstab"
))
{
// vidstab
QScopedPointer
<
ClipStabilize
>
d
(
new
ClipStabilize
(
binIds
,
filterName
,
100000
));
if
(
d
->
exec
()
==
QDialog
::
Accepted
)
{
...
...
src/mainwindow.cpp
View file @
3ed27aac
...
...
@@ -3048,7 +3048,7 @@ void MainWindow::buildDynamicActions()
Mlt
::
Profile
profile
;
std
::
unique_ptr
<
Mlt
::
Filter
>
filter
;
for
(
const
QString
&
stab
:
{
QStringLiteral
(
"vidstab"
)
,
QStringLiteral
(
"videostab2"
),
QStringLiteral
(
"videostab"
)
})
{
for
(
const
QString
&
stab
:
{
QStringLiteral
(
"vidstab"
)})
{
filter
=
std
::
make_unique
<
Mlt
::
Filter
>
(
profile
,
stab
.
toUtf8
().
constData
());
if
((
filter
!=
nullptr
)
&&
filter
->
is_valid
())
{
QAction
*
action
=
new
QAction
(
i18n
(
"Stabilize (%1)"
,
stab
),
m_extraFactory
->
actionCollection
());
...
...
src/project/clipstabilize.cpp
View file @
3ed27aac
...
...
@@ -63,17 +63,25 @@ ClipStabilize::ClipStabilize(const std::vector<QString> &binIds, QString filterN
dest_url
->
setUrl
(
QUrl
(
firstUrl
).
adjusted
(
QUrl
::
RemoveFilename
));
}
m_vbox
=
new
QVBoxLayout
(
optionsbox
);
if
(
m_filtername
==
QLatin1String
(
"vidstab"
)
||
m_filtername
==
QLatin1String
(
"videostab2"
))
{
AssetParameterView
*
view
=
new
AssetParameterView
(
this
);
if
(
m_filtername
==
QLatin1String
(
"vidstab"
))
{
m_view
.
reset
(
new
AssetParameterView
(
this
));
qDebug
()
<<
"// Fetching effect: "
<<
m_filtername
;
std
::
unique_ptr
<
Mlt
::
Filter
>
asset
=
EffectsRepository
::
get
()
->
getEffect
(
m_filtername
);
auto
prop
=
std
::
make_unique
<
Mlt
::
Properties
>
(
asset
->
get_properties
());
QDomElement
xml
=
EffectsRepository
::
get
()
->
getXml
(
m_filtername
);
m_assetModel
.
reset
(
new
AssetParameterModel
(
std
::
move
(
prop
),
xml
,
m_filtername
,
{
ObjectType
::
NoItem
,
-
1
}));
view
->
setModel
(
m_assetModel
,
QSize
(
1920
,
1080
));
m_vbox
->
addWidget
(
view
);
QDir
dir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppDataLocation
)
+
QStringLiteral
(
"/effects/presets/"
));
const
QString
presetFile
=
dir
.
absoluteFilePath
(
QString
(
"%1.json"
).
arg
(
m_assetModel
->
getAssetId
()));
const
QVector
<
QPair
<
QString
,
QVariant
>>
params
=
m_assetModel
->
loadPreset
(
presetFile
,
QStringLiteral
(
"lastsetting"
));
if
(
!
params
.
isEmpty
())
{
m_assetModel
->
setParameters
(
params
);
}
m_view
->
setModel
(
m_assetModel
,
QSize
(
1920
,
1080
));
m_vbox
->
addWidget
(
m_view
.
get
());
}
connect
(
buttonBox
->
button
(
QDialogButtonBox
::
Ok
),
&
QPushButton
::
clicked
,
this
,
&
ClipStabilize
::
slotValidate
);
connect
(
button_reset
,
&
QPushButton
::
clicked
,
this
,
&
ClipStabilize
::
resetValues
);
adjustSize
();
}
...
...
@@ -151,5 +159,23 @@ void ClipStabilize::slotValidate()
}
}
}
QDir
dir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppDataLocation
)
+
QStringLiteral
(
"/effects/presets/"
));
if
(
!
dir
.
exists
())
{
dir
.
mkpath
(
QStringLiteral
(
"."
));
}
const
QString
presetFile
=
dir
.
absoluteFilePath
(
QString
(
"%1.json"
).
arg
(
m_assetModel
->
getAssetId
()));
m_assetModel
->
savePreset
(
presetFile
,
QStringLiteral
(
"lastsetting"
));
accept
();
}
void
ClipStabilize
::
resetValues
()
{
QDir
dir
(
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppDataLocation
)
+
QStringLiteral
(
"/effects/presets/"
));
if
(
dir
.
exists
())
{
const
QString
presetFile
=
dir
.
absoluteFilePath
(
QString
(
"%1.json"
).
arg
(
m_assetModel
->
getAssetId
()));
m_assetModel
->
deletePreset
(
presetFile
,
QStringLiteral
(
"lastsetting"
));
}
m_view
->
resetValues
();
/*const QVector<QPair<QString, QVariant>> values = m_view->getDefaultValues();
m_assetModel->setParameters(values);*/
}
src/project/clipstabilize.h
View file @
3ed27aac
...
...
@@ -28,6 +28,7 @@
#include <unordered_map>
class
AssetParameterModel
;
class
AssetParameterView
;
class
ClipStabilize
:
public
QDialog
,
public
Ui
::
ClipStabilize_UI
{
...
...
@@ -49,13 +50,15 @@ public:
QString
filterName
()
const
;
private
slots
:
void
slotValidate
();
void
resetValues
();
private:
QString
m_filtername
;
std
::
vector
<
QString
>
m_binIds
;
QVBoxLayout
*
m_vbox
;
Timecode
m_tc
;
std
::
shared_ptr
<
AssetParameterModel
>
m_assetModel
;
std
::
shared_ptr
<
AssetParameterModel
>
m_assetModel
;
std
::
unique_ptr
<
AssetParameterView
>
m_view
;
signals:
void
addClip
(
const
QUrl
&
url
);
...
...
src/ui/clipstabilize_ui.ui
View file @
3ed27aac
...
...
@@ -6,21 +6,14 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
3
04
</width>
<height>
1
25
</height>
<width>
3
49
</width>
<height>
1
60
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Dialog
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_dest"
>
<property
name=
"text"
>
<string>
Destination
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
colspan=
"2"
>
<widget
class=
"KUrlRequester"
name=
"dest_url"
/>
</item>
...
...
@@ -31,6 +24,13 @@
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_dest"
>
<property
name=
"text"
>
<string>
Destination
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
colspan=
"3"
>
<widget
class=
"QWidget"
name=
"optionsbox"
native=
"true"
>
<property
name=
"sizePolicy"
>
...
...
@@ -41,24 +41,27 @@
</property>
</widget>
</item>
<item
row=
"
6"
column=
"2
"
>
<
widget
class=
"QDialogButtonBox"
name=
"buttonBox
"
>
<item
row=
"
3"
column=
"0
"
>
<
spacer
name=
"verticalSpacer
"
>
<property
name=
"orientation"
>
<enum>
Qt::
Horizont
al
</enum>
<enum>
Qt::
Vertic
al
</enum>
</property>
<property
name=
"standardButtons"
>
<set>
QDialogButtonBox::Abort|QDialogButtonBox::Ok
</set>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</
widget
>
</
spacer
>
</item>
<item
row=
"
4"
column=
"0"
colspan=
"2
"
>
<widget
class=
"Q
CheckBox"
name=
"auto_add
"
>
<item
row=
"
5"
column=
"0
"
>
<widget
class=
"Q
PushButton"
name=
"button_reset
"
>
<property
name=
"text"
>
<string>
Add clip to projec
t
</string>
<string>
Rese
t
</string>
</property>
</widget>
</item>
<item
row=
"
6"
column=
"0"
colspan=
"2
"
>
<item
row=
"
5"
column=
"1
"
>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
...
...
@@ -71,18 +74,22 @@
</property>
</spacer>
</item>
<item
row=
"
3"
column=
"0
"
>
<
spacer
name=
"verticalSpacer
"
>
<item
row=
"
5"
column=
"2
"
>
<
widget
class=
"QDialogButtonBox"
name=
"buttonBox
"
>
<property
name=
"orientation"
>
<enum>
Qt::
Vertic
al
</enum>
<enum>
Qt::
Horizont
al
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
<property
name=
"standardButtons"
>
<set>
QDialogButtonBox::Abort|QDialogButtonBox::Ok
</set>
</property>
</spacer>
</widget>
</item>
<item
row=
"4"
column=
"0"
colspan=
"3"
>
<widget
class=
"QCheckBox"
name=
"auto_add"
>
<property
name=
"text"
>
<string>
Add clip to project
</string>
</property>
</widget>
</item>
</layout>
</widget>
...
...
@@ -91,6 +98,7 @@
<class>
KUrlRequester
</class>
<extends>
QFrame
</extends>
<header>
kurlrequester.h
</header>
<container>
1
</container>
</customwidget>
</customwidgets>
<resources/>
...
...
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