feat(media): Factory dispatcht auf win32 zum SmtcController

This commit is contained in:
2026-04-16 18:16:51 +02:00
parent 802e06acd9
commit 265ca3c212
2 changed files with 15 additions and 4 deletions
+5 -2
View File
@@ -13,8 +13,8 @@ class MediaController(Protocol):
def create_media_controller(enabled: bool) -> MediaController:
"""Erstellt den plattformspezifischen Media-Controller.
`enabled=False` → immer NoopController. Auf Nicht-Linux-Plattformen
wird aktuell ebenfalls der NoopController zurückgegeben.
`enabled=False` → immer NoopController. Auf nicht unterstützten Plattformen
wird ebenfalls der NoopController zurückgegeben.
"""
if not enabled:
from whisper_local.media._noop import NoopController
@@ -22,5 +22,8 @@ def create_media_controller(enabled: bool) -> MediaController:
if sys.platform == "linux":
from whisper_local.media._mpris import MprisController
return MprisController()
if sys.platform == "win32":
from whisper_local.media._smtc import SmtcController
return SmtcController()
from whisper_local.media._noop import NoopController
return NoopController()