--- /dev/null
+/***************************************************************************
+ events.h - description
+ -------------------
+ begin : Feb 15 2008
+ copyright : (C) 2008 by Marco Gittler
+ email : g.marco@freenet.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef EVENTS_H
+#define EVENTS_H
+
+#include <QEvent>
+
+class ProgressEvent : public QEvent {
+public:
+ ProgressEvent( int value, QEvent::Type eventType )
+ : QEvent( eventType ), m_val( value ) {};
+ int value() const { return m_val; };
+private:
+ int m_val;
+
+};
+
+#endif
#include "renderer.h"
#include "kthumb.h"
#include "kdenlivesettings.h"
-
+#include "events.h"
void MyThread::init(KUrl url, QString target, double frame, double frameLength, int frequency, int channels, int arrayWidth)
{
stop_me = false;
Mlt::Filter m_convert(prof,"volume");
m_convert.set("gain", "normalise");
m_producer.attach(m_convert);
- }
+ }*/
- /*TODO if (qApp->mainWidget())
- QApplication::postEvent(qApp->mainWidget(), new ProgressEvent(-1, 10005));
- */
+ if (QApplication::activeWindow())
+ QApplication::postEvent(QApplication::activeWindow(), new ProgressEvent(-1, (QEvent::Type)10005));
+
int last_val = 0;
int val = 0;
kDebug() << "for " << m_frame << " " << m_frameLength << " " << m_producer.is_valid();
if (stop_me) break;
val=(int)((z-m_frame)/(m_frame+m_frameLength)*100.0);
if (last_val!=val & val > 1){
- //TODO QApplication::postEvent(qApp->mainWidget(), new ProgressEvent(val, 10005));
+ QApplication::postEvent(QApplication::activeWindow(), new ProgressEvent(val, (QEvent::Type)10005));
+
last_val=val;
}
m_producer.seek( z );
m_isWorking = false;
if (stop_me) {
f.remove();
- //TODO QApplication::postEvent(qApp->mainWidget(), new ProgressEvent(-1, 10005));
+ QApplication::postEvent(QApplication::activeWindow(), new ProgressEvent(-1, (QEvent::Type)10005));
+
}
- //TODO else QApplication::postEvent(qApp->mainWidget(), new ProgressEvent(0, 10005));
+ QApplication::postEvent(QApplication::activeWindow(), new ProgressEvent(0, (QEvent::Type)10005));
+
}
#include "initeffects.h"
#include "profilesdialog.h"
#include "projectsettings.h"
+#include "events.h"
#define ID_STATUS_MSG 1
#define ID_EDITMODE_MSG 2
m_timecodeFormat = new KComboBox(this);
m_timecodeFormat->addItem(i18n("hh:mm:ss::ff"));
m_timecodeFormat->addItem(i18n("Frames"));
+
+ statusProgressBar=new QProgressBar(this);
+ statusProgressBar->setMinimum(0);
+ statusProgressBar->setMaximum(100);
+ statusLabel=new QLabel(this);
+
+ statusBar()->insertPermanentWidget(0,statusProgressBar,1);
+ statusBar()->insertPermanentWidget(1,statusLabel,1);
statusBar()->insertPermanentFixedItem("00:00:00:00", ID_TIMELINE_POS);
statusBar()->insertPermanentWidget(ID_TIMELINE_FORMAT, m_timecodeFormat);
//connect( dialog, SIGNAL(settingsChanged()), this, SLOT(updateConfiguration()) );
dialog->show();
}
-
+void MainWindow::customEvent ( QEvent * event ){
+ if (event->type()==10005){
+ ProgressEvent* p=(ProgressEvent*) event;
+ statusProgressBar->setValue(p->value());
+ statusProgressBar->setFormat("%p done");
+ if (p->value()>0)
+ statusLabel->setText(tr("Creating Audio Thumbs"));
+ else
+ statusLabel->setText("");
+ }
+}
#include "mainwindow.moc"
#include <QDockWidget>
#include <QUndoView>
#include <QLabel>
+#include <QProgressBar>
#include <KXmlGuiWindow>
#include <KTextEdit>
#include "effectslistview.h"
#include "effectstackview.h"
+
class MainWindow : public KXmlGuiWindow
{
Q_OBJECT
MainWindow(QWidget *parent=0);
void parseProfiles();
-
+ void customEvent ( QEvent * event );
protected:
virtual bool queryClose();
private:
KTabWidget* m_timelineArea;
+ QProgressBar *statusProgressBar;
+ QLabel* statusLabel;
void setupActions();
QString fileName;
KdenliveDoc *m_activeDocument;