m_producer(NULL),
m_profile(NULL),
m_clip(clip),
- m_tc(tc)
+ m_tc(tc),
+ m_frameDisplay(KdenliveSettings::frametimecode())
{
setFont(KGlobalSettings::toolBarFont());
m_fps = m_tc.fps();
connect(this, SIGNAL(updateThumb()), m_previewTimer, SLOT(start()));
case IMAGE:
case TEXT:
- p = KThumb::getFrame(m_producer, t.time().frames(m_fps), width, 100);
+ p = QPixmap::fromImage(KThumb::getFrame(m_producer, t.time().frames(m_fps), width, 100));
break;
case COLOR:
colour = colour.replace(0, 2, "#");
connect(marker_position, SIGNAL(textChanged(const QString &)), this, SIGNAL(updateThumb()));
} else clip_thumb->setHidden(true);
- marker_position->setText(tc.getTimecode(t.time()));
+ if (m_frameDisplay) {
+ QValidator *valid = new QIntValidator(this);
+ marker_position->setInputMask("");
+ marker_position->setValidator(valid);
+ } else marker_position->setInputMask(tc.inputMask());
+ marker_position->setText(tc.getDisplayTimecode(t.time(), m_frameDisplay));
marker_comment->setText(t.comment());
marker_comment->selectAll();
void MarkerDialog::slotUpdateThumb()
{
m_previewTimer->stop();
- int pos = m_tc.getFrameCount(marker_position->text());
+ int pos = m_tc.getDisplayFrameCount(marker_position->text(), m_frameDisplay);
int width = 100.0 * m_dar;
if (width % 2 == 1) width++;
- QPixmap p = KThumb::getFrame(m_producer, pos, width, 100);
+ QPixmap p = QPixmap::fromImage(KThumb::getFrame(m_producer, pos, width, 100));
if (!p.isNull()) clip_thumb->setPixmap(p);
else kDebug() << "!!!!!!!!!!! ERROR CREATING THUMB";
}
void MarkerDialog::slotTimeUp()
{
- int duration = m_tc.getFrameCount(marker_position->text());
+ int duration = m_tc.getDisplayFrameCount(marker_position->text(), m_frameDisplay);
if (m_clip && duration >= m_clip->duration().frames(m_fps)) return;
duration ++;
- marker_position->setText(m_tc.getTimecode(GenTime(duration, m_fps)));
+ marker_position->setText(m_tc.getDisplayTimecode(GenTime(duration, m_fps), m_frameDisplay));
}
void MarkerDialog::slotTimeDown()
{
- int duration = m_tc.getFrameCount(marker_position->text());
+ int duration = m_tc.getDisplayFrameCount(marker_position->text(), m_frameDisplay);
if (duration <= 0) return;
duration --;
- marker_position->setText(m_tc.getTimecode(GenTime(duration, m_fps)));
+ marker_position->setText(m_tc.getDisplayTimecode(GenTime(duration, m_fps), m_frameDisplay));
}
CommentedTime MarkerDialog::newMarker()
{
- return CommentedTime(GenTime(m_tc.getFrameCount(marker_position->text()), m_fps), marker_comment->text());
+ return CommentedTime(GenTime(m_tc.getDisplayFrameCount(marker_position->text(), m_frameDisplay), m_fps), marker_comment->text());
}
void MarkerDialog::wheelEvent(QWheelEvent * event)