Added add-segments-contents-to-queue!
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 19 Nov 2015 04:33:01 +0000 (22:33 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 19 Nov 2015 04:33:01 +0000 (22:33 -0600)
loopy.scm

index 73ef5682a91ad6fb80a2ec2e337055653bd9f3c3..d878601659e583d63a791a7c1a970ff1c31fa984 100644 (file)
--- a/loopy.scm
+++ b/loopy.scm
@@ -22,6 +22,7 @@
             schedule-segments
 
             schedule-segments-split schedule-extract-until!
+            add-segments-contents-to-queue!
 
             make-port-mapping
             port-mapping-set! port-mapping-remove!
     (set-schedule-segments! schedule segments-after)
     segments-before))
 
+(define (add-segments-contents-to-queue! segments queue)
+  (for-each
+   (lambda (segment)
+     (let ((seg-queue (time-segment-queue segment)))
+       (while (not (q-empty? seg-queue))
+         (enq! queue (deq! seg-queue)))))
+   segments))
+
 
 \f
 ;;; Port handling