setRect(rect);
kDebug() << "///// NEW CLIP RECT: " << rect;
m_fps = fps;
- m_xml = clip->toXML();
m_clipName = clip->name();
m_producer = clip->getId();
m_clipType = clip->clipType();
m_cropStart = GenTime();
- m_maxDuration = m_cropDuration;
+ m_maxDuration = clip->maxDuration();
setAcceptDrops(true);
audioThumbReady = clip->audioThumbCreated();
/*
connect(this , SIGNAL(prepareAudioThumb(double, QPainterPath, int, int)) , this, SLOT(slotPrepareAudioThumb(double, QPainterPath, int, int)));
setBrush(QColor(141, 166, 215));
- if (m_clipType == VIDEO || m_clipType == AV) {
+ if (m_clipType == VIDEO || m_clipType == AV || m_clipType == SLIDESHOW) {
m_hasThumbs = true;
connect(this, SIGNAL(getThumb(int, int)), clip->thumbProducer(), SLOT(extractImage(int, int)));
connect(clip->thumbProducer(), SIGNAL(thumbReady(int, QPixmap)), this, SLOT(slotThumbReady(int, QPixmap)));
endThumbTimer = new QTimer(this);
endThumbTimer->setSingleShot(true);
connect(endThumbTimer, SIGNAL(timeout()), this, SLOT(slotGetEndThumb()));
-
} else if (m_clipType == COLOR) {
- m_maxDuration = GenTime(10000, m_fps);
- QString colour = m_xml.attribute("colour");
+ QString colour = clip->getProperty("colour");
colour = colour.replace(0, 2, "#");
setBrush(QColor(colour.left(7)));
} else if (m_clipType == IMAGE || m_clipType == TEXT) {
- m_maxDuration = GenTime(10000, m_fps);
- m_startPix = KThumb::getImage(KUrl(m_xml.attribute("resource")), (int)(50 * KdenliveSettings::project_display_ratio()), 50);
+ m_startPix = KThumb::getImage(KUrl(clip->getProperty("resource")), (int)(50 * KdenliveSettings::project_display_ratio()), 50);
m_endPix = m_startPix;
} else if (m_clipType == AUDIO) {
connect(clip, SIGNAL(gotAudioData()), this, SLOT(slotGotAudioData()));
audioThumbCachePic.clear();
}
+
+void ClipItem::refreshClip() {
+ m_maxDuration = m_clip->maxDuration();
+ if (m_clipType == VIDEO || m_clipType == AV || m_clipType == SLIDESHOW) slotFetchThumbs();
+ else if (m_clipType == COLOR) {
+ QString colour = m_clip->getProperty("colour");
+ colour = colour.replace(0, 2, "#");
+ setBrush(QColor(colour.left(7)));
+ } else if (m_clipType == IMAGE || m_clipType == TEXT) {
+ m_startPix = KThumb::getImage(KUrl(m_clip->getProperty("resource")), (int)(50 * KdenliveSettings::project_display_ratio()), 50);
+ m_endPix = m_startPix;
+ }
+}
+
void ClipItem::slotFetchThumbs() {
m_thumbsRequested += 2;
emit getThumb((int)m_cropStart.frames(m_fps), (int)(m_cropStart + m_cropDuration).frames(m_fps));
}
QDomElement ClipItem::xml() const {
- return m_xml;
+ return m_clip->toXML();
}
int ClipItem::clipType() {