summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <jb@kdenlive.org>2016-09-14 08:25:52 (GMT)
committerJean-Baptiste Mardelle <jb@kdenlive.org>2016-09-14 08:25:52 (GMT)
commita4191ce71025e3c5e6dda12961f3404100ecd92d (patch)
tree811632b0f9c18d0e3e52da5aceb0d002353af353
parentcee1588f74b51c30b53f5a60217484751797c77f (diff)
Allow defining automatic property of transitions, patch by Harald Albrecht
REVIEW: 128879
-rw-r--r--data/pics/CMakeLists.txt2
-rw-r--r--src/icons.qrc1
-rw-r--r--src/kdenlivesettings.kcfg5
-rw-r--r--src/mainwindow.cpp15
-rw-r--r--src/mainwindow.h2
-rw-r--r--src/timeline/customtrackview.cpp7
-rw-r--r--src/ui/configtimeline_ui.ui135
7 files changed, 102 insertions, 65 deletions
diff --git a/data/pics/CMakeLists.txt b/data/pics/CMakeLists.txt
index fa90248..6b13031 100644
--- a/data/pics/CMakeLists.txt
+++ b/data/pics/CMakeLists.txt
@@ -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
diff --git a/src/icons.qrc b/src/icons.qrc
index 5297163..c3e7909 100644
--- a/src/icons.qrc
+++ b/src/icons.qrc
@@ -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>
diff --git a/src/kdenlivesettings.kcfg b/src/kdenlivesettings.kcfg
index 4d18750..5145fa2 100644
--- a/src/kdenlivesettings.kcfg
+++ b/src/kdenlivesettings.kcfg
@@ -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>
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index f815700..a9b4c2f 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -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()
{
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 2597185..95629ae 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -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();
diff --git a/src/timeline/customtrackview.cpp b/src/timeline/customtrackview.cpp
index c7ee8a0..5f377c3 100644
--- a/src/timeline/customtrackview.cpp
+++ b/src/timeline/customtrackview.cpp
@@ -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");
diff --git a/src/ui/configtimeline_ui.ui b/src/ui/configtimeline_ui.ui
index a56940f..165f903 100644
--- a/src/ui/configtimeline_ui.ui
+++ b/src/ui/configtimeline_ui.ui
@@ -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>