mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-02 14:50:17 +01:00
Nyquist: Only import built-in effects
Extreme slowdown has been reported when generating LISP Functions for all scripting Commands, so only generate LISP functions for built-in effects. Additional LISP functions may be generated on demand using (aud-import <command-name>).
This commit is contained in:
@@ -45,6 +45,15 @@
|
||||
;;; If 'string' is not a valid LISP expression, the behaviour is undefined.
|
||||
(eval (read (make-string-input-stream string))))
|
||||
|
||||
(defun escape-backslash (in-string)
|
||||
;;; Escape backslashes
|
||||
(let (ch (out-string ""))
|
||||
(dotimes (i (length in-string) out-string)
|
||||
(setf ch (subseq in-string i (1+ i)))
|
||||
(if (string= ch "\\")
|
||||
(string-append out-string "\\\\")
|
||||
(string-append out-string ch)))))
|
||||
|
||||
(defmacro quote-string (string)
|
||||
;;; Prepend a single quote to a string
|
||||
`(setf ,string (format nil "\'~a" ,string)))
|
||||
@@ -66,13 +75,7 @@
|
||||
(if (not (last info))
|
||||
(error (format nil "(aud-get-info ~a) failed.~%" str)))
|
||||
(let* ((info-string (first info))
|
||||
(sanitized ""))
|
||||
;; Escape backslashes
|
||||
(dotimes (i (length info-string))
|
||||
(setf ch (subseq info-string i (1+ i)))
|
||||
(if (string= ch "\\")
|
||||
(string-append sanitized "\\\\")
|
||||
(string-append sanitized ch)))
|
||||
(sanitized (escape-backslash info-string)))
|
||||
(eval-string (quote-string sanitized)))))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user