aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-05-24 16:14:03 +0200
committerThomas White <taw@physics.org>2021-05-24 16:14:03 +0200
commit610057e7b5b2ac83261de1e599f1a4943d796b21 (patch)
tree776041d89cc17c90549b829b50b479487d928cde
parent5f1f79c6d3fa853786bd10fe075780143ed76559 (diff)
Indicate when stop button can be pressed
-rw-r--r--guile/starlet/midi-control/button-utils.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/guile/starlet/midi-control/button-utils.scm b/guile/starlet/midi-control/button-utils.scm
index 2f19c8d..449a164 100644
--- a/guile/starlet/midi-control/button-utils.scm
+++ b/guile/starlet/midi-control/button-utils.scm
@@ -47,6 +47,8 @@
(send-note-on pause-note))
((eq? new-state 'ready)
(send-note-on ready-note))
+ ((eq? new-state 'running)
+ (send-note-on ready-note))
(else
(send-note-off ready-note)))))))
@@ -61,7 +63,12 @@
#:func (lambda () (stop! pb)))
(when ready-note
- (send-note-on ready-note)))
+ (add-hook!
+ (state-change-hook pb)
+ (lambda (new-state)
+ (if (eq? new-state 'running)
+ (send-note-on ready-note)
+ (send-note-off ready-note))))))
(define* (make-back-button pb button