Default fade duration is now configurable from Kdenlive Settings > Misc

parent 898d3ed9
Pipeline #4708 passed with stage
in 13 minutes and 30 seconds
......@@ -3,7 +3,7 @@
<name>Fade from Black</name>
<description>Fade video from black</description>
<author>Charles Yates</author>
<parameter type="position" name="out" max="90000" min="0" default="75">
<parameter type="position" name="out" max="90000" min="0" default="%fade">
<name>Duration</name>
</parameter>
<parameter type="fixed" name="in" max="0" min="0" default="0">
......
......@@ -3,7 +3,7 @@
<name>Fade to Black</name>
<description>Fade video to black</description>
<author>Charles Yates</author>
<parameter type="position" name="in" max="0" min="0" default="-75">
<parameter type="position" name="in" max="0" min="0" default="-%fade">
<name>Duration</name>
</parameter>
<parameter type="fixed" name="out" max="99999" min="0" default="%out">
......
......@@ -6,7 +6,7 @@
<parameter type="fixed" name="in" max="0" min="0" default="0">
<name></name>
</parameter>
<parameter type="position" name="out" max="90000" min="0" default="75">
<parameter type="position" name="out" max="90000" min="0" default="%fade">
<name>Duration</name>
</parameter>
<parameter type="fixed" name="gain" max="0" min="0" default="0">
......
......@@ -3,7 +3,7 @@
<name>Fade out</name>
<description>Fade out audio track</description>
<author></author>
<parameter type="position" name="in" max="0" min="0" default="-75">
<parameter type="position" name="in" max="0" min="0" default="-%fade">
<name>Duration</name>
</parameter>
<parameter type="fixed" name="out" max="90000" min="0" default="%out">
......
......@@ -513,13 +513,14 @@ QVariant AssetParameterModel::parseAttribute(const ObjectId &owner, const QStrin
int height = profile->height();
int in = pCore->getItemIn(owner);
int out = in + pCore->getItemDuration(owner);
int frame_duration = pCore->getDurationFromString(KdenliveSettings::fade_duration());
// replace symbols in the double parameter
content.replace(QLatin1String("%maxWidth"), QString::number(width))
.replace(QLatin1String("%maxHeight"), QString::number(height))
.replace(QLatin1String("%width"), QString::number(width))
.replace(QLatin1String("%height"), QString::number(height))
.replace(QLatin1String("%out"), QString::number(out));
.replace(QLatin1String("%out"), QString::number(out))
.replace(QLatin1String("%fade"), QString::number(frame_duration));
if (type == ParamType::Double || type == ParamType::Hidden) {
// Use a Mlt::Properties to parse mathematical operators
......
......@@ -752,3 +752,9 @@ QString Core::getTimelineClipBinId(int cid)
}
return QString();
}
int Core::getDurationFromString(const QString &time)
{
const QString duration = currentDoc()->timecode().reformatSeparators(time);
return currentDoc()->timecode().getFrameCount(duration);
}
......@@ -195,6 +195,8 @@ public:
QString getProjectFolderName();
/** @brief Returns a timeline clip's bin id */
QString getTimelineClipBinId(int cid);
/** @brief Returns a frame duration from a timecode */
int getDurationFromString(const QString &time);
private:
explicit Core();
......
......@@ -62,6 +62,11 @@
<label>Default image sequence frame duration.</label>
<default>00:00:00:01</default>
</entry>
<entry name="fade_duration" type="String">
<label>Default image sequence frame duration.</label>
<default>00:00:03:00</default>
</entry>
<entry name="autoimagesequence" type="Bool">
<label>Automatically import image sequences.</label>
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>414</width>
<height>546</height>
<width>714</width>
<height>771</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
......@@ -95,6 +95,16 @@
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Fades</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLineEdit" name="kcfg_fade_duration"/>
</item>
</layout>
</widget>
</item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment