//QPainterPath roundRectPathUpper = upperRectPart(br), roundRectPathLower = lowerRectPart(br);
painter->setClipRect(exposed);
- // build path around clip
+ //build path around clip
//QPainterPath resultClipPath = roundRectPathUpper.united(roundRectPathLower);
//painter->fillPath(resultClipPath, paintColor);
painter->fillRect(br, paintColor);
}
void ClipItem::setEffectAt(int ix, QDomElement effect) {
- kDebug() << "CHange EFFECT AT: " << ix << ", CURR: " << m_effectList.at(ix).attribute("tag") << ", NEW: " << effect.attribute("tag");
+ kDebug() << "CHange EFFECT AT: " << ix << ", CURR: " << m_effectList.at(ix).attribute("tag") << ", NEW: " << effect.attribute("tag");
effect.setAttribute("kdenlive_ix", ix + 1);
m_effectList.insert(ix, effect);
m_effectList.removeAt(ix + 1);
setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable);
setIcon(0, KIcon("folder"));
setToolTip(1, "<qt><b>" + i18n("Folder"));
+ //kDebug() << "Constructed as folder, with clipId: " << m_clipId << ", and groupname: " << m_groupname;
}
ProjectItem::ProjectItem(QTreeWidget * parent, DocClipBase *clip)
setText(2, m_clip->description());
if ((m_clip->clipType() == AV || m_clip->clipType() == AUDIO) && KdenliveSettings::audiothumbnails()) m_clip->askForAudioThumbs();
//setFlags(Qt::NoItemFlags);
- //kDebug() << "PROJECT ITE;. ADDING LCIP: " << m_clipId;
+ //kDebug() << "Constructed with clipId: " << m_clipId;
}
ProjectItem::ProjectItem(QTreeWidgetItem * parent, DocClipBase *clip)
setText(2, m_clip->description());
if ((m_clip->clipType() == AV || m_clip->clipType() == AUDIO) && KdenliveSettings::audiothumbnails()) m_clip->askForAudioThumbs();
//setFlags(Qt::NoItemFlags);
- //kDebug() << "PROJECT ITE;. ADDING LCIP: " << m_clipId;
+ //kDebug() << "Constructed with clipId: " << m_clipId;
}
GenTime duration = GenTime(attributes["duration"].toInt(), KdenliveSettings::project_fps());
setData(1, DurationRole, Timecode::getEasyTimecode(duration, KdenliveSettings::project_fps()));
m_clip->setDuration(duration);
- //kDebug() << "//// LOADED CLIP, DURATION SET TO: " << duration.frames(KdenliveSettings::project_fps());
+ //kDebug() << "//// LOADED CLIP, DURATIONÂ SET TO: " << duration.frames(KdenliveSettings::project_fps());
} else {
// No duration known, use an arbitrary one until it is.
}
#include "definitions.h"
class DocClipBase;
+
+/** \brief Represents a clip or a folder in the projecttree
+ *
+ * This class represents a clip or folder in the projecttree and in the document(?) */
class ProjectItem : public QTreeWidgetItem {
public:
/** Create folder item */
int numReferences() const;
void setProperties(const QMap < QString, QString > &attributes, const QMap < QString, QString > &metadata);
+
+ /** \brief The id of the clip or folder.
+ *
+ * The clipId is used both to identify clips and folders (groups) */
const QString &clipId() const;
QStringList names() const;
bool isGroup() const;
ProjectItem *item = getItemById(clipId);
QTreeWidgetItem *p = item->parent();
if (p) {
- kDebug() << "/////// DELETEED CLIP HAS A PARENT... " << p->indexOfChild(item);
+ kDebug() << "/////// DELETED CLIP HAS A PARENT... " << p->indexOfChild(item);
QTreeWidgetItem *clone = p->takeChild(p->indexOfChild(item));
} else if (item) {
delete item;
void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties) {
const QString parent = clip->getProperty("groupid");
+ //kDebug() << "Adding clip with groupid: " << parent;
ProjectItem *item = NULL;
if (!parent.isEmpty()) {
ProjectItem *parentitem = getItemById(parent);
if (!parentitem) {
QStringList text;
QString groupName = clip->getProperty("groupname");
+ //kDebug() << "Adding clip to new group: " << groupName;
if (groupName.isEmpty()) groupName = i18n("Folder");
text << QString() << groupName;
listView->blockSignals(true);
parentitem = new ProjectItem(listView, text, parent);
listView->blockSignals(false);
+ } else {
+ //kDebug() << "Adding clip to existing group: " << parentitem->groupName();
}
if (parentitem) item = new ProjectItem(parentitem, clip);
}
}
void ProjectList::slotAddClip(QUrl givenUrl, QString group) {
- if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
+ if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
KUrl::List list;
if (givenUrl.isEmpty()) {
list = KFileDialog::getOpenUrls(KUrl("kfiledialog:///clipfolder"), "application/x-kdenlive application/x-flash-video application/vnd.rn-realmedia video/x-dv video/dv video/x-msvideo video/mpeg video/x-ms-wmv audio/mpeg audio/x-mp3 audio/x-wav application/ogg video/mp4 video/quicktime image/gif image/jpeg image/png image/x-bmp image/svg+xml image/tiff image/x-xcf-gimp image/x-vnd.adobe.photoshop image/x-pcx image/x-exr video/mlt-playlist audio/x-flac audio/mp4", this);
}
void ProjectList::slotAddColorClip() {
- if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
+ if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
QDialog *dia = new QDialog(this);
Ui::ColorClip_UI *dia_ui = new Ui::ColorClip_UI();
dia_ui->setupUi(dia);
void ProjectList::slotAddSlideshowClip() {
- if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
+ if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
SlideshowClip *dia = new SlideshowClip(this);
if (dia->exec() == QDialog::Accepted) {
ProjectItem *ProjectList::getItemById(const QString &id) {
QTreeWidgetItemIterator it(listView);
+ while (*it) {
+ if (((ProjectItem *)(*it))->clipId() == id)
+ return static_cast<ProjectItem *>(*it);
+ ++it;
+ }
+ return NULL;
+#ifdef USED_TO_BE_THIS
while (*it) {
if (((ProjectItem *)(*it))->clipId() == id)
break;
}
if (*it) return ((ProjectItem *)(*it));
return NULL;
+#endif
}
void ProjectList::slotSelectClip(const QString &ix) {