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