duplicate->setEffectList(m_effectList);
duplicate->setVideoOnly(m_videoOnly);
duplicate->setAudioOnly(m_audioOnly);
+ duplicate->setFades(fadeIn(), fadeOut());
//duplicate->setSpeed(m_speed);
return duplicate;
}
{
m_effectList.clone(effectList);
m_effectNames = m_effectList.effectNames().join(" / ");
- if (!m_effectList.isEmpty()) setSelectedEffect(0);
+ if (!m_effectList.isEmpty()) {
+ for (int i = 0; i < m_effectList.count(); i++) {
+ QString effectId = m_effectList.item(i).attribute("id");
+ // check if it is a fade effect
+ QDomNodeList params = m_effectList.item(i).elementsByTagName("parameter");
+ int fade = 0;
+ for (int j = 0; j < params.count(); j++) {
+ QDomElement e = params.item(j).toElement();
+ if (!e.isNull()) {
+ if (effectId == "fadein") {
+ if (m_effectList.hasEffect(QString(), "fade_from_black") == -1) {
+ if (e.attribute("name") == "out") fade += e.attribute("value").toInt();
+ else if (e.attribute("name") == "in") fade -= e.attribute("value").toInt();
+ } else {
+ QDomElement fadein = m_effectList.getEffectByTag(QString(), "fade_from_black");
+ if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt();
+ else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt();
+ }
+ } else if (effectId == "fade_from_black") {
+ if (m_effectList.hasEffect(QString(), "fadein") == -1) {
+ if (e.attribute("name") == "out") fade += e.attribute("value").toInt();
+ else if (e.attribute("name") == "in") fade -= e.attribute("value").toInt();
+ } else {
+ QDomElement fadein = m_effectList.getEffectByTag(QString(), "fadein");
+ if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt();
+ else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt();
+ }
+ } else if (effectId == "fadeout") {
+ if (m_effectList.hasEffect(QString(), "fade_to_black") == -1) {
+ if (e.attribute("name") == "out") fade -= e.attribute("value").toInt();
+ else if (e.attribute("name") == "in") fade += e.attribute("value").toInt();
+ } else {
+ QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fade_to_black");
+ if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt();
+ else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt();
+ }
+ } else if (effectId == "fade_to_black") {
+ if (m_effectList.hasEffect(QString(), "fadeout") == -1) {
+ if (e.attribute("name") == "out") fade -= e.attribute("value").toInt();
+ else if (e.attribute("name") == "in") fade += e.attribute("value").toInt();
+ } else {
+ QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fadeout");
+ if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt();
+ else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt();
+ }
+ }
+ }
+ }
+ if (fade > 0) m_startFade = fade;
+ else if (fade < 0) m_endFade = -fade;
+ }
+ setSelectedEffect(0);
+ }
}
const EffectsList ClipItem::effectList() const
return xml;
}
+QDomElement ClipItem::itemXml() const
+{
+ QDomElement xml = m_clip->toXML();
+ if (m_speed != 1.0) xml.setAttribute("speed", m_speed);
+ if (m_strobe > 1) xml.setAttribute("strobe", m_strobe);
+ if (m_audioOnly) xml.setAttribute("audio_only", 1);
+ else if (m_videoOnly) xml.setAttribute("video_only", 1);
+ return xml;
+}
+
int ClipItem::clipType() const
{
return m_clipType;
} else mappedRect = mapped;
double scale = painter->matrix().m11();
- int channels = baseClip()->getProperty("channels").toInt();
+ int channels = 0;
+ if (isEnabled() && m_clip) channels = m_clip->getProperty("channels").toInt();
if (scale != m_framePixelWidth)
m_audioThumbCachePic.clear();
double cropLeft = m_info.cropStart.frames(m_fps);
setToolTip(i18n("Add transition"));
return TRANSITIONEND;
}
- setToolTip(QString());
+ QString tooltip = "<b>" + m_clipName + "</b>";
+ if (!baseClip()->fileURL().isEmpty())
+ tooltip.append("<br />" + baseClip()->fileURL().path());
+ if (!baseClip()->description().isEmpty())
+ tooltip.append("<br />" + baseClip()->description());
+ setToolTip(tooltip);
return MOVE;
}
}
+void ClipItem::setFades(int in, int out)
+{
+ m_startFade = in;
+ m_endFade = out;
+}
+
/*
//virtual
void ClipItem::hoverEnterEvent(QGraphicsSceneHoverEvent *e)
}
*/
-void ClipItem::resizeStart(int posx)
+void ClipItem::resizeStart(int posx, bool)
{
- const int min = (startPos() - cropStart()).frames(m_fps);
- if (posx < min) posx = min;
+ bool sizeLimit = false;
+ if (clipType() != IMAGE && clipType() != COLOR && clipType() != TEXT) {
+ const int min = (startPos() - cropStart()).frames(m_fps);
+ if (posx < min) posx = min;
+ sizeLimit = true;
+ }
+
if (posx == startPos().frames(m_fps)) return;
const int previous = cropStart().frames(m_fps);
- AbstractClipItem::resizeStart(posx);
+ AbstractClipItem::resizeStart(posx, sizeLimit);
// set speed independant info
m_speedIndependantInfo = m_info;