]> git.sesse.net Git - kdenlive/commitdiff
slideshow update
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 20 Jul 2008 19:06:45 +0000 (19:06 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 20 Jul 2008 19:06:45 +0000 (19:06 +0000)
svn path=/branches/KDE4/; revision=2332

12 files changed:
src/clipmanager.cpp
src/clipmanager.h
src/clipproperties.cpp
src/docclipbase.cpp
src/kdenlivedoc.cpp
src/kdenlivedoc.h
src/projectlist.cpp
src/renderer.cpp
src/slideshowclip.cpp
src/slideshowclip.h
src/widgets/clipproperties_ui.ui
src/widgets/slideshowclip_ui.ui

index 40a6485cc526fd6551779ad94839aecbcad760ef..2596e75d78eeac3e8f5666aa28032f33bc9023df 100644 (file)
@@ -131,7 +131,7 @@ void ClipManager::slotAddColorClipFile(const QString name, const QString color,
     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);
@@ -145,6 +145,7 @@ void ClipManager::slotAddSlideshowClipFile(const QString name, const QString pat
     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);
index 9c9b54c1b88726b56870642324adbad4471d9b70..32c3fbba35e5d863db7df0849dcf7a5510c59595 100644 (file)
@@ -51,7 +51,7 @@ Q_OBJECT public:
     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);
index 5383988fb13923316ddf23c073f193d6e155efdf..bcb697a28a1f09ac812daa2148065bd95e7ac029 100644 (file)
@@ -72,6 +72,7 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
         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);
index 4abf90fb613b2b98acc6e0bf5f6ab478949038c9..0cdc17a700aa4c2146d339cbdb94ad5d043d4453 100644 (file)
@@ -398,6 +398,10 @@ void DocClipBase::slotRefreshProducer() {
                 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");
@@ -407,6 +411,10 @@ void DocClipBase::slotRefreshProducer() {
                 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 {
@@ -430,7 +438,7 @@ void DocClipBase::setProperties(QMap <QString, QString> properties) {
     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());
index 0c1c6aa3182e6ea92215ee9dd2e4f783cf0e7a4e..c0fd48c37c4d81e7c662aabcbdef801f943460c3 100644 (file)
@@ -646,8 +646,8 @@ void KdenliveDoc::slotAddColorClipFile(const QString name, const QString color,
     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);
 }
 
index 897475084f0bbf01724ac33582bb303153673f73..e3a325a0437180ce5b800c60087bb7aba15afb17 100644 (file)
@@ -73,7 +73,7 @@ Q_OBJECT public:
     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);
index c93a703166fc4552a3149f648705aa4d843cdd7b..8cec2bcf47f99005e60add9490551db44ebf4c8a 100644 (file)
@@ -386,7 +386,7 @@ void ProjectList::slotAddSlideshowClip() {
             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;
 }
index 7166e75321c49b0abc72f79eaab6b3f2c1d79f88..324d03a33fb917ee20b40487394ad6f3234922f7 100644 (file)
@@ -437,6 +437,10 @@ void Render::getFileProperties(const QDomElement &xml, int clipId) {
                 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);
index 6fba36736f9e0ec17cb598015bbfed4f766f785b..56b75b00074bbc4468f35f97800ca9c97d0bc7c6 100644 (file)
@@ -83,6 +83,8 @@ void SlideshowClip::slotEnableLumaFile(int state) {
     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() {
@@ -150,6 +152,10 @@ int SlideshowClip::imageCount() const {
     return m_count;
 }
 
+int SlideshowClip::softness() const {
+    return m_view.luma_softness->value();
+}
+
 bool SlideshowClip::loop() const {
     return m_view.slide_loop->isChecked();
 }
index 024d008fad65344367d61dab4b277713711e1045..116219ea8477a1a375365dceaddf9af61bb23ea1 100644 (file)
@@ -42,6 +42,7 @@ public:
     bool loop() const;
     bool fade() const;
     QString lumaFile() const;
+    int softness() const;
 
 private slots:
     void parseFolder();
index 4f23f5fbdd547a8abf417e8d960e204bfeb3a2a3..2aded4a9da2615cc84250d27d47ad8ed510f7dc8 100644 (file)
@@ -6,7 +6,7 @@
     <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" >
index c818c54713c729b37d0a36bff1435529e8da718e..c86e02b264fb54cd97e85dd047fe8827e842008b 100644 (file)
@@ -5,8 +5,8 @@
    <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>