setLayout(layout);
searchView->setTreeWidget(m_listView);
+ m_proxyAction = new QAction(i18n("Proxy clip"), this);
+ m_proxyAction->setCheckable(true);
+ m_proxyAction->setChecked(false);
+ connect(m_proxyAction, SIGNAL(toggled(bool)), this, SLOT(slotProxyCurrentItem(bool)));
+
+
m_queueTimer.setInterval(100);
connect(&m_queueTimer, SIGNAL(timeout()), this, SLOT(slotProcessNextClipInQueue()));
m_queueTimer.setSingleShot(true);
transcodeMenu->setEnabled(false);
m_transcodeAction = transcodeMenu;
m_menu->addAction(m_reloadAction);
+ m_menu->addAction(m_proxyAction);
m_menu->addMenu(inTimelineMenu);
inTimelineMenu->setEnabled(false);
m_menu->addAction(m_editButton->defaultAction());
m_openAction->setEnabled(false);
m_reloadAction->setEnabled(false);
m_transcodeAction->setEnabled(false);
+ m_proxyAction->setEnabled(false);
} else {
ProjectItem *clip;
if (m_listView->currentItem()->type() == PROJECTSUBCLIPTYPE) {
}
}
+void ProjectList::adjustProxyActions(ProjectItem *clip) const
+{
+ if (clip == NULL || clip->type() != PROJECTCLIPTYPE || clip->clipType() == COLOR || clip->clipType() == TEXT || clip->clipType() == PLAYLIST || clip->clipType() == SLIDESHOW || clip->clipType() == AUDIO) {
+ m_proxyAction->setEnabled(false);
+ return;
+ }
+ m_proxyAction->setEnabled(true);
+ m_proxyAction->setChecked(clip->hasProxy());
+}
+
void ProjectList::adjustTranscodeActions(ProjectItem *clip) const
{
if (clip == NULL || clip->type() != PROJECTCLIPTYPE || clip->clipType() == COLOR || clip->clipType() == TEXT || clip->clipType() == PLAYLIST || clip->clipType() == SLIDESHOW) {
clip = static_cast <ProjectItem*>(item);
// Display relevant transcoding actions only
adjustTranscodeActions(clip);
+ adjustProxyActions(clip);
// Display uses in timeline
emit findInTimeline(clip->clipId());
} else {
}
+void ProjectList::slotProxyCurrentItem(bool doProxy)
+{
+ if (m_listView->currentItem()->type() == PROJECTCLIPTYPE) {
+ ProjectItem *item = static_cast <ProjectItem*>(m_listView->currentItem());
+ if (item->referencedClip()) {
+ if (doProxy) {
+ DocClipBase *clip = item->referencedClip();
+ connect(clip, SIGNAL(proxyReady(const QString, bool)), this, SLOT(slotGotProxy(const QString, bool)));
+ item->setProxyStatus(1);
+ clip->generateProxy(m_doc->projectFolder());
+ }
+ else if (!item->referencedClip()->getProperty("proxy").isEmpty()) {
+ // remove proxy
+ item->referencedClip()->clearProperty("proxy");
+ QDomElement e = item->toXml().cloneNode().toElement();
+ e.removeAttribute("file_hash");
+ e.setAttribute("replace", 1);
+ m_infoQueue.insert(item->clipId(), e);
+ }
+ }
+ if (!m_infoQueue.isEmpty() && !m_queueTimer.isActive()) m_queueTimer.start();
+ }
+}
+
#include "projectlist.moc"
QMap <QString, QDomElement> m_producerQueue;
void requestClipInfo(const QDomElement xml, const QString id);
QList <QString> m_thumbnailQueue;
+ QAction *m_proxyAction;
void requestClipThumbnail(const QString id);
/** @brief Creates an EditFolderCommand to change the name of an folder item. */
/** @brief Enables and disables transcode actions based on the selected clip's type. */
void adjustTranscodeActions(ProjectItem *clip) const;
+ /** @brief Enables and disables proxy action based on the selected clip. */
+ void adjustProxyActions(ProjectItem *clip) const;
/** @brief Sets the buttons enabled/disabled according to selected item. */
void updateButtons() const;
void slotAddOrUpdateSequence(const QString frameName);
/** @brief A proxy clip was created, update display. */
void slotGotProxy(const QString id, bool success);
+ /** @brief Enable / disable proxy for current clip. */
+ void slotProxyCurrentItem(bool doProxy);
signals:
void clipSelected(DocClipBase *, QPoint zone = QPoint());
<rect>
<x>0</x>
<y>0</y>
- <width>268</width>
- <height>333</height>
+ <width>264</width>
+ <height>304</height>
</rect>
</property>
<property name="windowTitle">
<item row="0" column="0">
<widget class="QCheckBox" name="kcfg_enableproxy">
<property name="text">
- <string>Enable proxy clips for HD</string>
+ <string>Generate proxy clips</string>
</property>
</widget>
</item>
<item row="1" column="0">
- <widget class="QCheckBox" name="kcfg_autoproxy">
- <property name="text">
- <string>Generate automatically</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Transcoding parameters</string>
</property>
</widget>
</item>
- <item row="3" column="0">
+ <item row="2" column="0">
<widget class="QPlainTextEdit" name="kcfg_proxyparams">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">