-/**************************1*************************************************
- DocClipBase.cpp - description
- -------------------
- begin : Fri Apr 12 2002
- copyright : (C) 2002 by Jason Wood
- copyright : (C) 2009 by Jean-Baptiste Mardelle
-
- ***************************************************************************/
-
/***************************************************************************
+ * 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) *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
+
+
#include "docclipbase.h"
#include "kdenlivesettings.h"
#include "kthumb.h"
KUrl url = KUrl(xml.attribute("resource"));
if (!m_properties.contains("file_hash") && !url.isEmpty()) getFileHash(url.path());
- int out = xml.attribute("out").toInt();
- if (out != 0) {
- setDuration(GenTime(out, KdenliveSettings::project_fps()));
+
+ if (xml.hasAttribute("duration")) {
+ setDuration(GenTime(xml.attribute("duration").toInt(), KdenliveSettings::project_fps()));
} else {
- out = xml.attribute("duration").toInt();
- if (out != 0) setDuration(GenTime(out, KdenliveSettings::project_fps()));
+ int out = xml.attribute("out").toInt();
+ int in = xml.attribute("in").toInt();
+ setDuration(GenTime(out - in, KdenliveSettings::project_fps()));
}
+
if (!m_properties.contains("name")) m_properties.insert("name", url.fileName());
//if (!url.isEmpty() && QFile::exists(url.path()))
return m_audioThumbCreated;
}
-const QString & DocClipBase::name() const {
+const QString DocClipBase::name() const {
return m_properties.value("name");
}
}
DocClipBase *DocClipBase::
-createClip(KdenliveDoc *doc, const QDomElement & element) {
+createClip(KdenliveDoc */*doc*/, const QDomElement & element) {
DocClipBase *clip = 0;
QString description;
QDomNode node = element;
}*/
if (track == -1 || (m_clipType != AUDIO && m_clipType != AV)) {
if (m_baseTrackProducers.count() == 0) return NULL;
- int i;
for (int i = 0; i < m_baseTrackProducers.count(); i++) {
if (m_baseTrackProducers.at(i) != NULL)
return m_baseTrackProducers.at(i);