47 lines
1.7 KiB
Racket
47 lines
1.7 KiB
Racket
#lang racket/base
|
|
|
|
(require racket/class
|
|
racket/contract)
|
|
|
|
(provide run-player-agent
|
|
run-player-agent-cli)
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; goal : Start the graphical polling playback agent.
|
|
; pre : A graphical desktop is available.
|
|
; post : The agent remains active until its window is closed.
|
|
; result : The GUI frame returned by the implementation.
|
|
; internals:
|
|
; The GUI module is loaded only when this procedure is called. This
|
|
; keeps command-line use independent of racket/gui initialization.
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
(define/contract (run-player-agent)
|
|
(-> object?)
|
|
((dynamic-require "private-player-agent/player-agent-gui.rkt"
|
|
'run-player-agent-gui)))
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
; goal : Start the headless polling playback agent.
|
|
; pre : The configured server is reachable.
|
|
; post : The agent remains active until interrupted.
|
|
; result : Void after the agent has shut down.
|
|
; internals:
|
|
; Delayed loading keeps the graphical and headless entrypoints
|
|
; separate while preserving the existing public module API.
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
(define/contract (run-player-agent-cli #:server-url [server-url #f]
|
|
#:name [name #f]
|
|
#:config-file [config-file #f])
|
|
(->* ()
|
|
(#:server-url (or/c string? #f)
|
|
#:name (or/c string? #f)
|
|
#:config-file (or/c path-string? #f))
|
|
void?)
|
|
((dynamic-require "player-agent-cli.rkt" 'run-player-agent-cli)
|
|
#:server-url server-url
|
|
#:name name
|
|
#:config-file config-file))
|
|
|
|
(module+ main
|
|
(run-player-agent))
|