File indexing completed on 2023-09-24 04:59:13
0001 /* 0002 SPDX-FileCopyrightText: 2012 Till Theato <root@ttill.de> 0003 SPDX-FileCopyrightText: 2014 Jean-Baptiste Mardelle <jb@kdenlive.org> 0004 This file is part of Kdenlive. See www.kdenlive.org. 0005 0006 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0007 */ 0008 0009 #pragma once 0010 0011 #include "abstractprojectitem.h" 0012 #include "utils/timecode.h" 0013 0014 #include <KMessageWidget> 0015 0016 #include <QDir> 0017 #include <QDomElement> 0018 #include <QFuture> 0019 #include <QLineEdit> 0020 #include <QListView> 0021 #include <QMutex> 0022 #include <QPushButton> 0023 #include <QTreeView> 0024 #include <QListWidget> 0025 #include <QUrl> 0026 #include <QWidget> 0027 #include <QActionGroup> 0028 0029 #include <KRecentDirs> 0030 0031 class AbstractProjectItem; 0032 class BinItemDelegate; 0033 class BinListItemDelegate; 0034 class ClipController; 0035 class EffectStackModel; 0036 class InvalidDialog; 0037 class TranscodeSeek; 0038 class KdenliveDoc; 0039 class TagWidget; 0040 class Monitor; 0041 class ProjectClip; 0042 class ProjectFolder; 0043 class ProjectItemModel; 0044 class ProjectSortProxyModel; 0045 class QDockWidget; 0046 class QMenu; 0047 class QScrollArea; 0048 class QTimeLine; 0049 class QToolBar; 0050 class QToolButton; 0051 class QUndoCommand; 0052 class QVBoxLayout; 0053 class SmallJobLabel; 0054 class MediaBrowser; 0055 0056 namespace Mlt { 0057 class Producer; 0058 } 0059 0060 /** @class MyListView 0061 @brief \@todo Describe class MyListView 0062 @todo Describe class MyListView 0063 */ 0064 class MyListView : public QListView 0065 { 0066 Q_OBJECT 0067 public: 0068 explicit MyListView(QWidget *parent = nullptr); 0069 0070 protected: 0071 void mousePressEvent(QMouseEvent *event) override; 0072 void mouseReleaseEvent(QMouseEvent *event) override; 0073 void mouseMoveEvent(QMouseEvent *event) override; 0074 void focusInEvent(QFocusEvent *event) override; 0075 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 0076 void enterEvent(QEnterEvent *event) override; 0077 #else 0078 void enterEvent(QEvent *event) override; 0079 #endif 0080 void leaveEvent(QEvent *event) override; 0081 void dropEvent(QDropEvent *event) override; 0082 0083 Q_SIGNALS: 0084 void focusView(); 0085 void updateDragMode(PlaylistState::ClipState type); 0086 void displayBinFrame(QModelIndex ix, int frame, bool storeFrame = false); 0087 void processDragEnd(); 0088 private: 0089 QPoint m_startPos; 0090 PlaylistState::ClipState m_dragType; 0091 QModelIndex m_lastHoveredItem; 0092 }; 0093 0094 /** @class MyTreeView 0095 @brief \@todo Describe class MyTreeView 0096 @todo Describe class MyTreeView 0097 */ 0098 class MyTreeView : public QTreeView 0099 { 0100 Q_OBJECT 0101 Q_PROPERTY(bool editing READ isEditing WRITE setEditing NOTIFY editingChanged) 0102 public: 0103 explicit MyTreeView(QWidget *parent = nullptr); 0104 void setEditing(bool edit); 0105 0106 protected: 0107 void mousePressEvent(QMouseEvent *event) override; 0108 void mouseReleaseEvent(QMouseEvent *event) override; 0109 void mouseMoveEvent(QMouseEvent *event) override; 0110 void focusInEvent(QFocusEvent *event) override; 0111 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 0112 void enterEvent(QEnterEvent *) override; 0113 #else 0114 void enterEvent(QEvent *event) override; 0115 #endif 0116 void leaveEvent(QEvent *event) override; 0117 0118 protected Q_SLOTS: 0119 void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint) override; 0120 void editorDestroyed(QObject *editor) override; 0121 0122 private: 0123 QPoint m_startPos; 0124 PlaylistState::ClipState m_dragType; 0125 QModelIndex m_lastHoveredItem; 0126 bool m_editing; 0127 bool performDrag(); 0128 bool isEditing() const; 0129 0130 Q_SIGNALS: 0131 void focusView(); 0132 void updateDragMode(PlaylistState::ClipState type); 0133 void displayBinFrame(QModelIndex ix, int frame, bool storeFrame = false); 0134 void processDragEnd(); 0135 void selectCurrent(); 0136 void editingChanged(); 0137 }; 0138 0139 /** @class SmallJobLabel 0140 @brief \@todo Describe class SmallJobLabel 0141 @todo Describe class SmallJobLabel 0142 */ 0143 class SmallJobLabel : public QPushButton 0144 { 0145 Q_OBJECT 0146 public: 0147 explicit SmallJobLabel(QWidget *parent = nullptr); 0148 static const QString getStyleSheet(const QPalette &p); 0149 void setAction(QAction *action); 0150 0151 private: 0152 enum ItemRole { NameRole = Qt::UserRole, DurationRole, UsageRole }; 0153 0154 QTimeLine *m_timeLine; 0155 QAction *m_action{nullptr}; 0156 QMutex m_locker; 0157 0158 public Q_SLOTS: 0159 void slotSetJobCount(int jobCount); 0160 0161 private Q_SLOTS: 0162 void slotTimeLineChanged(qreal value); 0163 void slotTimeLineFinished(); 0164 }; 0165 0166 /** @class LineEventEater 0167 @brief \@todo Describe class LineEventEater 0168 @todo Describe class LineEventEater 0169 */ 0170 class LineEventEater : public QObject 0171 { 0172 Q_OBJECT 0173 public: 0174 explicit LineEventEater(QObject *parent = nullptr); 0175 0176 protected: 0177 bool eventFilter(QObject *obj, QEvent *event) override; 0178 0179 Q_SIGNALS: 0180 void clearSearchLine(); 0181 void showClearButton(bool); 0182 }; 0183 0184 /** 0185 * @class Bin 0186 * @brief The bin widget takes care of both item model and view upon project opening. 0187 */ 0188 class Bin : public QWidget 0189 { 0190 Q_OBJECT 0191 0192 /** @brief Defines the view types (icon view, tree view,...) */ 0193 enum BinViewType { BinTreeView, BinIconView }; 0194 0195 public: 0196 explicit Bin(std::shared_ptr<ProjectItemModel> model, QWidget *parent = nullptr, bool isMainBin = true); 0197 ~Bin() override; 0198 0199 bool isLoading; 0200 /** @brief Sets the document for the bin and initialize some stuff */ 0201 const QString setDocument(KdenliveDoc *project, const QString &id = QString()); 0202 /** @brief Delete all project related data, to be called before setDocument */ 0203 void cleanDocument(); 0204 0205 /** @brief Create a clip item from its xml description */ 0206 void createClip(const QDomElement &xml); 0207 0208 /** @brief Used to notify the Model View that an item was updated */ 0209 void emitItemUpdated(std::shared_ptr<AbstractProjectItem> item); 0210 0211 /** @brief Set monitor associated with this bin (clipmonitor) */ 0212 void setMonitor(Monitor *monitor); 0213 0214 /** @brief Returns the clip monitor */ 0215 Monitor *monitor(); 0216 0217 /** @brief Open a producer in the clip monitor */ 0218 void openProducer(std::shared_ptr<ProjectClip> controller); 0219 void openProducer(std::shared_ptr<ProjectClip> controller, int in, int out); 0220 0221 /** @brief Get a clip from it's id */ 0222 std::shared_ptr<ProjectClip> getBinClip(const QString &id); 0223 /** @brief Get a clip's name from it's id */ 0224 const QString getBinClipName(const QString &id) const; 0225 /** @brief Returns the duration of a given clip. */ 0226 size_t getClipDuration(int itemId) const; 0227 /** @brief Returns the frame size of a given clip. */ 0228 QSize getFrameSize(int itemId) const; 0229 /** @brief Returns the state of a given clip: AudioOnly, VideoOnly, Disabled (Disabled means it has audio and video capabilities */ 0230 PlaylistState::ClipState getClipState(int itemId) const; 0231 0232 /** @brief Add markers on clip \@param binId at \@param positions with @comments text if given */ 0233 void addClipMarker(const QString &binId, const QList<int> &positions, const QStringList &comments = {}); 0234 0235 /** @brief Get the count of all markers in all clips using this category */ 0236 int getAllClipMarkers(int category) const; 0237 0238 /** @brief Remove all clip markers using a category */ 0239 void removeMarkerCategories(QList<int> toRemove, const QMap<int, int> remapCategories); 0240 0241 /** @brief Returns a list of selected clip ids. 0242 * @param allowSubClips: if true, will include subclip ids in the form: "master clip id/in/out" 0243 */ 0244 std::vector<QString> selectedClipsIds(bool allowSubClips = false); 0245 0246 // Returns the selected clips 0247 QList<std::shared_ptr<ProjectClip>> selectedClips(); 0248 0249 /** @brief Current producer has changed, refresh monitor and timeline*/ 0250 void refreshClip(const QString &id); 0251 0252 void setupMenu(); 0253 0254 /** @brief The source file was modified, we will reload it soon, disable item in the meantime */ 0255 void setWaitingStatus(const QString &id); 0256 0257 const QString getDocumentProperty(const QString &key); 0258 0259 /** @brief Ask MLT to reload this clip's producer */ 0260 void reloadClip(const QString &id); 0261 0262 /** @brief refresh monitor (if clip changed) */ 0263 void reloadMonitorIfActive(const QString &id); 0264 /** @brief refresh monitor stream selector */ 0265 void reloadMonitorStreamIfActive(const QString &id); 0266 /** @brief Update timeline targets according to selected audio streams */ 0267 void updateTargets(QString id = QStringLiteral("-1")); 0268 /** @brief Update some timeline related stuff, like used clips bound, audio targets,... */ 0269 void sequenceActivated(); 0270 0271 void doMoveClip(const QString &id, const QString &newParentId); 0272 void doMoveFolder(const QString &id, const QString &newParentId); 0273 void setupGeneratorMenu(); 0274 0275 /** @brief Set focus to the Bin view. */ 0276 void focusBinView() const; 0277 /** @brief Get a string list of all clip ids that are inside a folder defined by id. */ 0278 QStringList getBinFolderClipIds(const QString &id) const; 0279 /** @brief Build a rename subclip command. */ 0280 void renameSubClipCommand(const QString &id, const QString &newName, const QString &oldName, int in, int out); 0281 /** @brief Rename a clip zone (subclip). */ 0282 void renameSubClip(const QString &id, const QString &newName, int in, int out); 0283 0284 /** @brief Edit an effect settings to a bin clip. */ 0285 void editMasterEffect(const std::shared_ptr<AbstractProjectItem> &clip); 0286 /** @brief An effect setting was changed, update stack if displayed. */ 0287 void updateMasterEffect(ClipController *ctl); 0288 void rebuildMenu(); 0289 void refreshIcons(); 0290 0291 /** @brief This function change the global enabled state of the bin effects 0292 */ 0293 void setBinEffectsEnabled(bool enabled, bool refreshMonitor = true); 0294 0295 void requestAudioThumbs(const QString &id, long duration); 0296 /** @brief Proxy status for the project changed, update. */ 0297 void refreshProxySettings(); 0298 /** @brief A clip is ready, update its info panel if displayed. */ 0299 void emitRefreshPanel(const QString &id); 0300 /** @brief Returns true if there is a clip in bin. Timeline clips are ignored. */ 0301 bool hasUserClip() const; 0302 /** @brief Trigger reload of all clips. */ 0303 void reloadAllProducers(bool reloadThumbs = true); 0304 /** @brief Ensure all audio thumbs have been created */ 0305 void checkAudioThumbs(); 0306 /** @brief Get usage stats for project bin. */ 0307 void getBinStats(uint *used, uint *unused, qint64 *usedSize, qint64 *unusedSize); 0308 /** @brief Returns the clip properties dockwidget. */ 0309 QDockWidget *clipPropertiesDock(); 0310 void rebuildProxies(); 0311 /** @brief Return a list of all clips hashes used in this project */ 0312 QStringList getProxyHashList(); 0313 /** @brief Get binId of the current selected folder */ 0314 QString getCurrentFolder(); 0315 /** @brief Save a clip zone as MLT playlist */ 0316 void saveZone(const QStringList &info, const QDir &dir); 0317 /** @brief A bin clip changed (its effects), invalidate preview */ 0318 void invalidateClip(const QString &binId); 0319 /** @brief Recreate missing proxies on document opening */ 0320 void checkMissingProxies(); 0321 /** @brief Save folder state (expanded or not) */ 0322 void saveFolderState(); 0323 /** @brief Load folder state (expanded or not), zoom level and possible other project stored Bin settings */ 0324 void loadBinProperties(const QStringList &foldersToExpand, int zoomLevel = -1); 0325 /** @brief gets a QList of all clips used in timeline */ 0326 QList<int> getUsedClipIds(); 0327 /** @brief Register a new timeline clip 0328 * @param uuid the uuid of the new playlist (equals the uuid of the timelinemodel) 0329 * @param id the bin id of the clip 0330 */ 0331 void registerSequence(const QUuid uuid, const QString id); 0332 /** @brief Update a new timeline clip when it has been changed 0333 * @param uuid the uuid of the timeline clip that was changed 0334 * @param id the updated duration of the timeline clip 0335 * * @param current the uuid of the currently active timeline 0336 */ 0337 void updateSequenceClip(const QUuid &uuid, int duration, int pos); 0338 /** @brief Returns the bin id of the clip managing a timeline sequence changed 0339 * @param uuid the uuid of the timeline clip 0340 */ 0341 const QString sequenceBinId(const QUuid &uuid); 0342 /** @brief Update a sequence AV info (has audio/video) */ 0343 void updateSequenceAVType(const QUuid &uuid, int tracksCount); 0344 0345 // TODO refac: remove this and call directly the function in ProjectItemModel 0346 void cleanupUnused(); 0347 void selectAll(); 0348 /** @brief Save an mlt playlist from a bin id and a list of cuts 0349 * @param binId the id of the source clip for zones 0350 * @param savePath the path for the resulting playlist 0351 * @param zones the source cli pzones that will be put in the result playlist 0352 * @param properties some extra properties that will be set on the producer 0353 * @param createNew if true, the playlist will be added as a new clip in project binId */ 0354 void savePlaylist(const QString &binId, const QString &savePath, const QVector<QPoint> &zones, const QMap<QString, QString> &properties, bool createNew); 0355 /** @brief Do some checks on the profile */ 0356 static void checkProfile(const std::shared_ptr<Mlt::Producer> &producer); 0357 /** @brief Should we process a profile check for added clips */ 0358 std::atomic<bool> shouldCheckProfile; 0359 /** @brief Set the message for key binding info. */ 0360 void updateKeyBinding(const QString &bindingMessage = QString()); 0361 /** @brief Returns true if a clip with id cid is visible in this bin. */ 0362 bool containsId(const QString &cid) const; 0363 void replaceSingleClip(const QString clipId, const QString &newUrl); 0364 /** @brief List all clips referenced in a timeline sequence. */ 0365 QStringList sequenceReferencedClips(const QUuid &uuid) const; 0366 /** @brief Define a thumbnail for a sequence clip. */ 0367 void setSequenceThumbnail(const QUuid &uuid, int frame); 0368 /** @brief When saving or rendering, copy timewarp temporary playlists to the correct folder. */ 0369 void moveTimeWarpToFolder(const QDir sequenceFolder, bool copy); 0370 /** @brief Create new sequence clip 0371 * @param aTracks the audio tracks count, use default if -1 0372 * @param vTracks the video tracks count, use default if -1 */ 0373 void buildSequenceClip(int aTracks = -1, int vTracks = -1); 0374 const QString buildSequenceClipWithUndo(Fun &undo, Fun &redo, int aTracks = -1, int vTracks = -1); 0375 0376 private Q_SLOTS: 0377 void slotAddClip(); 0378 /** @brief Reload clip from disk */ 0379 void slotReloadClip(); 0380 /** @brief Replace clip with another file */ 0381 void slotReplaceClip(); 0382 /** @brief Set sorting column */ 0383 void slotSetSorting(); 0384 /** @brief Show/hide date column */ 0385 void slotShowColumn(bool show); 0386 /** @brief Ensure current item is selected */ 0387 void ensureCurrent(); 0388 /** @brief Go to parent folder */ 0389 void slotBack(); 0390 /** @brief Setup the bin view type (icon view, tree view, ...). 0391 * @param action The action whose data defines the view type or nullptr to keep default view */ 0392 void slotInitView(QAction *action); 0393 void slotSetIconSize(int size); 0394 void selectProxyModel(const QModelIndex &id); 0395 void slotSaveHeaders(); 0396 0397 /** @brief Reset all text and log data from info message widget. */ 0398 void slotResetInfoMessage(); 0399 /** @brief Show dialog prompting for removal of invalid clips. */ 0400 void slotQueryRemoval(const QString &id, const QString &url, const QString &errorMessage); 0401 /** @brief Request display of current clip in monitor. */ 0402 void slotOpenCurrent(); 0403 void slotZoomView(bool zoomIn); 0404 /** @brief Widget gained focus, make sure we display effects for master clip. */ 0405 void slotGotFocus(); 0406 /** @brief Rename a Bin Item. */ 0407 void slotRenameItem(); 0408 void doRefreshPanel(const QString &id); 0409 /** @brief Enable item view and hide message */ 0410 void slotMessageActionTriggered(); 0411 /** @brief Request editing of title or slideshow clip */ 0412 void slotEditClip(); 0413 /** @brief Enable / disable clear button on search line 0414 * this is a workaround foq Qt bug 54676 0415 */ 0416 void showClearButton(bool show); 0417 /** @brief Display a defined frame in bin clip thumbnail 0418 */ 0419 void showBinFrame(const QModelIndex &ix, int frame, bool storeFrame = false); 0420 /** @brief Switch a tag on/off on current selection 0421 */ 0422 void switchTag(const QString &tag, bool add); 0423 /** @brief Update project tags 0424 */ 0425 void updateTags(const QMap <int, QStringList> &previousTags, const QMap <int, QStringList> &tags); 0426 void rebuildFilters(int tagsCount); 0427 /** @brief Switch a tag on a clip list 0428 */ 0429 void editTags(const QList <QString> &allClips, const QString &tag, bool add); 0430 /** @brief Update the string description of the clips count, like: 123 clips (3 selected). */ 0431 void updateClipsCount(); 0432 /** @brief Update the menu entry listing the occurrences of a clip in timeline. */ 0433 void updateTimelineOccurrences(); 0434 /** @brief Set (or unset) the default folder for newly created sequence clips. */ 0435 void setDefaultSequenceFolder(bool enable); 0436 /** @brief Fetch the filters from the UI and apply them to the proxy model */ 0437 void slotApplyFilters(); 0438 0439 public Q_SLOTS: 0440 0441 void slotRemoveInvalidClip(const QString &id, bool replace, const QString &errorMessage); 0442 /** @brief Reload clip thumbnail - when frame for thumbnail changed */ 0443 void slotRefreshClipThumbnail(const QString &id); 0444 void slotDeleteClip(); 0445 void slotItemDoubleClicked(const QModelIndex &ix, const QPoint &pos, uint modifiers); 0446 void slotSwitchClipProperties(const std::shared_ptr<ProjectClip> &clip); 0447 void slotSwitchClipProperties(); 0448 /** @brief Creates a new folder with optional name, and returns new folder's id */ 0449 void slotAddFolder(); 0450 void slotCreateProjectClip(); 0451 void slotEditClipCommand(const QString &id, const QMap<QString, QString> &oldProps, const QMap<QString, QString> &newProps); 0452 /** @brief Start a filter job requested by a filter applied in timeline */ 0453 void slotStartFilterJob(const ItemInfo &info, const QString &id, QMap<QString, QString> &filterParams, QMap<QString, QString> &consumerParams, 0454 QMap<QString, QString> &extraParams); 0455 void slotItemDropped(const QStringList &ids, const QModelIndex &parent); 0456 const QString slotItemDropped(const QList<QUrl> &urls, const QModelIndex &parent); 0457 void slotEffectDropped(const QStringList &effectData, const QModelIndex &parent); 0458 void slotTagDropped(const QString &tag, const QModelIndex &parent); 0459 void slotItemEdited(const QModelIndex &, const QModelIndex &, const QVector<int> &); 0460 /** @brief Open current clip in an external editing application */ 0461 void slotOpenClipExtern(); 0462 void slotDuplicateClip(); 0463 void slotLocateClip(); 0464 void showClipProperties(const std::shared_ptr<ProjectClip> &clip, bool forceRefresh = false); 0465 /** @brief Add extra data to a clip. */ 0466 void slotAddClipExtraData(const QString &id, const QString &key, const QString &data = QString()); 0467 void slotUpdateClipProperties(const QString &id, const QMap<QString, QString> &properties, bool refreshPropertiesPanel); 0468 /** @brief Add effect to active Bin clip (used when double clicking an effect in list). */ 0469 void slotAddEffect(QString id, const QStringList &effectData); 0470 void slotExpandUrl(const ItemInfo &info, const QString &url, QUndoCommand *command); 0471 /** @brief Abort all ongoing operations to prepare close. */ 0472 void abortOperations(); 0473 void doDisplayMessage(const QString &text, KMessageWidget::MessageType type, const QList<QAction *> &actions = QList<QAction *>(), bool showCloseButton = false, BinMessage::BinCategory messageCategory = BinMessage::BinCategory::NoMessage); 0474 void doDisplayMessage(const QString &text, KMessageWidget::MessageType type, const QString logInfo); 0475 /** @brief Reset all clip usage to 0 */ 0476 void resetUsageCount(); 0477 /** @brief Select a clip in the Bin from its id. */ 0478 void selectClipById(const QString &id, int frame = -1, const QPoint &zone = QPoint(), bool activateMonitor = true); 0479 const QString slotAddClipToProject(const QUrl &url); 0480 void droppedUrls(const QList<QUrl> &urls, const QString &folderInfo = QString()); 0481 /** @brief Returns the effectstack of a given clip. */ 0482 std::shared_ptr<EffectStackModel> getClipEffectStack(int itemId); 0483 /** @brief Adjust project profile to current clip. */ 0484 void adjustProjectProfileToItem(); 0485 /** @brief Check and propose auto adding audio tracks. 0486 * @param clipId The clip whose streams have to be checked 0487 * @param minimumTracksCount the number of active streams for this clip 0488 */ 0489 void checkProjectAudioTracks(QString clipId, int minimumTracksCount); 0490 void showTitleWidget(const std::shared_ptr<ProjectClip> &clip); 0491 /** @brief Add a clip in a specially named folder */ 0492 bool addProjectClipInFolder(const QString &path, const QString &sourceClipId, const QString &sourceFolder, const QString &jobId); 0493 /** @brief Check if a clip profile matches project, propose switch otherwise */ 0494 void slotCheckProfile(const QString &binId); 0495 /** @brief A non seekable clip was added to project, propose transcoding */ 0496 void requestTranscoding(const QString &url, const QString &id, int type, bool checkProfile, const QString &suffix = QString(), const QString &message = QString()); 0497 /** @brief Display the transcode to edit friendly format for currenly selected bin clips */ 0498 void requestSelectionTranscoding(); 0499 /** @brief Build the project bin audio/video icons according to color theme */ 0500 void slotUpdatePalette(); 0501 /** @brief Import multiple video streams in a clip */ 0502 void processMultiStream(const QString &clipId, QList<int> videoStreams, QList<int> audioStreams); 0503 0504 protected: 0505 /* This function is called whenever an item is selected to propagate signals 0506 (for ex request to show the clip in the monitor) 0507 */ 0508 void setCurrent(const std::shared_ptr<AbstractProjectItem> &item); 0509 void selectClip(const std::shared_ptr<ProjectClip> &clip); 0510 void contextMenuEvent(QContextMenuEvent *event) override; 0511 bool eventFilter(QObject *obj, QEvent *event) override; 0512 QSize sizeHint() const override; 0513 0514 private: 0515 bool m_isMainBin; 0516 std::shared_ptr<ProjectItemModel> m_itemModel; 0517 QAbstractItemView *m_itemView; 0518 BinItemDelegate *m_binTreeViewDelegate; 0519 BinListItemDelegate *m_binListViewDelegate; 0520 std::unique_ptr<ProjectSortProxyModel> m_proxyModel; 0521 /** @brief A map of opened timeline clips {uuid, bin id} */ 0522 QMap<QUuid, QString> m_openedPlaylists; 0523 QToolBar *m_toolbar; 0524 KdenliveDoc *m_doc; 0525 QLineEdit *m_searchLine; 0526 QToolButton *m_addButton; 0527 QMenu *m_extractAudioAction; 0528 QAction *m_transcodeAction; 0529 QMenu *m_clipsActionsMenu; 0530 QAction *m_inTimelineAction; 0531 QAction *m_showDate; 0532 QAction *m_showDesc; 0533 QAction *m_showRating; 0534 QAction *m_sortDescend; 0535 /** @brief Default view type (icon, tree, ...) */ 0536 BinViewType m_listType; 0537 /** @brief Default icon size for the views. */ 0538 QSize m_baseIconSize; 0539 /** @brief Keeps the column width info of the tree view. */ 0540 QByteArray m_headerInfo; 0541 QVBoxLayout *m_layout; 0542 QDockWidget *m_propertiesDock; 0543 QScrollArea *m_propertiesPanel; 0544 QSlider *m_slider; 0545 Monitor *m_monitor; 0546 QIcon m_blankThumb; 0547 QMenu *m_menu; 0548 QAction *m_openAction; 0549 QAction *m_editAction; 0550 QAction *m_reloadAction; 0551 QAction *m_replaceAction; 0552 QAction *m_duplicateAction; 0553 QAction *m_locateAction; 0554 QAction *m_proxyAction; 0555 QAction *m_deleteAction; 0556 QAction *m_openInBin; 0557 QAction *m_sequencesFolderAction; 0558 QAction *m_addClip; 0559 QAction *m_createFolderAction; 0560 QAction *m_renameAction; 0561 QMenu *m_jobsMenu; 0562 QAction *m_cancelJobs; 0563 QAction *m_discardCurrentClipJobs; 0564 QAction *m_discardPendingJobs; 0565 QAction *m_upAction; 0566 QAction *m_tagAction; 0567 QActionGroup *m_sortGroup; 0568 SmallJobLabel *m_infoLabel; 0569 TagWidget *m_tagsWidget; 0570 QMenu *m_filterMenu; 0571 QActionGroup m_filterTagGroup; 0572 QActionGroup m_filterRateGroup; 0573 QActionGroup m_filterUsageGroup; 0574 QActionGroup m_filterTypeGroup; 0575 QToolButton *m_filterButton; 0576 /** @brief The info widget for failed jobs. */ 0577 KMessageWidget *m_infoMessage; 0578 BinMessage::BinCategory m_currentMessage; 0579 QStringList m_errorLog; 0580 /** @brief Dialog listing invalid clips on load. */ 0581 InvalidDialog *m_invalidClipDialog; 0582 /** @brief Dialog listing non seekable clips on load. */ 0583 TranscodeSeek *m_transcodingDialog; 0584 /** @brief Set to true if widget just gained focus (means we have to update effect stack . */ 0585 bool m_gainedFocus; 0586 /** @brief List of Clip Ids that want an audio thumb. */ 0587 QStringList m_audioThumbsList; 0588 QString m_processingAudioThumb; 0589 QMutex m_audioThumbMutex; 0590 /** @brief This is a lock that ensures safety in case of concurrent access */ 0591 mutable QReadWriteLock m_lock; 0592 /** @brief Total number of milliseconds to process for audio thumbnails */ 0593 long m_audioDuration; 0594 /** @brief Total number of milliseconds already processed for audio thumbnails */ 0595 long m_processedAudio; 0596 /** @brief Indicates whether audio thumbnail creation is running. */ 0597 QFuture<void> m_audioThumbsThread; 0598 QAction *addAction(const QString &name, const QString &text, const QIcon &icon, const QString &category = {}); 0599 void setupAddClipAction(QMenu *addClipMenu, ClipType::ProducerType type, const QString &name, const QString &text, const QIcon &icon); 0600 /** @brief Get the QModelIndex value for an item in the Bin. */ 0601 QModelIndex getIndexForId(const QString &id, bool folderWanted) const; 0602 std::shared_ptr<ProjectClip> getFirstSelectedClip(); 0603 void showSlideshowWidget(const std::shared_ptr<ProjectClip> &clip); 0604 void processAudioThumbs(); 0605 void updateSortingAction(int ix); 0606 int wheelAccumulatedDelta; 0607 QString m_keyBindingMessage; 0608 QString m_clipsCountMessage; 0609 /** @brief Show the clip count and key binfing info in status bar. */ 0610 void showBinInfo(); 0611 /** @brief Find all clip Ids that have a specific tag. */ 0612 const QList<QString> getAllClipsWithTag(const QString &tag); 0613 0614 Q_SIGNALS: 0615 void itemUpdated(std::shared_ptr<AbstractProjectItem>); 0616 void producerReady(const QString &id); 0617 /** @brief Save folder info into MLT. */ 0618 void storeFolder(const QString &folderId, const QString &parentId, const QString &oldParentId, const QString &folderName); 0619 void gotFilterJobResults(const QString &, int, int, stringMap, stringMap); 0620 /** @brief Request display of effect stack for a Bin clip. */ 0621 void requestShowEffectStack(const QString &clipName, std::shared_ptr<EffectStackModel>, QSize frameSize, bool showKeyframes); 0622 void requestShowClipProperties(const std::shared_ptr<ProjectClip> &clip, bool forceRefresh = false); 0623 /** @brief Request that the given clip is displayed in the clip monitor */ 0624 void requestClipShow(std::shared_ptr<ProjectClip>); 0625 void displayBinMessage(const QString &, KMessageWidget::MessageType); 0626 void requesteInvalidRemoval(const QString &, const QString &, const QString &); 0627 /** @brief Analysis data changed, refresh panel. */ 0628 void updateAnalysisData(const QString &); 0629 void openClip(std::shared_ptr<ProjectClip> c, int in = -1, int out = -1); 0630 /** @brief Fill context menu with occurrences of this clip in timeline. */ 0631 void findInTimeline(const QString &, QList<int> ids = QList<int>()); 0632 void clipNameChanged(const QString &); 0633 /** @brief A clip was updated, request panel update. */ 0634 void refreshPanel(const QString &id); 0635 /** @brief Upon selection, activate timeline target tracks. */ 0636 void setupTargets(bool hasVideo, QMap <int, QString> audioStreams); 0637 /** @brief A drag event ended, inform timeline. */ 0638 void processDragEnd(); 0639 void requestBinClose(); 0640 /** @brief Update a timeline tab name on clip rename. */ 0641 void updateTabName(const QUuid &, const QString &); 0642 };