aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/demo.scm2
-rw-r--r--guile/starlet/scanout.scm38
2 files changed, 20 insertions, 20 deletions
diff --git a/examples/demo.scm b/examples/demo.scm
index c616786..1821d1a 100644
--- a/examples/demo.scm
+++ b/examples/demo.scm
@@ -39,8 +39,6 @@
(starlet midi-control button-utils)
(starlet midi-control faders))
-;; Start readout to OLA
-(start-ola-output)
;; Start MIDI control
(start-midi-control "/dev/snd/midiC0D0"
diff --git a/guile/starlet/scanout.scm b/guile/starlet/scanout.scm
index 3c9562a..7833076 100644
--- a/guile/starlet/scanout.scm
+++ b/guile/starlet/scanout.scm
@@ -29,8 +29,7 @@
#:use-module (ice-9 atomic)
#:use-module (ice-9 exceptions)
#:use-module (srfi srfi-1)
- #:export (start-ola-output
- patch-fixture!
+ #:export (patch-fixture!
scanout-freq
register-state!
current-value))
@@ -240,19 +239,22 @@
(define (start-ola-output)
- (unless ola-thread
- (let* ((ola-client (make-ola-streaming-client))
- (start-time (hirestime)))
-
- (set! ola-thread
- (begin-thread
- (with-exception-handler
- (lambda (exn)
- (display "Error in OLA output thread:\n")
- (set! ola-thread #f)
- (backtrace)
- (raise-exception exn))
- (lambda ()
- (scanout-loop ola-client start-time 0 '()))
- #:unwind? #f))))))
-
+ (if ola-thread
+ (format #t "OLA output already running\n")
+ (let* ((ola-client (make-ola-streaming-client))
+ (start-time (hirestime)))
+
+ (set! ola-thread
+ (begin-thread
+ (with-exception-handler
+ (lambda (exn)
+ (display "Error in OLA output thread:\n")
+ (set! ola-thread #f)
+ (backtrace)
+ (raise-exception exn))
+ (lambda ()
+ (scanout-loop ola-client start-time 0 '()))
+ #:unwind? #f))))))
+
+
+(start-ola-output)