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

Add messaging system to display MLT errors to the user

svn path=/trunk/kdenlive/; revision=3704
parent ca0776f9
......@@ -21,9 +21,11 @@
#ifndef DEFINITIONS_H
#define DEFINITIONS_H
#include "gentime.h"
#include <KLocale>
#include "gentime.h"
#include <QEvent>
const int FRAME_SIZE = 90;
const int MAXCLIPDURATION = 15000;
......@@ -179,4 +181,19 @@ private:
};
class MltErrorEvent : public QEvent
{
public:
MltErrorEvent(QString message) : QEvent(QEvent::User), m_message(message) {}
QString message() const {
return m_message;
}
private:
QString m_message;
};
#endif
......@@ -2317,9 +2317,9 @@ void MainWindow::slotShowClipProperties(DocClipBase *clip)
void MainWindow::customEvent(QEvent* e)
{
kDebug() << "// GOT ERROR";
if (e->type() == QEvent::User) {
// The timeline playing position changed...
kDebug() << "RECEIVED JOG EVEMNT!!!";
m_messageLabel->setMessage(static_cast <MltErrorEvent *>(e)->message(), ErrorMessage);
}
}
void MainWindow::slotActivateEffectStackView()
......@@ -2499,6 +2499,7 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event)
}
}
void MainWindow::slotSaveZone(Render *render, QPoint zone)
{
KDialog *dialog = new KDialog(this);
......
......@@ -29,7 +29,6 @@
#include "definitions.h"
#include <mlt++/Mlt.h>
//#include <framework/mlt_log.h>
#include <KDebug>
#include <KStandardDirs>
......@@ -44,14 +43,14 @@
#include <stdlib.h>
/*
static void kdenlive_callback(void* ptr, int level, const char* fmt, va_list vl)
static void kdenlive_callback(void* /*ptr*/, int level, const char* fmt, va_list vl)
{
if (level > MLT_LOG_ERROR) return;
QString error;
QProcess::startDetached("kdialog", QStringList() << "--error" << error.vsprintf(fmt, vl));
QApplication::postEvent(qApp->activeWindow() , new MltErrorEvent(error.vsprintf(fmt, vl).simplified()));
}
*/
static void consumer_frame_show(mlt_consumer, Render * self, mlt_frame frame_ptr)
{
......@@ -145,7 +144,7 @@ void Render::buildConsumer()
// FIXME: the event object returned by the listen gets leaked...
m_mltConsumer->listen("consumer-frame-show", this, (mlt_listener) consumer_frame_show);
m_mltConsumer->set("rescale", "nearest");
//mlt_log_set_callback(kdenlive_callback);
mlt_log_set_callback(kdenlive_callback);
QString audioDevice = KdenliveSettings::audiodevicename();
if (!audioDevice.isEmpty()) {
......
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