/***************************************************************************
- * DocClipBase.cpp - description *
- * ------------------- *
- * begin : Fri Apr 12 2002 *
+ * DocClipBase.cpp - description *
+ * ------------------- *
+ * begin : Fri Apr 12 2002 *
* Copyright (C) 2002 by Jason Wood (jasonwood@blueyonder.co.uk) *
* Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
* *
return doc.documentElement();
}
-DocClipBase *DocClipBase::
-createClip(KdenliveDoc */*doc*/, const QDomElement & element) {
- DocClipBase *clip = 0;
- QString description;
- QDomNode node = element;
- node.normalize();
- if (element.tagName() != "kdenliveclip") {
- kWarning() <<
- "DocClipBase::createClip() element has unknown tagName : " << element.tagName();
- return 0;
- }
-
- QDomNode n = element.firstChild();
-
- while (!n.isNull()) {
- QDomElement e = n.toElement();
- if (!e.isNull()) {
- QString tagName = e.tagName();
- if (e.tagName() == "avfile") {
- // clip = DocClipAVFile::createClip(e);
- } else if (e.tagName() == "DocTrackBaseList") {
- // clip = DocClipProject::createClip(doc, e);
- }
- } else {
- QDomText text = n.toText();
- if (!text.isNull()) {
- description = text.nodeValue();
- }
- }
-
- n = n.nextSibling();
- }
- if (clip == 0) {
- kWarning() << "DocClipBase::createClip() unable to create clip";
- } else {
- // setup DocClipBase specifics of the clip.
- QMap <QString, QString> props;
- props.insert("description", description);
- clip->setProperties(props);
- clip->setAudioThumbCreated(false);
- }
- return clip;
-}
void DocClipBase::setAudioThumbCreated(bool isDone) {
m_audioThumbCreated = isDone;
/** Returns the thumbnail used by this clip */
const QPixmap & thumbnail() const;
- static DocClipBase *createClip(KdenliveDoc *doc, const QDomElement & element);
/** Cache for every audio Frame with 10 Bytes */
/** format is frame -> channel ->bytes */
QMap<int, QMap<int, QByteArray> > audioFrameChache;
QList<QGraphicsItem *> collisions = button->collidingItems();
if (!collisions.isEmpty()) {
for (int j = 0; j < collisions.count(); j++) {
- if (list.at(j)->type() == button->type()) return false;
+ if (collisions.at(j)->type() == button->type()) return false;
}
}
targets.append(button->target());
}
}
- if (buttonCount == 0) return false;
+ if (buttonCount == 0) {
+ // We need at least one button
+ return false;
+ }
+
+ if (!m_view.background_image->isHidden()) {
+ // Make sure user selected a valid image / video file
+ if (!QFile::exists(m_view.background_image->url().path())) return false;
+ }
+
// check that we have a "Play all" entry
if (targets.contains(0)) return true;
// ... or that each video file has a button
}
void DvdWizardMenu::buildImage() {
+ emit completeChanged();
if (m_view.background_image->url().isEmpty()) {
m_scene->removeItem(m_background);
return;