- Fix a (possible) wrong format in the clip duration dialog when "frames" is current format.
- Reindent.
PR: http://www.kdenlive.org/mantis/view.php?id=1511 [1]
svn path=/trunk/kdenlive/; revision=4428
//kDebug() << "-- RESCALE DIFF=" << durationDiff.frames(25) << ", CLIP: " << startPos().frames(25) << "-" << endPos().frames(25);
if (type() == AVWIDGET) {
- if (hasSizeLimit && cropStart() + durationDiff < GenTime())
- durationDiff = GenTime() - cropStart();
+ if (hasSizeLimit && cropStart() + durationDiff < GenTime())
+ durationDiff = GenTime() - cropStart();
} else if (durationDiff >= cropDuration()) {
return;
if (cropDuration() > GenTime(3, m_fps)) durationDiff = GenTime(3, m_fps);
m_crop = m_clip->cropStart().frames(m_fps);
+ m_view.clip_position->setInputMask("");
+ m_view.crop_position->setInputMask("");
+ m_view.clip_duration->setInputMask("");
+ m_view.end_position->setInputMask("");
if (m_framesDisplay) {
- QValidator *valid = new QIntValidator(this);
- m_view.clip_position->setInputMask("");
- m_view.clip_position->setValidator(valid);
- m_view.crop_position->setInputMask("");
- m_view.clip_position->setValidator(valid);
- m_view.clip_duration->setInputMask("");
- m_view.clip_position->setValidator(valid);
- m_view.end_position->setInputMask("");
+ QIntValidator *valid = new QIntValidator(this);
+ valid->setBottom(0);
m_view.clip_position->setValidator(valid);
+ m_view.crop_position->setValidator(valid);
+ m_view.clip_duration->setValidator(valid);
+ m_view.end_position->setValidator(valid);
} else {
- m_view.clip_position->setInputMask(m_tc.inputMask());
- m_view.crop_position->setInputMask(m_tc.inputMask());
- m_view.clip_duration->setInputMask(m_tc.inputMask());
- m_view.end_position->setInputMask(m_tc.inputMask());
+ m_view.clip_position->setValidator(m_tc.validator());
+ m_view.crop_position->setValidator(m_tc.validator());
+ m_view.clip_duration->setValidator(m_tc.validator());
+ m_view.end_position->setValidator(m_tc.validator());
}
m_view.clip_position->setText(tc.getDisplayTimecode(m_clip->startPos(), m_framesDisplay));
m_view.crop_position->setText(tc.getDisplayTimecode(m_clip->cropStart(), m_framesDisplay));
{
bool sizeLimit = false;
if (clipType() != IMAGE && clipType() != COLOR && clipType() != TEXT) {
- const int min = (startPos() - cropStart()).frames(m_fps);
- if (posx < min) posx = min;
- sizeLimit = true;
+ const int min = (startPos() - cropStart()).frames(m_fps);
+ if (posx < min) posx = min;
+ sizeLimit = true;
}
if (posx == startPos().frames(m_fps)) return;
QPixmap m_startPix;
QPixmap m_endPix;
-
+
bool m_hasThumbs;
QTimer m_startThumbTimer;
QTimer m_endThumbTimer;
m_view.clip_filesize->setHidden(true);
m_view.label_size->setHidden(true);
}
- m_view.clip_duration->setInputMask(tc.inputMask());
+ m_view.clip_duration->setInputMask("");
+ m_view.clip_duration->setValidator(tc.validator());
m_view.clip_duration->setText(tc.getTimecode(m_clip->duration()));
if (t != IMAGE && t != COLOR && t != TEXT) m_view.clip_duration->setReadOnly(true);
else connect(m_view.clip_duration, SIGNAL(editingFinished()), this, SLOT(slotCheckMaxLength()));
QAction *delAllGuides = m_contextMenu->addAction(KIcon("edit-delete"), i18n("Delete All Guides"));
connect(delAllGuides, SIGNAL(triggered()), m_view, SLOT(slotDeleteAllGuides()));
m_goMenu = m_contextMenu->addMenu(i18n("Go To"));
- connect(m_goMenu, SIGNAL(triggered( QAction *)), this, SLOT(slotGoToGuide(QAction *)));
+ connect(m_goMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotGoToGuide(QAction *)));
setMouseTracking(true);
setMinimumHeight(20);
}
m_clickedGuide = m_view->hasGuide((int)(pos / m_factor), (int)(5 / m_factor + 1));
m_editGuide->setEnabled(m_clickedGuide > 0);
m_deleteGuide->setEnabled(m_clickedGuide > 0);
- m_view->buildGuidesMenu(m_goMenu);
+ m_view->buildGuidesMenu(m_goMenu);
m_contextMenu->exec(event->globalPos());
return;
}
goMenu->clear();
double fps = m_document->fps();
for (int i = 0; i < m_guides.count(); i++) {
- act = goMenu->addAction(m_guides.at(i)->label() + "/" + Timecode::getStringTimecode(m_guides.at(i)->position().frames(fps), fps));
- act->setData(m_guides.at(i)->position().frames(m_document->fps()));
+ act = goMenu->addAction(m_guides.at(i)->label() + "/" + Timecode::getStringTimecode(m_guides.at(i)->position().frames(fps), fps));
+ act->setData(m_guides.at(i)->position().frames(m_document->fps()));
}
goMenu->setEnabled(!m_guides.isEmpty());
}
QDomNodeList trans = m_doc.elementsByTagName("transition");
for (int i = 0; i < trans.count(); i++) {
QString luma = getProperty(trans.at(i).toElement(), "luma");
- if (!luma.startsWith('/')) luma.prepend(root);
+ if (!luma.startsWith('/')) luma.prepend(root);
if (!luma.isEmpty() && !QFile::exists(luma)) {
if (!missingLumas.contains(luma)) {
missingLumas.append(luma);
}
// make sure we don't show anything not matching the search expression
search_effect->updateSearch();
-
+
/*item = m_effectsList->currentItem();
if (item) {
if (item->isHidden()) {
EffectsList::setParameter(newparam, number, QString::number(points.count()));
for (int j = 0; (j < points.count() && j + off <= end); j++) {
QString in = inName;
- in.replace("%i", QString::number(j+off));
+ in.replace("%i", QString::number(j + off));
QString out = outName;
- out.replace("%i", QString::number(j+off));
+ out.replace("%i", QString::number(j + off));
EffectsList::setParameter(newparam, in, QString::number(points.at(j).x()));
EffectsList::setParameter(newparam, out, QString::number(points.at(j).y()));
}
buttonAdd->setToolTip(i18n("Add keyframe"));
buttonDelete->setIcon(KIcon("edit-delete"));
buttonDelete->setToolTip(i18n("Delete keyframe"));
-
+
m_configMenu = new QMenu(i18n("Misc..."), this);
buttonMenu->setMenu(m_configMenu);
buttonMenu->setPopupMode(QToolButton::MenuButtonPopup);
-
+
m_editOptions = m_configMenu->addAction(KIcon("system-run"), i18n("Show/Hide options"));
m_editOptions->setCheckable(true);
buttonMenu->setDefaultAction(m_editOptions);
slotSwitchOptions();
m_reset = m_configMenu->addAction(KIcon("view-refresh"), i18n("Reset"), this, SLOT(slotResetPosition()));
-
+
m_syncAction = m_configMenu->addAction(i18n("Sync timeline cursor"), this, SLOT(slotSyncCursor()));
m_syncAction->setCheckable(true);
m_syncAction->setChecked(KdenliveSettings::transitionfollowcursor());
connect(buttonAdd , SIGNAL(clicked()) , this , SLOT(slotAddFrame()));
connect(m_scene, SIGNAL(actionFinished()), this, SLOT(slotUpdateTransitionProperties()));
connect(m_scene, SIGNAL(doubleClickEvent()), this, SLOT(slotGeometry()));
-
+
buttonhcenter->setIcon(KIcon("kdenlive-align-hor"));
buttonhcenter->setToolTip(i18n("Align item horizontally"));
buttonvcenter->setIcon(KIcon("kdenlive-align-vert"));
buttonright->setToolTip(i18n("Align item to right"));
buttonleft->setIcon(KIcon("kdenlive-align-left"));
buttonleft->setToolTip(i18n("Align item to left"));
-
+
connect(buttonhcenter, SIGNAL(clicked()), this, SLOT(slotAlignHCenter()));
connect(buttonvcenter, SIGNAL(clicked()), this, SLOT(slotAlignVCenter()));
connect(buttontop, SIGNAL(clicked()), this, SLOT(slotAlignTop()));
connect(spinX, SIGNAL(valueChanged(int)), this, SLOT(slotGeometryX(int)));
connect(spinY, SIGNAL(valueChanged(int)), this, SLOT(slotGeometryY(int)));
connect(spinWidth, SIGNAL(valueChanged(int)), this, SLOT(slotGeometryWidth(int)));
- connect(spinHeight, SIGNAL(valueChanged(int)), this, SLOT(slotGeometryHeight(int)));
+ connect(spinHeight, SIGNAL(valueChanged(int)), this, SLOT(slotGeometryHeight(int)));
connect(spinResize, SIGNAL(valueChanged(int)), this, SLOT(slotResizeCustom(int)));
connect(buttonResize, SIGNAL(clicked()), this, SLOT(slotResizeOriginal()));
-
+
connect(this, SIGNAL(parameterChanged()), this, SLOT(slotUpdateGeometry()));
}
void Geometryval::slotUpdateGeometry()
{
QRectF r = m_paramRect->rect().normalized();
-
+
spinX->blockSignals(true);
spinY->blockSignals(true);
spinWidth->blockSignals(true);
spinHeight->blockSignals(true);
spinResize->blockSignals(true);
-
+
spinX->setValue(m_paramRect->pos().x());
spinY->setValue(m_paramRect->pos().y());
spinWidth->setValue(r.width());
spinHeight->setValue(r.height());
spinResize->setValue(m_paramRect->rect().width() * 100 / m_realWidth);
-
+
spinX->blockSignals(false);
spinY->blockSignals(false);
spinWidth->blockSignals(false);
qreal end = 1.0 / (size - 1);
for (int i = 0; i < size; ++i) {
/* Direct uncached version */
- _T2_ val = value(i * end ) * max;
+ _T2_ val = value(i * end) * max;
val = qBound(min, val, max);
(*transfer)[i] = val;
}
{
d->data = new Data;
QPointF p;
- p.rx() = 0.0; p.ry() = 0.0;
+ p.rx() = 0.0;
+ p.ry() = 0.0;
d->data->points.append(p);
- p.rx() = 1.0; p.ry() = 1.0;
+ p.rx() = 1.0;
+ p.ry() = 1.0;
d->data->points.append(p);
}
d->m_intIn = NULL;
d->m_intOut = NULL;
-
+
d->m_maxPoints = -1;
setMouseTracking(true);
}
d->setCurveModified();
} else if (e->key() == Qt::Key_Escape && d->state() != ST_NORMAL) {
- d->m_curve.setPoint(d->m_grab_point_index, QPointF(d->m_grabOriginalX, d->m_grabOriginalY) );
+ d->m_curve.setPoint(d->m_grab_point_index, QPointF(d->m_grabOriginalX, d->m_grabOriginalY));
setCursor(Qt::ArrowCursor);
d->setState(ST_NORMAL);
/*KisConfig cfg;
if (cfg.antialiasCurves())
p.setRenderHint(QPainter::Antialiasing);*/
-
+
// Draw default line
p.setPen(QPen(Qt::gray, 1, Qt::SolidLine));
- p.drawLine(QLineF(0, wHeight, wWidth, 0));
+ p.drawLine(QLineF(0, wHeight, wWidth, 0));
// Draw curve.
double prevY = wHeight - d->m_curve.value(0.) * wHeight;
void KisCurveWidget::mousePressEvent(QMouseEvent * e)
{
if (d->m_readOnlyMode) return;
-
+
double x = e->pos().x() / (double)(width() - 1);
double y = 1.0 - e->pos().y() / (double)(height() - 1);
int closest_point_index = d->nearestPointInRange(QPointF(x, y), width(), height());
-
+
if (e->button() == Qt::RightButton && closest_point_index > 0 && closest_point_index < d->m_curve.points().count() - 1) {
d->m_curve.removePoint(closest_point_index);
setCursor(Qt::ArrowCursor);
d->setCurveModified();
return;
} else if (e->button() != Qt::LeftButton) return;
-
+
if (closest_point_index < 0) {
if (d->m_maxPoints > 0 && d->m_curve.points().count() >= d->m_maxPoints)
return;
* so the user can move this point anywhere in a moment
*/
void addPointInTheMiddle();
-
+
void setMaxPoints(int max);
private:
m_projectMonitor->setupMenu(static_cast<QMenu*>(factory()->container("monitor_go", this)), m_playZone, m_loopZone);
m_clipMonitor->setupMenu(static_cast<QMenu*>(factory()->container("monitor_go", this)), m_playZone, m_loopZone, static_cast<QMenu*>(factory()->container("marker_menu", this)));
-
+
QMenu *clipInTimeline = static_cast<QMenu*>(factory()->container("clip_in_timeline", this));
clipInTimeline->setIcon(KIcon("go-jump"));
m_projectList->setupGeneratorMenu(static_cast<QMenu*>(factory()->container("generators", this)),
KAction* editItemDuration = new KAction(KIcon("measure"), i18n("Edit Duration"), this);
collection->addAction("edit_item_duration", editItemDuration);
connect(editItemDuration, SIGNAL(triggered(bool)), this, SLOT(slotEditItemDuration()));
-
+
KAction* clipInProjectTree = new KAction(KIcon("go-jump-definition"), i18n("Clip in Project Tree"), this);
collection->addAction("clip_in_project_tree", clipInProjectTree);
connect(clipInProjectTree, SIGNAL(triggered(bool)), this, SLOT(slotClipInProjectTree()));
connect(marker_position, SIGNAL(textChanged(const QString &)), this, SIGNAL(updateThumb()));
} else clip_thumb->setHidden(true);
+ marker_position->setInputMask("");
if (m_frameDisplay) {
- QValidator *valid = new QIntValidator(this);
- marker_position->setInputMask("");
+ QIntValidator *valid = new QIntValidator(this);
+ valid->setBottom(0);
marker_position->setValidator(valid);
- } else marker_position->setInputMask(tc.inputMask());
+ } else
+ marker_position->setValidator(tc.validator());
marker_position->setText(tc.getDisplayTimecode(t.time(), m_frameDisplay));
marker_comment->setText(t.comment());
m_timePos = new KRestrictedLine(this);
m_timePos->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding);
m_frametimecode = KdenliveSettings::frametimecode();
+ m_timePos->setInputMask("");
if (m_frametimecode) {
- m_timePos->setInputMask(QString());
- m_timePos->setValidator(new QIntValidator(this));
- } else m_timePos->setInputMask(m_monitorManager->timecode().inputMask());
+ QIntValidator *valid = new QIntValidator(this);
+ valid->setBottom(0);
+ m_timePos->setValidator(valid);
+ } else
+ m_timePos->setValidator(m_monitorManager->timecode().validator());
toolbar->addWidget(m_timePos);
void Monitor::updateTimecodeFormat()
{
m_frametimecode = KdenliveSettings::frametimecode();
+ m_timePos->setInputMask("");
if (m_frametimecode) {
int frames = m_monitorManager->timecode().getFrameCount(m_timePos->text());
- m_timePos->setValidator(new QIntValidator(this));
- m_timePos->setInputMask(QString());
+ QIntValidator *valid = new QIntValidator(this);
+ valid->setBottom(0);
+ m_timePos->setValidator(valid);
m_timePos->setText(QString::number(frames));
} else {
int pos = m_timePos->text().toInt();
- m_timePos->setValidator(0);
- m_timePos->setInputMask(m_monitorManager->timecode().inputMask());
+ m_timePos->setValidator(m_monitorManager->timecode().validator());
m_timePos->setText(m_monitorManager->timecode().getTimecodeFromFrames(pos));
}
}
for (int i = 0; i < selected.count(); i++) {
if (selected.at(i)->type() != PROJECTCLIPTYPE) {
if (selected.at(i)->type() == PROJECTFOLDERTYPE) {
- for (int j = 0; j < selected.at(i)->childCount(); j++)
- selected.append(selected.at(i)->child(j));
+ for (int j = 0; j < selected.at(i)->childCount(); j++)
+ selected.append(selected.at(i)->child(j));
}
continue;
}
dia_ui.setupUi(dia);
dia->setWindowTitle(i18n("Color Clip"));
dia_ui.clip_name->setText(i18n("Color Clip"));
- dia_ui.clip_duration->setInputMask(m_timecode.inputMask());
+ dia_ui.clip_duration->setInputMask("");
+ dia_ui.clip_duration->setValidator(m_timecode.validator());
dia_ui.clip_duration->setText(m_timecode.reformatSeparators(KdenliveSettings::color_duration()));
if (dia->exec() == QDialog::Accepted) {
QString color = dia_ui.clip_color->color().name();
SubProjectItem *sub = new SubProjectItem(clip, in, out, desc);
if (newItem && desc.isEmpty() && !m_listView->isColumnHidden(1)) {
if (!clip->isExpanded()) clip->setExpanded(true);
- m_listView->scrollToItem(sub);
+ m_listView->scrollToItem(sub);
m_listView->editItem(sub, 1);
}
QPixmap p = clip->referencedClip()->thumbProducer()->extractImage(in, (int)(sub->sizeHint(0).height() * m_render->dar()), sub->sizeHint(0).height() - 2);
if (KdenliveSettings::rmd_use_jack()) {
m_captureArgs << "--use-jack";
QStringList ports = KdenliveSettings::rmd_jackports().split(" ", QString::SkipEmptyParts);
- for(int i = 0; i < ports.count(); ++i) {
+ for (int i = 0; i < ports.count(); ++i) {
m_captureArgs << ports.at(i);
}
if (KdenliveSettings::rmd_jack_buffer() > 0.0)
int previousStart = trackPlaylist.clip_start(clipIndex);
int previousDuration = trackPlaylist.clip_length(clipIndex) - 1;
m_isBlocked = true;
- kDebug() << "RESIZE, old start: " << previousStart + moveFrame<<", "<<previousStart + previousDuration;
+ kDebug() << "RESIZE, old start: " << previousStart + moveFrame << ", " << previousStart + previousDuration;
trackPlaylist.resize_clip(clipIndex, previousStart + moveFrame, previousStart + previousDuration);
if (moveFrame > 0) trackPlaylist.insert_blank(clipIndex, moveFrame - 1);
else {
m_view.image_type->addItem("TIFF (*.tiff)", "tiff");
m_view.image_type->addItem("Open EXR (*.exr)", "exr");
- m_view.clip_duration->setInputMask(m_timecode.inputMask());
+ m_view.clip_duration->setInputMask("");
+ m_view.clip_duration->setValidator(m_timecode.validator());
m_view.clip_duration->setText(m_timecode.reformatSeparators(KdenliveSettings::image_duration()));
- m_view.luma_duration->setInputMask(m_timecode.inputMask());
+ m_view.luma_duration->setInputMask("");
+ m_view.luma_duration->setValidator(m_timecode.validator());
m_view.luma_duration->setText(m_timecode.getTimecodeFromFrames(int(ceil(m_timecode.fps()))));
m_view.folder_url->setUrl(QDir::homePath());
m_view.luma_duration_frames->setValue(m_timecode.getFrameCount(m_view.luma_duration->text()));
} else {
// switching to timecode format
- m_view.clip_duration->setInputMask(m_timecode.inputMask());
+ m_view.clip_duration->setInputMask("");
+ m_view.clip_duration->setValidator(m_timecode.validator());
m_view.clip_duration->setText(m_timecode.getTimecodeFromFrames(m_view.clip_duration_frames->value()));
- m_view.luma_duration->setInputMask(m_timecode.inputMask());
+ m_view.luma_duration->setInputMask("");
+ m_view.luma_duration->setValidator(m_timecode.validator());
m_view.luma_duration->setText(m_timecode.getTimecodeFromFrames(m_view.luma_duration_frames->value()));
}
m_view.clip_duration_frames->setHidden(!framesFormat);
* (at your option) any later version. *
* *
***************************************************************************/
-#include "timecode.h"
+#include <QValidator>
+
+#include <KDebug>
+#include <KLocale>
-#include <kdebug.h>
-#include <klocale.h>
+#include "timecode.h"
-Timecode::Timecode(Formats format, double framesPerSecond, bool dropFrame) :
- m_format(format),
- m_dropFrame(dropFrame),
- m_displayedFramesPerSecond(framesPerSecond + 0.5),
- m_realFps(framesPerSecond)
+Timecode::Timecode(Formats format, double framesPerSecond, bool dropFrame)
{
+ m_validator = new QRegExpValidator(0);
+ setFormat(framesPerSecond, dropFrame, format);
}
Timecode::~Timecode()
{
}
+void Timecode::setFormat(double framesPerSecond, bool dropFrame, Formats format)
+{
+ m_displayedFramesPerSecond = (int)(framesPerSecond + 0.5);
+ m_dropFrame = dropFrame;
+ m_format = format;
+ m_realFps = framesPerSecond;
+ QRegExp regExp;
+ if (m_dropFrame)
+ regExp.setPattern("^\\d{2}:\\d{2}:\\d{2};\\d{2}$");
+ else
+ regExp.setPattern("^\\d{2}:\\d{2}:\\d{2}:\\d{2}$");
+ m_validator->setRegExp(regExp);
+}
+
double Timecode::fps() const
{
return m_realFps; //m_displayedFramesPerSecond;
return m_dropFrame;
}
-QString Timecode::inputMask() const
+const QValidator *Timecode::validator() const
{
- if (m_dropFrame) return "99:99.99:99";
- return "99:99:99:99";
+ return m_validator;
}
+
+
QString Timecode::reformatSeparators(QString duration) const
{
- if (m_dropFrame) {
- return duration.replace(5, 1, '.');
- }
- return duration.replace(5, 1, ':');
+ if (m_dropFrame)
+ return duration.replace(8, 1, ';');
+ return duration.replace(8, 1, ':');
}
int Timecode::getDisplayFrameCount(const QString duration, bool frameDisplay) const
int hours, minutes, seconds, frames;
hours = duration.section(':', 0, 0).toInt();
- if (duration.contains('.')) {
- minutes = duration.section('.', 0, 0).section(':', 1, 1).toInt();
- seconds = duration.section('.', 1, 1).section(':', 0, 0).toInt();
- frames = duration.section('.', 1, 1).section(':', 1, 1).toInt();
+ minutes = duration.section(':', 1, 1).toInt();
+ if (duration.contains(';')) {
+ seconds = duration.section(';', 0, 0).section(':', 2, 2).toInt();
+ frames = duration.section(';', 1, 1).toInt();
} else {
- //Handle Drop Frame timecode frame calculations, even if the timecode supplied uses incorrect "99:99:99:99" format instead of "99:99.99:99"
- minutes = duration.section(':', 1, 1).toInt();
+ //Handle Drop Frame timecode frame calculations, even if the timecode supplied uses incorrect "99:99:99:99" format instead of "99:99:99;99"
seconds = duration.section(':', 2, 2).toInt();
frames = duration.section(':', 3, 3).toInt();
}
text.append(QString::number(hours).rightJustified(2, '0', false));
text.append(':');
text.append(QString::number(minutes).rightJustified(2, '0', false));
- if (m_dropFrame) {
- text.append('.');
- } else {
- text.append(':');
- }
- text.append(QString::number(seconds).rightJustified(2, '0', false));
text.append(':');
+ text.append(QString::number(seconds).rightJustified(2, '0', false));
+ if (m_dropFrame)
+ text.append(';');
+ else
+ text.append(':');
text.append(QString::number(hundredths).rightJustified(2, '0', false));
return text;
text.append(':');
text.append(QString::number(tenMinuteIntervals));
text.append(QString::number(numMinutes));
- if (m_dropFrame) {
- text.append('.');
- } else {
- text.append(':');
- }
- text.append(QString::number(seconds).rightJustified(2, '0', false));
text.append(':');
+ text.append(QString::number(seconds).rightJustified(2, '0', false));
+ if (m_dropFrame)
+ text.append(';');
+ else
+ text.append(':');
text.append(QString::number(frames).rightJustified(2, '0', false));
return text;
#ifndef TIMECODE_H
#define TIMECODE_H
-#include <qstring.h>
+#include <QString>
#include "gentime.h"
+class QValidator;
+class QRegExpValidator;
+
/**
Handles the conversion of a GenTime into a nicely formatted string, taking into account things such as drop frame if necessary. Handles multiple formats, such as HH:MM:SS:FF, HH:MM:SS:F, All Frames, All Seconds, etc.
public:
enum Formats { HH_MM_SS_FF, HH_MM_SS_HH, Frames, Seconds };
- explicit Timecode(Formats format = HH_MM_SS_FF, double framesPerSecond =
- 25, bool dropFrame = false);
+ explicit Timecode(Formats format = HH_MM_SS_FF, double framesPerSecond = 25,
+ bool dropFrame = false);
- /** Set the current timecode format; this is the output format for this timecode. */
- void setFormat(double framesPerSecond, bool dropFrame = false, Formats format = HH_MM_SS_FF) {
- m_displayedFramesPerSecond = (int)(framesPerSecond + 0.5);
- m_dropFrame = dropFrame;
- m_format = format;
- m_realFps = framesPerSecond;
- }
+ /**
+ * Set the current timecode format; this is the output format for this timecode.
+ */
+ void setFormat(double framesPerSecond, bool dropFrame = false,
+ Formats format = HH_MM_SS_FF);
Formats format() const {
return m_format;
const QString getTimecodeFromFrames(int frames) const;
double fps() const;
bool df() const;
- QString inputMask() const;
+ const QValidator *validator() const;
QString reformatSeparators(QString duration) const;
private:
bool m_dropFrame;
int m_displayedFramesPerSecond;
double m_realFps;
+ QRegExpValidator *m_validator;
const QString getTimecodeHH_MM_SS_FF(const GenTime & time) const;
const QString getTimecodeHH_MM_SS_FF(int frames) const;
showToolbars(TITLE_SELECT);
//If project is drop frame, set the input mask as such.
- title_duration->setInputMask(m_tc.inputMask());
+ title_duration->setInputMask("");
+ title_duration->setValidator(m_tc.validator());
title_duration->setText(m_tc.reformatSeparators(KdenliveSettings::title_duration()));
connect(backgroundColor, SIGNAL(clicked()), this, SLOT(slotChangeBackground())) ;