Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Start deprecating renderer

parent 15df53a7
......@@ -3412,7 +3412,7 @@ void Bin::showTitleWidget(ProjectClip *clip)
QString path = clip->getProducerProperty(QStringLiteral("resource"));
QDir titleFolder(m_doc->projectDataFolder() + QStringLiteral("/titles"));
titleFolder.mkpath(QStringLiteral("."));
TitleWidget dia_ui(QUrl(), m_doc->timecode(), titleFolder.absolutePath(), pCore->monitorManager()->projectMonitor()->render, pCore->window());
TitleWidget dia_ui(QUrl(), m_doc->timecode(), titleFolder.absolutePath(), pCore->monitorManager()->projectMonitor(), pCore->window());
connect(&dia_ui, &TitleWidget::requestBackgroundFrame, this, &Bin::slotGetCurrentProjectImage);
QDomDocument doc;
QString xmldata = clip->getProducerProperty(QStringLiteral("xmldata"));
......@@ -3563,8 +3563,9 @@ void Bin::slotUpdateClipProperties(const QString &id, const QMap<QString, QStrin
void Bin::updateTimelineProducers(const QString &id, const QMap<QString, QString> &passProperties)
{
pCore->projectManager()->currentTimeline()->updateClipProperties(id, passProperties);
m_doc->renderer()->updateSlowMotionProducers(id, passProperties);
//TODO REFAC
//pCore->projectManager()->currentTimeline()->updateClipProperties(id, passProperties);
//m_doc->renderer()->updateSlowMotionProducers(id, passProperties);
}
void Bin::showSlideshowWidget(ProjectClip *clip)
......
......@@ -152,6 +152,7 @@ void Core::initGUI(const QUrl &Url)
connect(m_binController.get(), &BinController::requestAudioThumb, m_binWidget, &Bin::slotCreateAudioThumb);
connect(m_binController.get(), &BinController::abortAudioThumbs, m_binWidget, &Bin::abortAudioThumbs);
connect(m_binController.get(), SIGNAL(loadThumb(QString, QImage, bool)), m_binWidget, SLOT(slotThumbnailReady(QString, QImage, bool)));
connect(m_binController.get(), &BinController::setDocumentNotes, m_projectManager, &ProjectManager::setDocumentNotes);
m_monitorManager = new MonitorManager(this);
// Producer queue, creating MLT::Producers on request
m_producerQueue = new ProducerQueue(m_binController);
......
......@@ -290,7 +290,7 @@ void ClipCreationDialog::createTitleClip(KdenliveDoc *doc, const QStringList &gr
// Make sure the titles folder exists
QDir dir(doc->projectDataFolder() + QStringLiteral("/titles"));
dir.mkpath(QStringLiteral("."));
QPointer<TitleWidget> dia_ui = new TitleWidget(QUrl::fromLocalFile(templatePath), doc->timecode(), dir.absolutePath(), doc->renderer(), bin);
QPointer<TitleWidget> dia_ui = new TitleWidget(QUrl::fromLocalFile(templatePath), doc->timecode(), dir.absolutePath(), bin->monitor(), bin);
QObject::connect(dia_ui.data(), &TitleWidget::requestBackgroundFrame, bin, &Bin::slotGetCurrentProjectImage);
if (dia_ui->exec() == QDialog::Accepted) {
// Ready, create clip xml
......
......@@ -35,8 +35,6 @@
#include "mltcontroller/producerqueue.h"
#include "profiles/profilemodel.hpp"
#include "project/clipmanager.h"
#include "project/dialogs/noteswidget.h"
#include "project/notesplugin.h"
#include "project/projectcommands.h"
#include "renderer.h"
#include "timeline/transitionhandler.h"
......@@ -73,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,
NotesPlugin *notes, bool *openBackup, MainWindow *parent)
bool *openBackup, MainWindow *parent)
: QObject(parent)
, m_autosave(nullptr)
, m_url(url)
, m_width(0)
, m_height(0)
, m_render(render)
, m_notesWidget(notes->widget())
, m_modified(false)
, m_projectFolder(projectFolder)
{
......@@ -102,7 +99,6 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QString &projectFolder, QUndoGro
bool success = false;
connect(m_commandStack.get(), &QUndoStack::indexChanged, this, &KdenliveDoc::slotModified);
connect(m_commandStack.get(), &DocUndoStack::invalidate, this, &KdenliveDoc::checkPreviewStack);
connect(m_render, &Render::setDocumentNotes, this, &KdenliveDoc::slotSetDocumentNotes);
connect(pCore->producerQueue(), &ProducerQueue::switchProfile, this, &KdenliveDoc::switchProfile);
// connect(m_commandStack, SIGNAL(cleanChanged(bool)), this, SLOT(setModified(bool)));
......@@ -282,11 +278,6 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QString &projectFolder, QUndoGro
updateProjectFolderPlacesEntry();
}
void KdenliveDoc::slotSetDocumentNotes(const QString &notes)
{
m_notesWidget->setHtml(notes);
}
KdenliveDoc::~KdenliveDoc()
{
if (m_url.isEmpty()) {
......@@ -701,15 +692,6 @@ QDomDocument KdenliveDoc::xmlSceneList(const QString &scene)
return sceneList;
}
QString KdenliveDoc::documentNotes() const
{
QString text = m_notesWidget->toPlainText().simplified();
if (text.isEmpty()) {
return QString();
}
return m_notesWidget->toHtml();
}
bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene)
{
QDomDocument sceneList = xmlSceneList(scene);
......
......@@ -47,7 +47,6 @@ class Render;
class ClipManager;
class MainWindow;
class TrackInfo;
class NotesPlugin;
class ProjectClip;
class ClipController;
......@@ -66,7 +65,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, NotesPlugin *notes, bool *openBackup,
const QMap<QString, QString> &metadata, const QPoint &tracks, Render *render, bool *openBackup,
MainWindow *parent = nullptr);
~KdenliveDoc();
/** @brief Get current document's producer. */
......@@ -142,7 +141,6 @@ public:
bool useProxy() const;
bool autoGenerateProxy(int width) const;
bool autoGenerateImageProxy(int width) const;
QString documentNotes() const;
/** @brief Saves effects embedded in project file. */
void saveCustomEffects(const QDomNodeList &customeffects);
void resetProfile();
......@@ -183,7 +181,6 @@ private:
int m_height;
Timecode m_timecode;
Render *m_render;
QTextEdit *m_notesWidget;
std::shared_ptr<DocUndoStack> m_commandStack;
ClipManager *m_clipManager;
MltVideoProfile m_profile;
......@@ -231,7 +228,6 @@ private slots:
void slotClipMissing(const QString &path);
void slotProcessModifiedClips();
void slotModified();
void slotSetDocumentNotes(const QString &notes);
void switchProfile(MltVideoProfile profile, const QString &id, const QDomElement &xml);
void slotSwitchProfile();
/** @brief Check if we did a new action invalidating more recent undo items. */
......
......@@ -297,7 +297,7 @@ Monitor::Monitor(Kdenlive::MonitorId id, MonitorManager *manager, QWidget *paren
connect(render, &Render::durationChanged, this, &Monitor::adjustRulerSize);
connect(render, &Render::rendererStopped, this, &Monitor::rendererStopped);
connect(render, &AbstractRender::scopesClear, m_glMonitor, &GLWidget::releaseAnalyse, Qt::DirectConnection);
connect(m_glMonitor, SIGNAL(analyseFrame(QImage)), render, SIGNAL(frameUpdated(QImage)));
connect(m_glMonitor, SIGNAL(analyseFrame(QImage)), this, SIGNAL(frameUpdated(QImage)));
connect(m_glMonitor, &GLWidget::audioSamplesSignal, render, &AbstractRender::audioSamplesSignal);
if (id != Kdenlive::ClipMonitor) {
......
......@@ -374,6 +374,8 @@ signals:
void removeSplitOverlay();
void acceptRipple(bool);
void switchTrimMode(int);
/** @brief Send a frame for analysis of title background display. */
void frameUpdated(const QImage &);
};
#endif
......@@ -21,6 +21,7 @@ the Free Software Foundation, either version 3 of the License, or
#include "project/dialogs/archivewidget.h"
#include "project/dialogs/backupwidget.h"
#include "project/dialogs/projectsettings.h"
#include "project/dialogs/noteswidget.h"
#include "project/notesplugin.h"
#include "timeline/customtrackview.h"
#include "timeline/timeline.h"
......@@ -196,7 +197,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, m_notesPlugin, &openBackup, pCore->window());
pCore->monitorManager()->projectMonitor()->render, &openBackup, pCore->window());
doc->m_autosave = new KAutoSaveFile(startFile, doc);
bool ok;
pCore->bin()->setDocument(doc);
......@@ -537,7 +538,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, m_notesPlugin, &openBackup, pCore->window());
pCore->monitorManager()->projectMonitor()->render, &openBackup, pCore->window());
if (stale == nullptr) {
stale = new KAutoSaveFile(url, doc);
doc->m_autosave = stale;
......@@ -739,12 +740,26 @@ QString ProjectManager::projectSceneList(const QString &outputFolder)
return scene;
}
void ProjectManager::setDocumentNotes(const QString &notes)
{
m_notesPlugin->widget()->setHtml(notes);
}
QString ProjectManager::documentNotes() const
{
QString text = m_notesPlugin->widget()->toPlainText().simplified();
if (text.isEmpty()) {
return QString();
}
return m_notesPlugin->widget()->toHtml();
}
void ProjectManager::prepareSave()
{
// TODO REFAC: save target tracks, preview chunks and guides
pCore->binController()->saveDocumentProperties(m_project->documentProperties(), m_project->metadata(),
QMap<double, QString>() /*m_trackView->projectView()->guidesData()*/);
pCore->binController()->saveProperty(QStringLiteral("kdenlive:documentnotes"), m_project->documentNotes());
pCore->binController()->saveProperty(QStringLiteral("kdenlive:documentnotes"), documentNotes());
pCore->binController()->saveProperty(QStringLiteral("kdenlive:clipgroups"), m_project->groupsXml());
}
......
......@@ -72,6 +72,8 @@ public:
void saveZone(const QStringList &info, const QDir &dir);
/** @brief Move project data files to new url */
void moveProjectData(const QString &src, const QString &dest);
/** @brief Retrieve current project's notes */
QString documentNotes() const;
public slots:
void newFile(bool showProjectSettings = true, bool force = false);
......@@ -127,6 +129,9 @@ public slots:
/** @brief Request repaint of audio thumbs */
void audioThumbFormatChanged();
/** @brief Set the text for current project's notes */
void setDocumentNotes(const QString &notes);
private slots:
void slotRevert();
/** @brief Open the project's backupdialog. */
......
......@@ -94,7 +94,6 @@ Render::Render(Kdenlive::MonitorId rendererName, BinController *binController, G
connect(m_binController, &BinController::prepareTimelineReplacement, this, &Render::prepareTimelineReplacement, Qt::DirectConnection);
connect(m_binController, &BinController::replaceTimelineProducer, this, &Render::replaceTimelineProducer, Qt::DirectConnection);
connect(m_binController, &BinController::updateTimelineProducer, this, &Render::updateTimelineProducer);
connect(m_binController, &BinController::setDocumentNotes, this, &Render::setDocumentNotes);
}
}
......
......@@ -20,7 +20,7 @@
#include "doc/kthumb.h"
#include "gradientwidget.h"
#include "kdenlivesettings.h"
#include "renderer.h"
#include "monitor/monitor.h"
#include "utils/KoIconUtils.h"
#include <cmath>
......@@ -65,7 +65,7 @@ const int BLUREFFECT = 1;
const int SHADOWEFFECT = 2;
const int TYPEWRITEREFFECT = 3;
TitleWidget::TitleWidget(const QUrl &url, const Timecode &tc, const QString &projectTitlePath, Render *render, QWidget *parent)
TitleWidget::TitleWidget(const QUrl &url, const Timecode &tc, const QString &projectTitlePath, Monitor *monitor, QWidget *parent)
: QDialog(parent)
, Ui::TitleWidget_UI()
, m_startViewport(nullptr)
......@@ -74,7 +74,7 @@ TitleWidget::TitleWidget(const QUrl &url, const Timecode &tc, const QString &pro
, m_unicodeDialog(new UnicodeDialog(UnicodeDialog::InputHex))
, m_projectTitlePath(projectTitlePath)
, m_tc(tc)
, m_fps(render->fps())
, m_fps(monitor->fps())
{
setupUi(this);
setMinimumSize(200, 200);
......@@ -137,8 +137,9 @@ TitleWidget::TitleWidget(const QUrl &url, const Timecode &tc, const QString &pro
rectLineWidth->setToolTip(i18n("Border width"));
itemzoom->setSuffix(i18n("%"));
m_frameWidth = render->renderWidth();
m_frameHeight = render->renderHeight();
QSize profileSize = monitor->profileSize();
m_frameWidth = (int)(profileSize.height() * monitor->profile()->dar() + 0.5);
m_frameHeight = profileSize.height();
showToolbars(TITLE_SELECT);
splitter->setStretchFactor(0, 20);
......@@ -178,14 +179,6 @@ TitleWidget::TitleWidget(const QUrl &url, const Timecode &tc, const QString &pro
connect(gradients_rect_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(rectChanged()));
connect(rectLineWidth, SIGNAL(valueChanged(int)), this, SLOT(rectChanged()));
// Fill effects, NOT SUPPORTED in titler version 2
/*effect_list->addItem(i18n("None"), NOEFFECT);
if (render->getMltVersionInfo(QStringLiteral("kdenlivetitle")) > 1.0) {
// there was a bug in MLT's kdenlivetitle module version 1 that crashed on typewriter effect
effect_list->addItem(i18n("Typewriter"), TYPEWRITEREFFECT);
}
effect_list->addItem(i18n("Blur"), BLUREFFECT);*/
connect(zValue, SIGNAL(valueChanged(int)), this, SLOT(zIndexChanged(int)));
connect(itemzoom, SIGNAL(valueChanged(int)), this, SLOT(itemScaled(int)));
connect(itemrotatex, SIGNAL(valueChanged(int)), this, SLOT(itemRotateX(int)));
......@@ -204,7 +197,7 @@ TitleWidget::TitleWidget(const QUrl &url, const Timecode &tc, const QString &pro
connect(origin_x_left, &QAbstractButton::clicked, this, &TitleWidget::slotOriginXClicked);
connect(origin_y_top, &QAbstractButton::clicked, this, &TitleWidget::slotOriginYClicked);
connect(render, &AbstractRender::frameUpdated, this, &TitleWidget::slotGotBackground);
connect(monitor, &Monitor::frameUpdated, this, &TitleWidget::slotGotBackground);
// Position and size
m_signalMapper = new QSignalMapper(this);
......@@ -483,17 +476,6 @@ TitleWidget::TitleWidget(const QUrl &url, const Timecode &tc, const QString &pro
loadGradients();
readChoices();
if (render->getMltVersionInfo(QStringLiteral("kdenlivetitle")) < 2.0) {
// Gradients and shadows are only supported since version 2, so disable
shadowBox->setEnabled(false);
gradient_color->setEnabled(false);
gradients_combo->setEnabled(false);
gradients_rect_combo->setEnabled(false);
gradient_rect->setEnabled(false);
edit_gradient->setEnabled(false);
edit_rect_gradient->setEnabled(false);
}
// Hide effects not implemented
tabWidget->removeTab(3);
......
......@@ -27,7 +27,7 @@
#include <QMap>
#include <QSignalMapper>
class Render;
class Monitor;
class TitleTemplate
{
......@@ -67,7 +67,7 @@ public:
* @param projectPath default path to save to or load from title documents
* @param render project renderer
* @param parent (optional) parent widget */
explicit TitleWidget(const QUrl &url, const Timecode &tc, const QString &projectTitlePath, Render *render, QWidget *parent = nullptr);
explicit TitleWidget(const QUrl &url, const Timecode &tc, const QString &projectTitlePath, Monitor *monitor, QWidget *parent = nullptr);
virtual ~TitleWidget();
QDomDocument xml();
void setXml(const QDomDocument &doc, const QString &id = QString());
......
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