X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fclipmanager.h;h=172d0d527e722e1e6265e8017d31b38fc424e91a;hb=a3eee7be24126f5a3458d488f44cd61c66135e17;hp=9ac2cfd2dbcc1bf9e25d8bea670b5df2b7f48a83;hpb=674229de00f3b42f64251808087651b0ccd1d6c9;p=kdenlive diff --git a/src/clipmanager.h b/src/clipmanager.h index 9ac2cfd2..172d0d52 100644 --- a/src/clipmanager.h +++ b/src/clipmanager.h @@ -26,7 +26,7 @@ #ifndef CLIPMANAGER_H #define CLIPMANAGER_H -#include +#include #include #include #include @@ -38,6 +38,7 @@ #include #include #include +#include #if KDE_IS_VERSION(4,5,0) #include @@ -51,17 +52,32 @@ class KdenliveDoc; class DocClipBase; class AbstractGroupItem; +class QGLWidget; + + +class SolidVolumeInfo +{ + +public: + QString path; // mount path of volume, with trailing slash + QString uuid; // UUID as from Solid + QString label; // volume label (think of CDs) + bool isRemovable; // may be removed + bool isMounted; + + bool isNull() const { return path.isNull(); } +}; namespace Mlt { class Producer; -}; +} class ClipManager: public QObject { Q_OBJECT public: - ClipManager(KdenliveDoc *doc); + ClipManager(KdenliveDoc *doc, QGLWidget *glContext); virtual ~ ClipManager(); void addClip(DocClipBase *clip); DocClipBase *getClipAt(int pos); @@ -72,24 +88,21 @@ Q_OBJECT public: * @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); + void slotAddClipFile(const KUrl &url, const QMap &data); /** @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 slotAddClipList(const KUrl::List &urls, const QMap &data); 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 crop,const bool fade, - const QString &luma_duration, const QString &luma_file, const int softness, - const QString &animation, const QString &group, const QString &groupId); + void slotAddColorClipFile(const QString &name, const QString &color, const QString &duration, const QString &group, const QString &groupId); + void slotAddSlideshowClipFile(QMap properties, const QString &group, const QString &groupId); DocClipBase *getClipById(QString clipId); - const QList getClipByResource(QString resource); + const QList getClipByResource(const QString &resource); void slotDeleteClips(QStringList ids); void setThumbsProgress(const QString &message, int progress); void checkAudioThumbs(); @@ -98,8 +111,6 @@ Q_OBJECT public: int getFreeClipId(); int getFreeFolderId(); int lastClipId() const; - void startAudioThumbsGeneration(); - void endAudioThumbsGeneration(const QString &requestedId); void askForAudioThumb(const QString &id); QString projectFolder() const; void clearUnusedProducers(); @@ -112,15 +123,18 @@ Q_OBJECT public: 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 frames); /** @brief remove a clip id from the queue list. */ void stopThumbs(const QString &id); + void projectTreeThumbReady(const QString &id, int frame, const QImage &img, int type); #if KDE_IS_VERSION(4,5,0) KImageCache* pixmapCache; #endif +public slots: + /** @brief Request creation of a clip thumbnail for specified frames. */ + void slotRequestThumbs(const QString &id, const QList &frames); + private slots: /** A clip was externally modified, monitor for more changes and prepare for reload */ void slotClipModified(const QString &path); @@ -129,8 +143,12 @@ private slots: /** 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(); + /** @brief Clip has been copied, add it now. */ + void slotAddClip(KIO::Job *job, const KUrl &, const KUrl &dst); private: // Private attributes + QGLWidget *m_mainGLContext; /** the list of clips in the document */ QList m_clipList; /** the list of groups in the document */ @@ -141,7 +159,6 @@ private: // Private attributes 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; @@ -151,17 +168,36 @@ private: // Private attributes QMap m_requestedThumbs; QMutex m_thumbsMutex; QFuture m_thumbsThread; + /** @brief The id of currently processed clip for thumbs creation. */ + QString m_processingThumbId; /** @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 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; + /** @brief The list of removable drives. */ + QList m_removableVolumes; + + QPoint m_projectTreeThumbSize; + + /** @brief Get a list of drives, to check if we have files on removable media. */ + void listRemovableVolumes(); + /** @brief Check if added file is on a removable drive. */ + bool isOnRemovableDevice(const KUrl &url); signals: void reloadClip(const QString &); void modifiedClip(const QString &); void missingClip(const QString &); void availableClip(const QString &); - void checkAllClips(bool displayRatioChanged, bool fpsChanged, QStringList brokenClips); + void checkAllClips(bool displayRatioChanged, bool fpsChanged, const QStringList &brokenClips); + void displayMessage(const QString &, int); + void thumbReady(const QString &id, int, const QImage&); + void gotClipPropertyThumbnail(const QString &id, const QImage&); }; #endif