m_documentProperties["zoneout"] = "100";
m_documentProperties["enableproxy"] = QString::number((int) KdenliveSettings::enableproxy());
m_documentProperties["proxyparams"] = KdenliveSettings::proxyparams();
+ m_documentProperties["generateproxy"] = QString::number((int) KdenliveSettings::enableproxy());
+ m_documentProperties["proxyminsize"] = "1000";
if (!url.isEmpty()) {
QString tmpFile;
QPoint projectTracks(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks());
bool useProxy = KdenliveSettings::enableproxy();
QString proxyParams = KdenliveSettings::proxyparams();
+ bool generateProxy = KdenliveSettings::enableproxy();
+ int proxyMinSize = 1000;
if (!showProjectSettings) {
if (!KdenliveSettings::activatetabs())
if (!closeCurrentDocument())
projectTracks = w->tracks();
useProxy = w->useProxy();
proxyParams = w->proxyParams();
+ generateProxy = w->generateProxy();
+ proxyMinSize = w->proxyMinSize();
delete w;
}
m_timelineArea->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->setDocumentProperty("generateproxy", QString::number((int) generateProxy));
+ doc->setDocumentProperty("proxyminsize", QString::number(proxyMinSize));
doc->m_autosave = new KAutoSaveFile(KUrl(), doc);
bool ok;
TrackView *trackView = new TrackView(doc, &ok, this);
if (KdenliveSettings::audiothumbnails() != w->enableAudioThumbs()) slotSwitchAudioThumbs();
if (m_activeDocument->profilePath() != profile) slotUpdateProjectProfile(profile);
m_activeDocument->setDocumentProperty("proxyparams", w->proxyParams());
+ m_activeDocument->setDocumentProperty("generateproxy", QString::number((int) w->generateProxy()));
+ m_activeDocument->setDocumentProperty("proxyminsize", QString::number(w->proxyMinSize()));
if (QString::number((int) w->useProxy()) != m_activeDocument->getDocumentProperty("enableproxy")) {
m_activeDocument->setDocumentProperty("enableproxy", QString::number((int) w->useProxy()));
slotUpdateProxySettings();
m_proxyAction->setEnabled(false);
return;
}
- m_proxyAction->setEnabled(true);
+ m_proxyAction->setEnabled(useProxy());
m_proxyAction->blockSignals(true);
m_proxyAction->setChecked(clip->hasProxy());
m_proxyAction->blockSignals(false);
m_openAction->setEnabled(true);
m_reloadAction->setEnabled(true);
m_transcodeAction->setEnabled(true);
- m_proxyAction->setEnabled(true);
+ m_proxyAction->setEnabled(useProxy());
return;
}
else if (item && item->type() == PROJECTFOLDERTYPE && item->childCount() > 0) {
CLIPTYPE t = clip->clipType();
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)));
- setProxyStatus(item, 1);
- clip->generateProxy(m_doc->projectFolder(), proxyParams());
+
+ //connect(clip, SIGNAL(proxyReady(const QString&, bool)), this, SLOT(slotGotProxy(const QString&, bool)));
+ //setProxyStatus(item, 1);
+ //clip->generateProxy(m_doc->projectFolder(), proxyParams());
}
else {
// Proxy clip already created
m_infoQueue.insert(clip->getId(), e);
}
}
- else {
+ //else {
// We don't use proxies
// remove file_hash so that we load all properties for the clip
QDomElement e = clip->toXML().cloneNode().toElement();
e.removeAttribute("file_hash");
m_infoQueue.insert(clip->getId(), e);
- }
+ //}
//m_render->getFileProperties(clip->toXML(), clip->getId(), true);
}
else if (!clip->getProperty("proxy").isEmpty()) {
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsDropEnabled);
toReload = clipId;
}
- if (item->referencedClip()->getProperty("proxy").isEmpty()) setProxyStatus(item, 0);
- item->referencedClip()->setProducer(producer, replace);
- item->referencedClip()->askForAudioThumbs();
+ if (!useProxy() && item->referencedClip()->getProperty("proxy").isEmpty()) setProxyStatus(item, 0);
+ QString type = properties.value("type");
+ QString size = properties.value("frame_size");
+ DocClipBase *clip = item->referencedClip();
+ if (useProxy() && (type == "video" || type == "av") && generateProxy() && size.section('x', 0, 0).toInt() > proxyMinSize()) {
+ if (clip->getProperty("proxy").isEmpty()) {
+ connect(clip, SIGNAL(proxyReady(const QString&, bool)), this, SLOT(slotGotProxy(const QString&, bool)));
+ setProxyStatus(item, 1);
+ clip->generateProxy(m_doc->projectFolder(), proxyParams());
+
+ }
+ }
+ clip->setProducer(producer, replace);
+ clip->askForAudioThumbs();
if (!replace && item->data(0, Qt::DecorationRole).isNull())
requestClipThumbnail(clipId);
if (!toReload.isEmpty())
if (m_listView->isEnabled() && replace) {
// update clip in clip monitor
emit clipSelected(NULL);
- emit clipSelected(item->referencedClip());
+ emit clipSelected(clip);
//TODO: Make sure the line below has no side effect
toReload = clipId;
}
return m_doc->getDocumentProperty("enableproxy").toInt();
}
+bool ProjectList::generateProxy() const
+{
+ return m_doc->getDocumentProperty("generateproxy").toInt();
+}
+
+int ProjectList::proxyMinSize() const
+{
+ return m_doc->getDocumentProperty("proxyminsize").toInt();
+}
+
QString ProjectList::proxyParams() const
{
return m_doc->getDocumentProperty("proxyparams").simplified();
m_deleteButton->defaultAction()->setEnabled(true);
m_reloadAction->setEnabled(true);
m_transcodeAction->setEnabled(true);
- m_proxyAction->setEnabled(true);
+ m_proxyAction->setEnabled(useProxy());
if (clip->clipType() == IMAGE && !KdenliveSettings::defaultimageapp().isEmpty()) {
m_openAction->setIcon(KIcon(KdenliveSettings::defaultimageapp()));
m_openAction->setEnabled(true);
}
CLIPTYPE t = item->clipType();
if ((t == VIDEO || t == AV || t == UNKNOWN) && item->referencedClip() != NULL) {
- if (useProxy()) {
+ if (generateProxy() && useProxy()) {
DocClipBase *clip = item->referencedClip();
- connect(clip, SIGNAL(proxyReady(const QString &, bool)), this, SLOT(slotGotProxy(const QString &, bool)));
- setProxyStatus(item, 1);
- clip->generateProxy(m_doc->projectFolder(), proxyParams());
+ if (clip->getProperty("frame_size").section('x', 0, 0).toInt() > proxyMinSize()) {
+ connect(clip, SIGNAL(proxyReady(const QString &, bool)), this, SLOT(slotGotProxy(const QString &, bool)));
+ setProxyStatus(item, 1);
+ clip->generateProxy(m_doc->projectFolder(), proxyParams());
+ }
}
else if (!item->referencedClip()->getProperty("proxy").isEmpty()) {
// remove proxy
bool useProxy() const;
/** @brief proxy parameters for this project. */
QString proxyParams() const;
+ /** @brief Should we automatically create proxy clips for newly added clips. */
+ bool generateProxy() const;
+ /** @brief Minimum clip width to create proxy. */
+ int proxyMinSize() const;
public slots:
void setDocument(KdenliveDoc *doc);
video_thumbs->setChecked(KdenliveSettings::videothumbnails());
audio_tracks->setValue(audiotracks);
video_tracks->setValue(videotracks);
- connect(enable_proxy, SIGNAL(toggled(bool)), proxy_params, SLOT(setVisible(bool)));
+ connect(enable_proxy, SIGNAL(toggled(bool)), proxy_box, SLOT(setEnabled(bool)));
+ connect(generate_proxy, SIGNAL(toggled(bool)), proxy_minsize, SLOT(setEnabled(bool)));
+
if (projectlist) {
enable_proxy->setChecked(projectlist->useProxy());
+ generate_proxy->setChecked(projectlist->generateProxy());
+ proxy_minsize->setValue(projectlist->proxyMinSize());
proxy_params->setText(projectlist->proxyParams());
- proxy_params->setVisible(projectlist->useProxy());
+ proxy_box->setEnabled(projectlist->useProxy());
}
else {
enable_proxy->setChecked(KdenliveSettings::enableproxy());
+ generate_proxy->setChecked(KdenliveSettings::enableproxy());
+ proxy_minsize->setValue(1000);
proxy_params->setText(KdenliveSettings::proxyparams());
- proxy_params->setVisible(KdenliveSettings::enableproxy());
+ proxy_box->setEnabled(KdenliveSettings::enableproxy());
}
if (readOnlyTracks) {
return enable_proxy->isChecked();
}
+bool ProjectSettings::generateProxy() const
+{
+ return generate_proxy->isChecked();
+}
+
+int ProjectSettings::proxyMinSize() const
+{
+ return proxy_minsize->value();
+}
+
QString ProjectSettings::proxyParams() const
{
return proxy_params->toPlainText();
bool enableVideoThumbs() const;
bool enableAudioThumbs() const;
bool useProxy() const;
+ bool generateProxy() const;
+ int proxyMinSize() const;
QString proxyParams() const;
static QStringList extractPlaylistUrls(QString path);
static QStringList extractSlideshowUrls(KUrl url);
<rect>
<x>0</x>
<y>0</y>
- <width>285</width>
- <height>433</height>
+ <width>321</width>
+ <height>462</height>
</rect>
</property>
<property name="windowTitle">
<attribute name="title">
<string>Settings</string>
</attribute>
- <layout class="QGridLayout" name="gridLayout_2">
+ <layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
</property>
</widget>
</item>
- <item row="0" column="1" colspan="4">
+ <item row="0" column="1" colspan="3">
<widget class="KUrlRequester" name="project_folder"/>
</item>
- <item row="1" column="0" colspan="6">
+ <item row="1" column="0" colspan="4">
<widget class="QGroupBox" name="properties">
<property name="title">
<string>Video Profile</string>
</layout>
</widget>
</item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_7">
- <property name="text">
- <string>Video tracks</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QSpinBox" name="video_tracks"/>
- </item>
- <item row="2" column="2" colspan="2">
- <widget class="QLabel" name="label_8">
- <property name="text">
- <string>Audio tracks</string>
- </property>
- </widget>
- </item>
- <item row="2" column="4">
- <widget class="QSpinBox" name="audio_tracks"/>
- </item>
- <item row="2" column="5">
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>67</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
+ <item row="2" column="0" colspan="4">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>Video tracks</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="video_tracks"/>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>Audio tracks</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="audio_tracks"/>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>67</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
</property>
</widget>
</item>
- <item row="3" column="3" colspan="3">
+ <item row="3" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</spacer>
</item>
+ <item row="4" column="0" colspan="4">
+ <widget class="QCheckBox" name="enable_proxy">
+ <property name="text">
+ <string>Enable proxy clips</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" colspan="4">
+ <widget class="QFrame" name="proxy_box">
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="generate_proxy">
+ <property name="text">
+ <string>Generate proxy if clip larger than</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="KIntSpinBox" name="proxy_minsize">
+ <property name="suffix">
+ <string>pixels</string>
+ </property>
+ <property name="maximum">
+ <number>10000</number>
+ </property>
+ <property name="value">
+ <number>1000</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="2">
+ <widget class="QTextEdit" name="proxy_params"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item row="6" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
</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">
</layout>
</widget>
<customwidgets>
+ <customwidget>
+ <class>KIntSpinBox</class>
+ <extends>QSpinBox</extends>
+ <header>knuminput.h</header>
+ </customwidget>
<customwidget>
<class>KUrlRequester</class>
<extends>QFrame</extends>