-;; -*-Emacs-Lisp-*-
+;; -*- mode: emacs-lisp -*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This program is free software; you can redistribute it and/or ;;
:group 'media)
(defcustom media/playlist-at-top nil
- "Should the playlists be created at the top of the media buffer ?"
+ "Should the playlists be created at the top of the media buffer?"
:type 'bool
:group 'media)
(defcustom media/add-current-song-to-interrupted-when-killing nil
- "Should we save the current song with time in the Interrupted playlist ?"
+ "Should we save the current song with time in the Interrupted playlist?"
:type 'bool
:group 'media)
(defcustom media/do-not-remove-nonexisting-entries nil
- "Should we remove the entries corresponding to a non-existing file when saving the playlists ?"
+ "Should we remove the entries corresponding to a non-existing file when saving the playlists?"
:type 'bool
:group 'media)
:group 'media)
(defcustom media/continue-mode nil
- "Should the player start the next song in the buffer when the current terminates ?"
+ "Should the player start the next song in the buffer when the current terminates?"
:type 'boolean
:group 'media)
(defcustom media/expert nil
- "Should the keymap help be shown ?"
+ "Should the keymap help be shown?"
:type 'boolean
:group 'media)
(time (get-text-property position 'time)))
(if (not url) (media/remove-highlight)
(run-hook-with-args 'media/before-play-hook url)
+ (setq media/current-information nil)
(media/api/play url)
;; We keep the information of the url and the title
(setq media/played-information (cons url (get-text-property position 'title)))
(defun media/stop () (interactive)
(message "Stop")
+ (setq media/current-information nil)
(media/api/stop))
(defun media/queue-song-at-point ()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(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."
(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)))
(unless (condition-case nil
(media/save-playlists)
- (error (not (y-or-n-p "Can not save the playlists. Still kill the media buffer ? "))))
+ (error (not (y-or-n-p "Can not save the playlists. Still kill the media buffer? "))))
(kill-buffer media/buffer))
)