Continue render deprecation

parent 2e004012
......@@ -2305,11 +2305,6 @@ const QString Bin::getDocumentProperty(const QString &key)
return m_doc->getDocumentProperty(key);
}
const QSize Bin::getRenderSize()
{
return m_doc->getRenderSize();
}
void Bin::slotUpdateJobStatus(const QString &id, int jobType, int status, const QString &label, const QString &actionName, const QString &details)
{
ProjectClip *clip = m_itemModel->getClipByBinID(id);
......@@ -2463,7 +2458,7 @@ void Bin::startJob(const QString &id, AbstractClipJob::JOBTYPE type)
if ((clip != nullptr) && !hasPendingJob(id, type)) {
// Launch job
const QList<ProjectClip *> clips = {clip};
m_jobManager->prepareJobs(clips, m_doc->fps(), type);
m_jobManager->prepareJobs(clips, pCore->getCurrentFps(), type);
}
}
......@@ -2875,7 +2870,7 @@ void Bin::startClipJob(const QStringList &params)
}
AbstractClipJob::JOBTYPE jobType = (AbstractClipJob::JOBTYPE)paramData.takeFirst().toInt();
QList<ProjectClip *> clips = selectedClips();
m_jobManager->prepareJobs(clips, m_doc->fps(), jobType, paramData);
m_jobManager->prepareJobs(clips, pCore->getCurrentFps(), jobType, paramData);
}
void Bin::slotCancelRunningJob(const QString &id, const QMap<QString, QString> &newProps)
......@@ -2929,7 +2924,7 @@ void Bin::loadSubClips(const QString &id, const QMap<QString, QString> &dataMap)
}
QMapIterator<QString, QString> i(dataMap);
QList<int> missingThumbs;
int maxFrame = clip->duration().frames(m_doc->fps()) - 1;
int maxFrame = clip->duration().frames(pCore->getCurrentFps()) - 1;
while (i.hasNext()) {
i.next();
if (!i.value().contains(QLatin1Char(';'))) {
......@@ -2963,7 +2958,7 @@ void Bin::addClipCut(const QString &id, int in, int out)
return;
}
sub = new ProjectSubClip(clip, m_itemModel, in, out, m_doc->timecode().getDisplayTimecodeFromFrames(in, KdenliveSettings::frametimecode()));
QStringList markersComment = clip->markersText(GenTime(in, m_doc->fps()), GenTime(out, m_doc->fps()));
QStringList markersComment = clip->markersText(GenTime(in, pCore->getCurrentFps()), GenTime(out, pCore->getCurrentFps()));
sub->setDescription(markersComment.join(QLatin1Char(';')));
QList<int> missingThumbs;
missingThumbs << in;
......@@ -3000,9 +2995,9 @@ void Bin::slotStartFilterJob(const ItemInfo &info, const QString &id, QMap<QStri
QMap<QString, QString> producerParams = QMap<QString, QString>();
producerParams.insert(QStringLiteral("producer"), clip->url());
if (info.cropDuration != GenTime()) {
producerParams.insert(QStringLiteral("in"), QString::number((int)info.cropStart.frames(m_doc->fps())));
producerParams.insert(QStringLiteral("out"), QString::number((int)(info.cropStart + info.cropDuration).frames(m_doc->fps())));
extraParams.insert(QStringLiteral("clipStartPos"), QString::number((int)info.startPos.frames(m_doc->fps())));
producerParams.insert(QStringLiteral("in"), QString::number((int)info.cropStart.frames(pCore->getCurrentFps())));
producerParams.insert(QStringLiteral("out"), QString::number((int)(info.cropStart + info.cropDuration).frames(pCore->getCurrentFps())));
extraParams.insert(QStringLiteral("clipStartPos"), QString::number((int)info.startPos.frames(pCore->getCurrentFps())));
extraParams.insert(QStringLiteral("clipTrack"), QString::number(info.track));
} else {
// We want to process whole clip
......@@ -3162,7 +3157,7 @@ void Bin::slotGotFilterJobResults(const QString &id, int startPos, int track, co
bool simpleList = false;
double sourceFps = clip->getOriginalFps();
if (qAbs(sourceFps) < 1e-4) {
sourceFps = m_doc->fps();
sourceFps = pCore->getCurrentFps();
}
if (filterInfo.contains(QStringLiteral("simplelist"))) {
// simple list
......@@ -3170,7 +3165,7 @@ void Bin::slotGotFilterJobResults(const QString &id, int startPos, int track, co
}
foreach (const QString &pos, value) {
if (simpleList) {
CommentedTime m(GenTime((int)(pos.toInt() * m_doc->fps() / sourceFps), m_doc->fps()), label + pos, markersType);
CommentedTime m(GenTime((int)(pos.toInt() * pCore->getCurrentFps() / sourceFps), pCore->getCurrentFps()), label + pos, markersType);
markersList << m;
index++;
continue;
......@@ -3183,7 +3178,7 @@ void Bin::slotGotFilterJobResults(const QString &id, int startPos, int track, co
if (newPos - cutPos < 24) {
continue;
}
CommentedTime m(GenTime(newPos + offset, m_doc->fps()), label + QString::number(index), markersType);
CommentedTime m(GenTime(newPos + offset, pCore->getCurrentFps()), label + QString::number(index), markersType);
markersList << m;
index++;
cutPos = newPos;
......@@ -3428,7 +3423,7 @@ void Bin::showTitleWidget(ProjectClip *clip)
if (dia_ui.exec() == QDialog::Accepted) {
QMap<QString, QString> newprops;
newprops.insert(QStringLiteral("xmldata"), dia_ui.xml().toString());
if (qAbs(dia_ui.duration() - clip->duration().frames(m_doc->fps())) > 1e-4) {
if (qAbs(dia_ui.duration() - clip->duration().frames(pCore->getCurrentFps())) > 1e-4) {
// duration changed, we need to update duration
newprops.insert(QStringLiteral("out"), QString::number(dia_ui.duration() - 1));
int currentLength = clip->getProducerIntProperty(QStringLiteral("kdenlive:duration"));
......
......@@ -231,9 +231,6 @@ public:
/** @brief A proxy clip was just created, pass it to the responsible item */
void gotProxy(const QString &id, const QString &path);
/** @brief Get the document's renderer frame size */
const QSize getRenderSize();
/** @brief Give a number available for a clip id, used when adding a new clip to the project. Id must be unique */
int getFreeClipId();
......
......@@ -261,12 +261,22 @@ std::unique_ptr<ProfileModel> &Core::getCurrentProfile() const
return ProfileRepository::get()->getProfile(profile);
}
int Core::getCurrentDar() const
double Core::getCurrentDar() const
{
return getCurrentProfile()->dar();
}
int Core::getCurrentFps() const
double Core::getCurrentFps() const
{
return getCurrentProfile()->fps();
}
QSize Core::getCurrentFrameDisplaySize() const
{
return QSize((int)(getCurrentProfile()->height() * getCurrentDar() + 0.5), getCurrentProfile()->height());
}
QSize Core::getCurrentFrameSize() const
{
return QSize(getCurrentProfile()->width(), getCurrentProfile()->height());
}
......@@ -95,10 +95,15 @@ public:
std::unique_ptr<ProfileModel> &getCurrentProfile() const;
/** @brief Returns Display Aspect Ratio of current profile */
int getCurrentDar() const;
double getCurrentDar() const;
/** @brief Returns frame rate of current profile */
int getCurrentFps() const;
double getCurrentFps() const;
/** @brief Returns the frame size (width x height) of current profile */
QSize getCurrentFrameSize() const;
/** @brief Returns the frame display size (width x height) of current profile */
QSize getCurrentFrameDisplaySize() const;
private:
explicit Core();
......
......@@ -30,6 +30,7 @@
#include "effectslist/initeffects.h"
#include "kdenlivesettings.h"
#include "mainwindow.h"
#include "renderer.h"
#include "mltcontroller/bincontroller.h"
#include "mltcontroller/clipcontroller.h"
#include "mltcontroller/effectscontroller.h"
......@@ -37,7 +38,6 @@
#include "profiles/profilemodel.hpp"
#include "project/clipmanager.h"
#include "project/projectcommands.h"
#include "renderer.h"
#include "timeline/transitionhandler.h"
#include "titler/titlewidget.h"
#include "utils/KoIconUtils.h"
......@@ -71,14 +71,13 @@
const double DOCUMENTVERSION = 0.96;
KdenliveDoc::KdenliveDoc(const QUrl &url, const QString &projectFolder, QUndoGroup *undoGroup, const QString &profileName,
const QMap<QString, QString> &properties, const QMap<QString, QString> &metadata, const QPoint &tracks, Render *render,
const QMap<QString, QString> &properties, const QMap<QString, QString> &metadata, const QPoint &tracks,
bool *openBackup, MainWindow *parent)
: QObject(parent)
, m_autosave(nullptr)
, m_url(url)
, m_width(0)
, m_height(0)
, m_render(render)
, m_modified(false)
, m_projectFolder(projectFolder)
{
......@@ -583,13 +582,13 @@ void KdenliveDoc::slotAutoSave()
{
// TODO: re-enable when qml timeline is ready
return;
if ((m_render != nullptr) && (m_autosave != nullptr)) {
if (m_autosave != nullptr) {
if (!m_autosave->isOpen() && !m_autosave->open(QIODevice::ReadWrite)) {
// show error: could not open the autosave file
qCDebug(KDENLIVE_LOG) << "ERROR; CANNOT CREATE AUTOSAVE FILE";
}
// qCDebug(KDENLIVE_LOG) << "// AUTOSAVE FILE: " << m_autosave->fileName();
QDomDocument sceneList = xmlSceneList(m_render->sceneList(m_url.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash).toLocalFile()));
QDomDocument sceneList = xmlSceneList(pCore->monitorManager()->projectMonitor()->sceneList(m_url.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash).toLocalFile()));
if (sceneList.isNull()) {
// Make sure we don't save if scenelist is corrupted
KMessageBox::error(QApplication::activeWindow(), i18n("Cannot write to file %1, scene list is corrupted.", m_autosave->fileName()));
......@@ -833,11 +832,16 @@ bool KdenliveDoc::profileChanged(const QString &profile) const
ProfileInfo KdenliveDoc::getProfileInfo() const
{
ProfileInfo info;
info.profileSize = getRenderSize();
info.profileFps = fps();
info.profileSize = pCore->getCurrentFrameSize();
info.profileFps = pCore->getCurrentFps();
return info;
}
Render *KdenliveDoc::renderer()
{
return nullptr;
}
double KdenliveDoc::dar() const
{
return (double)m_profile.display_aspect_num / m_profile.display_aspect_den;
......@@ -848,11 +852,6 @@ std::shared_ptr<DocUndoStack> KdenliveDoc::commandStack()
return m_commandStack;
}
Render *KdenliveDoc::renderer()
{
return m_render;
}
int KdenliveDoc::getFramePos(const QString &duration)
{
return m_timecode.getFrameCount(duration);
......@@ -875,15 +874,7 @@ QDomNodeList KdenliveDoc::producersList()
double KdenliveDoc::projectDuration() const
{
if (m_render) {
return GenTime(m_render->getLength(), m_render->fps()).ms() / 1000;
}
return 0;
}
double KdenliveDoc::fps() const
{
return m_render->fps();
return GenTime(pCore->monitorManager()->projectMonitor()->duration(), pCore->getCurrentFps()).ms() / 1000;
}
int KdenliveDoc::width() const
......@@ -1147,15 +1138,6 @@ void KdenliveDoc::updateProjectFolderPlacesEntry()
}
}
const QSize KdenliveDoc::getRenderSize() const
{
QSize size;
if (m_render) {
size.setWidth(m_render->frameRenderWidth());
size.setHeight(m_render->renderHeight());
}
return size;
}
// static
double KdenliveDoc::getDisplayRatio(const QString &path)
{
......@@ -1458,7 +1440,7 @@ QMap<QString, QString> KdenliveDoc::documentProperties()
m_projectFolder + QLatin1Char('/') + m_documentProperties.value(QStringLiteral("documentid")));
}
m_documentProperties.insert(QStringLiteral("profile"), profilePath());
m_documentProperties.insert(QStringLiteral("position"), QString::number(m_render->seekPosition().frames(m_render->fps())));
m_documentProperties.insert(QStringLiteral("position"), QString::number(pCore->monitorManager()->projectMonitor()->position().frames(pCore->getCurrentFps())));
if (!m_documentProperties.contains(QStringLiteral("decimalPoint"))) {
m_documentProperties.insert(QStringLiteral("decimalPoint"), QLocale().decimalPoint());
}
......@@ -1721,7 +1703,8 @@ void KdenliveDoc::selectPreviewProfile()
QMapIterator<QString, QString> i(values);
QStringList matchingProfiles;
QStringList fallBackProfiles;
QString profileSize = QStringLiteral("%1x%2").arg(m_render->renderWidth()).arg(m_render->renderHeight());
QSize pSize = pCore->getCurrentFrameDisplaySize();
QString profileSize = QStringLiteral("%1x%2").arg(pSize.width()).arg(pSize.height());
while (i.hasNext()) {
i.next();
......@@ -1741,7 +1724,7 @@ void KdenliveDoc::selectPreviewProfile()
rateFound = true;
double fps = arg.section(QLatin1Char('='), 1).toDouble();
if (fps > 0) {
if (qAbs((int)(m_render->fps() * 100) - (fps * 100)) <= 1) {
if (qAbs((int)(pCore->getCurrentFps() * 100) - (fps * 100)) <= 1) {
matchingProfiles << i.value();
break;
}
......@@ -1776,7 +1759,8 @@ void KdenliveDoc::checkPreviewStack()
void KdenliveDoc::saveMltPlaylist(const QString &fileName)
{
m_render->preparePreviewRendering(fileName);
//TODO REFAC
//m_render->preparePreviewRendering(fileName);
}
void KdenliveDoc::initCacheDirs()
......
......@@ -43,13 +43,13 @@
#include "timecode.h"
#include "timeline/guide.h"
class Render;
class ClipManager;
class MainWindow;
class TrackInfo;
class ProjectClip;
class ClipController;
class MarkerListModel;
class Render;
class QTextEdit;
class QUndoGroup;
......@@ -66,7 +66,7 @@ class KdenliveDoc : public QObject
Q_OBJECT
public:
KdenliveDoc(const QUrl &url, const QString &projectFolder, QUndoGroup *undoGroup, const QString &profileName, const QMap<QString, QString> &properties,
const QMap<QString, QString> &metadata, const QPoint &tracks, Render *render, bool *openBackup, MainWindow *parent = nullptr);
const QMap<QString, QString> &metadata, const QPoint &tracks, bool *openBackup, MainWindow *parent = nullptr);
~KdenliveDoc();
/** @brief Get current document's producer. */
Mlt::Producer *getProjectProducer();
......@@ -79,7 +79,6 @@ public:
Timecode timecode() const;
QDomDocument toXml();
std::shared_ptr<DocUndoStack> commandStack();
Render *renderer();
ClipManager *clipManager();
QString groupsXml() const;
......@@ -132,8 +131,6 @@ public:
const QMap<QString, QString> metadata() const;
/** @brief Set the document metadata (author, copyright, ...) */
void setMetadata(const QMap<QString, QString> &meta);
/** @brief Get frame size of the renderer (profile)*/
const QSize getRenderSize() const;
/** @brief Add url to the file watcher so that we monitor changes */
void watchFile(const QString &url);
/** @brief Get all document properties that need to be saved */
......@@ -172,6 +169,9 @@ public:
/** @brief Returns a pointer to the guide model */
std::shared_ptr<MarkerListModel> getGuideModel() const;
// TODO REFAC: delete */
Render *renderer();
private:
QUrl m_url;
QDomDocument m_document;
......@@ -183,7 +183,6 @@ private:
int m_width;
int m_height;
Timecode m_timecode;
Render *m_render;
std::shared_ptr<DocUndoStack> m_commandStack;
ClipManager *m_clipManager;
MltVideoProfile m_profile;
......
......@@ -1962,7 +1962,7 @@ void MainWindow::connectDocument()
KdenliveDoc *project = pCore->projectManager()->current();
connect(project, &KdenliveDoc::startAutoSave, pCore->projectManager(), &ProjectManager::slotStartAutoSave);
connect(project, &KdenliveDoc::reloadEffects, this, &MainWindow::slotReloadEffects);
KdenliveSettings::setProject_fps(project->fps());
KdenliveSettings::setProject_fps(pCore->getCurrentFps());
m_clipMonitorDock->raise();
m_effectStack->transitionConfig()->updateProjectFormat();
......@@ -2273,8 +2273,8 @@ void MainWindow::slotAddClipMarker()
if (pCore->projectManager()->currentTimeline()) {
ClipItem *item = pCore->projectManager()->currentTimeline()->projectView()->getActiveClipUnderCursor();
if (item) {
pos = GenTime((int)((m_projectMonitor->position() - item->startPos() + item->cropStart()).frames(project->fps()) * item->speed() + 0.5),
project->fps());
pos = GenTime((int)((m_projectMonitor->position() - item->startPos() + item->cropStart()).frames(pCore->getCurrentFps()) * item->speed() + 0.5),
pCore->getCurrentFps());
clip = pCore->binController()->getController(item->getBinId()).get();
}
}
......@@ -2293,7 +2293,7 @@ void MainWindow::slotAddClipMarker()
pCore->bin()->slotAddClipMarker(id, QList<CommentedTime>() << d->newMarker());
QString hash = clip->getClipHash();
if (!hash.isEmpty()) {
project->cacheImage(hash + QLatin1Char('#') + QString::number(d->newMarker().time().frames(project->fps())), d->markerImage());
project->cacheImage(hash + QLatin1Char('#') + QString::number(d->newMarker().time().frames(pCore->getCurrentFps())), d->markerImage());
}
}
delete d;
......@@ -2387,7 +2387,7 @@ void MainWindow::slotEditClipMarker()
QString hash = clip->getClipHash();
if (!hash.isEmpty()) {
pCore->projectManager()->current()->cacheImage(
hash + QLatin1Char('#') + QString::number(d->newMarker().time().frames(pCore->projectManager()->current()->fps())), d->markerImage());
hash + QLatin1Char('#') + QString::number(d->newMarker().time().frames(pCore->getCurrentFps())), d->markerImage());
}
if (d->newMarker().time() != pos) {
// remove old marker
......@@ -3440,20 +3440,20 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS
in = pCore->projectManager()->currentTimeline()->inPoint();
out = pCore->projectManager()->currentTimeline()->outPoint();
} else {
out = (int)GenTime(project->projectDuration()).frames(project->fps()) - 2;
out = (int)GenTime(project->projectDuration()).frames(pCore->getCurrentFps()) - 2;
}
QString playlistContent = pCore->projectManager()->projectSceneList(project->url().adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash).toLocalFile());
if (!chapterFile.isEmpty()) {
QDomDocument doc;
QDomElement chapters = doc.createElement(QStringLiteral("chapters"));
chapters.setAttribute(QStringLiteral("fps"), project->fps());
chapters.setAttribute(QStringLiteral("fps"), pCore->getCurrentFps());
doc.appendChild(chapters);
QMap<double, QString> guidesData = pCore->projectManager()->currentTimeline()->projectView()->guidesData();
QMapIterator<double, QString> g(guidesData);
while (g.hasNext()) {
g.next();
int time = (int)GenTime(g.key()).frames(project->fps());
int time = (int)GenTime(g.key()).frames(pCore->getCurrentFps());
if (time >= in && time < out) {
if (zoneOnly) {
time = time - in;
......
......@@ -2228,3 +2228,8 @@ void Monitor::setProducer(Mlt::Producer *producer)
{
m_glMonitor->setProducer(producer);
}
int Monitor::duration() const
{
return m_length;
}
......@@ -155,6 +155,8 @@ public:
/** @brief Seeks timeline without refreshing if monitor is not active **/
void silentSeek(int pos);
void setProducer(Mlt::Producer *producer);
/** @brief Returns current monitor's duration in frames **/
int duration() const;
protected:
void mousePressEvent(QMouseEvent *event) override;
......
......@@ -290,7 +290,7 @@ void ClipManager::slotAddTextTemplateClip(const QString &titleName, const QUrl &
AbstractGroupItem *ClipManager::createGroup()
{
QMutexLocker lock(&m_groupsMutex);
auto *group = new AbstractGroupItem(m_doc->fps());
auto *group = new AbstractGroupItem(pCore->getCurrentFps());
m_groupsList.append(group);
return group;
}
......@@ -332,12 +332,12 @@ QString ClipManager::groupsXml()
if (item->type() == AVWidget) {
QDomElement clip = doc.createElement(QStringLiteral("clipitem"));
clip.setAttribute(QStringLiteral("track"), info.track);
clip.setAttribute(QStringLiteral("position"), info.startPos.frames(m_doc->fps()));
clip.setAttribute(QStringLiteral("position"), info.startPos.frames(pCore->getCurrentFps()));
group.appendChild(clip);
} else if (item->type() == TransitionWidget) {
QDomElement clip = doc.createElement(QStringLiteral("transitionitem"));
clip.setAttribute(QStringLiteral("track"), info.track);
clip.setAttribute(QStringLiteral("position"), info.startPos.frames(m_doc->fps()));
clip.setAttribute(QStringLiteral("position"), info.startPos.frames(pCore->getCurrentFps()));
group.appendChild(clip);
}
}
......
......@@ -20,6 +20,7 @@
#include "proxyclipjob.h"
#include "bin/bin.h"
#include "core.h"
#include "bin/projectclip.h"
#include "doc/kdenlivedoc.h"
#include "kdenlive_debug.h"
......@@ -320,7 +321,7 @@ QList<ProjectClip *> ProxyJob::filterClips(const QList<ProjectClip *> &clips)
QHash<ProjectClip *, AbstractClipJob *> ProxyJob::prepareJob(Bin *bin, const QList<ProjectClip *> &clips)
{
QHash<ProjectClip *, AbstractClipJob *> jobs;
QSize renderSize = bin->getRenderSize();
QSize renderSize = pCore->getCurrentFrameSize();
QString params = bin->getDocumentProperty(QStringLiteral("proxyparams")).simplified();
for (int i = 0; i < clips.count(); i++) {
ProjectClip *item = clips.at(i);
......
......@@ -44,7 +44,7 @@ void NotesPlugin::setProject(KdenliveDoc *document)
void NotesPlugin::slotInsertTimecode()
{
int frames = pCore->monitorManager()->projectMonitor()->render->seekPosition().frames(pCore->projectManager()->current()->fps());
int frames = pCore->monitorManager()->projectMonitor()->render->seekPosition().frames(pCore->getCurrentFps());
QString position = pCore->projectManager()->current()->timecode().getTimecodeFromFrames(frames);
m_widget->insertHtml(QStringLiteral("<a href=\"") + QString::number(frames) + QStringLiteral("\">") + position + QStringLiteral("</a> "));
}
......
......@@ -194,7 +194,7 @@ void ProjectManager::newFile(bool showProjectSettings, bool force)
bool openBackup;
m_notesPlugin->clear();
KdenliveDoc *doc = new KdenliveDoc(QUrl(), projectFolder, pCore->window()->m_commandStack, profileName, documentProperties, documentMetadata, projectTracks,
pCore->monitorManager()->projectMonitor()->render, &openBackup, pCore->window());
&openBackup, pCore->window());
doc->m_autosave = new KAutoSaveFile(startFile, doc);
bool ok;
pCore->bin()->setDocument(doc);
......@@ -532,7 +532,7 @@ void ProjectManager::doOpenFile(const QUrl &url, KAutoSaveFile *stale)
new KdenliveDoc(stale ? QUrl::fromLocalFile(stale->fileName()) : url, QString(), pCore->window()->m_commandStack,
KdenliveSettings::default_profile().isEmpty() ? KdenliveSettings::current_profile() : KdenliveSettings::default_profile(),
QMap<QString, QString>(), QMap<QString, QString>(), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()),
pCore->monitorManager()->projectMonitor()->render, &openBackup, pCore->window());
&openBackup, pCore->window());
if (stale == nullptr) {
stale = new KAutoSaveFile(url, doc);
doc->m_autosave = stale;
......@@ -864,7 +864,6 @@ void ProjectManager::slotMoveFinished(KJob *job)
void ProjectManager::updateTimeline(Mlt::Tractor tractor)
{
qDebug() << "FILLING TIMELINEWIDGET";
pCore->binController()->loadBinPlaylist(tractor);
const QStringList ids = pCore->binController()->getClipIds();
for (const QString &id : ids) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -42,6 +42,7 @@
#include "transition.h"
#include "transitionhandler.h"
#include "utils/KoIconUtils.h"
#include "core.h"
#include <KDualAction>
#include <QLocale>
......@@ -387,7 +388,7 @@ void Timeline::checkDuration()
void Timeline::getTransitions()
{
int compositeMode = 0;
double fps = m_doc->fps();
double fps = pCore->getCurrentFps();
mlt_service service = mlt_service_get_producer(m_tractor->get_service());
QScopedPointer<Mlt::Field> field(m_tractor->field());
while (service != nullptr) {
......@@ -1000,8 +1001,8 @@ void Timeline::reloadTrack(const ItemInfo &info, bool includeLastFrame)
}
Mlt::Playlist pl = m_tracks.at(info.track)->playlist();
// Remove current clips
int startIndex = pl.get_clip_index_at(info.startPos.frames(m_doc->fps()));
int endIndex = pl.get_clip_index_at(info.endPos.frames(m_doc->fps())) - (includeLastFrame ? 0 : 1);
int startIndex = pl.get_clip_index_at(info.startPos.frames(pCore->getCurrentFps()));
int endIndex = pl.get_clip_index_at(info.endPos.frames(pCore->getCurrentFps())) - (includeLastFrame ? 0 : 1);
// Reload items
loadTrack(info.track, 0, pl, startIndex, endIndex, false);
}
......@@ -1009,7 +1010,7 @@ void Timeline::reloadTrack(const ItemInfo &info, bool includeLastFrame)
int Timeline::loadTrack(int ix, int offset, Mlt::Playlist &playlist, int start, int end, bool updateReferences)
{
// parse track
double fps = m_doc->fps();
double fps = pCore->getCurrentFps();
if (end == -1) {
end = playlist.count();
}
......@@ -1111,7 +1112,7 @@ void Timeline::loadGuides(const QMap<double, QString> &guidesData)
while (i.hasNext()) {
i.next();
// Guide positions are stored in seconds. we need to make sure that the time matches a frame
const GenTime pos = GenTime(GenTime(i.key()).frames(m_doc->fps()), m_doc->fps());
const GenTime pos = GenTime(GenTime(i.key()).frames(pCore->getCurrentFps()), pCore->getCurrentFps());
m_trackview->addGuide(pos, i.value(), true);
}
}
......@@ -1609,7 +1610,7 @@ MltVideoProfile Timeline::mltProfile() const
double Timeline::fps() const
{
return m_doc->fps();
return pCore->getCurrentFps();
}
QPoint Timeline::getTracksCount()
......@@ -1710,7 +1711,7 @@ int Timeline::getSpaceLength(const GenTime &pos, int tk, bool fromBlankStart)
if (!sourceTrack) {
return 0;
}
int insertPos = pos.frames(m_doc->fps());
int insertPos = pos.frames(pCore->getCurrentFps());
return sourceTrack->spaceLength(insertPos, fromBlankStart);
}
......@@ -1980,7 +1981,7 @@ void Timeline::invalidateRange(const ItemInfo &info)
return;
}
if (info.isValid()) {
m_timelinePreview->invalidatePreview(info.startPos.frames(m_doc->fps()), info.endPos.frames(m_doc->fps()));
m_timelinePreview->invalidatePreview(info.startPos.frames(pCore->getCurrentFps()), info.endPos.frames(pCore->getCurrentFps()));
} else {
m_timelinePreview->invalidatePreview(0, m_trackview->duration());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment