#endif /* KDE_IS_VERSION(4,3,80) */
#include <KToolBar>
#include <KColorScheme>
+#include <KProgressDialog>
#include <QTextStream>
#include <QTimer>
m_audiosignalDock->setObjectName("audiosignal");
m_audiosignalDock->setWidget(m_audiosignal);
addDockWidget(Qt::TopDockWidgetArea, m_audiosignalDock);
- if (m_projectMonitor){
- connect(m_projectMonitor->render, SIGNAL(showAudioSignal(const QByteArray&)), m_audiosignal, SLOT(showAudio(const QByteArray&)) );
+ if (m_projectMonitor) {
+ connect(m_projectMonitor->render, SIGNAL(showAudioSignal(const QByteArray&)), m_audiosignal, SLOT(showAudio(const QByteArray&)));
}
- if (m_clipMonitor){
- connect(m_clipMonitor->render, SIGNAL(showAudioSignal(const QByteArray&)), m_audiosignal, SLOT(showAudio(const QByteArray&)) );
+ if (m_clipMonitor) {
+ connect(m_clipMonitor->render, SIGNAL(showAudioSignal(const QByteArray&)), m_audiosignal, SLOT(showAudio(const QByteArray&)));
}
//connect(m_histogramDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateScopeFrameRequest()));
//connect(m_histogram, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotUpdateScopeFrameRequest()));
activateShuttleDevice();
#endif /* NO_JOGSHUTTLE */
m_projectListDock->raise();
+
+ actionCollection()->addAssociatedWidget(m_clipMonitor->container());
+ actionCollection()->addAssociatedWidget(m_projectMonitor->container());
}
MainWindow::~MainWindow()
{
if (!m_timelineArea->isEnabled()) return;
m_fileRevert->setEnabled(true);
- KdenliveDoc *doc = new KdenliveDoc(url, KdenliveSettings::defaultprojectfolder(), m_commandStack, KdenliveSettings::default_profile(), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), m_projectMonitor->render, m_notesWidget, this);
+
+ KProgressDialog progressDialog(this, i18n("Loading project"), i18n("Loading project"));
+ progressDialog.setAllowCancel(false);
+ progressDialog.progressBar()->setMaximum(4);
+ progressDialog.show();
+ progressDialog.progressBar()->setValue(0);
+ qApp->processEvents();
+
+ KdenliveDoc *doc = new KdenliveDoc(url, KdenliveSettings::defaultprojectfolder(), m_commandStack, KdenliveSettings::default_profile(), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), m_projectMonitor->render, m_notesWidget, this, &progressDialog);
+
+ progressDialog.progressBar()->setValue(1);
+ progressDialog.progressBar()->setMaximum(4);
+ progressDialog.setLabelText(i18n("Loading project"));
+ qApp->processEvents();
+
if (stale == NULL) {
stale = new KAutoSaveFile(url, doc);
doc->m_autosave = stale;
stale->setParent(doc);
}
connectDocumentInfo(doc);
+
+ progressDialog.progressBar()->setValue(2);
+ qApp->processEvents();
+
bool ok;
TrackView *trackView = new TrackView(doc, &ok, this);
+
+ progressDialog.progressBar()->setValue(3);
+ qApp->processEvents();
+
m_timelineArea->setCurrentIndex(m_timelineArea->addTab(trackView, KIcon("kdenlive"), doc->description()));
if (!ok) {
m_timelineArea->setEnabled(false);
m_projectMonitor->adjustRulerSize(trackView->duration());
m_projectMonitor->slotZoneMoved(trackView->inPoint(), trackView->outPoint());
m_clipMonitor->refreshMonitor(true);
+
+ progressDialog.progressBar()->setValue(4);
}
void MainWindow::recoverFiles(QList<KAutoSaveFile *> staleFiles)
disconnect(m_activeDocument, SIGNAL(guidesUpdated()), this, SLOT(slotGuidesUpdated()));
disconnect(m_activeDocument, SIGNAL(addProjectClip(DocClipBase *, bool)), m_projectList, SLOT(slotAddClip(DocClipBase *, bool)));
disconnect(m_activeDocument, SIGNAL(resetProjectList()), m_projectList, SLOT(slotResetProjectList()));
- disconnect(m_activeDocument, SIGNAL(signalDeleteProjectClip(const QString &)), m_projectList, SLOT(slotDeleteClip(const QString &)));
+ disconnect(m_activeDocument, SIGNAL(signalDeleteProjectClip(const QString &)), this, SLOT(slotDeleteClip(const QString &)));
disconnect(m_activeDocument, SIGNAL(updateClipDisplay(const QString &)), m_projectList, SLOT(slotUpdateClip(const QString &)));
disconnect(m_activeDocument, SIGNAL(selectLastAddedClip(const QString &)), m_projectList, SLOT(slotSelectClip(const QString &)));
disconnect(m_activeDocument, SIGNAL(deleteTimelineClip(const QString &)), m_activeTimeline, SLOT(slotDeleteClip(const QString &)));
}
//m_activeDocument->setRenderer(NULL);
disconnect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
- disconnect(m_projectList, SIGNAL(refreshClip()), m_clipMonitor, SLOT(refreshMonitor()));
+ disconnect(m_projectList, SIGNAL(refreshClip()), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
m_clipMonitor->stop();
}
KdenliveSettings::setCurrent_profile(doc->profilePath());
m_transitionConfig->updateProjectFormat(doc->mltProfile(), doc->timecode(), doc->tracksList());
m_effectStack->updateProjectFormat(doc->mltProfile(), doc->timecode());
connect(m_projectList, SIGNAL(clipSelected(DocClipBase *, QPoint)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *, QPoint)));
- connect(m_projectList, SIGNAL(refreshClip()), m_clipMonitor, SLOT(refreshMonitor()));
+ connect(m_projectList, SIGNAL(refreshClip()), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
connect(m_projectList, SIGNAL(clipNeedsReload(const QString&, bool)), trackView->projectView(), SLOT(slotUpdateClip(const QString &, bool)));
connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
connect(doc, SIGNAL(addProjectClip(DocClipBase *, bool)), m_projectList, SLOT(slotAddClip(DocClipBase *, bool)));
connect(doc, SIGNAL(resetProjectList()), m_projectList, SLOT(slotResetProjectList()));
- connect(doc, SIGNAL(signalDeleteProjectClip(const QString &)), m_projectList, SLOT(slotDeleteClip(const QString &)));
+ connect(doc, SIGNAL(signalDeleteProjectClip(const QString &)), this, SLOT(slotDeleteClip(const QString &)));
connect(doc, SIGNAL(updateClipDisplay(const QString &)), m_projectList, SLOT(slotUpdateClip(const QString &)));
connect(doc, SIGNAL(selectLastAddedClip(const QString &)), m_projectList, SLOT(slotSelectClip(const QString &)));
}
// any type of clip but a title
- ClipProperties dia(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
- connect(&dia, SIGNAL(addMarker(const QString &, GenTime, QString)), m_activeTimeline->projectView(), SLOT(slotAddClipMarker(const QString &, GenTime, QString)));
- if (dia.exec() == QDialog::Accepted) {
- QMap <QString, QString> newprops = dia.properties();
- if (newprops.isEmpty()) return;
- EditClipCommand *command = new EditClipCommand(m_projectList, clip->getId(), clip->properties(), newprops, true);
- m_activeDocument->commandStack()->push(command);
- m_activeDocument->setModified();
+ ClipProperties *dia = new ClipProperties(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
+ connect(dia, SIGNAL(addMarker(const QString &, GenTime, QString)), m_activeTimeline->projectView(), SLOT(slotAddClipMarker(const QString &, GenTime, QString)));
+ connect(dia, SIGNAL(applyNewClipProperties(const QString, QMap <QString, QString> , QMap <QString, QString> , bool, bool)), this, SLOT(slotApplyNewClipProperties(const QString, QMap <QString, QString> , QMap <QString, QString> , bool, bool)));
+ dia->show();
+}
- if (dia.needsTimelineRefresh()) {
- // update clip occurences in timeline
- m_activeTimeline->projectView()->slotUpdateClip(clip->getId(), dia.needsTimelineReload());
- }
+
+void MainWindow::slotApplyNewClipProperties(const QString id, QMap <QString, QString> props, QMap <QString, QString> newprops, bool refresh, bool reload)
+{
+ if (newprops.isEmpty()) return;
+ EditClipCommand *command = new EditClipCommand(m_projectList, id, props, newprops, true);
+ m_activeDocument->commandStack()->push(command);
+ m_activeDocument->setModified();
+
+ if (refresh) {
+ // update clip occurences in timeline
+ m_activeTimeline->projectView()->slotUpdateClip(id, reload);
}
}
void MainWindow::slotSwitchFullscreen()
{
- /*if (m_projectMonitor->isActive()) m_projectMonitor->slotSwitchFullScreen();
- else m_clipMonitor->slotSwitchFullScreen();*/
+ if (m_projectMonitor->isActive()) m_projectMonitor->slotSwitchFullScreen();
+ else m_clipMonitor->slotSwitchFullScreen();
}
void MainWindow::slotInsertZoneToTree()
{
QList <QDockWidget *> docks = findChildren<QDockWidget *>();
for (int i = 0; i < docks.count(); i++) {
- QDockWidget* dock=docks.at(i);
- if (show){
- dock->setTitleBarWidget(0);
- }else{
- if (!dock->isFloating()){
+ QDockWidget* dock = docks.at(i);
+ if (show) {
+ dock->setTitleBarWidget(0);
+ } else {
+ if (!dock->isFloating()) {
dock->setTitleBarWidget(new QWidget);
}
}
void MainWindow::slotOpenStopmotion()
{
if (m_stopmotion == NULL) {
- m_stopmotion = new StopmotionWidget(m_activeDocument->projectFolder(), this);
- connect(m_stopmotion, SIGNAL(addOrUpdateSequence(const QString)), m_projectList, SLOT(slotAddOrUpdateSequence(const QString)));
+ m_stopmotion = new StopmotionWidget(m_activeDocument->projectFolder(), this);
+ connect(m_stopmotion, SIGNAL(addOrUpdateSequence(const QString)), m_projectList, SLOT(slotAddOrUpdateSequence(const QString)));
}
m_stopmotion->show();
}
+
+void MainWindow::slotDeleteClip(const QString &id)
+{
+ QList <ClipProperties *> list = findChildren<ClipProperties *>();
+ for (int i = 0; i < list.size(); ++i) {
+ list.at(i)->disableClipId(id);
+ }
+ m_projectList->slotDeleteClip(id);
+}
+
#include "mainwindow.moc"