]> git.sesse.net Git - kdenlive/commitdiff
config option to normalise audio for thumbnails + small cleanup
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 5 Mar 2008 11:42:50 +0000 (11:42 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 5 Mar 2008 11:42:50 +0000 (11:42 +0000)
svn path=/branches/KDE4/; revision=1998

src/kdenlivesettings.kcfg
src/kthumb.cpp
src/widgets/configdisplay_ui.ui

index 03f686a5abbfa501fefefd915b0d591e08c34888..c3580d3355c64e7647aea9dddd24d260f2320c3a 100644 (file)
       <default>true</default>
     </entry>
 
+    <entry name="normaliseaudiothumbs" type="Bool">
+      <label>Normalise audio before creating thumbnails.</label>
+      <default>true</default>
+    </entry>
+
     <entry name="autoscroll" type="Bool">
       <label>Auto scroll timeline while playing.</label>
       <default>true</default>
index 50593bd5597568eb7b7388d47bae2d04dc1b0279..5842375b7e21eb1808693c0bd4c66712dde962ec 100644 (file)
@@ -66,19 +66,19 @@ void MyThread::run() {
     if (!f.open(QIODevice::WriteOnly)) {
         kDebug() << "++++++++  ERROR WRITING TO FILE: " << f.fileName() << endl;
         kDebug() << "++++++++  DISABLING AUDIO THUMBS" << endl;
-        //TODO KdenliveSettings::setAudiothumbnails(false);
+        KdenliveSettings::setAudiothumbnails(false);
         return;
     }
     m_isWorking = true;
-    Mlt::Profile prof((char*) qstrdup(KdenliveSettings::current_profile().toUtf8()));
+    Mlt::Profile prof((char*) KdenliveSettings::current_profile().toUtf8().data());
     Mlt::Producer m_producer(prof, m_url.path().toUtf8().data());
 
 
-    /*TODO if (KdenliveSettings::normaliseaudiothumbs()) {
+    if (KdenliveSettings::normaliseaudiothumbs()) {
             Mlt::Filter m_convert(prof,"volume");
             m_convert.set("gain", "normalise");
             m_producer.attach(m_convert);
-    }*/
+    }
 
     //QApplication::postEvent(m_parent, new ProgressEvent(-1, (QEvent::Type)10005));
 
@@ -158,7 +158,7 @@ QPixmap KThumb::getImage(KUrl url, int width, int height) {
     char *tmp = Render::decodedString(url.path());
     Mlt::Profile prof((char*) KdenliveSettings::current_profile().data());
     Mlt::Producer m_producer(prof, tmp);
-    delete tmp;
+    delete[] tmp;
 
     if (m_producer.is_blank()) {
         pix.fill(Qt::black);
@@ -187,7 +187,7 @@ void KThumb::extractImage(int frame, int frame2) {
     QPixmap pix(m_width, m_height);
     char *tmp = Render::decodedString(m_url.path());
     Mlt::Producer m_producer(*m_profile, tmp);
-    delete tmp;
+    delete[] tmp;
 
     if (m_producer.is_blank()) {
         pix.fill(Qt::black);
index 5f5eca0756b609bfdec211c4105c7036a6992075..1f0645aae19d8ef2f838a92c46004d113b02d880 100644 (file)
@@ -5,39 +5,25 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>306</width>
-    <height>107</height>
+    <width>348</width>
+    <height>187</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout_2" >
    <item row="0" column="0" >
     <widget class="QGroupBox" name="groupBox" >
      <property name="title" >
-      <string>Timeline</string>
+      <string>Thumbnails</string>
      </property>
      <layout class="QGridLayout" name="gridLayout" >
       <item row="0" column="0" >
-       <widget class="QLabel" name="label_2" >
-        <property name="text" >
-         <string>Thumbnails:</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1" >
        <widget class="QCheckBox" name="kcfg_videothumbnails" >
         <property name="text" >
          <string>Video</string>
         </property>
        </widget>
       </item>
-      <item row="0" column="2" >
-       <widget class="QCheckBox" name="kcfg_audiothumbnails" >
-        <property name="text" >
-         <string>Audio</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="3" >
+      <item row="0" column="1" >
        <spacer name="horizontalSpacer" >
         <property name="orientation" >
          <enum>Qt::Horizontal</enum>
         </property>
        </spacer>
       </item>
-      <item row="1" column="0" colspan="2" >
-       <widget class="QCheckBox" name="kcfg_autoscroll" >
+      <item row="1" column="0" >
+       <widget class="QCheckBox" name="kcfg_audiothumbnails" >
+        <property name="text" >
+         <string>Audio</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1" >
+       <widget class="QCheckBox" name="kcfg_normaliseaudiothumbs" >
         <property name="text" >
-         <string>Autoscroll while playing</string>
+         <string>Normalise audio for thumbnails</string>
         </property>
        </widget>
       </item>
     </widget>
    </item>
    <item row="1" column="0" >
+    <widget class="QCheckBox" name="kcfg_autoscroll" >
+     <property name="text" >
+      <string>Autoscroll while playing</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0" >
     <spacer name="verticalSpacer" >
      <property name="orientation" >
       <enum>Qt::Vertical</enum>