m_doc->commandStack()->push(command);
}
-void ClipManager::slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, QString group, const int groupId) {
+void ClipManager::slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const int softness, QString group, const int groupId) {
QDomDocument doc;
QDomElement prod = doc.createElement("producer");
prod.setAttribute("resource", path);
prod.setAttribute("name", name);
prod.setAttribute("loop", loop);
prod.setAttribute("fade", fade);
+ prod.setAttribute("softness", QString::number(softness));
prod.setAttribute("luma_file", luma_file);
if (!group.isEmpty()) {
prod.setAttribute("groupname", group);
void slotAddClipFile(const KUrl url, const QString group, const int groupId);
void slotAddTextClipFile(const QString path, const QString xml, const QString group, const int groupId);
void slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const int groupId);
- void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const QString group, const int groupId);
+ void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const int softness, const QString group, const int groupId);
DocClipBase *getClipById(int clipId);
void slotDeleteClip(uint clipId);
void setThumbsProgress(const QString &message, int progress);
m_view.image_type->addItems(types);
m_view.slide_loop->setChecked(props.value("loop").toInt());
m_view.slide_fade->setChecked(props.value("fade").toInt());
+ m_view.luma_softness->setValue(props.value("softness").toInt());
QString path = props.value("resource");
if (path.endsWith("png")) m_view.image_type->setCurrentIndex(TYPE_PNG);
else if (path.endsWith("bmp")) m_view.image_type->setCurrentIndex(TYPE_BMP);
char *tmp = (char *) qstrdup(resource.toUtf8().data());
filter->set("luma.resource", tmp);
delete[] tmp;
+ if (getProperty("softness") != QString()) {
+ int soft = getProperty("softness").toInt();
+ filter->set("luma.softness", (double) soft / 100.0);
+ }
} else {
// filter does not exist, create it...
Mlt::Filter *filter = new Mlt::Filter(*(m_clipProducer->profile()), "luma");
char *tmp = (char *) qstrdup(resource.toUtf8().data());
filter->set("luma.resource", tmp);
delete[] tmp;
+ if (getProperty("softness") != QString()) {
+ int soft = getProperty("softness").toInt();
+ filter->set("luma.softness", (double) soft / 100.0);
+ }
clipService.attach(*filter);
}
} else {
QMapIterator<QString, QString> i(properties);
bool refreshProducer = false;
QStringList keys;
- keys << "luma_duration" << "luma_file" << "fade" << "ttl";
+ keys << "luma_duration" << "luma_file" << "fade" << "ttl" << "softness";
while (i.hasNext()) {
i.next();
m_properties.insert(i.key(), i.value());
setModified(true);
}
-void KdenliveDoc::slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const QString group, const int groupId) {
- m_clipManager->slotAddSlideshowClipFile(name, path, count, duration, loop, fade, luma_duration, luma_file, group, groupId);
+void KdenliveDoc::slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const int softness, const QString group, const int groupId) {
+ m_clipManager->slotAddSlideshowClipFile(name, path, count, duration, loop, fade, luma_duration, luma_file, softness, group, groupId);
setModified(true);
}
void slotDeleteFolder(const QString folderName, const int id);
void slotEditFolder(const QString folderName, const QString oldfolderName, int clipId);
void slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const int groupId = -1);
- void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const QString group, const int groupId = -1);
+ void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const int softness, const QString group, const int groupId = -1);
void deleteClip(const uint clipId);
int getFramePos(QString duration);
DocClipBase *getBaseClip(int clipId);
groupId = item->clipId();
}
- m_doc->slotAddSlideshowClipFile(dia->clipName(), dia->selectedPath(), dia->imageCount(), dia->clipDuration(), dia->loop(), dia->fade(), dia->lumaDuration(), dia->lumaFile(), group, groupId);
+ m_doc->slotAddSlideshowClipFile(dia->clipName(), dia->selectedPath(), dia->imageCount(), dia->clipDuration(), dia->loop(), dia->fade(), dia->lumaDuration(), dia->lumaFile(), dia->softness(),group, groupId);
}
delete dia;
}
char *tmp = decodedString(xml.attribute("luma_file"));
filter->set("luma.resource", tmp);
delete[] tmp;
+ if (xml.hasAttribute("softness")) {
+ int soft = xml.attribute("softness").toInt();
+ filter->set("luma.softness", (double) soft / 100.0);
+ }
}
Mlt::Service clipService(producer->get_service());
clipService.attach(*filter);
bool enable = false;
if (state == Qt::Checked) enable = true;
m_view.luma_file->setEnabled(enable);
+ m_view.luma_softness->setEnabled(enable);
+ m_view.label_softness->setEnabled(enable);
}
void SlideshowClip::parseFolder() {
return m_count;
}
+int SlideshowClip::softness() const {
+ return m_view.luma_softness->value();
+}
+
bool SlideshowClip::loop() const {
return m_view.slide_loop->isChecked();
}
bool loop() const;
bool fade() const;
QString lumaFile() const;
+ int softness() const;
private slots:
void parseFolder();
<x>0</x>
<y>0</y>
<width>315</width>
- <height>440</height>
+ <height>469</height>
</rect>
</property>
<property name="windowTitle" >
<rect>
<x>0</x>
<y>0</y>
- <width>288</width>
- <height>210</height>
+ <width>299</width>
+ <height>223</height>
</rect>
</property>
<attribute name="title" >
<rect>
<x>0</x>
<y>0</y>
- <width>288</width>
- <height>210</height>
+ <width>299</width>
+ <height>223</height>
</rect>
</property>
<attribute name="title" >
<rect>
<x>0</x>
<y>0</y>
- <width>288</width>
- <height>210</height>
+ <width>299</width>
+ <height>223</height>
</rect>
</property>
<attribute name="title" >
<x>0</x>
<y>0</y>
<width>299</width>
- <height>194</height>
+ <height>223</height>
</rect>
</property>
<attribute name="title" >
<item row="4" column="1" >
<widget class="KComboBox" name="luma_file" />
</item>
- <item row="5" column="0" colspan="2" >
+ <item row="6" column="0" colspan="2" >
<widget class="QLabel" name="slide_info" >
<property name="text" >
<string>No image found</string>
</property>
</widget>
</item>
- <item row="6" column="1" >
+ <item row="7" column="1" >
<spacer name="verticalSpacer_6" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
</spacer>
</item>
+ <item row="5" column="1" >
+ <widget class="QSlider" name="luma_softness" >
+ <property name="maximum" >
+ <number>100</number>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QLabel" name="label_15" >
+ <property name="text" >
+ <string>Softness</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<widget class="QWidget" name="tab_3" >
<rect>
<x>0</x>
<y>0</y>
- <width>288</width>
- <height>210</height>
+ <width>299</width>
+ <height>223</height>
</rect>
</property>
<attribute name="title" >
<rect>
<x>0</x>
<y>0</y>
- <width>288</width>
- <height>210</height>
+ <width>299</width>
+ <height>223</height>
</rect>
</property>
<attribute name="title" >
<rect>
<x>0</x>
<y>0</y>
- <width>251</width>
- <height>392</height>
+ <width>252</width>
+ <height>415</height>
</rect>
</property>
<property name="windowTitle" >
</property>
</widget>
</item>
- <item row="7" column="0" >
+ <item row="5" column="1" >
+ <widget class="KRestrictedLine" name="luma_duration" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="inputMask" >
+ <string>99:99:99:99; </string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" >
<widget class="QCheckBox" name="luma_fade" >
<property name="enabled" >
<bool>false</bool>
</property>
</widget>
</item>
- <item row="7" column="1" >
+ <item row="6" column="1" >
<widget class="KComboBox" name="luma_file" >
<property name="enabled" >
<bool>false</bool>
</property>
</widget>
</item>
+ <item row="7" column="0" >
+ <widget class="QLabel" name="label_softness" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Softness</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="1" >
+ <widget class="QSlider" name="luma_softness" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="maximum" >
+ <number>100</number>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
<item row="8" column="0" colspan="2" >
<widget class="KListWidget" name="icon_list" />
</item>
</property>
</widget>
</item>
- <item row="5" column="1" >
- <widget class="KRestrictedLine" name="luma_duration" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="inputMask" >
- <string>99:99:99:99; </string>
- </property>
- </widget>
- </item>
</layout>
</widget>
<customwidgets>