From c938e810fd891a36ee0747034d2bafa39a79726d Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Thu, 3 Nov 2022 18:41:36 -0400 Subject: Support timers --- emacsconf-stream.el | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'emacsconf-stream.el') diff --git a/emacsconf-stream.el b/emacsconf-stream.el index e587836..26a4773 100644 --- a/emacsconf-stream.el +++ b/emacsconf-stream.el @@ -327,6 +327,26 @@ This uses the BBB room if available, or the IRC channel if not." (expand-file-name (concat (plist-get talk :video-slug) "--main.webm") dir) t)) info))) + +(defun emacsconf-stream-handle-talk-timer (talk) + (save-window-excursion + (emacsconf-with-talk-heading (plist-get talk :slug) + (org-todo "PLAYING")))) + +(defun emacsconf-stream-schedule-timers (&optional info) + (interactive) + (setq info (emacsconf-filter-talks (or info (emacsconf-get-talk-info)))) + (cancel-function-timers #'emacsconf-stream-handle-talk-timer) + (let ((now (current-time))) + (mapc (lambda (talk) + (when (and (time-less-p now (plist-get talk :start-time))) + (run-at-time + (time-to-seconds (time-subtract (plist-get talk :start-time) now)) + nil + #'emacsconf-stream-handle-talk-timer + talk))) + info))) + ;; (emacsconf-stream-display-talk-info ;; '(:title "The ship that builds itself: How we used Emacs to develop a workshop for communities" ;; :speakers-with-pronouns "Noorah Alhasan (she/her), Joseph Corneli (he/him), Leo Vivier (he/him)" -- cgit v1.2.3