refactor(main.py): remove unused variables and improve mouse_callback method signature
This commit is contained in:
8
main.py
8
main.py
@@ -39,7 +39,6 @@ class MediaGrader:
|
|||||||
CTRL_SEEK_MULTIPLIER = 10
|
CTRL_SEEK_MULTIPLIER = 10
|
||||||
|
|
||||||
SEGMENT_COUNT = 16
|
SEGMENT_COUNT = 16
|
||||||
SEGMENT_OVERLAP_PERCENT = 10
|
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, directory: str, seek_frames: int = 30, snap_to_iframe: bool = False
|
self, directory: str, seek_frames: int = 30, snap_to_iframe: bool = False
|
||||||
@@ -56,7 +55,6 @@ class MediaGrader:
|
|||||||
|
|
||||||
self.multi_segment_mode = False
|
self.multi_segment_mode = False
|
||||||
self.segment_count = self.SEGMENT_COUNT
|
self.segment_count = self.SEGMENT_COUNT
|
||||||
self.segment_overlap_percent = self.SEGMENT_OVERLAP_PERCENT
|
|
||||||
self.segment_caps = []
|
self.segment_caps = []
|
||||||
self.segment_frames = []
|
self.segment_frames = []
|
||||||
self.segment_positions = []
|
self.segment_positions = []
|
||||||
@@ -87,8 +85,6 @@ class MediaGrader:
|
|||||||
|
|
||||||
self.mouse_dragging = False
|
self.mouse_dragging = False
|
||||||
self.timeline_rect = None
|
self.timeline_rect = None
|
||||||
self.window_width = 800
|
|
||||||
self.window_height = 600
|
|
||||||
|
|
||||||
self.undo_history = []
|
self.undo_history = []
|
||||||
|
|
||||||
@@ -827,8 +823,6 @@ class MediaGrader:
|
|||||||
return
|
return
|
||||||
|
|
||||||
height, width = frame.shape[:2]
|
height, width = frame.shape[:2]
|
||||||
self.window_height = height
|
|
||||||
self.window_width = width
|
|
||||||
|
|
||||||
# Timeline background area
|
# Timeline background area
|
||||||
timeline_y = height - self.TIMELINE_HEIGHT
|
timeline_y = height - self.TIMELINE_HEIGHT
|
||||||
@@ -859,7 +853,7 @@ class MediaGrader:
|
|||||||
cv2.circle(frame, (handle_x, handle_y), self.TIMELINE_HANDLE_SIZE // 2, self.TIMELINE_COLOR_HANDLE, -1)
|
cv2.circle(frame, (handle_x, handle_y), self.TIMELINE_HANDLE_SIZE // 2, self.TIMELINE_COLOR_HANDLE, -1)
|
||||||
cv2.circle(frame, (handle_x, handle_y), self.TIMELINE_HANDLE_SIZE // 2, self.TIMELINE_COLOR_BORDER, 2)
|
cv2.circle(frame, (handle_x, handle_y), self.TIMELINE_HANDLE_SIZE // 2, self.TIMELINE_COLOR_BORDER, 2)
|
||||||
|
|
||||||
def mouse_callback(self, event, x, y, flags, param):
|
def mouse_callback(self, event, x, y, _, __):
|
||||||
"""Handle mouse events for timeline interaction"""
|
"""Handle mouse events for timeline interaction"""
|
||||||
if not self.timeline_rect or not self.is_video(self.media_files[self.current_index]) or self.multi_segment_mode:
|
if not self.timeline_rect or not self.is_video(self.media_files[self.current_index]) or self.multi_segment_mode:
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user