X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fclipmanager.h;h=f9ac1722b27b2b56e0be1e91e1c852e9bb25b3dd;hb=55bcc23d4c1c479c32cdd8c9401eb27f92eea1f9;hp=b3f06e649ccbfdf7c7be89bca8efa3bbf46f49d4;hpb=ead7176d2ab818ec3a1275aeca2b2fc0c1ea1276;p=kdenlive diff --git a/src/clipmanager.h b/src/clipmanager.h index b3f06e64..f9ac1722 100644 --- a/src/clipmanager.h +++ b/src/clipmanager.h @@ -17,21 +17,30 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ +/** + * @class ClipManager + * @brief Manages the list of clips in a document. + * @author Jean-Baptiste Mardelle + */ + #ifndef CLIPMANAGER_H #define CLIPMANAGER_H -/**ClipManager manages the list of clips in a document - *@author Jean-Baptiste Mardelle - */ - #include #include #include +#include #include #include #include #include +#include + +#if KDE_IS_VERSION(4,5,0) +#include +#endif + #include "gentime.h" #include "definitions.h" @@ -55,12 +64,28 @@ Q_OBJECT public: void addClip(DocClipBase *clip); DocClipBase *getClipAt(int pos); void deleteClip(const QString &clipId); + + /** @brief Add a file to the project. + * @ref slotAddClipList + * @param url file to add + * @param group name of the group to insert the file in (can be empty) + * @param groupId id of the group (if any) */ void slotAddClipFile(const KUrl url, const QString group, const QString &groupId); + + /** @brief Adds a list of files to the project. + * @param urls files to add + * @param group name of the group to insert the files in (can be empty) + * @param groupId id of the group (if any) + * It checks for duplicated items and asks to the user for instructions. */ void slotAddClipList(const KUrl::List urls, const QString group, const QString &groupId); void slotAddTextClipFile(const QString titleName, int out, const QString xml, const QString group, const QString &groupId); void slotAddTextTemplateClip(QString titleName, const KUrl path, const QString group, const QString &groupId); + void slotAddXmlClipFile(const QString name, const QDomElement xml, const QString group, const QString &groupId); void slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const QString &groupId); - void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const int softness, const QString group, const QString &groupId); + void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, + const bool loop, const bool crop,const bool fade, + const QString &luma_duration, const QString &luma_file, const int softness, + const QString &animation, const QString group, const QString &groupId); DocClipBase *getClipById(QString clipId); const QList getClipByResource(QString resource); void slotDeleteClips(QStringList ids); @@ -76,7 +101,7 @@ Q_OBJECT public: void askForAudioThumb(const QString &id); QString projectFolder() const; void clearUnusedProducers(); - void resetProducersList(const QList prods); + void resetProducersList(const QList prods, bool displayRatioChanged, bool fpsChanged); void addFolder(const QString&, const QString&); void deleteFolder(const QString&); void clear(); @@ -85,13 +110,17 @@ Q_OBJECT public: QDomElement groupsXml() const; int clipsCount() const; -public slots: - void updatePreviewSettings(); +#if KDE_IS_VERSION(4,5,0) + KImageCache* pixmapCache; +#endif private slots: + /** A clip was externally modified, monitor for more changes and prepare for reload */ void slotClipModified(const QString &path); void slotClipMissing(const QString &path); void slotClipAvailable(const QString &path); + /** Check the list of externally modified clips, and process them if they were not modified in the last 1500 milliseconds */ + void slotProcessModifiedClips(); private: // Private attributes /** the list of clips in the document */ @@ -104,15 +133,19 @@ private: // Private attributes KdenliveDoc *m_doc; int m_clipIdCounter; int m_folderIdCounter; - bool m_audioThumbsEnabled; QString m_generatingAudioId; KDirWatch m_fileWatcher; + /** Timer used to reload clips when they have been externally modified */ + QTimer m_modifiedTimer; + /** List of the clip IDs that need to be reloaded after being externally modified */ + QMap m_modifiedClips; signals: void reloadClip(const QString &); + void modifiedClip(const QString &); void missingClip(const QString &); void availableClip(const QString &); - void checkAllClips(); + void checkAllClips(bool displayRatioChanged, bool fpsChanged); }; #endif