X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fprojectitem.h;h=3e50a07d5a05729f1c8ea5157b7a11469f575e21;hb=92aa0ab52311111e893535c7762fc7a58bd490fb;hp=1cf05b7d4bdff866442e4c415d738a21c49925c5;hpb=0a21eb6dd5c5a44882c51c2c857eec96758d5285;p=kdenlive diff --git a/src/projectitem.h b/src/projectitem.h index 1cf05b7d..3e50a07d 100644 --- a/src/projectitem.h +++ b/src/projectitem.h @@ -24,42 +24,64 @@ #include #include #include +#include #include #include "gentime.h" #include "definitions.h" -#include "docclipbase.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: - ProjectItem(QTreeWidget * parent, const QStringList & strings, QDomElement xml, int clipId); - ProjectItem(QTreeWidgetItem * parent, const QStringList & strings, QDomElement xml, int clipId); - ProjectItem(QTreeWidget * parent, const QStringList & strings, int clipId); +public: ProjectItem(QTreeWidget * parent, DocClipBase *clip); + ProjectItem(QTreeWidgetItem * parent, DocClipBase *clip); virtual ~ProjectItem(); QDomElement toXml() const; + 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; 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(int status); + /** \brief Returns the proxy status for this clip (true means there is a proxy clip). */ + bool hasProxy() const; + /** \brief Returns true if we are currently creating the proxy for this clip. */ + bool isProxyRunning() const; - private: - QDomElement m_element; - GenTime m_duration; - bool m_durationKnown; + 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: CLIPTYPE m_clipType; - int m_clipId; - void slotSetToolTip(); - bool m_isGroup; - QString m_groupName; + QString m_clipId; DocClipBase *m_clip; + }; #endif