Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/animation/timeline_frames_view.h
Show All 21 Lines | |||||
22 | #include <QScopedPointer> | 22 | #include <QScopedPointer> | ||
23 | #include <QTableView> | 23 | #include <QTableView> | ||
24 | #include "kis_action_manager.h" | 24 | #include "kis_action_manager.h" | ||
25 | #include "kritaanimationdocker_export.h" | 25 | #include "kritaanimationdocker_export.h" | ||
26 | 26 | | |||
27 | class KisAction; | 27 | class KisAction; | ||
28 | class TimelineWidget; | 28 | class TimelineWidget; | ||
29 | 29 | | |||
30 | | ||||
31 | class KRITAANIMATIONDOCKER_EXPORT TimelineFramesView : public QTableView | 30 | class KRITAANIMATIONDOCKER_EXPORT TimelineFramesView : public QTableView | ||
32 | { | 31 | { | ||
33 | Q_OBJECT | 32 | Q_OBJECT | ||
34 | public: | 33 | public: | ||
35 | TimelineFramesView(QWidget *parent); | 34 | TimelineFramesView(QWidget *parent); | ||
36 | ~TimelineFramesView() override; | 35 | ~TimelineFramesView() override; | ||
37 | 36 | | |||
38 | void setModel(QAbstractItemModel *model) override; | 37 | void setModel(QAbstractItemModel *model) override; | ||
Show All 11 Lines | |||||
50 | private Q_SLOTS: | 49 | private Q_SLOTS: | ||
51 | void slotUpdateLayersMenu(); | 50 | void slotUpdateLayersMenu(); | ||
52 | void slotUpdateFrameActions(); | 51 | void slotUpdateFrameActions(); | ||
53 | 52 | | |||
54 | void slotSetStartTimeToCurrentPosition(); | 53 | void slotSetStartTimeToCurrentPosition(); | ||
55 | void slotSetEndTimeToCurrentPosition(); | 54 | void slotSetEndTimeToCurrentPosition(); | ||
56 | void slotUpdatePlackbackRange(); | 55 | void slotUpdatePlackbackRange(); | ||
57 | 56 | | |||
57 | // Layer | ||||
58 | void slotAddNewLayer(); | 58 | void slotAddNewLayer(); | ||
59 | void slotAddExistingLayer(QAction *action); | 59 | void slotAddExistingLayer(QAction *action); | ||
60 | void slotDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); | 60 | void slotDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); | ||
61 | | ||||
62 | void slotRemoveLayer(); | 61 | void slotRemoveLayer(); | ||
63 | | ||||
64 | void slotLayerContextMenuRequested(const QPoint &globalPos); | 62 | void slotLayerContextMenuRequested(const QPoint &globalPos); | ||
65 | 63 | | |||
64 | // New, Copy, Insert and Remove Frames | ||||
66 | void slotNewFrame(); | 65 | void slotNewFrame(); | ||
67 | void slotCopyFrame(); | 66 | void slotCopyFrame(); | ||
68 | 67 | | |||
69 | 68 | void slotInsertKeyframesLeft(int count = 1, int timing = 1, bool forceEntireColumn = false); | |||
70 | void slotInsertKeyframesLeft(int count = -1, bool forceEntireColumn = false); | 69 | void slotInsertKeyframesRight(int count = 1, int timing = 1, bool forceEntireColumn = false); | ||
71 | void slotInsertKeyframesRight(int count = -1, bool forceEntireColumn = false); | | |||
72 | 70 | | |||
73 | void slotInsertKeyframesLeftCustom(); | 71 | void slotInsertKeyframesLeftCustom(); | ||
74 | void slotInsertKeyframesRightCustom(); | 72 | void slotInsertKeyframesRightCustom(); | ||
75 | 73 | | |||
76 | void slotRemoveFrame(bool forceEntireColumn = false, bool needsOffset = false); | 74 | void slotRemoveFrame(bool forceEntireColumn = false, bool needsOffset = false); | ||
77 | void slotRemoveFramesAndShift(bool forceEntireColumn = false); | 75 | void slotRemoveFramesAndShift(bool forceEntireColumn = false); | ||
78 | 76 | | |||
79 | void slotInsertColumnsLeft(int count = -1); | 77 | void slotInsertColumnsLeft(int count = 1, int timing = 1); | ||
80 | void slotInsertColumnsLeftCustom(); | 78 | void slotInsertColumnsLeftCustom(); | ||
81 | 79 | | |||
82 | void slotInsertColumnsRight(int count = -1); | 80 | void slotInsertColumnsRight(int count = 1, int timing = 1); | ||
83 | void slotInsertColumnsRightCustom(); | 81 | void slotInsertColumnsRightCustom(); | ||
84 | 82 | | |||
85 | void slotRemoveColumns(); | 83 | void slotRemoveColumns(); | ||
86 | void slotRemoveColumnsAndShift(); | 84 | void slotRemoveColumnsAndShift(); | ||
87 | 85 | | |||
88 | void slotInsertHoldFrames(int count = 1, bool forceEntireColumn = false); | 86 | void slotInsertHoldFrames(int count = 1, bool forceEntireColumn = false); | ||
89 | void slotRemoveHoldFrames(int count = 1, bool forceEntireColumn = false); | 87 | void slotRemoveHoldFrames(int count = 1, bool forceEntireColumn = false); | ||
90 | 88 | | |||
91 | void slotInsertHoldFramesCustom(); | 89 | void slotInsertHoldFramesCustom(); | ||
92 | void slotRemoveHoldFramesCustom(); | 90 | void slotRemoveHoldFramesCustom(); | ||
93 | 91 | | |||
94 | void slotInsertHoldColumns(int count = 1); | 92 | void slotInsertHoldColumns(int count = 1); | ||
95 | void slotRemoveHoldColumns(int count = 1); | 93 | void slotRemoveHoldColumns(int count = 1); | ||
96 | 94 | | |||
97 | void slotInsertHoldColumnsCustom(); | 95 | void slotInsertHoldColumnsCustom(); | ||
98 | void slotRemoveHoldColumnsCustom(); | 96 | void slotRemoveHoldColumnsCustom(); | ||
99 | 97 | | |||
100 | void slotMirrorFrames(bool forceEntireColumn = false); | 98 | void slotMirrorFrames(bool forceEntireColumn = false); | ||
101 | void slotMirrorColumns(); | 99 | void slotMirrorColumns(); | ||
102 | 100 | | |||
103 | 101 | // Copy-paste | |||
104 | void slotCopyFrames(bool forceEntireColumn = false); | 102 | void slotCopyFrames(bool forceEntireColumn = false); | ||
105 | void slotCutFrames(bool forceEntireColumn = false); | 103 | void slotCutFrames(bool forceEntireColumn = false); | ||
106 | void slotPasteFrames(bool forceEntireColumn = false); | 104 | void slotPasteFrames(bool forceEntireColumn = false); | ||
107 | 105 | | |||
108 | void slotCopyColumns(); | 106 | void slotCopyColumns(); | ||
109 | void slotCutColumns(); | 107 | void slotCutColumns(); | ||
110 | void slotPasteColumns(); | 108 | void slotPasteColumns(); | ||
111 | 109 | | |||
112 | void slotReselectCurrentIndex(); | 110 | void slotReselectCurrentIndex(); | ||
113 | 111 | | |||
114 | void slotUpdateInfiniteFramesCount(); | 112 | void slotUpdateInfiniteFramesCount(); | ||
115 | 113 | | |||
116 | void slotHeaderDataChanged(Qt::Orientation orientation, int first, int last); | 114 | void slotHeaderDataChanged(Qt::Orientation orientation, int first, int last); | ||
117 | 115 | | |||
118 | void slotZoomButtonPressed(qreal staticPoint); | 116 | void slotZoomButtonPressed(qreal staticPoint); | ||
119 | void slotZoomButtonChanged(qreal value); | 117 | void slotZoomButtonChanged(qreal value); | ||
120 | 118 | | |||
121 | void slotColorLabelChanged(int); | 119 | void slotColorLabelChanged(int); | ||
122 | void slotEnsureRowVisible(int row); | 120 | void slotEnsureRowVisible(int row); | ||
123 | 121 | | |||
124 | 122 | // Audio | |||
125 | void slotSelectAudioChannelFile(); | 123 | void slotSelectAudioChannelFile(); | ||
126 | void slotAudioChannelMute(bool value); | 124 | void slotAudioChannelMute(bool value); | ||
127 | void slotAudioChannelRemove(); | 125 | void slotAudioChannelRemove(); | ||
128 | void slotUpdateAudioActions(); | 126 | void slotUpdateAudioActions(); | ||
129 | void slotAudioVolumeChanged(int value); | 127 | void slotAudioVolumeChanged(int value); | ||
130 | 128 | | |||
131 | private: | 129 | private: | ||
132 | void setFramesPerSecond(int fps); | 130 | void setFramesPerSecond(int fps); | ||
133 | void calculateSelectionMetrics(int &minColumn, int &maxColumn, QSet<int> &rows) const; | 131 | void calculateSelectionMetrics(int &minColumn, int &maxColumn, QSet<int> &rows) const; | ||
134 | 132 | | |||
135 | void insertFramesImpl(int insertAtColumn, int count, QSet<int> rows, bool forceEntireColumn); | 133 | void insertFramesImpl(int insertAtColumn, int count, int timing, QSet<int> rows, bool forceEntireColumn); | ||
136 | 134 | | |||
137 | void createFrameEditingMenuActions(QMenu *menu, bool addFrameCreationActions); | 135 | void createFrameEditingMenuActions(QMenu *menu, bool addFrameCreationActions); | ||
138 | 136 | | |||
139 | QModelIndexList calculateSelectionSpan(bool forceEntireColumn, bool editableOnly = true) const; | 137 | QModelIndexList calculateSelectionSpan(bool forceEntireColumn, bool editableOnly = true) const; | ||
140 | void cutCopyImpl(bool forceEntireColumn, bool copy); | 138 | void cutCopyImpl(bool forceEntireColumn, bool copy); | ||
141 | 139 | | |||
142 | int defaultNumberOfFramesToAdd() const; | 140 | int defaultNumberOfFramesToAdd() const; | ||
143 | void setDefaultNumberOfFramesToAdd(int value) const; | 141 | void setDefaultNumberOfFramesToAdd(int value) const; | ||
Show All 33 Lines |