X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fprojectitem.h;h=9a017f0c43c45c49d7865afabd76edbc1ed9d969;hb=5a0c47a5868ec91b6747f306e84d92f7ecdf4f99;hp=2b52c89d0a056a8dd892fee8c882db312d3dcf62;hpb=3d8380d9471c13f2fda9ca9270a0bc1e416fabe1;p=kdenlive diff --git a/src/projectitem.h b/src/projectitem.h index 2b52c89d..9a017f0c 100644 --- a/src/projectitem.h +++ b/src/projectitem.h @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -31,12 +32,13 @@ #include "definitions.h" class DocClipBase; -class ProjectItem : public QTreeWidgetItem { + +/** \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: - ProjectItem(QTreeWidget * parent, const QStringList & strings, QDomElement xml, int clipId); - ProjectItem(QTreeWidgetItem * parent, const QStringList & strings, QDomElement xml, int clipId); - /** Create folder item */ - ProjectItem(QTreeWidget * parent, const QStringList & strings, int clipId); ProjectItem(QTreeWidget * parent, DocClipBase *clip); ProjectItem(QTreeWidgetItem * parent, DocClipBase *clip); virtual ~ProjectItem(); @@ -44,26 +46,46 @@ public: int numReferences() const; void setProperties(const QMap < QString, QString > &attributes, const QMap < QString, QString > &metadata); - int clipId() const; + + /** \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; - const QString groupName() const; - void setGroupName(const QString name); const KUrl clipUrl() const; int clipMaxDuration() const; CLIPTYPE clipType() const; void changeDuration(int frames); DocClipBase *referencedClip(); void setProperties(QMap props); + void setProperty(const QString &key, const QString &value); + void clearProperty(const QString &key); + QString getClipHash() const; + static int itemDefaultHeight(); + void slotSetToolTip(); + /** \brief Set the status of proxy clip creation. 0 = no proxy, 1 = creating proxy, 2 = proxy created. */ + void setProxyStatus(PROXYSTATUS status); + /** \brief Returns the proxy status for this clip (true means there is a proxy clip). */ + bool hasProxy() const; + /** \brief Returns true if the proxy for this clip is ready. */ + bool isProxyReady() const; + /** \brief Returns true if we are currently creating the proxy for this clip. */ + bool isProxyRunning() const; + + virtual bool operator<(const QTreeWidgetItem &other)const { + int column = treeWidget()->sortColumn(); + if (other.type() != PROJECTFOLDERTYPE) + return text(column).toLower() < other.text(column).toLower(); + else return false; + } private: - GenTime m_duration; - QString m_groupName; - bool m_durationKnown; CLIPTYPE m_clipType; - int m_clipId; - void slotSetToolTip(); DocClipBase *m_clip; + QString m_clipId; + + void buildItem(); + }; #endif