summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-11-03 18:41:36 -0400
committerSacha Chua <sacha@sachachua.com>2022-11-03 18:41:36 -0400
commitc938e810fd891a36ee0747034d2bafa39a79726d (patch)
treebf770f85a8f6dacee77ccbef5000be4fc333e413
parent3b386b3e1e470d6a32c24718b1216a57bba2258c (diff)
downloademacsconf-el-c938e810fd891a36ee0747034d2bafa39a79726d.tar.xz
emacsconf-el-c938e810fd891a36ee0747034d2bafa39a79726d.zip
Support timers
Diffstat (limited to '')
-rw-r--r--emacsconf-stream.el20
1 files changed, 20 insertions, 0 deletions
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)"