From b275d77794f5243a2e58899dfd7fcb8af0c757d5 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 22 Nov 2020 22:09:29 +0100 Subject: cut-to-cue-number: Copy the hash table This hash table will become the one which contains the cross-fade functions. Therefore, when we "emphatically" set it like this, it must not be the same table as in the cue state itself. --- guile/starlet/utils.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'guile/starlet/utils.scm') diff --git a/guile/starlet/utils.scm b/guile/starlet/utils.scm index 13ee585..be87321 100644 --- a/guile/starlet/utils.scm +++ b/guile/starlet/utils.scm @@ -1,6 +1,7 @@ (define-module (starlet utils) #:export (return-unspecified - print-hash-table)) + print-hash-table + copy-hash-table)) (define (return-unspecified) @@ -13,3 +14,10 @@ (display value) (newline)) ht)) + +(define (copy-hash-table ht) + (let ((new-ht (make-hash-table))) + (hash-for-each (lambda (key value) + (hash-set! new-ht key value)) + ht) + new-ht)) -- cgit v1.2.3