diff options
-rw-r--r-- | emms-player-mplayer.el | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/emms-player-mplayer.el b/emms-player-mplayer.el index 12f553d..c7fbffd 100644 --- a/emms-player-mplayer.el +++ b/emms-player-mplayer.el @@ -74,7 +74,7 @@ emms-player-simple-process-name (format "seek %d 2\n" sec))) -(defun emms-player-mplayer-subscript-checker () +(defun emms-player-mplayer-subtitle-checker () (let* ((track (emms-playlist-current-selected-track)) (name (emms-track-name track)) (ext (file-name-extension name)) @@ -82,35 +82,35 @@ ;; TODO, script for chinese, gb, big, etc. (srt (replace-regexp-in-string (concat ext "$") "srt" name)) (choices (remove-if-not 'file-exists-p (list sub srt))) - (subscript nil)) + (subtitle nil)) (cond ((> (length choices) 1) - (setq subscript - (ido-completing-read "Select subscripts: " + (setq subtitle + (ido-completing-read "Select subtitles: " choices))) ((= (length choices) 1) - (setq subscript (car choices)))) - (when subscript + (setq subtitle (car choices)))) + (when subtitle (setq emms-player-mplayer-parameters (append emms-player-mplayer-parameters - (list "-sub" subscript)))))) + (list "-sub" subtitle)))))) -(defun emms-player-mplayer-start-with-subscript-checker (track) - "Start the player process by checking possible subscripts +(defun emms-player-mplayer-start-with-subtitle-checker (track) + "Start the player process by checking possible subtitles additionally." (let ((emms-player-mplayer-parameters emms-player-mplayer-parameters)) - (emms-player-mplayer-subscript-checker) + (emms-player-mplayer-subtitle-checker) (emms-player-simple-start (emms-track-name track) emms-player-mplayer emms-player-mplayer-command-name emms-player-mplayer-parameters))) ;; Uncomment me if you want to use -;; `emms-player-mplayer-start-with-subscript-checker'. We need to +;; `emms-player-mplayer-start-with-subtitle-checker'. We need to ;; redefine `emms-player-mplayer-start', since i can't figure out an ;; easy way to achieve this by modifying the emms source. (xwl) ;; ;; (defalias 'emms-player-mplayer-start -;; 'emms-player-mplayer-start-with-subscript-checker) +;; 'emms-player-mplayer-start-with-subtitle-checker) (provide 'emms-player-mplayer) ;;; emms-player-mplayer.el ends here |