[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdenlive] src: Merge branch '16.12'
From:       Jean-Baptiste Mardelle <null () kde ! org>
Date:       2017-02-04 15:39:38
Message-ID: E1ca2R8-0001MI-CW () code ! kde ! org
[Download RAW message or body]

Git commit adbdc888eb39b0bb6b65856c8d2bda280fb89a12 by Jean-Baptiste Mardelle.
Committed on 04/02/2017 at 15:39.
Pushed by mardelle into branch 'master'.

Merge branch '16.12'

M  +1    -1    src/bin/projectclip.cpp
M  +16   -0    src/dialogs/clipcreationdialog.cpp
M  +15   -0    src/dialogs/kdenlivesettingsdialog.cpp
M  +3    -4    src/doc/kthumb.cpp
M  +1    -1    src/doc/kthumb.h
M  +3    -1    src/effectslist/initeffects.cpp
M  +8    -4    src/effectstack/graphicsscenerectmove.cpp
M  +2    -1    src/effectstack/graphicsscenerectmove.h
M  +4    -0    src/kdenlivesettings.kcfg
M  +6    -5    src/mltcontroller/producerqueue.cpp
M  +1    -1    src/monitor/monitor.cpp
M  +0    -1    src/timeline/transitionhandler.cpp

https://commits.kde.org/kdenlive/adbdc888eb39b0bb6b65856c8d2bda280fb89a12

diff --cc src/bin/projectclip.cpp
index 29be9b029,dd5d1003e..c9d3a7c4a
--- a/src/bin/projectclip.cpp
+++ b/src/bin/projectclip.cpp
@@@ -961,12 -916,12 +961,12 @@@ void ProjectClip::doExtractImage(
              emit thumbReady(pos, img);
              continue;
          }
 -	prod->seek(pos);
 -	Mlt::Frame *frame = prod->get_frame();
 +        prod->seek(pos);
 +        Mlt::Frame *frame = prod->get_frame();
          frame->set("deinterlace_method", "onefield");
 -        frame->set("top_field_first", -1 );
 -	if (frame && frame->is_valid()) {
 +        frame->set("top_field_first", -1);
 +        if (frame && frame->is_valid()) {
-             img = KThumb::getFrame(frame, frameWidth, 150);
+             img = KThumb::getFrame(frame, frameWidth, 150, prod->profile()->sar() \
!= 1);  bin()->cachePixmap(path, img);
              emit thumbReady(pos, img);
          }
diff --cc src/dialogs/kdenlivesettingsdialog.cpp
index 517e047ba,91bcee8d6..d8706a5b0
--- a/src/dialogs/kdenlivesettingsdialog.cpp
+++ b/src/dialogs/kdenlivesettingsdialog.cpp
@@@ -113,8 -115,13 +114,13 @@@ KdenliveSettingsDialog::KdenliveSetting
      m_configEnv.libraryfolderurl->lineEdit()->setObjectName(QStringLiteral("kcfg_libraryfolder"));
                
      m_configEnv.libraryfolderurl->setEnabled(!KdenliveSettings::librarytodefaultfolder());
                
      m_configEnv.kcfg_librarytodefaultfolder->setToolTip(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) \
                + QStringLiteral("/library"));
 -    connect(m_configEnv.kcfg_librarytodefaultfolder, SIGNAL(clicked()), this, \
SLOT(slotEnableLibraryFolder()));  +    \
connect(m_configEnv.kcfg_librarytodefaultfolder, &QAbstractButton::clicked, this, \
&KdenliveSettingsDialog::slotEnableLibraryFolder);  
+     // Mime types
+     QStringList mimes = ClipCreationDialog::getExtensions();
+     qSort(mimes);
+     m_configEnv.supportedmimes->setPlainText(mimes.join(QStringLiteral(" ")));
+ 
      m_page2 = addPage(p2, i18n("Environment"));
      m_page2->setIcon(KoIconUtils::themedIcon(QStringLiteral("application-x-executable-script")));
  
@@@ -868,22 -863,28 +874,31 @@@ void KdenliveSettingsDialog::updateSett
  
      bool restart = false;
      if (m_configSdl.kcfg_gpu_accel->isChecked() != KdenliveSettings::gpu_accel()) {
 -	// GPU setting was changed, we need to restart Kdenlive or everything will be \
                corrupted
 -	if (KMessageBox::warningContinueCancel(this, i18n("Kdenlive must be restarted to \
                change this setting")) == KMessageBox::Continue) {
 -	    restart = true;
 -	}
 -	else {
 -	    m_configSdl.kcfg_gpu_accel->setChecked(KdenliveSettings::gpu_accel());
 -	}
 +        // GPU setting was changed, we need to restart Kdenlive or everything will \
be corrupted  +        if (KMessageBox::warningContinueCancel(this, i18n("Kdenlive \
must be restarted to change this setting")) == KMessageBox::Continue) {  +            \
restart = true;  +        } else {
 +            m_configSdl.kcfg_gpu_accel->setChecked(KdenliveSettings::gpu_accel());
 +        }
      }
  
+     // Mimes
+     if (m_configEnv.kcfg_addedExtensions->text() != \
KdenliveSettings::addedExtensions()) { +         // Update list
+         KdenliveSettings::setAddedExtensions(m_configEnv.kcfg_addedExtensions->text());
 +         QStringList mimes = ClipCreationDialog::getExtensions();
+         qSort(mimes);
+         m_configEnv.supportedmimes->setPlainText(mimes.join(QStringLiteral(" ")));
+     }
+ 
      KConfigDialog::settingsChangedSlot();
      //KConfigDialog::updateSettings();
 -    if (resetProfile) emit doResetProfile();
 -    if (restart) emit restartKdenlive();
 +    if (resetProfile) {
 +        emit doResetProfile();
 +    }
 +    if (restart) {
 +        emit restartKdenlive();
 +    }
      emit checkTabPosition();
  }
  
diff --cc src/doc/kthumb.cpp
index ce9c91644,eb633e258..4d6d178ae
--- a/src/doc/kthumb.cpp
+++ b/src/doc/kthumb.cpp
@@@ -84,20 -80,20 +84,19 @@@ QImage KThumb::getFrame(Mlt::Producer *
      return p;
  }
  
 -
  //static
- QImage KThumb::getFrame(Mlt::Frame *frame, int width, int height)
+ QImage KThumb::getFrame(Mlt::Frame *frame, int width, int height, bool \
forceRescale)  {
 -    if (frame == NULL || !frame->is_valid()) {
 +    if (frame == nullptr || !frame->is_valid()) {
          QImage p(width, height, QImage::Format_ARGB32_Premultiplied);
          p.fill(QColor(Qt::red).rgb());
          return p;
      }
-     int ow = width;
-     int oh = height;
+     int ow = forceRescale ? 0 : width;
+     int oh = forceRescale ? 0 : height;
      mlt_image_format format = mlt_image_rgb24a;
-     //frame->set("progressive", "1");
      ow += ow % 2;
 -    const uchar* imagedata = frame->get_image(format, ow, oh);
 +    const uchar *imagedata = frame->get_image(format, ow, oh);
      if (imagedata) {
          QImage image(ow, oh, QImage::Format_RGBA8888);
          memcpy(image.bits(), imagedata, ow * oh * 4);
diff --cc src/doc/kthumb.h
index a610df6ed,a36e8f647..4c495bc47
--- a/src/doc/kthumb.h
+++ b/src/doc/kthumb.h
@@@ -35,14 -36,14 +35,14 @@@ class Frame
  
  namespace KThumb
  {
 -    QPixmap getImage(const QUrl &url, int width, int height = -1);
 -    QPixmap getImage(const QUrl &url, int frame, int width, int height = -1);
 -    QImage getFrame(Mlt::Producer *producer, int framepos, int displayWidth, int \
                height);
 -    QImage getFrame(Mlt::Frame *frame, int width, int height, bool forceRescale = \
                false);
 -    /** @brief Calculates image variance, useful to know if a thumbnail is \
                interesting. 
 -     *  @return an integer between 0 and 100. 0 means no variance, eg. black image \
                while bigger values mean contrasted image
 -     * */
 -    uint imageVariance(const QImage &image);
 +QPixmap getImage(const QUrl &url, int width, int height = -1);
 +QPixmap getImage(const QUrl &url, int frame, int width, int height = -1);
 +QImage getFrame(Mlt::Producer *producer, int framepos, int displayWidth, int \
                height);
- QImage getFrame(Mlt::Frame *frame, int width, int height);
++QImage getFrame(Mlt::Frame *frame, int width, int height, bool forceRescale = \
false);  +/** @brief Calculates image variance, useful to know if a thumbnail is \
interesting.  + *  @return an integer between 0 and 100. 0 means no variance, eg. \
black image while bigger values mean contrasted image  + * */
 +uint imageVariance(const QImage &image);
  };
  
  #endif
diff --cc src/effectslist/initeffects.cpp
index 6f3f52ebf,61110036b..c0efabd78
--- a/src/effectslist/initeffects.cpp
+++ b/src/effectslist/initeffects.cpp
@@@ -785,12 -756,14 +785,14 @@@ void initEffects::fillTransitionsList(M
                  tname.appendChild(ret.createTextNode(i18n("Composite")));
                  desc.appendChild(ret.createTextNode(i18n("A key-framable \
alpha-channel compositor for two frames.")));  \
paramList.append(quickParameterFill(ret, i18n("Geometry"), \
QStringLiteral("geometry"), QStringLiteral("geometry"), \
QStringLiteral("0%/0%:100%x100%:100"), QStringLiteral("-500;-500;-500;-500;0"), \
                QStringLiteral("500;500;500;500;100")));
 -                paramList.append(quickParameterFill(ret, i18n("Alpha Channel \
Operation"), QStringLiteral("operator"), QStringLiteral("list"), \
QStringLiteral("over"), QLatin1String(""), QLatin1String(""), \
QStringLiteral("over,and,or,xor"), i18n("Over,And,Or,Xor")));  +                \
paramList.append(quickParameterFill(ret, i18n("Alpha Channel Operation"), \
QStringLiteral("operator"), QStringLiteral("list"), QStringLiteral("over"), \
                QString(), QString(), QStringLiteral("over,and,or,xor"), \
                i18n("Over,And,Or,Xor")));
-                 paramList.append(quickParameterFill(ret, i18n("Align"), \
QStringLiteral("aligned"), QStringLiteral("bool"), QStringLiteral("0"), \
QStringLiteral("0"), QStringLiteral("1"))); +                 \
paramList.append(quickParameterFill(ret, i18n("Align"), QStringLiteral("aligned"), \
QStringLiteral("bool"), QStringLiteral("1"), QStringLiteral("0"), \
QStringLiteral("1"))); +                 paramList.append(quickParameterFill(ret, \
i18n("Align"), QStringLiteral("valign"), QStringLiteral("fixed"), \
QStringLiteral("middle"), QStringLiteral("middle"), QStringLiteral("middle"))); +     \
paramList.append(quickParameterFill(ret, i18n("Align"), QStringLiteral("halign"), \
QStringLiteral("fixed"), QStringLiteral("centre"), QStringLiteral("centre"), \
QStringLiteral("centre")));  paramList.append(quickParameterFill(ret, i18n("Fill"), \
QStringLiteral("fill"), QStringLiteral("bool"), QStringLiteral("1"), \
QStringLiteral("0"), QStringLiteral("1")));  paramList.append(quickParameterFill(ret, \
i18n("Distort"), QStringLiteral("distort"), QStringLiteral("bool"), \
                QStringLiteral("0"), QStringLiteral("0"), QStringLiteral("1")));
 -                paramList.append(quickParameterFill(ret, i18n("Wipe Method"), \
QStringLiteral("luma"), QStringLiteral("list"), QLatin1String(""), QLatin1String(""), \
                QLatin1String(""), QStringLiteral("%lumaPaths"), QLatin1String("")));
 -                paramList.append(quickParameterFill(ret, i18n("Wipe Softness"), \
QStringLiteral("softness"), QStringLiteral("double"), QStringLiteral("0"), \
QStringLiteral("0"), QStringLiteral("100"), QLatin1String(""), QLatin1String(""), \
QStringLiteral("100")));  +                paramList.append(quickParameterFill(ret, \
i18n("Wipe Method"), QStringLiteral("luma"), QStringLiteral("list"), QString(), \
QString(), QString(), QStringLiteral("%lumaPaths"), QString()));  +                \
paramList.append(quickParameterFill(ret, i18n("Wipe Softness"), \
QStringLiteral("softness"), QStringLiteral("double"), QStringLiteral("0"), \
QStringLiteral("0"), QStringLiteral("100"), QString(), QString(), \
QStringLiteral("100")));  paramList.append(quickParameterFill(ret, i18n("Wipe \
Invert"), QStringLiteral("luma_invert"), QStringLiteral("bool"), QStringLiteral("0"), \
QStringLiteral("0"), QStringLiteral("1")));  paramList.append(quickParameterFill(ret, \
i18n("Force Progressive Rendering"), QStringLiteral("progressive"), \
QStringLiteral("bool"), QStringLiteral("1"), QStringLiteral("0"), \
QStringLiteral("1")));  paramList.append(quickParameterFill(ret, i18n("Force \
Deinterlace Overlay"), QStringLiteral("deinterlace"), QStringLiteral("bool"), \
                QStringLiteral("0"), QStringLiteral("0"), QStringLiteral("1")));
diff --cc src/effectstack/graphicsscenerectmove.cpp
index 4f84c7120,014cdfdcd..a3f5dc056
--- a/src/effectstack/graphicsscenerectmove.cpp
+++ b/src/effectstack/graphicsscenerectmove.cpp
@@@ -695,12 -670,15 +694,15 @@@ void GraphicsSceneRectMove::mousePressE
                  break;
              }
          }
 -        if (item == NULL || (e->modifiers() != Qt::ShiftModifier && \
!alreadySelected)) {  +        if (item == nullptr || (e->modifiers() != \
Qt::ShiftModifier && !alreadySelected)) {  clearTextSelection();
-         } else if (item && item->flags() & QGraphicsItem::ItemIsMovable) {
+         } else if (e->modifiers() & Qt::ShiftModifier) {
+             clearTextSelection(false);
+         }
+         if (item && item->flags() & QGraphicsItem::ItemIsMovable) {
              m_sceneClickPoint = e->scenePos();
              m_selectedItem = item;
 -            //qDebug() << "/////////  ITEM TYPE: " << item->type();
 +            //qCDebug(KDENLIVE_LOG) << "/////////  ITEM TYPE: " << item->type();
              if (item->type() == QGraphicsTextItem::Type) {
                  MyTextItem *t = static_cast<MyTextItem *>(item);
                  if (t->textInteractionFlags() == Qt::TextEditorInteraction) {
@@@ -765,10 -742,10 +767,10 @@@
          m_selectedItem->setSelected(true);
          m_createdText = true;
      }
 -    //qDebug() << "//////  MOUSE CLICK, RESIZE MODE: " << m_resizeMode;
 +    //qCDebug(KDENLIVE_LOG) << "//////  MOUSE CLICK, RESIZE MODE: " << \
m_resizeMode;  }
  
- void GraphicsSceneRectMove::clearTextSelection()
+ void GraphicsSceneRectMove::clearTextSelection(bool reset)
  {
      if (m_selectedItem && m_selectedItem->type() == QGraphicsTextItem::Type) {
          // disable text editing
@@@ -778,11 -755,13 +780,14 @@@
          t->setTextCursor(QTextCursor(cur));
          t->setTextInteractionFlags(Qt::NoTextInteraction);
      }
 -    m_selectedItem = NULL;
 +    m_selectedItem = nullptr;
 +    clearSelection();
+     if (reset) {
+         clearSelection();
+     }
  }
  
 -void GraphicsSceneRectMove::mouseMoveEvent(QGraphicsSceneMouseEvent* e)
 +void GraphicsSceneRectMove::mouseMoveEvent(QGraphicsSceneMouseEvent *e)
  {
      QList<QGraphicsView*> viewlist = views();
      if (viewlist.isEmpty()) {
diff --cc src/mltcontroller/producerqueue.cpp
index 7a949a890,95be8c306..6d136a467
--- a/src/mltcontroller/producerqueue.cpp
+++ b/src/mltcontroller/producerqueue.cpp
@@@ -485,12 -481,10 +486,12 @@@ void ProducerQueue::processFileProperti
                      }
                      delete glProd;
                  } else {
 -                    if (frameNumber > 0) producer->seek(frameNumber);
 +                    if (frameNumber > 0) {
 +                        producer->seek(frameNumber);
 +                    }
                      frame = producer->get_frame();
                      if (frame && frame->is_valid()) {
-                         img = KThumb::getFrame(frame, fullWidth, info.imageHeight);
+                         img = KThumb::getFrame(frame, fullWidth, info.imageHeight, \
forceThumbScale);  emit replyGetImage(info.clipId, img);
                      }
                  }
@@@ -683,10 -660,11 +684,10 @@@
                      img = KThumb::getFrame(frame, fullWidth, info.imageHeight);
                      delete glProd;
                  } else {
-                     img = KThumb::getFrame(frame, fullWidth, info.imageHeight);
+                     img = KThumb::getFrame(frame, fullWidth, info.imageHeight, \
forceThumbScale);  }
                  emit replyGetImage(info.clipId, img);
 -            }
 -            else {
 +            } else {
                  filePropertyMap[QStringLiteral("frame_size")] = \
QString::number(frame->get_int("width")) + 'x' + \
QString::number(frame->get_int("height"));  int af = \
frame->get_int("audio_frequency");  int ac = frame->get_int("audio_channels");
@@@ -727,20 -694,21 +728,20 @@@
                          tmpProd->attach(scaler);
                          tmpProd->attach(converter);
                          frame = tmpProd->get_frame();
 -                    }
 -                    else {
 +                    } else {
                          tmpProd = producer;
                      }
-                     QImage img = KThumb::getFrame(frame, fullWidth, \
info.imageHeight); +                     QImage img = KThumb::getFrame(frame, \
fullWidth, info.imageHeight, forceThumbScale);  if (frameNumber == -1) {
                          // No user specipied frame, look for best one
                          int variance = KThumb::imageVariance(img);
                          if (variance < 6) {
                              // Thumbnail is not interesting (for example all black, \
seek to fetch better thumb  delete frame;
 -                            frameNumber =  duration > 100 ? 100 : duration / 2 ;
 +                            frameNumber =  duration > 100 ? 100 : duration / 2;
                              tmpProd->seek(frameNumber);
                              frame = tmpProd->get_frame();
-                             img = KThumb::getFrame(frame, fullWidth, \
info.imageHeight); +                             img = KThumb::getFrame(frame, \
fullWidth, info.imageHeight, forceThumbScale);  }
                      }
                      if (KdenliveSettings::gpu_accel()) {
diff --cc src/monitor/monitor.cpp
index 18cd051fd,a1c1ad99f..f7a5c3c3a
--- a/src/monitor/monitor.cpp
+++ b/src/monitor/monitor.cpp
@@@ -531,12 -520,12 +531,12 @@@ void Monitor::slotForceSize(QAction *a
      if (resizeType > 0) {
          // calculate size
          QRect r = QApplication::desktop()->screenGeometry();
-         profileWidth = m_glMonitor->profileSize().width() * resizeType / 100;
          profileHeight = m_glMonitor->profileSize().height() * resizeType / 100;
+         profileWidth = m_glMonitor->profile()->dar() * profileHeight;
          if (profileWidth > r.width() * 0.8 || profileHeight > r.height() * 0.7) {
              // reset action to free resize
 -            QList< QAction * > list = m_forceSize->actions ();
 -            foreach(QAction *ac, list) {
 +            QList< QAction * > list = m_forceSize->actions();
 +            foreach (QAction *ac, list) {
                  if (ac->data().toInt() == m_forceSizeFactor) {
                      m_forceSize->setCurrentAction(ac);
                      break;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic