#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 "interfaces.h"
-#include "kdenlive-config.h"
+#include "config-kdenlive.h"
#include "cliptranscode.h"
#include "ui_templateclip_ui.h"
#include "colorscopes/vectorscope.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 <KApplication>
#include <KAction>
#include <KLocale>
#include <knewstuff2/engine.h>
#include <knewstuff2/ui/knewstuffaction.h>
#define KNS3 KNS
-#endif /* KDE_IS_VERSION(4,3,80) */
+#endif
#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)
{
closeTabButton->adjustSize();
closeTabButton->setToolTip(i18n("Close the current tab"));
m_timelineArea->setCornerWidget(closeTabButton);
- connect(m_timelineArea, SIGNAL(currentChanged(int)), this, SLOT(activateDocument()));
+ //connect(m_timelineArea, SIGNAL(currentChanged(int)), this, SLOT(activateDocument()));
connect(&m_findTimer, SIGNAL(timeout()), this, SLOT(findTimeout()));
m_findTimer.setSingleShot(true);
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_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());
actionCollection()->addAssociatedWidget(m_projectMonitor->container());
+
+ // Populate encoding profiles
+ KConfig conf("encodingprofiles.rc", KConfig::FullConfig, "appdata");
+ if (KdenliveSettings::proxyparams().isEmpty() || KdenliveSettings::proxyextension().isEmpty()) {
+ KConfigGroup group(&conf, "proxy");
+ QMap< QString, QString > values = group.entryMap();
+ QMapIterator<QString, QString> i(values);
+ if (i.hasNext()) {
+ i.next();
+ QString data = i.value();
+ KdenliveSettings::setProxyparams(data.section(';', 0, 0));
+ KdenliveSettings::setProxyextension(data.section(';', 1, 1));
+ }
+ }
+ if (KdenliveSettings::v4l_parameters().isEmpty() || KdenliveSettings::v4l_extension().isEmpty()) {
+ KConfigGroup group(&conf, "video4linux");
+ QMap< QString, QString > values = group.entryMap();
+ QMapIterator<QString, QString> i(values);
+ if (i.hasNext()) {
+ i.next();
+ QString data = i.value();
+ KdenliveSettings::setV4l_parameters(data.section(';', 0, 0));
+ KdenliveSettings::setV4l_extension(data.section(';', 1, 1));
+ }
+ }
+ if (KdenliveSettings::decklink_parameters().isEmpty() || KdenliveSettings::decklink_extension().isEmpty()) {
+ KConfigGroup group(&conf, "decklink");
+ QMap< QString, QString > values = group.entryMap();
+ QMapIterator<QString, QString> i(values);
+ if (i.hasNext()) {
+ i.next();
+ QString data = i.value();
+ KdenliveSettings::setDecklink_parameters(data.section(';', 0, 0));
+ KdenliveSettings::setDecklink_extension(data.section(';', 1, 1));
+ }
+ }
}
MainWindow::~MainWindow()
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 (!m_activeDocument) return;
DocClipBase *clip = m_activeDocument->clipManager()->getClipById(id);
+ if (!clip) return;
if (clip->numReferences() > 0) m_activeTimeline->projectView()->slotUpdateClip(id);
if (m_clipMonitor->activeClip() && m_clipMonitor->activeClip()->getId() == id) {
- if (clip) m_clipMonitor->updateClipProducer(clip->getCloneProducer());
- }
- if (clip) {
- clip->cleanupProducers();
+ Mlt::Producer *monitorProducer = clip->getCloneProducer();
+ m_clipMonitor->updateClipProducer(monitorProducer);
}
+ clip->cleanupProducers();
}
void MainWindow::slotConnectMonitors()
connect(m_projectList, SIGNAL(showClipProperties(QList <DocClipBase *>, QMap<QString, QString>)), this, SLOT(slotShowClipProperties(QList <DocClipBase *>, QMap<QString, QString>)));
connect(m_projectMonitor->render, SIGNAL(replyGetImage(const QString &, const QString &, int, int)), m_projectList, SLOT(slotReplyGetImage(const QString &, const QString &, int, int)));
connect(m_projectMonitor->render, SIGNAL(replyGetImage(const QString &, const QImage &)), m_projectList, SLOT(slotReplyGetImage(const QString &, const QImage &)));
- connect(m_projectMonitor->render, SIGNAL(replyGetFileProperties(const QString &, Mlt::Producer*, const stringMap &, const stringMap &, bool, bool)), this, SLOT(slotReplyGetFileProperties(const QString &, Mlt::Producer*, const stringMap &, const stringMap &, bool, bool)));
+ connect(m_projectMonitor->render, SIGNAL(replyGetFileProperties(const QString &, Mlt::Producer*, const stringMap &, const stringMap &, bool)), m_projectList, SLOT(slotReplyGetFileProperties(const QString &, Mlt::Producer*, const stringMap &, const stringMap &, bool)));
connect(m_projectMonitor->render, SIGNAL(removeInvalidClip(const QString &, bool)), m_projectList, SLOT(slotRemoveInvalidClip(const QString &, bool)));
QMap <QString, QString> documentProperties;
QPoint projectTracks(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks());
if (!showProjectSettings) {
- // set up default properties
- documentProperties.insert("enableproxy", QString::number((int) KdenliveSettings::enableproxy()));
- documentProperties.insert("generateproxy", QString::number((int) KdenliveSettings::generateproxy()));
- documentProperties.insert("proxyminsize", QString::number(KdenliveSettings::proxyminsize()));
- documentProperties.insert("proxyparams", KdenliveSettings::proxyparams());
- documentProperties.insert("proxyextension", KdenliveSettings::proxyextension());
- documentProperties.insert("generateimageproxy", QString::number((int) KdenliveSettings::generateimageproxy()));
- documentProperties.insert("proxyimageminsize", QString::number(KdenliveSettings::proxyimageminsize()));
if (!KdenliveSettings::activatetabs())
if (!closeCurrentDocument())
return;
}
}
m_clipMonitor->slotSetClipProducer(NULL);
+ m_projectList->slotResetProjectList();
m_timelineArea->removeTab(m_timelineArea->indexOf(w));
if (m_timelineArea->count() == 1) {
m_timelineArea->setTabBarHidden(true);
bool ok;
TrackView *trackView = new TrackView(doc, &ok, this);
-
+ connectDocument(trackView, doc);
progressDialog.progressBar()->setValue(3);
qApp->processEvents();
slotGotProgressInfo(QString(), -1);
m_projectMonitor->adjustRulerSize(trackView->duration());
m_projectMonitor->slotZoneMoved(trackView->inPoint(), trackView->outPoint());
- m_clipMonitor->refreshMonitor(true);
-
progressDialog.progressBar()->setValue(4);
if (openBackup) slotOpenBackupDialog(url);
}
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));
{
if (!m_renderWidget) {
QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) : KdenliveSettings::defaultprojectfolder();
- m_renderWidget = new RenderWidget(projectfolder, m_projectList->useProxy(), this);
+ MltVideoProfile profile;
+ if (m_activeDocument) profile = m_activeDocument->mltProfile();
+ m_renderWidget = new RenderWidget(projectfolder, m_projectList->useProxy(), profile, this);
connect(m_renderWidget, SIGNAL(shutdown()), this, SLOT(slotShutdown()));
connect(m_renderWidget, SIGNAL(selectedRenderProfile(QMap <QString, QString>)), this, SLOT(slotSetDocumentRenderProfile(QMap <QString, QString>)));
connect(m_renderWidget, SIGNAL(prepareRenderingData(bool, bool, const QString&)), this, SLOT(slotPrepareRendering(bool, bool, const QString&)));
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());
KdenliveSettings::setProject_fps(doc->fps());
m_monitorManager->resetProfiles(doc->timecode());
+ m_clipMonitorDock->raise();
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.
slotUpdateMousePosition(0);
+ m_monitorManager->activateMonitor("clip");
// set tool to select tool
m_buttonSelectTool->setChecked(true);
}
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
}
if (entry->status() == KNS::Entry::Installed)
kDebug() << "// Installed files: " << entry->installedFiles();
}
-#endif /* KDE_IS_VERSION(4,3,80) */
+#endif
return entries.size();
}
// We need to delete the "aspect_ratio" property because proxy clips
// sometimes have different ratio than original clips
EffectsList::removeProperty(e, "aspect_ratio");
+ EffectsList::removeMetaProperties(e);
}
}
}
delete dia;
}
-void MainWindow::slotReplyGetFileProperties(const QString &clipId, Mlt::Producer *producer, const stringMap &properties, const stringMap &metadata, bool replace, bool refreshThumbnail)
-{
- m_projectList->slotReplyGetFileProperties(clipId, producer, properties, metadata, replace, refreshThumbnail);
-}
-
-
void MainWindow::slotElapsedTime()
{
kDebug()<<"-----------------------------------------\n"<<"Time elapsed: "<<m_timer.elapsed()<<"\n-------------------------";