#include <QPixmap>
#include <QObject>
#include <QTimer>
+#include <QMutex>
+#include <QFuture>
#include <KUrl>
#include <KUndoStack>
int getFreeClipId();
int getFreeFolderId();
int lastClipId() const;
- void startAudioThumbsGeneration();
- void endAudioThumbsGeneration(const QString &requestedId);
void askForAudioThumb(const QString &id);
QString projectFolder() const;
void clearUnusedProducers();
void removeGroup(AbstractGroupItem *group);
QDomElement groupsXml() const;
int clipsCount() const;
+ /** @brief Request creation of a clip thumbnail for specified frames. */
+ void requestThumbs(const QString id, QList <int> frames);
+ /** @brief remove a clip id from the queue list. */
+ void stopThumbs(const QString &id);
#if KDE_IS_VERSION(4,5,0)
KImageCache* pixmapCache;
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();
+ void slotGetThumbs();
+ void slotGetAudioThumbs();
private: // Private attributes
/** the list of clips in the document */
KdenliveDoc *m_doc;
int m_clipIdCounter;
int m_folderIdCounter;
- 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 <QString, QTime> m_modifiedClips;
+ /** Struct containing the list of clip thumbnails to request (clip id and frames) */
+ QMap <QString, int> m_requestedThumbs;
+ QMutex m_thumbsMutex;
+ QFuture<void> m_thumbsThread;
+ /** @brief If true, abort processing of clip thumbs before removing a clip. */
+ bool m_abortThumb;
+ /** @brief We are about to delete the clip producer, stop processing thumbs. */
+ bool m_closing;
+ QFuture<void> m_audioThumbsThread;
+ /** @brief If true, abort processing of audio thumbs. */
+ bool m_abortAudioThumb;
+ /** @brief The id of currently processed clip for audio thumbs creation. */
+ QString m_processingAudioThumbId;
signals:
void reloadClip(const QString &);
void modifiedClip(const QString &);
void missingClip(const QString &);
void availableClip(const QString &);
- void checkAllClips(bool displayRatioChanged, bool fpsChanged);
+ void checkAllClips(bool displayRatioChanged, bool fpsChanged, QStringList brokenClips);
+ void displayMessage(const QString &, int);
};
#endif