Commit a4191ce7 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Allow defining automatic property of transitions, patch by Harald Albrecht

REVIEW: 128879
parent cee1588f
......@@ -64,6 +64,7 @@ breeze-light/lt_insert-horizontal-rule.svgz
breeze-light/lt_insert-text.svgz
breeze-light/lt_insert-image.svgz
breeze-light/lt_jog-dial.svg
breeze-light/lt_auto-transition.svg
breeze-light/lt_kdenlive-add-clip.svgz
breeze-light/lt_kdenlive-add-color-clip.svgz
breeze-light/lt_kdenlive-add-slide-clip.svgz
......@@ -237,6 +238,7 @@ breeze-dark/dk_insert-horizontal-rule.svgz
breeze-dark/dk_insert-text.svgz
breeze-dark/dk_insert-image.svgz
breeze-dark/dk_jog-dial.svg
breeze-dark/dk_auto-transition.svg
breeze-dark/dk_kdenlive-add-clip.svgz
breeze-dark/dk_kdenlive-add-color-clip.svgz
breeze-dark/dk_kdenlive-add-slide-clip.svgz
......
......@@ -21,6 +21,7 @@
<file alias="jog-dial.svg">../data/pics/breeze-light/lt_jog-dial.svg</file>
<file alias="show-all-effects.svg">../data/pics/breeze-light/lt_show-all-effects.svg</file>
<file alias="show-gpu-effects.svg">../data/pics/breeze-light/lt_show-gpu-effects.svg</file>
<file alias="auto-transition.svg">../data/pics/breeze-light/lt_auto-transition.svg</file>
<file alias="kdenlive.png">../data/icons/48-apps-kdenlive.png</file>
</qresource>
</RCC>
......@@ -687,6 +687,11 @@
<default>true</default>
</entry>
<entry name="automatictransitions" type="Bool">
<label>New transitions are automatic transitions.</label>
<default>true</default>
</entry>
<entry name="transitionfollowcursor" type="Bool">
<label>When editing a composite transition, move timeline cursor for better preview.</label>
<default>true</default>
......
......@@ -1084,12 +1084,19 @@ void MainWindow::setupActions()
m_buttonShowMarkers->setCheckable(true);
m_buttonShowMarkers->setChecked(KdenliveSettings::showmarkers());
connect(m_buttonShowMarkers, SIGNAL(triggered()), this, SLOT(slotSwitchMarkersComments()));
m_buttonSnap = new QAction(KoIconUtils::themedIcon(QStringLiteral("kdenlive-snap")), i18n("Snap"), this);
m_buttonSnap->setCheckable(true);
m_buttonSnap->setChecked(KdenliveSettings::snaptopoints());
connect(m_buttonSnap, SIGNAL(triggered()), this, SLOT(slotSwitchSnap()));
m_buttonAutomaticTransition = new QAction(KoIconUtils::themedIcon(QStringLiteral("auto-transition")), i18n("Automatic transitions"), this);
m_buttonAutomaticTransition->setCheckable(true);
m_buttonAutomaticTransition->setChecked(KdenliveSettings::automatictransitions());
connect(m_buttonAutomaticTransition, SIGNAL(triggered()), this, SLOT(slotSwitchAutomaticTransition()));
m_buttonFitZoom = new QAction(KoIconUtils::themedIcon(QStringLiteral("zoom-fit-best")), i18n("Fit zoom to project"), this);
m_buttonFitZoom->setCheckable(false);
......@@ -1136,6 +1143,7 @@ void MainWindow::setupActions()
/*QString styleBorderless = QStringLiteral("QToolButton { border-width: 0px;margin: 1px 3px 0px;padding: 0px;}");*/
toolbar->addAction(m_buttonAutomaticSplitAudio);
toolbar->addAction(m_buttonAutomaticTransition);
toolbar->addAction(m_buttonVideoThumbs);
toolbar->addAction(m_buttonAudioThumbs);
toolbar->addAction(m_buttonShowMarkers);
......@@ -1188,6 +1196,7 @@ void MainWindow::setupActions()
addAction(QStringLiteral("spacer_tool"), m_buttonSpacerTool);
addAction(QStringLiteral("automatic_split_audio"), m_buttonAutomaticSplitAudio);
addAction(QStringLiteral("automatic_transition"), m_buttonAutomaticTransition);
addAction(QStringLiteral("show_video_thumbs"), m_buttonVideoThumbs);
addAction(QStringLiteral("show_audio_thumbs"), m_buttonAudioThumbs);
addAction(QStringLiteral("show_markers"), m_buttonShowMarkers);
......@@ -2049,6 +2058,7 @@ void MainWindow::updateConfiguration()
m_buttonVideoThumbs->setChecked(KdenliveSettings::videothumbnails());
m_buttonShowMarkers->setChecked(KdenliveSettings::showmarkers());
slotSwitchSplitAudio(KdenliveSettings::splitaudio());
slotSwitchAutomaticTransition();
// Update list of transcoding profiles
buildDynamicActions();
......@@ -2099,6 +2109,11 @@ void MainWindow::slotSwitchSnap()
m_buttonSnap->setChecked(KdenliveSettings::snaptopoints());
}
void MainWindow::slotSwitchAutomaticTransition()
{
KdenliveSettings::setAutomatictransitions(!KdenliveSettings::automatictransitions());
m_buttonAutomaticTransition->setChecked(KdenliveSettings::automatictransitions());
}
void MainWindow::slotDeleteItem()
{
......
......@@ -202,6 +202,7 @@ private:
QAction *m_buttonShowMarkers;
QAction *m_buttonFitZoom;
QAction *m_buttonAutomaticSplitAudio;
QAction *m_buttonAutomaticTransition;
QAction *m_normalEditTool;
QAction *m_overwriteEditTool;
QAction *m_insertEditTool;
......@@ -285,6 +286,7 @@ private slots:
void slotSwitchSplitAudio(bool enable);
void slotSwitchMarkersComments();
void slotSwitchSnap();
void slotSwitchAutomaticTransition();
void slotRenderProject();
void slotStopRenderProject();
void slotFullScreen();
......
......@@ -2938,7 +2938,12 @@ void CustomTrackView::slotAddTransition(ClipItem* /*clip*/, ItemInfo transitionI
void CustomTrackView::addTransition(const ItemInfo &transitionInfo, int endTrack, const QDomElement &params, bool refresh)
{
Transition *tr = new Transition(transitionInfo, endTrack, m_document->fps(), params, true);
// If transition is to be created from paste, then use that automatic setting.
// Otherwise, when no automatic setting is present, use the current configuration setting.
bool autotrans = params.attribute(QStringLiteral("automatic"),
KdenliveSettings::automatictransitions() ? QLatin1String("1") : QLatin1String("0"))
== QStringLiteral("1");
Transition *tr = new Transition(transitionInfo, endTrack, m_document->fps(), params, autotrans);
connect(tr, &AbstractClipItem::selectItem, this, &CustomTrackView::slotSelectItem);
tr->setPos(transitionInfo.startPos.frames(m_document->fps()), getPositionFromTrack(transitionInfo.track) + tr->itemOffset() + 1);
////qDebug() << "---- ADDING transition " << params.attribute("value");
......
......@@ -11,21 +11,27 @@
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0" colspan="4">
<widget class="QCheckBox" name="kcfg_ffmpegaudiothumbnails">
<property name="text">
<string>Use FFmpeg for audio thumbnails (faster)</string>
<item row="12" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>23</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_showmarkers">
<item row="4" column="0" colspan="3">
<widget class="QCheckBox" name="kcfg_verticalzoom">
<property name="text">
<string>Display clip markers comments</string>
<string>Zoom using vertical drag in ruler</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="4">
<item row="7" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
......@@ -62,6 +68,51 @@
</item>
</layout>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_autoscroll">
<property name="text">
<string>Autoscroll while playing</string>
</property>
</widget>
</item>
<item row="8" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Timeline clip and transition corners</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="kcfg_clipcornertype">
<item>
<property name="text">
<string>Rounded</string>
</property>
</item>
<item>
<property name="text">
<string>Straight</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="5" column="0" colspan="3">
<widget class="QCheckBox" name="kcfg_splitaudio">
<property name="text">
......@@ -69,17 +120,17 @@
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_autoscroll">
<item row="1" column="0" colspan="4">
<widget class="QCheckBox" name="kcfg_ffmpegaudiothumbnails">
<property name="text">
<string>Autoscroll while playing</string>
<string>Use FFmpeg for audio thumbnails (faster)</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QCheckBox" name="kcfg_verticalzoom">
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="kcfg_showmarkers">
<property name="text">
<string>Zoom using vertical drag in ruler</string>
<string>Display clip markers comments</string>
</property>
</widget>
</item>
......@@ -133,56 +184,12 @@
</layout>
</widget>
</item>
<item row="11" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>23</height>
</size>
<item row="6" column="0">
<widget class="QCheckBox" name="kcfg_automatictransitions">
<property name="text">
<string>Create new transitions as automatic transitions</string>
</property>
</spacer>
</item>
<item row="7" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Timeline clip and transition corners</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="kcfg_clipcornertype">
<item>
<property name="text">
<string>Rounded</string>
</property>
</item>
<item>
<property name="text">
<string>Straight</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
......
Supports Markdown
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