|
52 | 52 |
|
53 | 53 | from classes import exceptions, info, qt_types, sentry, ui_util, updates
|
54 | 54 | from classes.app import get_app
|
| 55 | +from windows.views.timeline_backend.enums import MenuCopy, MenuSlice |
55 | 56 | from classes.exporters.edl import export_edl
|
56 | 57 | from classes.exporters.final_cut_pro import export_xml
|
57 | 58 | from classes.importers.edl import import_edl
|
@@ -1767,52 +1768,52 @@ def keyPressEvent(self, event):
|
1767 | 1768 | # Get list of clip ids
|
1768 | 1769 | clip_ids = [c.id for c in intersecting_clips]
|
1769 | 1770 | trans_ids = [t.id for t in intersecting_trans]
|
1770 |
| - self.timeline.Slice_Triggered(0, clip_ids, trans_ids, playhead_position) |
| 1771 | + self.timeline.Slice_Triggered(MenuSlice.KEEP_BOTH, clip_ids, trans_ids, playhead_position) |
1771 | 1772 | elif key.matches(self.getShortcutByName("sliceAllKeepLeftSide")) == QKeySequence.ExactMatch:
|
1772 | 1773 | intersecting_clips = Clip.filter(intersect=playhead_position)
|
1773 | 1774 | intersecting_trans = Transition.filter(intersect=playhead_position)
|
1774 | 1775 | if intersecting_clips or intersecting_trans:
|
1775 | 1776 | # Get list of clip ids
|
1776 | 1777 | clip_ids = [c.id for c in intersecting_clips]
|
1777 | 1778 | trans_ids = [t.id for t in intersecting_trans]
|
1778 |
| - self.timeline.Slice_Triggered(1, clip_ids, trans_ids, playhead_position) |
| 1779 | + self.timeline.Slice_Triggered(MenuSlice.KEEP_LEFT, clip_ids, trans_ids, playhead_position) |
1779 | 1780 | elif key.matches(self.getShortcutByName("sliceAllKeepRightSide")) == QKeySequence.ExactMatch:
|
1780 | 1781 | intersecting_clips = Clip.filter(intersect=playhead_position)
|
1781 | 1782 | intersecting_trans = Transition.filter(intersect=playhead_position)
|
1782 | 1783 | if intersecting_clips or intersecting_trans:
|
1783 | 1784 | # Get list of clip ids
|
1784 | 1785 | clip_ids = [c.id for c in intersecting_clips]
|
1785 | 1786 | trans_ids = [t.id for t in intersecting_trans]
|
1786 |
| - self.timeline.Slice_Triggered(2, clip_ids, trans_ids, playhead_position) |
| 1787 | + self.timeline.Slice_Triggered(MenuSlice.KEEP_RIGHT, clip_ids, trans_ids, playhead_position) |
1787 | 1788 | elif key.matches(self.getShortcutByName("sliceSelectedKeepBothSides")) == QKeySequence.ExactMatch:
|
1788 | 1789 | intersecting_clips = Clip.filter(intersect=playhead_position)
|
1789 | 1790 | intersecting_trans = Transition.filter(intersect=playhead_position)
|
1790 | 1791 | if intersecting_clips or intersecting_trans:
|
1791 | 1792 | # Get list of clip ids
|
1792 | 1793 | clip_ids = [c.id for c in intersecting_clips if c.id in self.selected_clips]
|
1793 | 1794 | trans_ids = [t.id for t in intersecting_trans if t.id in self.selected_transitions]
|
1794 |
| - self.timeline.Slice_Triggered(0, clip_ids, trans_ids, playhead_position) |
| 1795 | + self.timeline.Slice_Triggered(MenuSlice.KEEP_BOTH, clip_ids, trans_ids, playhead_position) |
1795 | 1796 | elif key.matches(self.getShortcutByName("sliceSelectedKeepLeftSide")) == QKeySequence.ExactMatch:
|
1796 | 1797 | intersecting_clips = Clip.filter(intersect=playhead_position)
|
1797 | 1798 | intersecting_trans = Transition.filter(intersect=playhead_position)
|
1798 | 1799 | if intersecting_clips or intersecting_trans:
|
1799 | 1800 | # Get list of clip ids
|
1800 | 1801 | clip_ids = [c.id for c in intersecting_clips if c.id in self.selected_clips]
|
1801 | 1802 | trans_ids = [t.id for t in intersecting_trans if t.id in self.selected_transitions]
|
1802 |
| - self.timeline.Slice_Triggered(1, clip_ids, trans_ids, playhead_position) |
| 1803 | + self.timeline.Slice_Triggered(MenuSlice.KEEP_LEFT, clip_ids, trans_ids, playhead_position) |
1803 | 1804 | elif key.matches(self.getShortcutByName("sliceSelectedKeepRightSide")) == QKeySequence.ExactMatch:
|
1804 | 1805 | intersecting_clips = Clip.filter(intersect=playhead_position)
|
1805 | 1806 | intersecting_trans = Transition.filter(intersect=playhead_position)
|
1806 | 1807 | if intersecting_clips or intersecting_trans:
|
1807 | 1808 | # Get list of ids that are also selected
|
1808 | 1809 | clip_ids = [c.id for c in intersecting_clips if c.id in self.selected_clips]
|
1809 | 1810 | trans_ids = [t.id for t in intersecting_trans if t.id in self.selected_transitions]
|
1810 |
| - self.timeline.Slice_Triggered(2, clip_ids, trans_ids, playhead_position) |
| 1811 | + self.timeline.Slice_Triggered(MenuSlice.KEEP_RIGHT, clip_ids, trans_ids, playhead_position) |
1811 | 1812 |
|
1812 | 1813 | elif key.matches(self.getShortcutByName("copyAll")) == QKeySequence.ExactMatch:
|
1813 |
| - self.timeline.Copy_Triggered(-1, self.selected_clips, self.selected_transitions) |
| 1814 | + self.timeline.Copy_Triggered(MenuCopy.ALL, self.selected_clips, self.selected_transitions) |
1814 | 1815 | elif key.matches(self.getShortcutByName("pasteAll")) == QKeySequence.ExactMatch:
|
1815 |
| - self.timeline.Paste_Triggered(9, float(playhead_position), -1, [], []) |
| 1816 | + self.timeline.Paste_Triggered(MenuCopy.PASTE, float(playhead_position), -1, [], []) |
1816 | 1817 | elif key.matches(self.getShortcutByName("nudgeLeft")) == QKeySequence.ExactMatch:
|
1817 | 1818 | self.timeline.Nudge_Triggered(-1, self.selected_clips, self.selected_transitions)
|
1818 | 1819 | elif key.matches(self.getShortcutByName("nudgeRight")) == QKeySequence.ExactMatch:
|
@@ -3140,14 +3141,14 @@ def playToggle(self):
|
3140 | 3141 |
|
3141 | 3142 | def copyAll(self):
|
3142 | 3143 | """Handle Copy QShortcut (selected clips / transitions)"""
|
3143 |
| - self.timeline.Copy_Triggered(-1, self.selected_clips, self.selected_transitions) |
| 3144 | + self.timeline.Copy_Triggered(MenuCopy.ALL, self.selected_clips, self.selected_transitions) |
3144 | 3145 |
|
3145 | 3146 | def pasteAll(self):
|
3146 | 3147 | """Handle Paste QShortcut (at timeline position, same track as original clip)"""
|
3147 | 3148 | fps = get_app().project.get("fps")
|
3148 | 3149 | fps_float = float(fps["num"]) / float(fps["den"])
|
3149 | 3150 | playhead_position = float(self.preview_thread.current_frame - 1) / fps_float
|
3150 |
| - self.timeline.Paste_Triggered(9, float(playhead_position), -1, [], []) |
| 3151 | + self.timeline.Paste_Triggered(MenuCopy.PASTE, float(playhead_position), -1, [], []) |
3151 | 3152 |
|
3152 | 3153 | def eventFilter(self, obj, event):
|
3153 | 3154 | """Filter out certain QShortcuts - for example, arrow keys used
|
|
0 commit comments