#include <KRuler>
#include <KConfigDialog>
#include <KXMLGUIFactory>
+#include <KStatusBar>
#include <mlt++/Mlt.h>
#include "mainwindow.h"
#include "kdenlivesettings.h"
#include "ui_configmisc_ui.h"
+
+#define ID_STATUS_MSG 1
+#define ID_EDITMODE_MSG 2
+#define ID_TIMELINE_MSG 3
+#define ID_TIMELINE_POS 4
+#define ID_TIMELINE_FORMAT 5
MainWindow::MainWindow(QWidget *parent)
: KXmlGuiWindow(parent),
m_timelineArea->setTabReorderingEnabled(true);
connect(m_timelineArea, SIGNAL(currentChanged (int)), this, SLOT(activateDocument()));
+ Mlt::Factory::init(NULL);
m_monitorManager = new MonitorManager();
projectListDock = new QDockWidget(i18n("Project Tree"), this);
transitionConfigDock->setWidget(transitionConfig);
addDockWidget(Qt::TopDockWidgetArea, transitionConfigDock);
- Mlt::Factory::init(NULL);
clipMonitorDock = new QDockWidget(i18n("Clip Monitor"), this);
clipMonitorDock->setObjectName("clip_monitor");
m_clipMonitor = new Monitor("clip", m_monitorManager, this);
clipMonitorDock->setWidget(m_clipMonitor);
addDockWidget(Qt::TopDockWidgetArea, clipMonitorDock);
-
+ //m_clipMonitor->stop();
+
projectMonitorDock = new QDockWidget(i18n("Project Monitor"), this);
projectMonitorDock->setObjectName("project_monitor");
m_projectMonitor = new Monitor("project", m_monitorManager, this);
overviewDock = new QDockWidget(i18n("Project Overview"), this);
overviewDock->setObjectName("project_overview");
- m_overView = new CustomTrackView(NULL, this);
+ m_overView = new CustomTrackView(NULL, NULL, this);
overviewDock->setWidget(m_overView);
addDockWidget(Qt::TopDockWidgetArea, overviewDock);
tabifyDockWidget (clipMonitorDock, projectMonitorDock);
setCentralWidget(m_timelineArea);
+
+ m_timecodeFormat = new KComboBox(this);
+ m_timecodeFormat->addItem(i18n("hh:mm:ss::ff"));
+ m_timecodeFormat->addItem(i18n("Frames"));
+ statusBar()->insertPermanentFixedItem("00:00:00:00", ID_TIMELINE_POS);
+ statusBar()->insertPermanentWidget(ID_TIMELINE_FORMAT, m_timecodeFormat);
+
setupGUI(Default, "kdenliveui.rc");
connect(projectMonitorDock, SIGNAL(visibilityChanged (bool)), m_projectMonitor, SLOT(refreshMonitor(bool)));
else projectMonitorDock->raise();
}
+void MainWindow::slotSetClipDuration(int id, int duration)
+{
+ if (!m_activeDocument) return;
+ m_activeDocument->setProducerDuration(id, duration);
+}
+
void MainWindow::slotConnectMonitors()
{
connect(m_projectList, SIGNAL(clipSelected(const QDomElement &)), m_clipMonitor, SLOT(slotSetXml(const QDomElement &)));
+ connect(m_projectList, SIGNAL(receivedClipDuration(int, int)), this, SLOT(slotSetClipDuration(int, int)));
+
connect(m_projectList, SIGNAL(getFileProperties(const QDomElement &, int)), m_clipMonitor->render, SLOT(getFileProperties(const QDomElement &, int)));
connect(m_clipMonitor->render, SIGNAL(replyGetImage(int, int, const QPixmap &, int, int)), m_projectList, SLOT(slotReplyGetImage(int, int, const QPixmap &, int, int)));
KStandardAction::openNew(this, SLOT(newFile()),
actionCollection());
+ KStandardAction::preferences(this, SLOT(slotPreferences()),
+ actionCollection());
+
/*KStandardAction::undo(this, SLOT(undo()),
actionCollection());
//connectDocument(trackView, doc);
}
+void MainWindow::slotUpdateMousePosition(int pos)
+{
+ if (m_activeDocument)
+ switch(m_timecodeFormat->currentIndex()) {
+ case 0:
+ statusBar()->changeItem(m_activeDocument->timecode().getTimecodeFromFrames(pos), ID_TIMELINE_POS);
+ break;
+ default:
+ statusBar()->changeItem(QString::number(pos), ID_TIMELINE_POS);
+ }
+}
+
void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //changed
{
//m_projectMonitor->stop();
m_activeDocument->setProducers(m_projectList->producersList());
m_activeDocument->setRenderer(NULL);
}
+ connect(trackView, SIGNAL(cursorMoved()), m_projectMonitor, SLOT(activateMonitor()));
+ connect(trackView, SIGNAL(mousePosition(int)), this, SLOT(slotUpdateMousePosition(int)));
+ connect(m_projectMonitor, SIGNAL(renderPosition(int)), trackView, SLOT(moveCursorPos(int)));
m_projectList->setDocument(doc);
m_monitorManager->setTimecode(doc->timecode());
doc->setRenderer(m_projectMonitor->render);