]> git.sesse.net Git - kdenlive/commitdiff
When user wants to display timecode in frames, use frames for all timecode display...
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 8 Feb 2010 20:01:34 +0000 (20:01 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 8 Feb 2010 20:01:34 +0000 (20:01 +0000)
http://www.kdenlive.org/mantis/view.php?id=1421

svn path=/trunk/kdenlive/; revision=4303

src/customruler.cpp
src/customtrackview.cpp
src/customtrackview.h
src/kdenlivedoc.cpp
src/kdenlivesettingsdialog.cpp
src/keyframeedit.cpp
src/mainwindow.cpp
src/markerdialog.cpp
src/positionedit.cpp

index c01a0fe310a57d1c89e53328e79c7b8d705ccd93..1c7d78e1ba7991cf6d1e82bae2856ff3bc74d8b5 100644 (file)
@@ -187,16 +187,20 @@ void CustomRuler::mouseMoveEvent(QMouseEvent * event)
         if (event->y() <= 10) setCursor(Qt::ArrowCursor);
         else if (qAbs(pos - m_zoneStart * m_factor) < 4) {
             setCursor(KCursor("left_side", Qt::SizeHorCursor));
-            setToolTip(i18n("Zone start: %1", m_timecode.getTimecodeFromFrames(m_zoneStart)));
+            if (KdenliveSettings::frametimecode()) setToolTip(i18n("Zone start: %1", m_zoneStart));
+            else setToolTip(i18n("Zone start: %1", m_timecode.getTimecodeFromFrames(m_zoneStart)));
         } else if (qAbs(pos - m_zoneEnd * m_factor) < 4) {
             setCursor(KCursor("right_side", Qt::SizeHorCursor));
-            setToolTip(i18n("Zone end: %1", m_timecode.getTimecodeFromFrames(m_zoneEnd)));
+            if (KdenliveSettings::frametimecode()) setToolTip(i18n("Zone end: %1", m_zoneEnd));
+            else setToolTip(i18n("Zone end: %1", m_timecode.getTimecodeFromFrames(m_zoneEnd)));
         } else if (qAbs(pos - (m_zoneStart + (m_zoneEnd - m_zoneStart) / 2) * m_factor) < 4) {
             setCursor(Qt::SizeHorCursor);
-            setToolTip(i18n("Zone duration: %1", m_timecode.getTimecodeFromFrames(m_zoneEnd - m_zoneStart)));
+            if (KdenliveSettings::frametimecode()) setToolTip(i18n("Zone duration: %1", m_zoneEnd - m_zoneStart));
+            else setToolTip(i18n("Zone duration: %1", m_timecode.getTimecodeFromFrames(m_zoneEnd - m_zoneStart)));
         } else {
             setCursor(Qt::ArrowCursor);
-            setToolTip(i18n("Position: %1", m_timecode.getTimecodeFromFrames(pos / m_factor)));
+            if (KdenliveSettings::frametimecode()) setToolTip(i18n("Position: %1", (int)(pos / m_factor)));
+            else setToolTip(i18n("Position: %1", m_timecode.getTimecodeFromFrames(pos / m_factor)));
         }
     }
 }
index 04e1ec73b89e2801f32eb7007fa766696dc2e54d..42a096c92507a9f007ed0cc5d907663f4d5d1cb3 100644 (file)
@@ -5772,3 +5772,12 @@ void CustomTrackView::insertZoneOverwrite(QStringList data, int in)
     new AddTimelineClipCommand(this, clip->toXML(), clip->getId(), info, EffectsList(), true, false, true, false, addCommand);
     m_commandStack->push(addCommand);
 }
+
+void CustomTrackView::clearSelection()
+{
+    resetSelectionGroup();
+    scene()->clearSelection();
+    m_dragItem = NULL;
+    emit clipItemSelected(NULL);
+}
+
index f0b6a7539a56d2af4c8f27e926fe73743f72073f..c0aea67124c27def55c1ee52789e24e70ea0be0d 100644 (file)
@@ -130,6 +130,7 @@ public:
     QStringList extractTransitionsLumas();
     void setEditMode(EDITMODE mode);
     void insertClipCut(DocClipBase *clip, int in, int out);
+    void clearSelection();
 
 public slots:
     void setCursorPos(int pos, bool seek = true);
index 5c889404c04a886b89285942296d09b0331f2e45..13b1791c22611869eaca9160856dc77e2d208ce8 100644 (file)
@@ -482,9 +482,9 @@ bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene)
     sceneList.setContent(scene, true);
     QDomElement mlt = sceneList.firstChildElement("mlt");
     if (mlt.isNull() || !mlt.hasChildNodes()) {
-       //Make sure we don't save if scenelist is corrupted
-       KMessageBox::error(kapp->activeWindow(), i18n("Cannot write to file %1", path));
-       return false;
+        //Make sure we don't save if scenelist is corrupted
+        KMessageBox::error(kapp->activeWindow(), i18n("Cannot write to file %1", path));
+        return false;
     }
     QDomElement addedXml = sceneList.createElement("kdenlivedoc");
     mlt.appendChild(addedXml);
index 842e13323a7fb7f8625f075de1c1936bdcbe4f74..2ed31f0ea1a56033ef32ec06ad94c86e6291052d 100644 (file)
@@ -96,7 +96,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent) :
 
     QWidget *p6 = new QWidget;
     m_configSdl.setupUi(p6);
-    
+
     // Disable drop B frames, see Kdenlive issue #1330
     m_configSdl.groupBox->setHidden(true);
 
index 5302ab6f393408e3b34f06f488b4d71da6373bb5..ecfcb9cc62719c2525f256bb5b8331e83d9630d1 100644 (file)
@@ -100,7 +100,9 @@ void KeyframeEdit::addParameter(QDomElement e)
         bool found = false;
         int j;
         for (j = 0; j < keyframe_list->rowCount(); j++) {
-            int currentPos = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(j)->text());
+            int currentPos;
+            if (KdenliveSettings::frametimecode()) currentPos = keyframe_list->verticalHeaderItem(j)->text().toInt();
+            else currentPos = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(j)->text());
             if (frame == currentPos) {
                 keyframe_list->setItem(j, columnId, new QTableWidgetItem(frames.at(i).section(':', 1, 1)));
                 found = true;
@@ -111,7 +113,10 @@ void KeyframeEdit::addParameter(QDomElement e)
         }
         if (!found) {
             keyframe_list->insertRow(j);
-            keyframe_list->setVerticalHeaderItem(j, new QTableWidgetItem(m_timecode.getTimecodeFromFrames(frame)));
+            QString currentPos;
+            if (KdenliveSettings::frametimecode()) currentPos = QString::number(frame);
+            else currentPos = m_timecode.getTimecodeFromFrames(frame);
+            keyframe_list->setVerticalHeaderItem(j, new QTableWidgetItem(currentPos));
             keyframe_list->setItem(j, columnId, new QTableWidgetItem(frames.at(i).section(':', 1, 1)));
             keyframe_list->resizeRowToContents(j);
         }
@@ -145,7 +150,9 @@ void KeyframeEdit::setupParam()
     for (int i = 0; i < frames.count(); i++) {
         keyframe_list->insertRow(i);
         int currentpos = frames.at(i).section(':', 0, 0).toInt();
-        QString framePos = m_timecode.getTimecodeFromFrames(currentpos);
+        QString framePos;
+        if (KdenliveSettings::frametimecode()) framePos  = QString::number(currentpos);
+        else framePos = m_timecode.getTimecodeFromFrames(currentpos);
         keyframe_list->setVerticalHeaderItem(i, new QTableWidgetItem(framePos));
         keyframe_list->setItem(i, col, new QTableWidgetItem(frames.at(i).section(':', 1, 1)));
         if ((m_active_keyframe > -1) && (m_active_keyframe == currentpos)) {
@@ -182,11 +189,16 @@ void KeyframeEdit::slotAddKeyframe()
     int row = keyframe_list->currentRow();
     int col = keyframe_list->currentColumn();
     int newrow = row;
-    int pos1 = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(row)->text());
+    int pos1;
+    if (KdenliveSettings::frametimecode()) pos1 = keyframe_list->verticalHeaderItem(row)->text().toInt();
+    else pos1 = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(row)->text());
+
     int result;
     kDebug() << "// ADD KF: " << row << ", MAX: " << keyframe_list->rowCount() << ", POS: " << pos1;
     if (row < (keyframe_list->rowCount() - 1)) {
-        int pos2 = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(row + 1)->text());
+        int pos2;
+        if (KdenliveSettings::frametimecode()) pos2 = keyframe_list->verticalHeaderItem(row + 1)->text().toInt();
+        else pos2 = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(row + 1)->text());
         result = pos1 + (pos2 - pos1) / 2;
         newrow++;
     } else if (row == 0) {
@@ -197,12 +209,17 @@ void KeyframeEdit::slotAddKeyframe()
             result = m_min;
         }
     } else {
-        int pos2 = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(row - 1)->text());
+        int pos2;
+        if (KdenliveSettings::frametimecode()) pos2 = keyframe_list->verticalHeaderItem(row - 1)->text().toInt();
+        else pos2 = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(row - 1)->text());
         result = pos2 + (pos1 - pos2) / 2;
     }
 
     keyframe_list->insertRow(newrow);
-    keyframe_list->setVerticalHeaderItem(newrow, new QTableWidgetItem(m_timecode.getTimecodeFromFrames(result)));
+    QString currentPos;
+    if (KdenliveSettings::frametimecode()) currentPos = QString::number(result);
+    else currentPos = m_timecode.getTimecodeFromFrames(result);
+    keyframe_list->setVerticalHeaderItem(newrow, new QTableWidgetItem(currentPos));
     for (int i = 0; i < keyframe_list->columnCount(); i++) {
         keyframe_list->setItem(newrow, i, new QTableWidgetItem(keyframe_list->item(item->row(), i)->text()));
     }
@@ -224,14 +241,19 @@ void KeyframeEdit::slotGenerateParams(int row, int column)
         QTableWidgetItem *item = keyframe_list->item(row, 0);
         if (item == NULL) return;
         QString val = keyframe_list->verticalHeaderItem(row)->text();
-        int pos = m_timecode.getFrameCount(val);
+        int pos;
+        if (KdenliveSettings::frametimecode()) pos = val.toInt();
+        else pos = m_timecode.getFrameCount(val);
+
         if (pos <= m_min) {
             pos = m_min;
-            val = m_timecode.getTimecodeFromFrames(pos);
+            if (KdenliveSettings::frametimecode()) val = QString::number(pos);
+            else val = m_timecode.getTimecodeFromFrames(pos);
         }
         if (pos > m_max) {
             pos = m_max;
-            val = m_timecode.getTimecodeFromFrames(pos);
+            if (KdenliveSettings::frametimecode()) val = QString::number(pos);
+            else val = m_timecode.getTimecodeFromFrames(pos);
         }
         if (val != keyframe_list->verticalHeaderItem(row)->text()) keyframe_list->verticalHeaderItem(row)->setText(val);
 
@@ -242,7 +264,12 @@ void KeyframeEdit::slotGenerateParams(int row, int column)
             if (v <= m_params.at(col).attribute("min").toInt()) item->setText(m_params.at(col).attribute("min"));
             QString keyframes;
             for (int i = 0; i < keyframe_list->rowCount(); i++) {
-                if (keyframe_list->item(i, col)) keyframes.append(QString::number(m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(i)->text())) + ':' + keyframe_list->item(i, col)->text() + ';');
+                if (keyframe_list->item(i, col)) {
+                    int pos3;
+                    if (KdenliveSettings::frametimecode()) pos3 = keyframe_list->verticalHeaderItem(i)->text().toInt();
+                    else pos3 = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(i)->text());
+                    keyframes.append(QString::number(pos3) + ':' + keyframe_list->item(i, col)->text() + ';');
+                }
             }
             m_params[col].setAttribute("keyframes", keyframes);
         }
@@ -254,14 +281,20 @@ void KeyframeEdit::slotGenerateParams(int row, int column)
     QTableWidgetItem *item = keyframe_list->item(row, column);
     if (item == NULL) return;
     QString val = keyframe_list->verticalHeaderItem(row)->text();
-    int pos = m_timecode.getFrameCount(val);
+    ;
+    int pos;
+    if (KdenliveSettings::frametimecode()) pos = val.toInt();
+    else pos = m_timecode.getFrameCount(val);
+
     if (pos <= m_min) {
         pos = m_min;
-        val = m_timecode.getTimecodeFromFrames(pos);
+        if (KdenliveSettings::frametimecode()) val = QString::number(pos);
+        else val = m_timecode.getTimecodeFromFrames(pos);
     }
     if (pos > m_max) {
         pos = m_max;
-        val = m_timecode.getTimecodeFromFrames(pos);
+        if (KdenliveSettings::frametimecode()) val = QString::number(pos);
+        else val = m_timecode.getTimecodeFromFrames(pos);
     }
     /*QList<QTreeWidgetItem *> duplicates = keyframe_list->findItems(val, Qt::MatchExactly, 0);
     duplicates.removeAll(item);
@@ -278,7 +311,12 @@ void KeyframeEdit::slotGenerateParams(int row, int column)
 
     QString keyframes;
     for (int i = 0; i < keyframe_list->rowCount(); i++) {
-        if (keyframe_list->item(i, column)) keyframes.append(QString::number(m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(i)->text())) + ':' + keyframe_list->item(i, column)->text() + ';');
+        if (keyframe_list->item(i, column)) {
+            int pos3;
+            if (KdenliveSettings::frametimecode()) pos3 = keyframe_list->verticalHeaderItem(i)->text().toInt();
+            else pos3 = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(i)->text());
+            keyframes.append(QString::number(pos3) + ':' + keyframe_list->item(i, column)->text() + ';');
+        }
     }
     m_params[column].setAttribute("keyframes", keyframes);
     emit parameterChanged();
@@ -289,7 +327,12 @@ void KeyframeEdit::generateAllParams()
     for (int col = 0; col < keyframe_list->columnCount(); col++) {
         QString keyframes;
         for (int i = 0; i < keyframe_list->rowCount(); i++) {
-            if (keyframe_list->item(i, col)) keyframes.append(QString::number(m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(i)->text())) + ':' + keyframe_list->item(i, col)->text() + ';');
+            if (keyframe_list->item(i, col)) {
+                int pos3;
+                if (KdenliveSettings::frametimecode()) pos3 = keyframe_list->verticalHeaderItem(i)->text().toInt();
+                else pos3 = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(i)->text());
+                keyframes.append(QString::number(pos3) + ':' + keyframe_list->item(i, col)->text() + ';');
+            }
         }
         m_params[col].setAttribute("keyframes", keyframes);
     }
@@ -315,11 +358,23 @@ void KeyframeEdit::slotAdjustKeyframeInfo(bool seek)
     int max = m_max;
     QTableWidgetItem *above = keyframe_list->item(item->row() - 1, item->column());
     QTableWidgetItem *below = keyframe_list->item(item->row() + 1, item->column());
-    if (above) min = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(above->row())->text()) + 1;
-    if (below) max = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(below->row())->text()) - 1;
+    if (above) {
+        if (KdenliveSettings::frametimecode()) min = keyframe_list->verticalHeaderItem(above->row())->text().toInt();
+        else min = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(above->row())->text());
+        min++;
+    }
+    if (below) {
+        if (KdenliveSettings::frametimecode()) max = keyframe_list->verticalHeaderItem(below->row())->text().toInt();
+        else max = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(below->row())->text());
+        max--;
+    }
     keyframe_pos->blockSignals(true);
     keyframe_pos->setRange(min, max);
-    keyframe_pos->setValue(m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(item->row())->text()));
+    int pos;
+    if (KdenliveSettings::frametimecode()) pos = keyframe_list->verticalHeaderItem(item->row())->text().toInt();
+    else pos = m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(item->row())->text());
+
+    keyframe_pos->setValue(pos);
     keyframe_pos->blockSignals(false);
     for (int col = 0; col < keyframe_list->columnCount(); col++) {
         QSlider *sl = static_cast <QSlider*>(m_slidersLayout->itemAtPosition(col, 1)->widget());
@@ -334,7 +389,10 @@ void KeyframeEdit::slotAdjustKeyframeInfo(bool seek)
 void KeyframeEdit::slotAdjustKeyframePos(int value)
 {
     QTableWidgetItem *item = keyframe_list->currentItem();
-    keyframe_list->verticalHeaderItem(item->row())->setText(m_timecode.getTimecodeFromFrames(value));
+    QString val;
+    if (KdenliveSettings::frametimecode()) val = QString::number(value);
+    else val = m_timecode.getTimecodeFromFrames(value);
+    keyframe_list->verticalHeaderItem(item->row())->setText(val);
     slotGenerateParams(item->row(), -1);
     if (KdenliveSettings::keyframeseek()) emit seekToPos(value);
 }
index 8dc36617608d20851ae19deb06d9d7dc3fde9e60..3dcb07f70c40ed74e67a54688bdbab975a6fd55e 100644 (file)
@@ -426,7 +426,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent
 
     m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor);
     slotConnectMonitors();
-    
+
     // Disable drop B frames, see Kdenlive issue #1330, see also kdenlivesettingsdialog.cpp
     KdenliveSettings::setDropbframes(false);
 
@@ -3164,6 +3164,7 @@ void MainWindow::slotUpdateTimecodeFormat(int ix)
     KdenliveSettings::setFrametimecode(ix == 1);
     m_clipMonitor->updateTimecodeFormat();
     m_projectMonitor->updateTimecodeFormat();
+    m_activeTimeline->projectView()->clearSelection();
 }
 
 void MainWindow::slotRemoveFocus()
index a0f62d58c11771938db229029436db54ac5a6352..c437aa82d3505a0a88b98905999e795cea873ec7 100644 (file)
@@ -82,7 +82,10 @@ MarkerDialog::MarkerDialog(DocClipBase *clip, CommentedTime t, Timecode tc, cons
         connect(marker_position, SIGNAL(textChanged(const QString &)), this, SIGNAL(updateThumb()));
     } else clip_thumb->setHidden(true);
 
-    marker_position->setText(tc.getTimecode(t.time()));
+    if (KdenliveSettings::frametimecode()) {
+        marker_position->setInputMask("000000000000");
+        marker_position->setText(QString::number((int) t.time().frames(m_fps)));
+    } else marker_position->setText(tc.getTimecode(t.time()));
 
     marker_comment->setText(t.comment());
     marker_comment->selectAll();
@@ -104,7 +107,9 @@ MarkerDialog::~MarkerDialog()
 void MarkerDialog::slotUpdateThumb()
 {
     m_previewTimer->stop();
-    int pos = m_tc.getFrameCount(marker_position->text());
+    int pos;
+    if (KdenliveSettings::frametimecode()) pos = marker_position->text().toInt();
+    else pos = m_tc.getFrameCount(marker_position->text());
     int width = 100.0 * m_dar;
     if (width % 2 == 1) width++;
     QPixmap p = QPixmap::fromImage(KThumb::getFrame(m_producer, pos, width, 100));
@@ -114,22 +119,29 @@ void MarkerDialog::slotUpdateThumb()
 
 void MarkerDialog::slotTimeUp()
 {
-    int duration = m_tc.getFrameCount(marker_position->text());
+    int duration;
+    if (KdenliveSettings::frametimecode()) duration = marker_position->text().toInt();
+    else duration = m_tc.getFrameCount(marker_position->text());
     if (m_clip && duration >= m_clip->duration().frames(m_fps)) return;
     duration ++;
-    marker_position->setText(m_tc.getTimecode(GenTime(duration, m_fps)));
+    if (KdenliveSettings::frametimecode()) marker_position->setText(QString::number(duration));
+    else marker_position->setText(m_tc.getTimecode(GenTime(duration, m_fps)));
 }
 
 void MarkerDialog::slotTimeDown()
 {
-    int duration = m_tc.getFrameCount(marker_position->text());
+    int duration;
+    if (KdenliveSettings::frametimecode()) duration = marker_position->text().toInt();
+    else duration = m_tc.getFrameCount(marker_position->text());
     if (duration <= 0) return;
     duration --;
-    marker_position->setText(m_tc.getTimecode(GenTime(duration, m_fps)));
+    if (KdenliveSettings::frametimecode()) marker_position->setText(QString::number(duration));
+    else marker_position->setText(m_tc.getTimecode(GenTime(duration, m_fps)));
 }
 
 CommentedTime MarkerDialog::newMarker()
 {
+    if (KdenliveSettings::frametimecode()) return CommentedTime(GenTime(marker_position->text().toInt(), m_fps), marker_comment->text());
     return CommentedTime(GenTime(m_tc.getFrameCount(marker_position->text()), m_fps), marker_comment->text());
 }
 
index 02f6253695633cc9ecfc30dc546d344dab8233b3..7a8208bdaebfad4301f3c28b69a346060162fa65 100644 (file)
@@ -30,7 +30,10 @@ PositionEdit::PositionEdit(const QString name, int pos, int min, int max, const
     connect(m_ui.horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateTimecode()));
     connect(m_ui.krestrictedline, SIGNAL(editingFinished()), this, SLOT(slotUpdatePosition()));
     m_ui.horizontalSlider->setValue(pos);
-    m_ui.krestrictedline->setText(m_tc.getTimecodeFromFrames(pos));
+    if (KdenliveSettings::frametimecode()) {
+        m_ui.krestrictedline->setInputMask("000000000000");
+        m_ui.krestrictedline->setText(QString::number(pos));
+    } else m_ui.krestrictedline->setText(m_tc.getTimecodeFromFrames(pos));
 }
 
 int PositionEdit::getPosition() const
@@ -41,23 +44,28 @@ int PositionEdit::getPosition() const
 void PositionEdit::setPosition(int pos)
 {
     m_ui.horizontalSlider->setValue(pos);
-    m_ui.krestrictedline->setText(m_tc.getTimecodeFromFrames(pos));
+    if (KdenliveSettings::frametimecode()) m_ui.krestrictedline->setText(QString::number(pos));
+    else m_ui.krestrictedline->setText(m_tc.getTimecodeFromFrames(pos));
 }
 
 void PositionEdit::slotUpdateTimecode()
 {
-    m_ui.krestrictedline->setText(m_tc.getTimecodeFromFrames(m_ui.horizontalSlider->value()));
+    if (KdenliveSettings::frametimecode()) m_ui.krestrictedline->setText(QString::number(m_ui.horizontalSlider->value()));
+    else m_ui.krestrictedline->setText(m_tc.getTimecodeFromFrames(m_ui.horizontalSlider->value()));
     emit parameterChanged();
 }
 
 void PositionEdit::slotUpdatePosition()
 {
     m_ui.horizontalSlider->blockSignals(true);
-    int pos = m_tc.getFrameCount(m_ui.krestrictedline->text());
+    int pos;
+    if (KdenliveSettings::frametimecode()) pos = m_ui.krestrictedline->text().toInt();
+    else pos = m_tc.getFrameCount(m_ui.krestrictedline->text());
     m_ui.horizontalSlider->setValue(pos);
     if (pos != m_ui.horizontalSlider->value()) {
         // Value out of range
-        m_ui.krestrictedline->setText(m_tc.getTimecodeFromFrames(m_ui.horizontalSlider->value()));
+        if (KdenliveSettings::frametimecode()) m_ui.krestrictedline->setText(QString::number(m_ui.horizontalSlider->value()));
+        else m_ui.krestrictedline->setText(m_tc.getTimecodeFromFrames(m_ui.horizontalSlider->value()));
     }
     m_ui.horizontalSlider->blockSignals(false);
     emit parameterChanged();