From e31fada906bbcdebc4f0fd88b68f9921264726c0 Mon Sep 17 00:00:00 2001 From: Leon Rische Date: Tue, 27 Sep 2022 20:30:04 +0200 Subject: Add audio replay commands --- org-fc-audio.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'org-fc-audio.el') diff --git a/org-fc-audio.el b/org-fc-audio.el index 2e95f7a..2774603 100644 --- a/org-fc-audio.el +++ b/org-fc-audio.el @@ -52,6 +52,8 @@ :type 'string :group 'org-fc) +(defvar org-fc-audio-last-file nil) + (defun org-fc-audio-set-before-setup (file) "Set the befor-setup audio property of the current card to FILE." (interactive "f") @@ -79,6 +81,7 @@ the file at the given speed." (defun org-fc-audio-play-file (file speed) "Play the audio FILE at SPEED." + (setq org-fc-audio-last-file file) (start-process-shell-command "org-fc audio" nil @@ -96,6 +99,17 @@ the file at the given speed." 'org-fc-after-flip-hook (lambda () (org-fc-audio-play org-fc-audio-after-flip-property))) +(defun org-fc-audio-replay () + (interactive) + (when org-fc-audio-last-file + (org-fc-audio-play-file org-fc-audio-last-file 1.0))) + +(defun org-fc-audio-replay-slow () + (interactive) + (when org-fc-audio-last-file + (org-fc-audio-play-file org-fc-audio-last-file 0.7))) + + ;;; Footer (provide 'org-fc-audio) -- cgit v1.2.3