return prod->get(property) == codec;
}
-void DocClipBase::generateProxy(KUrl proxyFolder)
+void DocClipBase::generateProxy(KUrl proxyFolder, QString params)
{
if (m_proxyThread.isRunning()) return;
QStringList parameters;
parameters << "-i" << m_properties.value("resource");
- QString params = KdenliveSettings::proxyparams().simplified();
foreach(QString s, params.split(' '))
parameters << s;
// Make sure we don't block when proxy file already exists
bool checkHash() const;
void setPlaceHolder(bool place);
/** @brief Generate a proxy clip (lower resolution copy) named like the clip's hash. */
- void generateProxy(KUrl proxyFolder);
+ void generateProxy(KUrl proxyFolder, QString params);
/** @brief Abort creation of the proxy clip (lower resolution copy). */
void abortProxy();
signals:
void gotAudioData();
- void proxyReady(const QString, bool success);
+ void proxyReady(const QString &, bool success);
};
#endif
m_documentProperties["verticalzoom"] = "1";
m_documentProperties["zonein"] = "0";
m_documentProperties["zoneout"] = "100";
-
+ m_documentProperties["enableproxy"] = QString::number((int) KdenliveSettings::enableproxy());
+ m_documentProperties["proxyparams"] = KdenliveSettings::proxyparams();
+
if (!url.isEmpty()) {
QString tmpFile;
success = KIO::NetAccess::download(url.path(), tmpFile, parent);
</group>
<group name="drag_value">
- <entry name="dragvalue_nonlinear" type="Bool">
- <label>...</label>
- <default>false</default>
- </entry>
<entry name="dragvalue_mode" type="Int">
<label>...</label>
<default>0</default>
if (m_configProject.kcfg_enableproxy->isChecked() != KdenliveSettings::enableproxy()) {
KdenliveSettings::setEnableproxy(m_configProject.kcfg_enableproxy->isChecked());
- emit updateProxySettings();
}
if (m_modified) {
void customChanged();
void doResetProfile();
void updateCaptureFolder();
- void updateProxySettings();
};
QString profileName = KdenliveSettings::default_profile();
KUrl projectFolder = KdenliveSettings::defaultprojectfolder();
QPoint projectTracks(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks());
+ bool useProxy = KdenliveSettings::enableproxy();
+ QString proxyParams = KdenliveSettings::proxyparams();
if (!showProjectSettings) {
if (!KdenliveSettings::activatetabs())
if (!closeCurrentDocument())
profileName = w->selectedProfile();
projectFolder = w->selectedFolder();
projectTracks = w->tracks();
+ useProxy = w->useProxy();
+ proxyParams = w->proxyParams();
delete w;
}
m_timelineArea->setEnabled(true);
m_projectList->setEnabled(true);
KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, projectTracks, m_projectMonitor->render, m_notesWidget, this);
+ doc->setDocumentProperty("useproxy", QString::number((int) useProxy));
+ doc->setDocumentProperty("proxyparams", proxyParams);
doc->m_autosave = new KAutoSaveFile(KUrl(), doc);
bool ok;
TrackView *trackView = new TrackView(doc, &ok, this);
if (KdenliveSettings::videothumbnails() != w->enableVideoThumbs()) slotSwitchVideoThumbs();
if (KdenliveSettings::audiothumbnails() != w->enableAudioThumbs()) slotSwitchAudioThumbs();
if (m_activeDocument->profilePath() != profile) slotUpdateProjectProfile(profile);
+ m_activeDocument->setDocumentProperty("proxyparams", w->proxyParams());
+ if (QString::number((int) w->useProxy()) != m_activeDocument->getDocumentProperty("enableproxy")) {
+ m_activeDocument->setDocumentProperty("enableproxy", QString::number((int) w->useProxy()));
+ slotUpdateProxySettings();
+ }
}
delete w;
}
{
if (!m_renderWidget) {
QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) : KdenliveSettings::defaultprojectfolder();
- m_renderWidget = new RenderWidget(projectfolder, this);
+ m_renderWidget = new RenderWidget(projectfolder, m_projectList->useProxy(), 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&)));
KdenliveSettingsDialog* dialog = new KdenliveSettingsDialog(actions, this);
connect(dialog, SIGNAL(settingsChanged(const QString&)), this, SLOT(updateConfiguration()));
- connect(dialog, SIGNAL(updateProxySettings()), this, SLOT(slotUpdateProxySettings()));
connect(dialog, SIGNAL(doResetProfile()), m_monitorManager, SLOT(slotResetProfiles()));
#ifndef Q_WS_MAC
connect(dialog, SIGNAL(updateCaptureFolder()), this, SLOT(slotUpdateCaptureFolder()));
} else exportAudio = m_renderWidget->selectedAudioExport();
// Do we want proxy rendering
- if (KdenliveSettings::enableproxy() && !m_renderWidget->proxyRendering()) {
+ if (m_projectList->useProxy() && !m_renderWidget->proxyRendering()) {
// replace proxy clips with originals
QMap <QString, QString> proxies = m_projectList->getProxies();
QMapIterator<QString, QString> i(proxies);
void MainWindow::slotUpdateProxySettings()
{
- if (m_renderWidget) m_renderWidget->updateProxyConfig();
+ if (m_renderWidget) m_renderWidget->updateProxyConfig(m_projectList->useProxy());
if (KdenliveSettings::enableproxy())
KStandardDirs::makeDir(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) + "proxy/");
m_projectList->updateProxyConfig();
item = new ProjectItem(m_listView, clip);
if (item->data(0, DurationRole).isNull()) item->setData(0, DurationRole, i18n("Loading"));
if (getProperties) {
+ qApp->processEvents();
m_refreshed = false;
// Proxy clips
CLIPTYPE t = clip->clipType();
- if ((t == VIDEO || t == AV || t == UNKNOWN) && KdenliveSettings::enableproxy()) {
+ if ((t == VIDEO || t == AV || t == UNKNOWN) && useProxy()) {
if (clip->getProperty("proxy").isEmpty()) {
- connect(clip, SIGNAL(proxyReady(const QString, bool)), this, SLOT(slotGotProxy(const QString, bool)));
+ connect(clip, SIGNAL(proxyReady(const QString&, bool)), this, SLOT(slotGotProxy(const QString&, bool)));
setProxyStatus(item, 1);
- clip->generateProxy(m_doc->projectFolder());
+ clip->generateProxy(m_doc->projectFolder(), proxyParams());
}
else {
// Proxy clip already created
//m_render->getFileProperties(clip->toXML(), clip->getId(), true);
}
else if (!clip->getProperty("proxy").isEmpty()) {
- connect(clip, SIGNAL(proxyReady(const QString, bool)), this, SLOT(slotGotProxy(const QString, bool)));
+ connect(clip, SIGNAL(proxyReady(const QString&, bool)), this, SLOT(slotGotProxy(const QString&, bool)));
setProxyStatus(item, 1);
- clip->generateProxy(m_doc->projectFolder());
+ clip->generateProxy(m_doc->projectFolder(), proxyParams());
}
clip->askForAudioThumbs();
m_queueRunner = QtConcurrent::run(this, &ProjectList::slotProcessNextClipInQueue);
}
-void ProjectList::slotGotProxy(const QString id, bool success)
+void ProjectList::slotGotProxy(const QString &id, bool success)
{
ProjectItem *item = getItemById(id);
if (item) {
return profileUpdated;
}
+bool ProjectList::useProxy() const
+{
+ return m_doc->getDocumentProperty("enableproxy").toInt();
+}
+
+QString ProjectList::proxyParams() const
+{
+ return m_doc->getDocumentProperty("proxyparams").simplified();
+}
+
void ProjectList::slotReplyGetImage(const QString &clipId, const QPixmap &pix)
{
ProjectItem *item = getItemById(clipId);
QTreeWidgetItemIterator it(m_listView);
while (*it) {
if ((*it)->type() != PROJECTCLIPTYPE) {
- // subitem
+ // subitem or folder
++it;
continue;
}
continue;
}
item = static_cast<ProjectItem *>(*it);
- if (item && item->referencedClip() != NULL) {
- if (KdenliveSettings::enableproxy()) {
+ if (item == NULL) {
+ ++it;
+ continue;
+ }
+ CLIPTYPE t = item->clipType();
+ if ((t == VIDEO || t == AV || t == UNKNOWN) && item->referencedClip() != NULL) {
+ if (useProxy()) {
DocClipBase *clip = item->referencedClip();
- connect(clip, SIGNAL(proxyReady(const QString, bool)), this, SLOT(slotGotProxy(const QString, bool)));
+ connect(clip, SIGNAL(proxyReady(const QString &, bool)), this, SLOT(slotGotProxy(const QString &, bool)));
setProxyStatus(item, 1);
- clip->generateProxy(m_doc->projectFolder());
+ clip->generateProxy(m_doc->projectFolder(), proxyParams());
}
else if (!item->referencedClip()->getProperty("proxy").isEmpty()) {
// remove proxy
}
if (listItem->type() == PROJECTCLIPTYPE) {
ProjectItem *item = static_cast <ProjectItem*>(listItem);
- if (item->referencedClip()) {
+ CLIPTYPE t = item->clipType();
+ if ((t == VIDEO || t == AV || t == UNKNOWN) && item->referencedClip()) {
if (doProxy) {
DocClipBase *clip = item->referencedClip();
- connect(clip, SIGNAL(proxyReady(const QString, bool)), this, SLOT(slotGotProxy(const QString, bool)));
+ connect(clip, SIGNAL(proxyReady(const QString&, bool)), this, SLOT(slotGotProxy(const QString&, bool)));
setProxyStatus(item, 1);
- clip->generateProxy(m_doc->projectFolder());
+ clip->generateProxy(m_doc->projectFolder(), proxyParams());
}
else if (!item->referencedClip()->getProperty("proxy").isEmpty()) {
// remove proxy
QMap <QString, QString> getProxies();
/** @brief Enable / disable proxies. */
void updateProxyConfig();
+ /** @brief Does this project automatically use proxies. */
+ bool useProxy() const;
+ /** @brief proxy parameters for this project. */
+ QString proxyParams() const;
public slots:
void setDocument(KdenliveDoc *doc);
/** @brief Add a sequence from the stopmotion widget. */
void slotAddOrUpdateSequence(const QString frameName);
/** @brief A proxy clip was created, update display. */
- void slotGotProxy(const QString id, bool success);
+ void slotGotProxy(const QString &id, bool success);
/** @brief Enable / disable proxy for current clip. */
void slotProxyCurrentItem(bool doProxy);
video_thumbs->setChecked(KdenliveSettings::videothumbnails());
audio_tracks->setValue(audiotracks);
video_tracks->setValue(videotracks);
-
+ connect(enable_proxy, SIGNAL(toggled(bool)), proxy_params, SLOT(setVisible(bool)));
+ if (projectlist) {
+ enable_proxy->setChecked(projectlist->useProxy());
+ proxy_params->setText(projectlist->proxyParams());
+ proxy_params->setVisible(projectlist->useProxy());
+ }
+ else {
+ enable_proxy->setChecked(KdenliveSettings::enableproxy());
+ proxy_params->setText(KdenliveSettings::proxyparams());
+ proxy_params->setVisible(KdenliveSettings::enableproxy());
+ }
+
if (readOnlyTracks) {
video_tracks->setEnabled(false);
audio_tracks->setEnabled(false);
return audio_thumbs->isChecked();
}
+bool ProjectSettings::useProxy() const
+{
+ return enable_proxy->isChecked();
+}
+
+QString ProjectSettings::proxyParams() const
+{
+ return proxy_params->toPlainText();
+}
//static
QStringList ProjectSettings::extractPlaylistUrls(QString path)
QPoint tracks();
bool enableVideoThumbs() const;
bool enableAudioThumbs() const;
+ bool useProxy() const;
+ QString proxyParams() const;
static QStringList extractPlaylistUrls(QString path);
static QStringList extractSlideshowUrls(KUrl url);
const int FINISHEDJOB = 2;
-RenderWidget::RenderWidget(const QString &projectfolder, QWidget * parent) :
+RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, QWidget * parent) :
QDialog(parent),
m_projectFolder(projectfolder),
m_blockProcessing(false)
m_view.buttonInfo->setDown(true);
} else m_view.advanced_params->hide();
- m_view.proxy_render->setHidden(!KdenliveSettings::enableproxy());
+ m_view.proxy_render->setHidden(!enableProxy);
m_view.rescale_keep->setChecked(KdenliveSettings::rescalekeepratio());
connect(m_view.rescale_width, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateRescaleWidth(int)));
return (m_view.export_audio->checkState() != Qt::Unchecked);
}
-void RenderWidget::updateProxyConfig()
+void RenderWidget::updateProxyConfig(bool enable)
{
- m_view.proxy_render->setHidden(!KdenliveSettings::enableproxy());
+ m_view.proxy_render->setHidden(!enable);
}
bool RenderWidget::proxyRendering()
Q_OBJECT
public:
- explicit RenderWidget(const QString &projectfolder, QWidget * parent = 0);
+ explicit RenderWidget(const QString &projectfolder, bool enableProxy, QWidget * parent = 0);
virtual ~RenderWidget();
void setGuides(QDomElement guidesxml, double duration);
void focusFirstVisibleItem();
/** @brief Returns true if user wants audio export. */
bool selectedAudioExport() const;
/** @brief Show / hide proxy settings. */
- void updateProxyConfig();
+ void updateProxyConfig(bool enable);
/** @brief Should we render using proxy clips. */
bool proxyRendering();
<rect>
<x>0</x>
<y>0</y>
- <width>289</width>
- <height>367</height>
+ <width>285</width>
+ <height>433</height>
</rect>
</property>
<property name="windowTitle">
<property name="bottomMargin">
<number>0</number>
</property>
+ <item row="1" column="0" colspan="2">
+ <widget class="QFrame" name="frame">
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_5">
+ <item row="0" column="0">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item row="0" column="0" colspan="2">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
</property>
</widget>
</item>
- <item row="3" column="3" colspan="2">
+ <item row="3" column="3" colspan="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</spacer>
</item>
- <item row="4" column="0" colspan="2">
+ <item row="6" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</spacer>
</item>
+ <item row="4" column="0" colspan="5">
+ <widget class="QCheckBox" name="enable_proxy">
+ <property name="text">
+ <string>Enable proxy clips</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" colspan="6">
+ <widget class="QTextEdit" name="proxy_params"/>
+ </item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
</widget>
</widget>
</item>
- <item row="1" column="0" colspan="2">
- <widget class="QFrame" name="frame">
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <layout class="QGridLayout" name="gridLayout_5">
- <item row="0" column="0">
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- <zorder>buttonBox</zorder>
- <zorder>buttonBox</zorder>
- </widget>
- </item>
</layout>
</widget>
<customwidgets>