38 TotalSceneDurationInFrames = Qt::UserRole + 1,
39 TotalSceneDurationInSeconds = Qt::UserRole + 2,
46 , m_originalLock(!model->m_reorderingKeyframes) {
47 m_model->m_reorderingKeyframes =
true;
51 m_model->m_reorderingKeyframes = !m_originalLock;
56 bool m_originalLock =
false;
62 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex())
const override;
63 QModelIndex parent(
const QModelIndex &index)
const override;
65 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
66 int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
68 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
69 bool setData(
const QModelIndex &index,
const QVariant &
value,
int role = Qt::EditRole)
override;
78 bool setCommentScrollData(
const QModelIndex & index,
const QVariant &
value);
87 bool setThumbnailPixmapData(
const QModelIndex & parentIndex,
const KisPaintDeviceSP & dev);
96 bool updateDurationData(
const QModelIndex & parentIndex);
98 Qt::ItemFlags flags(
const QModelIndex &index)
const override;
101 bool insertRows(
int position,
int rows,
const QModelIndex &index = QModelIndex())
override;
102 bool removeRows(
int position,
int rows,
const QModelIndex &index = QModelIndex())
override;
103 bool moveRows(
const QModelIndex &sourceParent,
int sourceRow,
int count,
104 const QModelIndex &destinationParent,
int destinationChild)
override;
109 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent)
override;
110 Qt::DropActions supportedDropActions()
const override;
111 Qt::DropActions supportedDragActions()
const override;
120 int visibleCommentCount()
const;
126 int totalCommentCount();
133 int visibleCommentsUpto(QModelIndex index)
const;
154 void setFreeze(
bool);
155 bool isFrozen()
const;
156 void setLocked(
bool);
157 bool isLocked()
const;
158 int getFramesPerSecond()
const;
171 QModelIndex indexFromFrame(
int frame,
bool framePerfect =
true)
const;
179 QModelIndex lastIndexBeforeFrame(
int frame)
const;
194 int nextKeyframeGlobal(
int keyframeTime)
const;
201 int lastKeyframeWithin(QModelIndex index);
208 void reorderKeyframes();
217 bool changeSceneHoldLength(
int oldDuration, QModelIndex itemIndex);
225 bool insertItem(QModelIndex index,
bool after);
233 bool removeItem(QModelIndex index,
KUndo2Command *command =
nullptr);
251 int lastKeyframeGlobal()
const;
259 void insertChildRows(
int position,
KUndo2Command* cmd =
nullptr);
267 void visualizeScene(
const QModelIndex& index,
bool useUndo =
true);
269 void createDuplicateKeyframes(
const QModelIndex& index,
KUndo2Command* cmd =
nullptr);
270 void createBlankKeyframes(
const QModelIndex& index,
KUndo2Command* cmd =
nullptr);
275 inline bool isValidBoard(
const QModelIndex &index)
const {
return index.isValid() && !index.parent().isValid();}
277 bool moveRowsImpl(
const QModelIndex &sourceParent,
int sourceRow,
int count,
278 const QModelIndex &destinationParent,
int destinationChild,
KUndo2Command *parentCMD =
nullptr);
285 void slotCurrentFrameChanged(
int frameId);
290 void slotFramerateChanged();
297 void slotUpdateThumbnailForFrame(
int frame,
bool delay =
true);
302 void slotUpdateThumbnails();
314 void slotFrameRenderCancelled(
int frame);
316 void slotCommentDataChanged();
317 void slotCommentRowInserted(
const QModelIndex,
int,
int);
318 void slotCommentRowRemoved(
const QModelIndex,
int,
int);
319 void slotCommentRowMoved(
const QModelIndex &sourceParent,
int sourceRow,
int count,
320 const QModelIndex &destinationParent,
int destinationChild);
340 bool m_freezeKeyframePositions {
false};
341 bool m_lockBoards {
false};
342 bool m_reorderingKeyframes {
false};
This class maintains queues of dirty frames sorted in the order of proximity to the last changed fram...
StoryboardModel * m_model
KeyframeReorderLock(StoryboardModel *model)
The main storyboard model. This class manages a StoryboardItemList which is a list of StoryboardItem ...
void sigStoryboardItemListChanged()
This signal is emitted whenever m_items is changed. it is used to keep the StoryboardItemList in KisD...
KisIdleWatcher m_imageIdleWatcher
bool isValidBoard(const QModelIndex &index) const
QVector< StoryboardComment > m_commentList
KisSignalCompressor m_renderSchedulingCompressor
StoryboardItemList m_items