4from pathlib
import Path
6from ._native
import mxvk
14 self.
native = mxvk.SteadyStopwatch(name)
19 return self.
native.time_passed() / 1000.0
21 def restart(self, name: str =
"app") ->
None:
27 if self.
native is not None:
37 if not getattr(mxvk,
"has_mixer",
False):
38 raise RuntimeError(
"MXVK was built without MIXER support")
46 def play(self, sound_id: int, loops: int = 0) -> int:
48 return self.
native.play_wav(sound_id, loops)
52 if self.
native is not None:
60 def __init__(self, source: int | str | Path = 0) ->
None:
62 if not getattr(mxvk,
"has_cv",
False):
63 raise RuntimeError(
"MXVK was built without CV support")
65 if isinstance(source, int):
66 self.
native.open_camera(source)
68 self.
native.open(str(source))
70 def frame(self, *, flip_y: bool =
False) -> object |
None:
72 return self.
native.read_rgba(flip_y)
76 if self.
native is not None:
SDL3_mixer-based audio manager.