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
7d0b60c9
Commit
7d0b60c9
authored
Aug 05, 2020
by
Jean-Baptiste Mardelle
Browse files
Restore increased range for volume effect, only limit the visible range in timeline
Related to
#770
parent
186c2793
Changes
5
Hide whitespace changes
Inline
Side-by-side
data/effects/README
View file @
7d0b60c9
...
...
@@ -50,6 +50,11 @@ The rest:
- tag "comment": (optional) description of the parameter (support HTML formatting) (not yet supported by all widgets)
- attribute "name": MLT filter parameter name
- attribute "paramprefix": a string to be prepended to the parameter value before passing it to MLT
- attribute "suffix": a string to be appended to the parameter (for UI display only)
- attribute "min": the minimal accepted value
- attribute "max": the maximal accepted value
- attribute "visualmin": the minimal value displayed in timeline keyframes (can be > than min)
- attribute "visualmax": the maximal value displayed in timeline keyframes (can be < than max)
- attribute "default": initial value, format depends on parameter type
- attribute "optional": if it is set, it means that this parameter can have an empty value. So then loading a project, don't set its value to default
- attribute "type": widget (GUI) to use
...
...
data/effects/volume.xml
View file @
7d0b60c9
...
...
@@ -3,7 +3,7 @@
<name>
Volume (keyframable)
</name>
<description>
Adjust audio volume with keyframes
</description>
<author>
Dan Dennedy
</author>
<parameter
type=
"animated"
name=
"level"
default=
"0"
max=
"50"
min=
"-50"
suffix=
"dB"
scale=
"-1"
>
<parameter
type=
"animated"
name=
"level"
default=
"0"
max=
"50"
min=
"-
100"
visualmax=
"50"
visualmin=
"-
50"
suffix=
"dB"
scale=
"-1"
>
<name>
Gain
</name>
</parameter>
</effect>
src/assets/keyframes/model/keyframemodel.cpp
View file @
7d0b60c9
...
...
@@ -298,8 +298,12 @@ bool KeyframeModel::updateKeyframe(int pos, double newVal)
{
GenTime
Pos
(
pos
,
pCore
->
getCurrentFps
());
if
(
auto
ptr
=
m_model
.
lock
())
{
double
min
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
MinRole
).
toDouble
();
double
max
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
MaxRole
).
toDouble
();
double
min
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
VisualMinRole
).
toDouble
();
double
max
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
VisualMaxRole
).
toDouble
();
if
(
qFuzzyIsNull
(
min
)
&&
qFuzzyIsNull
(
max
))
{
min
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
MinRole
).
toDouble
();
max
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
MaxRole
).
toDouble
();
}
double
factor
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
FactorRole
).
toDouble
();
double
norm
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
DefaultRole
).
toDouble
();
int
logRole
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
ScaleRole
).
toInt
();
...
...
@@ -454,8 +458,12 @@ QVariant KeyframeModel::data(const QModelIndex &index, int role) const
double
val
=
it
->
second
.
second
.
toDouble
();
if
(
auto
ptr
=
m_model
.
lock
())
{
Q_ASSERT
(
m_index
.
isValid
());
double
min
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
MinRole
).
toDouble
();
double
max
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
MaxRole
).
toDouble
();
double
min
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
VisualMinRole
).
toDouble
();
double
max
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
VisualMaxRole
).
toDouble
();
if
(
qFuzzyIsNull
(
min
)
&&
qFuzzyIsNull
(
max
))
{
min
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
MinRole
).
toDouble
();
max
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
MaxRole
).
toDouble
();
}
double
factor
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
FactorRole
).
toDouble
();
double
norm
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
DefaultRole
).
toDouble
();
int
logRole
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
ScaleRole
).
toInt
();
...
...
@@ -890,8 +898,12 @@ QVariant KeyframeModel::updateInterpolated(const QVariant &interpValue, double v
QVariant
KeyframeModel
::
getNormalizedValue
(
double
newVal
)
const
{
if
(
auto
ptr
=
m_model
.
lock
())
{
double
min
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
MinRole
).
toDouble
();
double
max
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
MaxRole
).
toDouble
();
double
min
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
VisualMinRole
).
toDouble
();
double
max
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
VisualMaxRole
).
toDouble
();
if
(
qFuzzyIsNull
(
min
)
&&
qFuzzyIsNull
(
max
))
{
min
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
MinRole
).
toDouble
();
max
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
MaxRole
).
toDouble
();
}
double
factor
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
FactorRole
).
toDouble
();
double
norm
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
DefaultRole
).
toDouble
();
int
logRole
=
ptr
->
data
(
m_index
,
AssetParameterModel
::
ScaleRole
).
toInt
();
...
...
src/assets/model/assetparametermodel.cpp
View file @
7d0b60c9
...
...
@@ -440,6 +440,10 @@ QVariant AssetParameterModel::data(const QModelIndex &index, int role) const
return
parseAttribute
(
m_ownerId
,
QStringLiteral
(
"decimals"
),
element
);
case
OddRole
:
return
element
.
attribute
(
QStringLiteral
(
"odd"
))
==
QLatin1String
(
"1"
);
case
VisualMinRole
:
return
parseAttribute
(
m_ownerId
,
QStringLiteral
(
"visualmin"
),
element
);
case
VisualMaxRole
:
return
parseAttribute
(
m_ownerId
,
QStringLiteral
(
"visualmax"
),
element
);
case
DefaultRole
:
return
parseAttribute
(
m_ownerId
,
QStringLiteral
(
"default"
),
element
);
case
FilterRole
:
...
...
src/assets/model/assetparametermodel.hpp
View file @
7d0b60c9
...
...
@@ -91,6 +91,8 @@ public:
CommentRole
,
AlternateNameRole
,
MinRole
,
VisualMinRole
,
VisualMaxRole
,
MaxRole
,
DefaultRole
,
SuffixRole
,
...
...
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