setMinimumHeight(20);
}
+void CustomRuler::updateProjectFps(Timecode t)
+{
+ m_timecode = t;
+ mediumMarkDistance = FRAME_SIZE * m_timecode.fps();
+ bigMarkDistance = FRAME_SIZE * m_timecode.fps() * 60;
+ update();
+}
+
void CustomRuler::slotEditGuide()
{
m_view->slotEditGuide(m_clickedGuide);
void setDuration(int d);
void setZone(QPoint p);
int offset() const;
+ void updateProjectFps(Timecode t);
protected:
virtual void paintEvent(QPaintEvent * /*e*/);
int max;
if (pa.attribute("min").startsWith('%')) {
min = (int) ProfilesDialog::getStringEval(m_profile, pa.attribute("min"));
- }
- else min = pa.attribute("min").toInt();
+ } else min = pa.attribute("min").toInt();
if (pa.attribute("max").startsWith('%')) {
max = (int) ProfilesDialog::getStringEval(m_profile, pa.attribute("max"));
- }
- else max = pa.attribute("max").toInt();
+ } else max = pa.attribute("max").toInt();
createSliderItem(paramName, (int)(value.toDouble() + 0.5) , min, max);
delete toFillin;
toFillin = NULL;
kDebug() << "Kdenlive document, init timecode: " << m_fps;
if (m_fps == 30000.0 / 1001.0) m_timecode.setFormat(30, true);
- else m_timecode.setFormat((int) m_fps);
+ else m_timecode.setFormat((int)(m_fps + 0.5));
//kDebug() << "// SETTING SCENE LIST:\n\n" << m_document.toString();
connect(m_autoSaveTimer, SIGNAL(timeout()), this, SLOT(slotAutoSave()));
m_height = m_profile.height;
kDebug() << "Kdenlive document, init timecode from path: " << path << ", " << m_fps;
if (m_fps == 30000.0 / 1001.0) m_timecode.setFormat(30, true);
- else m_timecode.setFormat((int) m_fps);
+ else m_timecode.setFormat((int)(m_fps + 0.5));
}
double KdenliveDoc::dar()
if (m_activeDocument->profilePath() != profile) {
// Profile was changed
double dar = m_activeDocument->dar();
-
- // Deselect current effect / transition
- m_effectStack->slotClipItemSelected(NULL, 0);
- m_transitionConfig->slotTransitionItemSelected(NULL, 0, QPoint(), false);
-
+
+ // Deselect current effect / transition
+ m_effectStack->slotClipItemSelected(NULL, 0);
+ m_transitionConfig->slotTransitionItemSelected(NULL, 0, QPoint(), false);
+
m_activeDocument->setProfilePath(profile);
KdenliveSettings::setCurrent_profile(profile);
KdenliveSettings::setProject_fps(m_activeDocument->fps());
setCaption(m_activeDocument->description(), m_activeDocument->isModified());
m_monitorManager->resetProfiles(m_activeDocument->timecode());
- m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeTimeline->tracksNumber());
- m_effectStack->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode());
+ m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeTimeline->tracksNumber());
+ m_effectStack->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode());
if (m_renderWidget) m_renderWidget->setProfile(m_activeDocument->mltProfile());
m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
m_activeDocument->clipManager()->resetProducersList(m_projectMonitor->render->producersList());
if (dar != m_activeDocument->dar()) m_projectList->reloadClipThumbnails();
+ m_activeTimeline->updateProjectFps();
// We need to desactivate & reactivate monitors to get a refresh
m_monitorManager->switchMonitors();
}
setCaption(doc->description(), doc->isModified());
m_saveAction->setEnabled(doc->isModified());
m_activeDocument = doc;
+ m_activeTimeline->updateProjectFps();
if (KdenliveSettings::dropbframes()) slotUpdatePreviewSettings();
// set tool to select tool
Timecode::Timecode(Formats format, int framesPerSecond, bool dropFrame) :
m_format(format),
m_dropFrame(dropFrame),
- m_displayedFramesPerSecond(framesPerSecond)
+ m_displayedFramesPerSecond(framesPerSecond + 0.5)
{
}
if (m_dropFrame)
return getTimecodeDropFrame(time, fps);
- return getTimecodeHH_MM_SS_FF((int)time.frames(fps));
+ return getTimecodeHH_MM_SS_FF((int)(time.frames(fps) + 0.5));
}
QString Timecode::getTimecodeHH_MM_SS_FF(int frames) const
QDomElement e = params.item(i).toElement();
if (!e.isNull() && e.attribute("tag") == paramName) {
if (e.attribute("type") == "double") {
- QString factor = e.attribute("factor", "1");
+ QString factor = e.attribute("factor", "1");
if (factor != "1") {
- double fact;
- if (factor.startsWith('%')) {
- fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
- }
- else fact = factor.toDouble();
+ double fact;
+ if (factor.startsWith('%')) {
+ fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
+ } else fact = factor.toDouble();
double val = paramValue.toDouble() * fact;
paramValue = QString::number(val);
}
double fact;
if (factor.isEmpty()) fact = 1;
else if (factor.startsWith('%')) {
- fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
+ fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
} else fact = factor.toDouble();
for (QDomNode n3 = effect.firstChild(); !n3.isNull(); n3 = n3.nextSibling()) {
// parse effect parameters
QString factor = e.attribute("factor", "1");
double fact;
if (factor.startsWith('%')) {
- fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
+ fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
} else fact = factor.toDouble();
e.setAttribute("value", paramvalue.toDouble() * fact);
} else e.setAttribute("value", paramvalue);
adjustTrackHeaders();
}
+void TrackView::updateProjectFps()
+{
+ m_ruler->updateProjectFps(m_doc->timecode());
+}
+
#include "trackview.moc"
int tracksNumber() const;
KdenliveDoc *document();
void refresh() ;
+ void updateProjectFps();
int outPoint() const;
int inPoint() const;
int fitZoom() const;