Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/cuemsengine/cues/CueHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from cuemsutils.tools.CTimecode import CTimecode

from ..comms.NodeCommunications import NodeCommunications
from ..players import VideoPlayer
from ..players.PlayerHandler import PLAYER_HANDLER
from ..tools import MtcListener
from .ActionHandler import ACTION_HANDLER as _ACTION_HANDLER_SINGLETON
Expand Down Expand Up @@ -54,8 +53,6 @@ class CueHandler:
# Instance attributes (declared for IDE/type checker support)
_armed_cues: list[Cue]
_armed_cues_set: set[str]
_video_players: dict
_front_video_player: VideoPlayer | None
_lock: Lock
communications_thread: NodeCommunications

Expand All @@ -65,8 +62,6 @@ def __new__(cls, *args, **kwargs):
# Initialize instance attributes
cls._instance._armed_cues = []
cls._instance._armed_cues_set = set()
cls._instance._video_players = {}
cls._instance._front_video_player = None
cls._instance._lock = Lock()
return cls._instance

Expand Down
26 changes: 1 addition & 25 deletions src/cuemsengine/players/VideoPlayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,10 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileContributor: Ion Reguera <ion@stagelab.coop>
# SPDX-FileContributor: Adrià Masip <adria@stagelab.coop>
from cuemsutils.log import Logger, logged
from cuemsutils.log import Logger

from ..osc.endpoints import OSC_VIDEOPLAYER_CONF, OSC_VIDEOPLAYER_LAYER_CONF
from ..osc.OssiaClient import PlayerClient
from .Player import Player


class VideoPlayer(Player):
"""Video player systemd service wrapper.

This class restarts the videocomposer service.

IMPORTANT: This class should not be used, since videocomposer is a systemd
service and not a subprocess.
"""

def __init__(self):
super().__init__()
Logger.warning(
"Restarting the videocomposer service. Use VideoClient only to"
"control videocomposer."
)

@logged
def run(self):
process_call_list = ["systemctl", "restart", "videocomposer.service"]
Logger.info(f"Restarting videocomposer service: {process_call_list}")
self.call_subprocess(process_call_list)


class VideoClient(PlayerClient):
Expand Down
4 changes: 2 additions & 2 deletions src/cuemsengine/players/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# SPDX-FileCopyrightText: 2026 Stagelab Coop SCCL
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileContributor: Adrià Masip <adria@stagelab.coop>
# SPDX-FileContributor: Ion Reguera <ion@stagelab.coop>

from .AudioPlayer import AudioClient, AudioPlayer
from .DmxPlayer import DmxClient, DmxPlayer
from .VideoPlayer import VideoClient, VideoPlayer
from .VideoPlayer import VideoClient

__all__ = [
"AudioClient",
"AudioPlayer",
"DmxClient",
"DmxPlayer",
"VideoClient",
"VideoPlayer",
]
2 changes: 0 additions & 2 deletions tests/test_action_cue.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ def handler():
h = object.__new__(CueHandler)
h._armed_cues = []
h._armed_cues_set = set()
h._video_players = {}
h._front_video_player = None
h._lock = __import__("threading").Lock()
h.communications_thread = MagicMock()
ACTION_HANDLER.bind_cue_handler(h)
Expand Down
6 changes: 4 additions & 2 deletions tests/testdev_engines_communication.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2026 Stagelab Coop SCCL
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileContributor: Ion Reguera <ion@stagelab.coop>

from logging import INFO
from time import sleep
from unittest.mock import patch
Expand Down Expand Up @@ -82,8 +86,6 @@ def test_two_projects_load_from_controller(
assert (
len(mock_player_subprocess) > 0
), "Expected player subprocess calls to be recorded"
player_types = {call["player"] for call in mock_player_subprocess}
assert "VideoPlayer" in player_types, "Expected VideoPlayer to be called"
# Verify each call has required fields
for call in mock_player_subprocess:
assert "player" in call
Expand Down
Loading