]> git.sesse.net Git - kdenlive/commitdiff
Fix timecode widget sometimes emitting value changed twice causing unnecessary refresh
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 14 Nov 2012 08:30:44 +0000 (09:30 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 14 Nov 2012 08:30:44 +0000 (09:30 +0100)
src/clipdurationdialog.cpp
src/geometryval.cpp
src/geometrywidget.cpp
src/kthumb.cpp
src/markerdialog.cpp
src/monitor.cpp
src/positionedit.cpp
src/simplekeyframes/simplekeyframewidget.cpp
src/timecodedisplay.cpp
src/timecodedisplay.h

index a9fbb934af4bc0228d55598b2cb703e2dcf6e76c..69436e2619a44d1403b54d200d9ef554f503fca1 100644 (file)
@@ -68,10 +68,10 @@ ClipDurationDialog::ClipDurationDialog(AbstractClipItem *clip, Timecode tc, GenT
     m_cropStart->setValue(m_clip->cropStart());
     m_cropEnd->setValue(m_clip->maxDuration() - m_clip->cropDuration() - m_clip->cropStart());
 
-    connect(m_pos,       SIGNAL(editingFinished()), this, SLOT(slotCheckStart()));
-    connect(m_dur,       SIGNAL(editingFinished()), this, SLOT(slotCheckDuration()));
-    connect(m_cropStart, SIGNAL(editingFinished()), this, SLOT(slotCheckCrop()));
-    connect(m_cropEnd,   SIGNAL(editingFinished()), this, SLOT(slotCheckEnd()));
+    connect(m_pos,       SIGNAL(timeCodeEditingFinished()), this, SLOT(slotCheckStart()));
+    connect(m_dur,       SIGNAL(timeCodeEditingFinished()), this, SLOT(slotCheckDuration()));
+    connect(m_cropStart, SIGNAL(timeCodeEditingFinished()), this, SLOT(slotCheckCrop()));
+    connect(m_cropEnd,   SIGNAL(timeCodeEditingFinished()), this, SLOT(slotCheckEnd()));
 
     adjustSize();
 }
index f28cb1b54d24a64800387ed64b552c48bb237242..2c52f685779f5ebdea333507bb47eaa163c5b95e 100644 (file)
@@ -419,7 +419,7 @@ void Geometryval::setupParam(const QDomElement par, int minFrame, int maxFrame)
     slotUpdateGeometry();
     if (!m_fixedMode) {
         m_timePos.setRange(0, maxFrame - minFrame - 1);
-        connect(&m_timePos, SIGNAL(editingFinished()), this , SLOT(slotPositionChanged()));
+        connect(&m_timePos, SIGNAL(timeCodeEditingFinished()), this , SLOT(slotPositionChanged()));
     }
     connect(spinTransp, SIGNAL(valueChanged(int)), this , SLOT(slotTransparencyChanged(int)));
 }
index e92f029ce23668aa7d08041bb173be471587e752..d51c38cae84ba959d12f6504abbd96bf7842a07b 100644 (file)
@@ -90,7 +90,7 @@ GeometryWidget::GeometryWidget(Monitor* monitor, Timecode timecode, int clipPos,
     connect(m_timeline, SIGNAL(keyframeMoved(int)),   this, SLOT(slotKeyframeMoved(int)));
     connect(m_timeline, SIGNAL(addKeyframe(int)),     this, SLOT(slotAddKeyframe(int)));
     connect(m_timeline, SIGNAL(removeKeyframe(int)),  this, SLOT(slotDeleteKeyframe(int)));
-    connect(m_timePos, SIGNAL(editingFinished()), this, SLOT(slotPositionChanged()));
+    connect(m_timePos, SIGNAL(timeCodeEditingFinished()), this, SLOT(slotPositionChanged()));
     connect(m_ui.buttonPrevious,  SIGNAL(clicked()), this, SLOT(slotPreviousKeyframe()));
     connect(m_ui.buttonNext,      SIGNAL(clicked()), this, SLOT(slotNextKeyframe()));
     connect(m_ui.buttonAddDelete, SIGNAL(clicked()), this, SLOT(slotAddDeleteKeyframe()));
index 66cdad249224e5645b9bee69fbf85c481399d0e8..128b45060cb82945ae2ad663a2491faf0f8fc51e 100644 (file)
@@ -168,6 +168,9 @@ QImage KThumb::getProducerFrame(int framepos, int frameWidth, int displayWidth,
     QMutexLocker lock(&m_mutex);
     m_producer->seek(framepos);
     Mlt::Frame *frame = m_producer->get_frame();
+    /*frame->set("rescale.interp", "nearest");
+    frame->set("deinterlace_method", "onefield");
+    frame->set("top_field_first", -1 );*/
     QImage p = getFrame(frame, frameWidth, displayWidth, height);
     delete frame;
     return p;
index e789cc150da12e57378b42263a7d5dc74dea1644..3402fb2b5fe3140a2a536295431297bf75036345 100644 (file)
@@ -93,7 +93,7 @@ MarkerDialog::MarkerDialog(DocClipBase *clip, CommentedTime t, Timecode tc, cons
             clip_thumb->setFixedHeight(p.height());
             clip_thumb->setPixmap(p);
         }
-        connect(m_in, SIGNAL(editingFinished()), this, SIGNAL(updateThumb()));
+        connect(m_in, SIGNAL(timeCodeEditingFinished()), this, SIGNAL(updateThumb()));
     } else {
         clip_thumb->setHidden(true);
     }
index 02a9d92178e064c5042f6b2431f67c13afcca86c..9a08767e208553c90c67db781fca65c10ac61b82 100644 (file)
@@ -202,7 +202,7 @@ Monitor::Monitor(Kdenlive::MONITORID id, MonitorManager *manager, QString profil
     m_toolbar->addWidget(spacer);
     m_timePos = new TimecodeDisplay(m_monitorManager->timecode(), this);
     m_toolbar->addWidget(m_timePos);
-    connect(m_timePos, SIGNAL(editingFinished()), this, SLOT(slotSeek()));
+    connect(m_timePos, SIGNAL(timeCodeEditingFinished()), this, SLOT(slotSeek()));
     m_toolbar->setMaximumHeight(s * 1.5);
     layout->addWidget(m_toolbar);
 }
index f03b8da3c8135a7dde1b4a4bbb7380b9de7e0fa3..aaeac222449168e8ade295294639362b566c573f 100644 (file)
@@ -46,7 +46,7 @@ PositionEdit::PositionEdit(const QString name, int pos, int min, int max, const
 
     connect(m_slider, SIGNAL(valueChanged(int)), m_display, SLOT(setValue(int)));
     connect(m_slider, SIGNAL(valueChanged(int)), this, SIGNAL(parameterChanged(int)));
-    connect(m_display, SIGNAL(editingFinished()), this, SLOT(slotUpdatePosition()));
+    connect(m_display, SIGNAL(timeCodeEditingFinished()), this, SLOT(slotUpdatePosition()));
     m_slider->setValue(pos);
 }
 
index 20ede65f9c381eba1f326575b6c5bb9a6b235c49..51651560e95e713ca6771fec23c8421a773dcd19 100644 (file)
@@ -60,7 +60,7 @@ SimpleKeyframeWidget::SimpleKeyframeWidget(Timecode t, int duration, QWidget *pa
     l->addWidget(m_buttonNext, 1, 2);
     l->addWidget(m_time, 1, 3, Qt::AlignRight);
 
-    connect(m_time, SIGNAL(editingFinished()), this, SLOT(slotSetPosition()));
+    connect(m_time, SIGNAL(timeCodeEditingFinished()), this, SLOT(slotSetPosition()));
     connect(m_timeline, SIGNAL(positionChanged(int)), this, SLOT(slotSetPosition(int)));
     connect(m_timeline, SIGNAL(atKeyframe(bool)), this, SLOT(slotAtKeyframe(bool)));
     connect(m_timeline, SIGNAL(keyframeAdded(int)), this, SIGNAL(keyframeAdded(int)));
index 93cf6d84ea2cdbe779957dcf5d8dc3c611872217..fe4ed4cb6a55a9b0090730d060bd434b03ee0ffe 100644 (file)
@@ -72,7 +72,6 @@ void TimecodeDisplay::stepBy(int steps)
 {
     int val = m_value + steps;
     setValue(val);
-    emit editingFinished();
 }
 
 void TimecodeDisplay::setTimeCodeFormat(bool frametimecode, bool init)
@@ -121,14 +120,12 @@ void TimecodeDisplay::mouseReleaseEvent(QMouseEvent *e)
     }
 }
 
-/*
+
 void TimecodeDisplay::wheelEvent(QWheelEvent *e)
 {
-    if (e->delta() > 0)
-        slotValueUp();
-    else
-        slotValueDown();
-}*/
+    QAbstractSpinBox::wheelEvent(e);
+    clearFocus();
+}
 
 
 int TimecodeDisplay::maximum() const
@@ -195,7 +192,7 @@ void TimecodeDisplay::slotEditingFinished()
     lineEdit()->deselect();
     if (m_frametimecode) setValue(lineEdit()->text().toInt());
     else setValue(lineEdit()->text());
-    emit editingFinished();
+    emit timeCodeEditingFinished();
 }
 
 #include <timecodedisplay.moc>
index e3ae03f7ca83eb361f425d3ed0be60d5ad6fadf0..97bd353eaf1f1dbb2f84fdeb8fe56b4cc76dc1a4 100644 (file)
@@ -93,7 +93,7 @@ public slots:
     void setValue(const QString &value);
     void setValue(GenTime value);
 
-    /** @brief Sets value's format accorrding to Kdenlive's settings.
+    /** @brief Sets value's format according to Kdenlive's settings.
     * @param t (optional, if already existing) Timecode object to use */
     void slotUpdateTimeCodeFormat();
 
@@ -108,12 +108,12 @@ signals:
      * @param final if the value is final ie not produced during sliding (on slider release it's final)
      */
     void valueChanged(int value, bool final);
-    void editingFinished();
+    void timeCodeEditingFinished();
 
 protected:
     virtual void keyPressEvent(QKeyEvent *e);
     virtual void mouseReleaseEvent(QMouseEvent *);
-//    virtual void wheelEvent(QWheelEvent *e);
+    virtual void wheelEvent(QWheelEvent *e);
     virtual QAbstractSpinBox::StepEnabled stepEnabled () const;
 
 };