#include "renderwidget.h"
#include "renderer.h"
#include "audiosignal.h"
- #ifndef NO_JOGSHUTTLE
+ #ifdef USE_JOGSHUTTLE
#include "jogshuttle.h"
#include "jogaction.h"
#include "jogshuttleconfig.h"
- #endif /* NO_JOGSHUTTLE */
+ #endif
#include "clipproperties.h"
#include "wizard.h"
- #include "editclipcommand.h"
+ #include "commands/editclipcommand.h"
#include "titlewidget.h"
#include "markerdialog.h"
#include "clipitem.h"
#include "colorscopes/waveform.h"
#include "colorscopes/rgbparade.h"
#include "colorscopes/histogram.h"
- #include "audiospectrum.h"
- #include "spectrogram.h"
+ #include "audioscopes/audiospectrum.h"
+ #include "audioscopes/spectrogram.h"
#include "archivewidget.h"
#include "databackup/backupwidget.h"
#include <KFileItem>
#include <KNotification>
#include <KNotifyConfigWidget>
- #if KDE_IS_VERSION(4,3,80)
#include <knewstuff3/downloaddialog.h>
#include <knewstuff3/knewstuffaction.h>
- #else
- #include <knewstuff2/engine.h>
- #include <knewstuff2/ui/knewstuffaction.h>
- #define KNS3 KNS
- #endif /* KDE_IS_VERSION(4,3,80) */
#include <KToolBar>
#include <KColorScheme>
#include <KProgressDialog>
m_activeTimeline(NULL),
m_recMonitor(NULL),
m_renderWidget(NULL),
- #ifndef NO_JOGSHUTTLE
+ #ifdef USE_JOGSHUTTLE
m_jogProcess(NULL),
m_jogShuttle(NULL),
- #endif /* NO_JOGSHUTTLE */
+ #endif
m_findActivated(false),
m_stopmotion(NULL)
{
m_clipMonitorDock->setObjectName("clip_monitor");
m_clipMonitor = new Monitor("clip", m_monitorManager, QString(), m_timelineArea);
m_clipMonitorDock->setWidget(m_clipMonitor);
+
+ // Connect the project list
connect(m_projectList, SIGNAL(clipSelected(DocClipBase *, QPoint)), m_clipMonitor, SLOT(slotSetClipProducer(DocClipBase *, QPoint)));
connect(m_projectList, SIGNAL(raiseClipMonitor()), m_clipMonitor, SLOT(activateMonitor()));
-
+ connect(m_projectList, SIGNAL(loadingIsOver()), this, SLOT(slotElapsedTime()));
+ connect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
+ connect(m_projectList, SIGNAL(updateRenderStatus()), this, SLOT(slotCheckRenderStatus()));
+ connect(m_projectList, SIGNAL(clipNeedsReload(const QString&)),this, SLOT(slotUpdateClip(const QString &)));
+ connect(m_projectList, SIGNAL(updateProfile(const QString &)), this, SLOT(slotUpdateProjectProfile(const QString &)));
+ connect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
+ connect(m_projectList, SIGNAL(findInTimeline(const QString&)), this, SLOT(slotClipInTimeline(const QString&)));
+ connect(m_clipMonitor, SIGNAL(zoneUpdated(QPoint)), m_projectList, SLOT(slotUpdateClipCut(QPoint)));
+
m_projectMonitorDock = new QDockWidget(i18n("Project Monitor"), this);
m_projectMonitorDock->setObjectName("project_monitor");
m_projectMonitor = new Monitor("project", m_monitorManager, QString());
connect(m_recMonitor, SIGNAL(addProjectClip(KUrl)), this, SLOT(slotAddProjectClip(KUrl)));
connect(m_recMonitor, SIGNAL(addProjectClipList(KUrl::List)), this, SLOT(slotAddProjectClipList(KUrl::List)));
connect(m_recMonitor, SIGNAL(showConfigDialog(int, int)), this, SLOT(slotPreferences(int, int)));
- #endif
+ #endif /* ! Q_WS_MAC */
m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor, m_recMonitor);
m_notesDock = new QDockWidget(i18n("Project Notes"), this);
connect(m_notesWidget, SIGNAL(seekProject(int)), m_projectMonitor->render, SLOT(seekToFrame(int)));
m_notesWidget->setTabChangesFocus(true);
- #if KDE_IS_VERSION(4,4,0)
m_notesWidget->setClickMessage(i18n("Enter your project notes here ..."));
- #endif
m_notesDock->setWidget(m_notesWidget);
addDockWidget(Qt::TopDockWidgetArea, m_notesDock);
connect(m_projectMonitorDock, SIGNAL(visibilityChanged(bool)), m_projectMonitor, SLOT(refreshMonitor(bool)));
connect(m_clipMonitorDock, SIGNAL(visibilityChanged(bool)), m_clipMonitor, SLOT(refreshMonitor(bool)));
- //connect(m_monitorManager, SIGNAL(connectMonitors()), this, SLOT(slotConnectMonitors()));
connect(m_monitorManager, SIGNAL(checkColorScopes()), this, SLOT(slotUpdateColorScopes()));
connect(m_monitorManager, SIGNAL(clearScopes()), this, SLOT(slotClearColorScopes()));
connect(m_effectList, SIGNAL(addEffect(const QDomElement)), this, SLOT(slotAddEffect(const QDomElement)));
m_projectList->slotAddClip(urls);
}
- #ifndef NO_JOGSHUTTLE
+ #ifdef USE_JOGSHUTTLE
activateShuttleDevice();
- #endif /* NO_JOGSHUTTLE */
+ #endif
m_projectListDock->raise();
actionCollection()->addAssociatedWidget(m_clipMonitor->container());
m_effectList->reloadEffectList(m_effectsMenu, m_effectActions);
}
- #ifndef NO_JOGSHUTTLE
+ #ifdef USE_JOGSHUTTLE
void MainWindow::activateShuttleDevice()
{
delete m_jogShuttle;
connect(m_jogShuttle, SIGNAL(forward(double)), m_monitorManager, SLOT(slotForward(double)));
connect(m_jogShuttle, SIGNAL(action(const QString&)), this, SLOT(slotDoAction(const QString&)));
}
- #endif /* NO_JOGSHUTTLE */
+ #endif /* USE_JOGSHUTTLE */
void MainWindow::slotDoAction(const QString& action_name)
{
if (w->exec() == QDialog::Accepted) {
QString profile = w->selectedProfile();
m_activeDocument->setProjectFolder(w->selectedFolder());
- #ifndef Q_WS_MAC
+ #ifndef Q_WS_MAC
m_recMonitor->slotUpdateCaptureFolder(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
#endif
if (m_renderWidget) m_renderWidget->setDocumentPath(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
disconnect(m_notesWidget, SIGNAL(textChanged()), m_activeDocument, SLOT(setModified()));
disconnect(m_clipMonitor, SIGNAL(zoneUpdated(QPoint)), m_activeDocument, SLOT(setModified()));
disconnect(m_projectList, SIGNAL(projectModified()), m_activeDocument, SLOT(setModified()));
- disconnect(m_projectList, SIGNAL(updateProfile(const QString &)), this, SLOT(slotUpdateProjectProfile(const QString &)));
disconnect(m_projectMonitor->render, SIGNAL(refreshDocumentProducers(bool, bool)), m_activeDocument, SLOT(checkProjectClips(bool, bool)));
disconnect(m_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
disconnect(m_activeTimeline, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
disconnect(m_projectList, SIGNAL(loadingIsOver()), m_activeTimeline->projectView(), SLOT(slotUpdateAllThumbs()));
- disconnect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
- disconnect(m_projectList, SIGNAL(updateRenderStatus()), this, SLOT(slotCheckRenderStatus()));
- disconnect(m_projectList, SIGNAL(clipNeedsReload(const QString&)), this, SLOT(slotUpdateClip(const QString &)));
disconnect(m_projectList, SIGNAL(refreshClip(const QString &)), m_activeTimeline->projectView(), SLOT(slotRefreshThumbs(const QString &)));
m_effectStack->clear();
}
//m_activeDocument->setRenderer(NULL);
- disconnect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
m_clipMonitor->stop();
}
KdenliveSettings::setCurrent_profile(doc->profilePath());
m_projectList->setDocument(doc);
m_transitionConfig->updateProjectFormat(doc->mltProfile(), doc->timecode(), doc->tracksList());
m_effectStack->updateProjectFormat(doc->mltProfile(), doc->timecode());
- connect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
connect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), trackView->projectView(), SLOT(slotRefreshThumbs(const QString &, bool)));
- connect(m_projectList, SIGNAL(clipNeedsReload(const QString&)),this, SLOT(slotUpdateClip(const QString &)));
connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
- connect(m_projectList, SIGNAL(updateProfile(const QString &)), this, SLOT(slotUpdateProjectProfile(const QString &)));
connect(m_projectList, SIGNAL(clipNameChanged(const QString, const QString)), trackView->projectView(), SLOT(clipNameChanged(const QString, const QString)));
- connect(m_projectList, SIGNAL(findInTimeline(const QString&)), this, SLOT(slotClipInTimeline(const QString&)));
-
-
//connect(trackView, SIGNAL(cursorMoved()), m_projectMonitor, SLOT(activateMonitor()));
connect(trackView, SIGNAL(insertTrack(int)), this, SLOT(slotInsertTrack(int)));
connect(trackView, SIGNAL(deleteTrack(int)), this, SLOT(slotDeleteTrack(int)));
connect(trackView->projectView(), SIGNAL(forceClipProcessing(const QString &)), m_projectList, SLOT(slotForceProcessing(const QString &)));
connect(m_projectMonitor, SIGNAL(renderPosition(int)), trackView, SLOT(moveCursorPos(int)));
connect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), trackView, SLOT(slotSetZone(QPoint)));
- connect(m_clipMonitor, SIGNAL(zoneUpdated(QPoint)), m_projectList, SLOT(slotUpdateClipCut(QPoint)));
connect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), doc, SLOT(setModified()));
connect(m_clipMonitor, SIGNAL(zoneUpdated(QPoint)), doc, SLOT(setModified()));
connect(m_projectMonitor, SIGNAL(durationChanged(int)), trackView, SLOT(setDuration(int)));
connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
connect(trackView, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int)));
connect(m_projectList, SIGNAL(loadingIsOver()), trackView->projectView(), SLOT(slotUpdateAllThumbs()));
- connect(m_projectList, SIGNAL(loadingIsOver()), this, SLOT(slotElapsedTime()));
- connect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
- connect(m_projectList, SIGNAL(updateRenderStatus()), this, SLOT(slotCheckRenderStatus()));
trackView->projectView()->setContextMenu(m_timelineContextMenu, m_timelineContextClipMenu, m_timelineContextTransitionMenu, m_clipTypeGroup, (QMenu*)(factory()->container("marker_menu", this)));
m_activeDocument = doc;
m_activeTimeline->updateProjectFps();
m_activeDocument->checkProjectClips();
- #ifndef Q_WS_MAC
+ #ifndef Q_WS_MAC
m_recMonitor->slotUpdateCaptureFolder(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
#endif
//Update the mouse position display so it will display in DF/NDF format by default based on the project setting.
void MainWindow::slotUpdateCaptureFolder()
{
- #ifndef Q_WS_MAC
+ #ifndef Q_WS_MAC
if (m_activeDocument) m_recMonitor->slotUpdateCaptureFolder(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
else m_recMonitor->slotUpdateCaptureFolder(KdenliveSettings::defaultprojectfolder());
#endif
// Update list of transcoding profiles
loadTranscoders();
- #ifndef NO_JOGSHUTTLE
+ #ifdef USE_JOGSHUTTLE
activateShuttleDevice();
- #endif /* NO_JOGSHUTTLE */
+ #endif
}
int MainWindow::getNewStuff(const QString &configFile)
{
KNS3::Entry::List entries;
- #if KDE_IS_VERSION(4,3,80)
KNS3::DownloadDialog dialog(configFile);
dialog.exec();
entries = dialog.changedEntries();
if (entry.status() == KNS3::Entry::Installed)
kDebug() << "// Installed files: " << entry.installedFiles();
}
- #else
- KNS::Engine engine(0);
- if (engine.init(configFile))
- entries = engine.downloadDialogModal(this);
- foreach(KNS::Entry * entry, entries) {
- if (entry->status() == KNS::Entry::Installed)
- kDebug() << "// Installed files: " << entry->installedFiles();
- }
- #endif /* KDE_IS_VERSION(4,3,80) */
return entries.size();
}
#include "projectlist.h"
#include "projectitem.h"
- #include "addfoldercommand.h"
+ #include "commands/addfoldercommand.h"
#include "kdenlivesettings.h"
#include "slideshowclip.h"
#include "ui_colorclip_ui.h"
#include "projectlistview.h"
#include "timecodedisplay.h"
#include "profilesdialog.h"
- #include "editclipcommand.h"
- #include "editclipcutcommand.h"
- #include "editfoldercommand.h"
- #include "addclipcutcommand.h"
+ #include "commands/editclipcommand.h"
+ #include "commands/editclipcutcommand.h"
+ #include "commands/editfoldercommand.h"
+ #include "commands/addclipcutcommand.h"
#include "ui_templateclip_ui.h"
m_proxyThreads.clearFutures();
m_thumbnailQueue.clear();
m_listView->clear();
+ m_listView->setEnabled(true);
emit clipSelected(NULL);
m_refreshed = false;
m_allClipsProcessed = false;
{
if (m_render->processingItems() == 0 && m_thumbnailQueue.isEmpty()) {
if (!m_refreshed && m_allClipsProcessed) {
+ m_refreshed = true;
m_listView->setEnabled(true);
slotClipSelected();
QTimer::singleShot(500, this, SIGNAL(loadingIsOver()));
emit displayMessage(QString(), -1);
- m_refreshed = true;
}
updateButtons();
} else if (!m_refreshed) {
}
} else {
int max = m_doc->clipManager()->clipsCount();
- emit displayMessage(i18n("Loading clips"), (int)(100 *(max - queue) / max));
+ if (max > 0) emit displayMessage(i18n("Loading clips"), (int)(100 *(max - queue) / max));
}
if (m_allClipsProcessed) emit processNextThumbnail();
}
- if (replace && item) {
- toReload = clipId;
- }
if (!item) {
// no item for producer, delete it
delete producer;
+ return;
}
+ if (replace) toReload = clipId;
if (!toReload.isEmpty())
emit clipNeedsReload(toReload);
}
QFile::remove(info.dest);
setProxyStatus(info.dest, CREATINGPROXY);
+
+ // Get the list of clips that will need to get progress info
+ QTreeWidgetItemIterator it(m_listView);
+ QList <ProjectItem *> processingItems;
+ while (*it && !m_abortAllProxies) {
+ if ((*it)->type() == PROJECTCLIPTYPE) {
+ ProjectItem *item = static_cast <ProjectItem *>(*it);
+ if (item->referencedClip()->getProperty("proxy") == info.dest) {
+ processingItems.append(item);
+ }
+ }
+ ++it;
+ }
// Special case: playlist clips (.mlt or .kdenlive project files)
if (info.type == PLAYLIST) {
}
else {
QString log = QString(myProcess.readAll());
- processLogInfo(info.dest, &duration, log);
+ processLogInfo(processingItems, &duration, log);
}
myProcess.waitForFinished(500);
}
// Make sure we don't block when proxy file already exists
parameters << "-y";
parameters << info.dest;
- kDebug()<<"// STARTING PROXY GEN: "<<parameters;
QProcess myProcess;
myProcess.setProcessChannelMode(QProcess::MergedChannels);
myProcess.start("ffmpeg", parameters);
myProcess.waitForStarted();
int result = -1;
int duration = 0;
+
while (myProcess.state() != QProcess::NotRunning) {
// building proxy file
if (m_abortProxy.contains(info.dest) || m_abortAllProxies) {
}
else {
QString log = QString(myProcess.readAll());
- processLogInfo(info.dest, &duration, log);
+ processLogInfo(processingItems, &duration, log);
}
myProcess.waitForFinished(500);
}
myProcess.waitForFinished();
+ m_abortProxy.removeAll(info.dest);
+ m_processingProxy.removeAll(info.dest);
if (result == -1) result = myProcess.exitStatus();
if (result == 0) {
// proxy successfully created
QFile::remove(info.dest);
setProxyStatus(info.dest, PROXYCRASHED);
}
- m_abortProxy.removeAll(info.dest);
- m_processingProxy.removeAll(info.dest);
}
-void ProjectList::processLogInfo(const QString &path, int *duration, const QString &log)
+void ProjectList::processLogInfo(QList <ProjectItem *>items, int *duration, const QString &log)
{
int progress;
if (*duration == 0) {
progress = numbers.at(0).toInt() * 3600 + numbers.at(1).toInt() * 60 + numbers.at(2).toDouble();
}
else progress = (int) time.toDouble();
- setProxyStatus(path, CREATINGPROXY, (int) (100.0 * progress / (*duration)));
+ for (int i = 0; i < items.count(); i++)
+ setProxyStatus(items.at(i), CREATINGPROXY, (int) (100.0 * progress / (*duration)));
}
}