X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=elisp.git;a=blobdiff_plain;f=media.el;h=25b19ec4699456c4d843949fe9df245aee683f28;hp=b83bbef032f2f8348c6da1819faded6aa975b426;hb=6a44bdf65c8691602f917c8d5b4d8d751efa83d7;hpb=68437333c6fb4ed63860f22e12fccc9cc37e7c28 diff --git a/media.el b/media.el index b83bbef..25b19ec 100644 --- a/media.el +++ b/media.el @@ -822,6 +822,7 @@ returns nil if no id3 tags could be found." (defun media/stop () (interactive) (message "Stop") + (setq media/current-information nil) (media/api/stop)) (defun media/queue-song-at-point () @@ -869,6 +870,19 @@ the 'Queue' playlist, and plays it if no song is currently playing." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defun media/player-error () + (message "Player error") + (setq media/current-information nil) + (media/remove-highlight)) + +(defun media/song-terminates () + (with-current-buffer media/buffer + (if media/continue-mode (media/play-next t) + (setq media/current-information nil) + (media/remove-highlight)))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defun media/switch-continue-mode () "Switches between a mode which automatically chains files and a mode which stops when the songs ends." @@ -879,15 +893,6 @@ which stops when the songs ends." (message "Continue mode switched off.")) ) -(defun media/player-error () - (message "Player error") - (media/remove-highlight)) - -(defun media/song-terminates () - (with-current-buffer media/buffer - (if media/continue-mode (media/play-next t) - (media/remove-highlight)))) - (defun media/duration-to-string (duration) (let ((sec (mod duration 60)) (min (/ duration 60)))