0
1
mirror of https://github.com/radio95-rnt/RadioPlayer.git synced 2026-02-26 21:53:54 +01:00

simplify the procman a little (internal)

This commit is contained in:
2025-12-12 22:00:20 +01:00
parent de877ffbea
commit f421e75293
2 changed files with 6 additions and 6 deletions

View File

@@ -24,7 +24,7 @@ class Process:
class Skeleton_ProcessManager:
processes: list[Process]
def _get_audio_duration(self, file_path): ...
def play(self, track: Track, fade_in_time: float=0, fade_out_time: float=0) -> Process: ...
def play(self, track: Track) -> Process: ...
def anything_playing(self) -> bool: ...
def stop_all(self, timeout: float | None = None) -> None: ...
def wait_all(self, timeout: float | None = None) -> None: ...
@@ -66,7 +66,7 @@ class ProcmanCommunicator(BaseIMCModule):
elif int(op) == 4:
return {"op": 4, "arg": self.procman.anything_playing()}
elif int(op) == 5:
if arg := data.get("arg"): return {"op": 5, "arg": self.procman.play(arg, data.get("fade_in_time", data.get("fade_time", 5)), data.get("fade_out_time", data.get("fade_time", 5)))}
if arg := data.get("arg"): return {"op": 5, "arg": self.procman.play(arg)}
else: return
class PlayerModule(BaseIMCModule):