#include "effectslist.h"
#include "clipitem.h"
#include "mainwindow.h"
-
+#include "kdenlivesettings.h"
EffectStackView::EffectStackView(QWidget *parent)
: QWidget(parent) {
effectLists["audio"] = &MainWindow::audioEffects;
effectLists["video"] = &MainWindow::videoEffects;
effectLists["custom"] = &MainWindow::customEffects;
-
- ui.infoBox->hide();
+ ui.splitter->setStretchFactor(1, 10);
+ ui.splitter->setStretchFactor(0, 1);
setEnabled(false);
}
ui.buttonNew->setMenu(menu);
}
-void EffectStackView::updateProjectFormat(MltVideoProfile profile) {
- effectedit->updateProjectFormat(profile);
+void EffectStackView::updateProjectFormat(MltVideoProfile profile, Timecode t) {
+ effectedit->updateProjectFormat(profile, t);
}
void EffectStackView::slotSaveEffect() {
void EffectStackView::setupListView(int ix) {
ui.effectlist->clear();
+
+ // Issue 238: Add icons for effect type in effectstack.
+ KIcon videoIcon("kdenlive-show-video");
+ KIcon audioIcon("kdenlive-show-audio");
+ QListWidgetItem* item;
+
for (int i = 0;i < clipref->effectsCount();i++) {
QDomElement d = clipref->effectAt(i);
+
QDomNode namenode = d.elementsByTagName("name").item(0);
if (!namenode.isNull()) {
- QListWidgetItem* item = new QListWidgetItem(i18n(namenode.toElement().text().toUtf8().data()), ui.effectlist);
+ // Issue 238: Add icons for effect type in effectstack.
+ // Logic more or less copied from initeffects.cpp
+ QString type = d.attribute("type", QString::null);
+ if ("audio" == type) {
+ item = new QListWidgetItem(audioIcon, i18n(namenode.toElement().text().toUtf8().data()), ui.effectlist);
+ } else if ("custom" == type) {
+ item = new QListWidgetItem(i18n(namenode.toElement().text().toUtf8().data()), ui.effectlist);
+ } else {
+ item = new QListWidgetItem(videoIcon, i18n(namenode.toElement().text().toUtf8().data()), ui.effectlist);
+ }
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
if (d.attribute("disabled") == "1") item->setCheckState(Qt::Unchecked);
else item->setCheckState(Qt::Checked);
}
}
if (clipref->effectsCount() == 0) {
- emit transferParamDesc(QDomElement(), 0, 100);
+ emit transferParamDesc(QDomElement(), 0, 0);
ui.buttonDel->setEnabled(false);
ui.buttonSave->setEnabled(false);
ui.buttonReset->setEnabled(false);
bool isChecked = false;
if (hasItem && ui.effectlist->currentItem()->checkState() == Qt::Checked) isChecked = true;
if (hasItem && ui.effectlist->currentItem()->isSelected()) {
- emit transferParamDesc(clipref->effectAt(activeRow), 0, 100);//minx max frame
+ emit transferParamDesc(clipref->effectAt(activeRow), clipref->cropStart().frames(KdenliveSettings::project_fps()), clipref->cropDuration().frames(KdenliveSettings::project_fps()));//minx max frame
}
if (clipref) clipref->setSelectedEffect(activeRow);
ui.buttonDel->setEnabled(hasItem);
}
if (!dom.isNull()) {
dom.setAttribute("kdenlive_ix", old.attribute("kdenlive_ix"));
- emit transferParamDesc(dom, 0, 100);//minx max frame
+ emit transferParamDesc(dom, clipref->cropStart().frames(KdenliveSettings::project_fps()), clipref->cropDuration().frames(KdenliveSettings::project_fps()));//minx max frame
emit updateClipEffect(clipref, old, dom, activeRow);
}
}