#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;
};
+
+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
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()
}
}
+
void MainWindow::slotSaveZone(Render *render, QPoint zone)
{
KDialog *dialog = new KDialog(this);
#include "definitions.h"
#include <mlt++/Mlt.h>
-//#include <framework/mlt_log.h>
#include <KDebug>
#include <KStandardDirs>
#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)
{
// 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()) {