change plugin system

This commit is contained in:
Q
2025-08-13 21:22:11 +03:00
parent 4c522db2ac
commit 3472210a84
2 changed files with 6 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ import argparse
from tsmark.video_annotator import Marker
VERSION = "0.7.2"
VERSION = "0.7.4"
def get_options():

View File

@@ -597,6 +597,9 @@ class World:
def __init__(self, tsmark):
self.tsmark = tsmark
self.window_name = "tsmark - plugin"
print("plugin loaded")
def __call__(self):
print("plugin called")
self.tsmark.paused = True
cv2.namedWindow(self.window_name, flags=cv2.WINDOW_AUTOSIZE | cv2.WINDOW_KEEPRATIO | cv2.WINDOW_GUI_NORMAL)
frame = cv2.resize(np.zeros((16, 16, 3), dtype=np.uint8), self.tsmark.video_res)
@@ -618,12 +621,12 @@ class World:
loaded_plugin = importlib.util.module_from_spec(module_spec)
module_spec.loader.exec_module(loaded_plugin)
plugin_class = getattr(loaded_plugin, plugin_class)
self.plugin = plugin_class
self.plugin = plugin_class(self)
def launch_plugin(self):
if self.plugin:
self.plugin(self)
self.plugin()
def interpolate_points(self, point_index=None):
"""types: