forked from genewildish/Mainline
feat: add SixelDisplay backend for terminal graphics
- Implement pure Python Sixel encoder (no C dependency) - Add SixelDisplay class to display.py with ANSI parsing - Update controller._get_display() to handle sixel mode - Add --display sixel CLI flag - Add mise run-sixel task - Update docs with display modes
This commit is contained in:
@@ -3,6 +3,7 @@ Stream controller - manages input sources and orchestrates the render stream.
|
||||
"""
|
||||
|
||||
from engine.config import Config, get_config
|
||||
from engine.display import MultiDisplay, NullDisplay, SixelDisplay, TerminalDisplay
|
||||
from engine.effects.controller import handle_effects_command
|
||||
from engine.eventbus import EventBus
|
||||
from engine.events import EventType, StreamEvent
|
||||
@@ -14,12 +15,29 @@ from engine.websocket_display import WebSocketDisplay
|
||||
|
||||
def _get_display(config: Config):
|
||||
"""Get the appropriate display based on config."""
|
||||
if config.websocket:
|
||||
display_mode = config.display.lower()
|
||||
|
||||
displays = []
|
||||
|
||||
if display_mode in ("terminal", "both"):
|
||||
displays.append(TerminalDisplay())
|
||||
|
||||
if display_mode in ("websocket", "both"):
|
||||
ws = WebSocketDisplay(host="0.0.0.0", port=config.websocket_port)
|
||||
ws.start_server()
|
||||
ws.start_http_server()
|
||||
return ws
|
||||
return None
|
||||
displays.append(ws)
|
||||
|
||||
if display_mode == "sixel":
|
||||
displays.append(SixelDisplay())
|
||||
|
||||
if not displays:
|
||||
return NullDisplay()
|
||||
|
||||
if len(displays) == 1:
|
||||
return displays[0]
|
||||
|
||||
return MultiDisplay(displays)
|
||||
|
||||
|
||||
class StreamController:
|
||||
|
||||
Reference in New Issue
Block a user